diff --git a/src/gtk/help-overlay.blp b/src/gtk/help-overlay.blp index 289cf6e..44e467a 100644 --- a/src/gtk/help-overlay.blp +++ b/src/gtk/help-overlay.blp @@ -4,9 +4,17 @@ ShortcutsWindow help_overlay { modal: true; ShortcutsSection { section-name: "shortcuts"; - // max-height: 8; + max-height: 17; ShortcutsGroup { title: _("General"); + ShortcutsShortcut { + title: _("Refresh"); + action-name: "app.refresh"; + } + ShortcutsShortcut { + title: _("Open Files"); + action-name: "app.open-files"; + } ShortcutsShortcut { title: _("Open Menu"); action-name: "app.open-menu"; @@ -20,5 +28,108 @@ ShortcutsWindow help_overlay { action-name: "app.quit"; } } + ShortcutsGroup { + title: _("Navigation"); + ShortcutsShortcut { + title: _("Show Packages Page"); + action-name: "app.show-packages-page"; + } + ShortcutsShortcut { + title: _("Show Remotes Page"); + action-name: "app.show-remotes-page"; + } + ShortcutsShortcut { + title: _("Show User Data Page"); + action-name: "app.show-user-data-page"; + } + ShortcutsShortcut { + title: _("Show Snapshots Page"); + action-name: "app.show-snapshots-page"; + } + ShortcutsShortcut { + title: _("Show Install Page"); + action-name: "app.show-install-page"; + } + } + ShortcutsGroup { + title: _("Packages Page"); + ShortcutsShortcut { + title: _("Selection Mode"); + action-name: "app.toggle-select-mode"; + } + ShortcutsShortcut { + title: _("Search Mode"); + action-name: "app.toggle-search-mode"; + } + ShortcutsShortcut { + title: _("Edit Filters"); + action-name: "app.filter"; + } + ShortcutsShortcut { + title: _("Uninstall Selected Packages"); + action-name: "app.delete"; + } + } + ShortcutsGroup { + title: _("Remotes Page"); + ShortcutsShortcut { + title: _("Search Mode"); + action-name: "app.toggle-search-mode"; + } + ShortcutsShortcut { + title: _("Show or Hide Disabled Remotes"); + action-name: "app.filter"; + } + ShortcutsShortcut { + title: _("New Remote"); + action-name: "app.new"; + } + } + ShortcutsGroup { + title: _("User Data Page"); + ShortcutsShortcut { + title: _("Selection Mode"); + action-name: "app.toggle-select-mode"; + } + ShortcutsShortcut { + title: _("Search Mode"); + action-name: "app.toggle-search-mode"; + } + ShortcutsShortcut { + title: _("Edit Sorting Modes"); + action-name: "app.filter"; + } + ShortcutsShortcut { + title: _("Trash Selected Data"); + action-name: "app.delete"; + } + ShortcutsShortcut { + title: _("Show Active Data"); + action-name: "app.active-data-view"; + } + ShortcutsShortcut { + title: _("Show Leftover Data"); + action-name: "app.leftover-data-view"; + } + } + ShortcutsGroup { + title: _("Snapshots Page"); + ShortcutsShortcut { + title: _("Selection Mode"); + action-name: "app.toggle-select-mode"; + } + ShortcutsShortcut { + title: _("Search Mode"); + action-name: "app.toggle-search-mode"; + } + ShortcutsShortcut { + title: _("Trash Selected Snapshots"); + action-name: "app.delete"; + } + ShortcutsShortcut { + title: _("New Snapshots"); + action-name: "app.new"; + } + } } } diff --git a/src/main.py b/src/main.py index cbd17c8..ea5d720 100644 --- a/src/main.py +++ b/src/main.py @@ -43,6 +43,10 @@ class WarehouseApplication(Adw.Application): ) self.create_action("about", self.on_about_action) self.create_action("preferences", self.on_preferences_action) + self.create_action("quit", lambda *_: self.quit(), ["q"]) + self.create_action("open-menu", lambda *_: self.props.active_window.main_menu.popup(), ["F10"]) + self.create_action("refresh", lambda *_: self.props.active_window.refresh_handler(), ["r", "F5"]) + self.create_action("open-files", self.on_open_files_shortcut, ["o"]) self.create_action("show-packages-page", lambda *_: self.props.active_window.switch_page_shortcut_handler("p"), ["p"]) self.create_action("show-remotes-page", lambda *_: self.props.active_window.switch_page_shortcut_handler("m"), ["m"]) @@ -50,11 +54,8 @@ class WarehouseApplication(Adw.Application): self.create_action("show-snapshots-page", lambda *_: self.props.active_window.switch_page_shortcut_handler("s"), ["s"]) self.create_action("show-install-page", lambda *_: self.props.active_window.switch_page_shortcut_handler("i"), ["i"]) - self.create_action("quit", lambda *_: self.quit(), ["q"]) - self.create_action("refresh", lambda *_: self.props.active_window.refresh_handler(), ["r", "F5"]) - self.create_action("open-menu", lambda *_: self.props.active_window.main_menu.popup(), ["F10"]) - self.create_action("open-files", self.on_open_files_shortcut, ["o"]) - self.create_action("toggle-select-mode", self.on_toggle_select_mode_shortcut, ["b", "Return", "KP_Enter"]) + self.create_action("toggle-select-mode", self.on_toggle_select_mode_shortcut, ["b", "Return"]) + self.create_action("toggle-selection-kp-enter", self.on_toggle_select_mode_shortcut, ["KP_Enter"]) # Doesn't show in the shortcuts window self.create_action("toggle-search-mode", self.on_toggle_search_mode_shortcut, ["f"]) self.create_action("filter", self.on_filter_shortcut, ["t"]) self.create_action("new", self.on_new_shortcut, ["n"]) diff --git a/src/main_window/window.blp b/src/main_window/window.blp index 2938f71..91fc18b 100644 --- a/src/main_window/window.blp +++ b/src/main_window/window.blp @@ -143,6 +143,10 @@ menu primary_menu { // label: _("Refresh List"); // action: "app.refresh-list"; // } + item { + label: _("_Open Files"); + action: "app.open-files"; + } item { label: _("_Keyboard Shortcuts"); action: "win.show-help-overlay";