ovirtclient.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:ovirt-desktop-client 作者: nkovacne 项目源码 文件源码
def connect(self, rowid):
        """
            Description: Whenever the user clicks on the 'connect' row, this method will make
                         sure the VM status is up and only then will call the connect2machine method.
            Arguments: The row id that has been clicked. This relationship is stored using the VmData class.
            Returns: Nothing
        """

        self.lastclick = int(time())         # Last click timestamp update

        vmid = self.vmdata[rowid].vmid
        vmname = self.vmdata[rowid].vmname
        vmstatus = self.vmdata[rowid].vmstatus

        if vmstatus != 'up':
            QMessageBox.warning(None, _('apptitle') + ': ' + _('warning'), _('cannot_connect_if_vm_not_up'))
            return

        if vmname in self.openviewer_vms:
            QMessageBox.critical(None, _('apptitle') + ': ' + _('error'), _('cannot_open_more_viewer_sessions'))
            return

        self.openviewer_vms.append(vmname)
        self.refresh_grid()                  # Enforce a dashboard reload to make the icon refresh

        self.connect2machine(vmid, vmname)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号