From 32f01614a515970f84388089681a89343f85c657 Mon Sep 17 00:00:00 2001 From: heliguy Date: Sat, 2 Sep 2023 21:53:18 -0400 Subject: [PATCH] Added more keyboard shortcuts --- src/gtk/help-overlay.blp | 7 ++++++- src/main.py | 11 ++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/gtk/help-overlay.blp b/src/gtk/help-overlay.blp index b8e15332..cec7f066 100644 --- a/src/gtk/help-overlay.blp +++ b/src/gtk/help-overlay.blp @@ -15,6 +15,11 @@ ShortcutsWindow help_overlay { action-name: "app.search"; } + ShortcutsShortcut { + title: C_("shortcut window", "Refresh"); + action-name: "app.refresh-list"; + } + ShortcutsShortcut { title: C_("shortcut window", "Toggle Batch Mode"); action-name: "app.toggle-batch-mode"; @@ -22,7 +27,7 @@ ShortcutsWindow help_overlay { ShortcutsShortcut { title: C_("shortcut window", "Manage Orphaned Data Folders"); - action-name: "app.open-orphans-window"; + action-name: "app.manage-data-folders"; } ShortcutsShortcut { diff --git a/src/main.py b/src/main.py index 75c04a4b..ea80ad5f 100644 --- a/src/main.py +++ b/src/main.py @@ -41,7 +41,9 @@ def __init__(self): self.create_action('manage-data-folders', self.on_manage_data_folders_action) self.create_action('toggle-batch-mode', self.batch_mode_shortcut, ['b', 'Return']) self.create_action('select-all-in-batch-mode', self.select_all_shortcut, ['a']) - self.create_action('open-orphans-window', self.manage_data_shortcut, ['d']) + self.create_action('manage-data-folders', self.manage_data_shortcut, ['d']) + self.create_action('refresh-list', self.refresh_list_shortcut, ['r','F5']) + self.create_action('show-runtimes', self.show_runtimes_shortcut, ['t']) self.show_runtimes_stateful = Gio.SimpleAction.new_stateful("show-runtimes", None, GLib.Variant.new_boolean(False)) self.show_runtimes_stateful.connect("activate", self.on_show_runtimes_action) @@ -61,6 +63,13 @@ def select_all_shortcut(self, widget, _): def manage_data_shortcut(self, widget, _): self.props.active_window.orphans_window() + def refresh_list_shortcut(self, widget, _): + self.props.active_window.refresh_list_of_flatpaks(widget, True) + + def show_runtimes_shortcut(self, widget, _): + window = self.props.active_window + window.show_runtimes_toggle_handler(window, not window.show_runtimes) + def do_activate(self): """Called when the application is activated.