From be32f4f61d2f6a0bfc342990557ce0257fd046a8 Mon Sep 17 00:00:00 2001 From: Marcel Date: Wed, 9 Mar 2022 10:42:52 +0100 Subject: [PATCH] [improvement] log can be opened from menu now (or focuses) --- PyLoT.py | 8 +++++++- pylot/core/util/widgets.py | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/PyLoT.py b/PyLoT.py index 18a95289..4e6bbbc8 100755 --- a/PyLoT.py +++ b/PyLoT.py @@ -505,6 +505,8 @@ class MainWindow(QMainWindow): """Show either the documentation homepage (internet connection available), or shipped documentation files.""") + logAction = self.createAction(self, "&Show Log", self.showLogWidget, + tip="""Display Log""") # create button group for component selection @@ -604,7 +606,7 @@ class MainWindow(QMainWindow): autoPickActions = (self.auto_pick, self.auto_pick_local, self.auto_pick_sge) self.helpMenu = self.menuBar().addMenu('&Help') - helpActions = (helpAction,) + helpActions = (helpAction,logAction) fileToolActions = (self.newProjectAction, self.openProjectAction, self.saveProjectAction, @@ -771,6 +773,10 @@ class MainWindow(QMainWindow): self.ref_event_button.setEnabled(False) self.test_event_button.setEnabled(False) + def showLogWidget(self): + self.logwidget.show() + self.logwidget.activateWindow() + def keyPressEvent(self, event): if event.key() == QtCore.Qt.Key.Key_Control: self._ctrl = True diff --git a/pylot/core/util/widgets.py b/pylot/core/util/widgets.py index 0817eeb5..4b16d421 100644 --- a/pylot/core/util/widgets.py +++ b/pylot/core/util/widgets.py @@ -131,6 +131,7 @@ class LogWidget(QtWidgets.QWidget): def reset_error(self): # used to make sure that write errors is finished before raising new Message box etc. self.current_active_error = False + self.stderr.append(60*'#' + '\n\n') def getDataType(parent):