diff --git a/src/main.py b/src/main.py index 5b192fc..c235ddd 100644 --- a/src/main.py +++ b/src/main.py @@ -76,8 +76,8 @@ class BavarderApplication(Adw.Application): # threading.Event() # ) # An event for letting us know when Gst is done playing - def on_quit(self, action, param): - """Called when the user activates the Quit action.""" + def quitting(self, _): + """Called before closing main window.""" self.settings.set_strv("enabled-providers", list(self.enabled_providers)) self.settings.set_string("latest-provider", self.get_provider().slug) @@ -86,6 +86,10 @@ class BavarderApplication(Adw.Application): self.save_providers() self.quit() + def on_quit(self, action, param): + """Called when the user activates the Quit action.""" + self.quitting() + def save_providers(self): r = {} for k, p in self.providers.items(): @@ -114,6 +118,8 @@ class BavarderApplication(Adw.Application): self.win.response_stack.set_visible_child_name("page_response") + self.win.connect("close-request", self.quitting) + self.provider_selector_model = Gtk.StringList() self.providers = {}