Skip to content
Snippets Groups Projects

User can raise an available form in Forms Menu

Merged Lan Dam requested to merge raise_selected_form into master
All threads resolved!
1 file
+ 12
4
Compare changes
  • Side-by-side
  • Inline
@@ -404,7 +404,7 @@ class MainWindow(QtWidgets.QMainWindow, UIMainWindow):
sel_key, do.logData, processing_log)
self.search_message_dialog.show()
self.add_action_to_forms_menu('Search Messages',
self.search_message_dialog)
'self.search_message_dialog')
def set_current_directory(self, path: str = '') -> None:
"""
@@ -510,6 +510,9 @@ class MainWindow(QtWidgets.QMainWindow, UIMainWindow):
:param form: QtWidget
:type form: QtWidgets.QWidget
"""
if not isinstance(form, QtWidgets.QWidget):
print(f"DEVELOPING ERROR: Type of form must be QWidget instead of "
f"{form.__class__.__name__}")
if form_name not in self.actions_in_forms_menu:
action = QtWidgets.QAction(form_name, self)
self.forms_menu.addAction(action)
@@ -524,10 +527,15 @@ class MainWindow(QtWidgets.QMainWindow, UIMainWindow):
:param form_name: name of form that will be shown in forms_menu
:type form_name: str
:return:
:rtype:
"""
action = self.actions_in_forms_menu[form_name]
try:
action = self.actions_in_forms_menu[form_name]
except KeyError:
return
if not isinstance(action, QtWidgets.QAction):
print(f"DEVELOPING ERROR: {form_name} has no QAction associated "
f"with it in actions_in_forms_menu")
return
self.forms_menu.removeAction(action)
del self.actions_in_forms_menu[form_name]
Loading