def connectHost(self, hostId, frameless=False, screenIndex=None): hostId = unicode(hostId) # sometimes hostId comes as QString tabPage = self.tabWidget.createTab(hostId) tabPage.reconnectionNeeded.connect(self.connectHost) if frameless: self.tabWidget.detachFrameless(tabPage, screenIndex) execCmd, opts = self.getCmd(tabPage, hostId) ProcessManager.start(hostId, tabPage, execCmd, opts)
def closeEvent(self, event): if not ProcessManager.hasActiveProcess: self.saveSettings() QCoreApplication.exit() return ret = self.showOkCancelMessageBox("Are you sure do you want to quit?", "Exit confirmation") if ret == QMessageBox.Cancel: event.ignore() return self.saveSettings() ProcessManager.killemall() event.accept() QCoreApplication.exit()
def connectHost(self, hostId, frameless=False, screenIndex=None): hostId = unicode(hostId) # sometimes hostId comes as QString tabPage = self.tabWidget.createTab(hostId) tabPage.reconnectionNeeded.connect(self.connectHost) if frameless: self.tabWidget.detachFrameless(tabPage, screenIndex) try: execCmd, opts = self.getCmd(tabPage, hostId) except LookupError: logger.error(u"Host {} not found.".format(hostId)) return ProcessManager.start(hostId, tabPage, execCmd, opts) return tabPage
def closeEvent(self, event): if not ProcessManager.hasActiveProcess: self.saveSettings() return msgBox = QMessageBox(self, text="Are you sure do you want to quit?") msgBox.setWindowTitle("Exit confirmation") msgBox.setStandardButtons(QMessageBox.Ok | QMessageBox.Cancel) ret = msgBox.exec_() if ret == QMessageBox.Cancel: event.ignore() return self.saveSettings() ProcessManager.killemall() event.accept()
def closeEvent(self, event): if not ProcessManager.hasActiveProcess: self.saveSettings() QCoreApplication.exit() return msgBox = QMessageBox(self, text="Are you sure do you want to quit?") msgBox.setWindowTitle("Exit confirmation") msgBox.setStandardButtons(QMessageBox.Ok | QMessageBox.Cancel) ret = msgBox.exec_() if ret == QMessageBox.Cancel: event.ignore() return self.saveSettings() ProcessManager.killemall() event.accept() QCoreApplication.exit()