def on_actionImportSession_triggered(self, filename=None): from profit.lib.widgets.importexportdialog import ImportExportDialog from profit.workbench.sessionreplay import SessionReplay if not filename: filename = QFileDialog.getOpenFileName( self, 'Import Session From File') if filename: dlg = ImportExportDialog('Import', self) if dlg.exec_() != dlg.Accepted: return types = dlg.selectedTypes() if not types: return if not self.warningOpenTabs(): return dlg = SessionReplay() dlg.setWindowTitle('Reading session file.') dlg.setWindowModality(Qt.WindowModal) dlg.setImportParameters(self.session, filename, types) dlg.exec_()
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()