From 331bfaa98c913d5597b61ef03736569dbbd88928 Mon Sep 17 00:00:00 2001 From: Sander Sweers Date: Sat, 10 Dec 2022 19:18:34 +0100 Subject: [PATCH] Services: Add accels to close --- blueman/main/Services.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/blueman/main/Services.py b/blueman/main/Services.py index 0546fe6e4..f4c191506 100644 --- a/blueman/main/Services.py +++ b/blueman/main/Services.py @@ -29,6 +29,10 @@ def do_quit(_: object) -> bool: s.set_callback(do_quit) s.attach() + close_action = Gio.SimpleAction.new("quit", None) + close_action.connect("activate", lambda x, y: self.quit()) + self.add_action(close_action) + def do_activate(self) -> None: if not self.window: self.window = Gtk.ApplicationWindow(application=self, title=_("Local Services"), icon_name="blueman", @@ -77,6 +81,10 @@ def do_activate(self) -> None: self.window.present_with_time(Gtk.get_current_event_time()) + def do_startup(self) -> None: + Gtk.Application.do_startup(self) + self.set_accels_for_action("app.quit", ["w", "q", "Escape"]) + def option_changed(self) -> None: rets = [plugin.on_query_apply_state() for plugin in ServicePlugin.instances if plugin._is_loaded] show_apply = False