def on_actionSaveSession_triggered(self): if self.session.filename is None: self.actionSaveSessionAs.trigger() else: if self.session.saveInProgress(): warningBox('Save in Progress', 'Session save already in progress.') else: self.session.save() def lookup(): return not self.session.saveInProgress() dlg = WaitMessageBox(lookup, self) dlg.setText('Save in Progress...') dlg.setWindowTitle('Profit Workbench Session Save') dlg.show()
def on_actionExportSession_triggered(self, filename=None): from profit.lib.widgets.importexportdialog import ImportExportDialog if not filename: filename = QFileDialog.getSaveFileName( self, 'Export Session To File') if filename: if self.session.exportInProgress(): warningBox('Export in Progress', 'Session export already in progress.') else: dlg = ImportExportDialog('Export', self) if dlg.exec_() != dlg.Accepted: return types = dlg.selectedTypes() if not types: return self.session.exportMessages(filename, types) def lookup(): return not self.session.exportInProgress() dlg = WaitMessageBox(lookup, self) dlg.setText('Export in Progress...') dlg.setWindowTitle('Profit Workbench Session Export') dlg.show()