From 76572af2b73450f496d11b32eab3bb39f9194697 Mon Sep 17 00:00:00 2001 From: Lyubomir Ternavskiy <127299159+LyubomirT@users.noreply.github.com> Date: Wed, 1 May 2024 03:54:50 -0400 Subject: [PATCH] Add show_help method to MainWindow class --- wincuts.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wincuts.py b/wincuts.py index 953c7e7..85e6406 100644 --- a/wincuts.py +++ b/wincuts.py @@ -122,6 +122,7 @@ def initUI(self): layout.addWidget(self.button_help) # Add Help button to the layout self.setLayout(layout) + def show_help(self): help_dialog = HelpDialog() help_dialog.exec_() @@ -176,6 +177,10 @@ def __init__(self, shortcut_manager): super().__init__() self.shortcut_manager = shortcut_manager self.initUI() + + def show_help(self): + help_dialog = HelpDialog() + help_dialog.exec_() def initUI(self): self.setWindowTitle("Shortcut Manager") @@ -194,6 +199,7 @@ def initUI(self): open_action.triggered.connect(self.show) quit_action.triggered.connect(self.quit) + help_action.triggered.connect(self.show_help) # Connect help action to show_help tray_menu.addAction(open_action) tray_menu.addAction(help_action) # Add help action to tray menu @@ -208,6 +214,8 @@ def initUI(self): self.shortcut_editor.list_shortcuts() self.listen_shortcuts() + + def closeEvent(self, event): event.ignore() self.hide()