diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-06-24 17:38:33 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-06-24 17:38:33 +0000 |
commit | f702b50b6ac6cb2e1e0e848a629a623f323c9de2 (patch) | |
tree | 67d787608695391e5edc2eb245b3943302ba1734 /deluge/ui/gtk3/menubar.py | |
parent | Releasing debian version 2.1.1-5. (diff) | |
download | deluge-f702b50b6ac6cb2e1e0e848a629a623f323c9de2.tar.xz deluge-f702b50b6ac6cb2e1e0e848a629a623f323c9de2.zip |
Merging upstream version 2.1.2~dev0+20230529.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'deluge/ui/gtk3/menubar.py')
-rw-r--r-- | deluge/ui/gtk3/menubar.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/deluge/ui/gtk3/menubar.py b/deluge/ui/gtk3/menubar.py index a812a8c..328cb7e 100644 --- a/deluge/ui/gtk3/menubar.py +++ b/deluge/ui/gtk3/menubar.py @@ -23,6 +23,17 @@ from .path_chooser import PathChooser log = logging.getLogger(__name__) +default_main_window_accelmap = { + '<Deluge-MainWindow>/File/Add Torrent': '<Primary>o', + '<Deluge-MainWindow>/File/Create Torrent': '<Primary>n', + '<Deluge-MainWindow>/File/Quit & Shutdown Daemon': '<Primary><Shift>q', + '<Deluge-MainWindow>/File/Quit': '<Primary>q', + '<Deluge-MainWindow>/Edit/Preferences': '<Primary>p', + '<Deluge-MainWindow>/Edit/Connection Manager': '<Primary>m', + '<Deluge-MainWindow>/View/Find ...': '<Primary>f', + '<Deluge-MainWindow>/Help/FAQ': 'F1', +} + class MenuBar(component.Component): def __init__(self): @@ -112,6 +123,11 @@ class MenuBar(component.Component): # Attach the torrent_menu to the Torrent file menu self.menu_torrent.set_submenu(self.torrentmenu) + # Set keyboard shortcuts + for accel_path, accelerator in default_main_window_accelmap.items(): + accel_key, accel_mods = Gtk.accelerator_parse(accelerator) + Gtk.AccelMap.change_entry(accel_path, accel_key, accel_mods, True) + # Make sure the view menuitems are showing the correct active state self.main_builder.get_object('menuitem_toolbar').set_active( self.config['show_toolbar'] |