CTRL+W and CTRL+Q stops local instance before closing the app

This commit is contained in:
jeffser 2024-08-11 13:23:34 -06:00
parent 3b95d369b8
commit fd92a86c5e
2 changed files with 2 additions and 1 deletions

View File

@ -53,7 +53,7 @@ class AlpacaApplication(Adw.Application):
def __init__(self, version):
super().__init__(application_id='com.jeffser.Alpaca',
flags=Gio.ApplicationFlags.DEFAULT_FLAGS)
self.create_action('quit', lambda *_: self.quit(), ['<primary>w', '<primary>q'])
self.create_action('quit', lambda *_: self.props.active_window.closing_app(None), ['<primary>w', '<primary>q'])
self.create_action('preferences', lambda *_: AlpacaWindow.show_preferences_dialog(self.props.active_window), ['<primary>comma'])
self.create_action('about', self.on_about_action)
self.version = version

View File

@ -345,6 +345,7 @@ class AlpacaWindow(Adw.ApplicationWindow):
else:
logger.info("Closing app...")
local_instance.stop()
self.get_application().quit()
@Gtk.Template.Callback()
def model_spin_changed(self, spin):