Skip to content

Commit

Permalink
Services: Add accels to close
Browse files Browse the repository at this point in the history
  • Loading branch information
infirit committed Dec 10, 2022
1 parent 701c55f commit 331bfaa
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions blueman/main/Services.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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", ["<Ctrl>w", "<Ctrl>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
Expand Down

0 comments on commit 331bfaa

Please sign in to comment.