Add shortcut information to places

This commit is contained in:
heliguy4599
2024-10-12 23:22:41 -04:00
parent 40be21887d
commit 7730afe768
3 changed files with 122 additions and 6 deletions

View File

@@ -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";
}
}
}
}

View File

@@ -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(), ["<primary>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(), ["<primary>r", "F5"])
self.create_action("open-files", self.on_open_files_shortcut, ["<primary>o"])
self.create_action("show-packages-page", lambda *_: self.props.active_window.switch_page_shortcut_handler("p"), ["<primary>p"])
self.create_action("show-remotes-page", lambda *_: self.props.active_window.switch_page_shortcut_handler("m"), ["<primary>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"), ["<primary>s"])
self.create_action("show-install-page", lambda *_: self.props.active_window.switch_page_shortcut_handler("i"), ["<primary>i"])
self.create_action("quit", lambda *_: self.quit(), ["<primary>q"])
self.create_action("refresh", lambda *_: self.props.active_window.refresh_handler(), ["<primary>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, ["<primary>o"])
self.create_action("toggle-select-mode", self.on_toggle_select_mode_shortcut, ["<primary>b", "<primary>Return", "<primary>KP_Enter"])
self.create_action("toggle-select-mode", self.on_toggle_select_mode_shortcut, ["<primary>b", "<primary>Return"])
self.create_action("toggle-selection-kp-enter", self.on_toggle_select_mode_shortcut, ["<primary>KP_Enter"]) # Doesn't show in the shortcuts window
self.create_action("toggle-search-mode", self.on_toggle_search_mode_shortcut, ["<primary>f"])
self.create_action("filter", self.on_filter_shortcut, ["<primary>t"])
self.create_action("new", self.on_new_shortcut, ["<primary>n"])

View File

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