[improvement] log can be opened from menu now (or focuses)

This commit is contained in:
Marcel Paffrath 2022-03-09 10:42:52 +01:00
parent 9036a9054e
commit be32f4f61d
2 changed files with 8 additions and 1 deletions

View File

@ -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

View File

@ -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):