[gnome-music/wip/mschraal/help-launcher: 11/11] application: Use async call for launching help




commit b057618f71b99b4fa39969f19fd059cfd0bb8548
Author: Marinus Schraal <mschraal gnome org>
Date:   Fri Feb 18 01:02:48 2022 +0100

    application: Use async call for launching help

 gnomemusic/application.py | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/gnomemusic/application.py b/gnomemusic/application.py
index 391b901c9..b00ff31da 100644
--- a/gnomemusic/application.py
+++ b/gnomemusic/application.py
@@ -204,11 +204,17 @@ class Application(Gtk.Application):
             if accel is not None:
                 self.set_accels_for_action(*accel)
 
-    def _help(self, action, param):
-        try:
-            Gtk.show_uri(self._window, "help:gnome-music", Gdk.CURRENT_TIME)
-        except GLib.Error:
-            self._log.message("Help handler not available.")
+    def _help(self, action: Gio.Action, param: Optional[GLib.Variant]) -> None:
+
+        def show_uri_cb(parent: Gtk.Window, result: Gio.AsyncResult) -> None:
+            try:
+                Gtk.show_uri_full_finish(parent, result)
+            except GLib.Error:
+                self._log.message("Help handler not available.")
+
+        Gtk.show_uri_full(
+            self._window, "help:gnome-music", Gdk.CURRENT_TIME, None,
+            show_uri_cb)
 
     def _lastfm_account(
             self, action: Gio.SimpleAction,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]