Skip to content

Commit

Permalink
Added more keyboard shortcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
heliguy4599 committed Sep 3, 2023
1 parent 68c5621 commit 32f0161
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/gtk/help-overlay.blp
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,19 @@ 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";
}

ShortcutsShortcut {
title: C_("shortcut window", "Manage Orphaned Data Folders");
action-name: "app.open-orphans-window";
action-name: "app.manage-data-folders";
}

ShortcutsShortcut {
Expand Down
11 changes: 10 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, ['<primary>b', '<primary>Return'])
self.create_action('select-all-in-batch-mode', self.select_all_shortcut, ['<primary>a'])
self.create_action('open-orphans-window', self.manage_data_shortcut, ['<primary>d'])
self.create_action('manage-data-folders', self.manage_data_shortcut, ['<primary>d'])
self.create_action('refresh-list', self.refresh_list_shortcut, ['<primary>r','F5'])
self.create_action('show-runtimes', self.show_runtimes_shortcut, ['<primary>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)
Expand All @@ -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.
Expand Down

0 comments on commit 32f0161

Please sign in to comment.