- fixed issue with trying to access GUI from different threads by adding a new signal for printing to shell messages

This commit is contained in:
Marius Stanciu
2020-06-07 15:30:46 +03:00
committed by Marius
parent 2c2db0efe2
commit 039500b43f
6 changed files with 20 additions and 14 deletions

View File

@@ -203,9 +203,10 @@ class App(QtCore.QObject):
# ###############################################################################################################
# Inform the user
# Handled by:
# * App.info() --> Print on the status bar
# Handled by: App.info() --> Print on the status bar
inform = QtCore.pyqtSignal([str], [str, bool])
# Handled by: App.info_shell() --> Print on the shell
inform_shell = QtCore.pyqtSignal(str)
app_quit = QtCore.pyqtSignal()
@@ -762,6 +763,9 @@ class App(QtCore.QObject):
self.inform[str].connect(self.info)
self.inform[str, bool].connect(self.info)
# signal for displaying messages in the shell
self.inform_shell.connect(self.info_shell)
# signal to be called when the app is quiting
self.app_quit.connect(self.quit_application, type=Qt.QueuedConnection)
self.message.connect(lambda: message_dialog(parent=self.ui))
@@ -2428,6 +2432,9 @@ class App(QtCore.QObject):
if msg != '' and shell_echo is True:
self.shell_message(msg)
def info_shell(self, msg):
self.shell_message(msg=msg)
def on_import_preferences(self):
"""
Loads the application default settings from a saved file into