[shotwell] Replace deprecated gtk_show_uri



commit 83f2e394cfc61f120a0021c37882d286b491c9eb
Author: Jens Georg <mail jensge org>
Date:   Fri Mar 30 13:09:53 2018 +0200

    Replace deprecated gtk_show_uri

 src/AppWindow.vala           |    4 ++--
 src/Resources.vala           |    9 +++++----
 src/dialogs/Preferences.vala |    2 +-
 src/util/system.vala         |    4 ----
 4 files changed, 8 insertions(+), 11 deletions(-)
---
diff --git a/src/AppWindow.vala b/src/AppWindow.vala
index 780f21c..2e8fd26 100644
--- a/src/AppWindow.vala
+++ b/src/AppWindow.vala
@@ -615,7 +615,7 @@ public abstract class AppWindow : PageWindow {
 
     private void on_help_contents() {
         try {
-            Resources.launch_help(get_screen());
+            Resources.launch_help(this);
         } catch (Error err) {
             error_message(_("Unable to display help: %s").printf(err.message));
         }
@@ -676,7 +676,7 @@ public abstract class AppWindow : PageWindow {
     }
     
     public void show_uri(string url) throws Error {
-        sys_show_uri(get_window().get_screen(), url);
+        Gtk.show_uri_on_window(this, url, Gdk.CURRENT_TIME);
     }
     
     protected virtual void add_actions () {
diff --git a/src/Resources.vala b/src/Resources.vala
index ef86424..60a8cfe 100644
--- a/src/Resources.vala
+++ b/src/Resources.vala
@@ -975,7 +975,7 @@ along with Shotwell; if not, write to the Free Software Foundation, Inc.,
         return null;
     }
 
-    public static void launch_help(Gdk.Screen screen, string? anchor=null) throws Error {
+    public static void launch_help(Gtk.Window window, string? anchor=null) throws Error {
         string? help_path = get_help_path();
         
         if(help_path != null) {
@@ -1001,11 +1001,12 @@ along with Shotwell; if not, write to the Free Software Foundation, Inc.,
         }
         
         // launch from system-installed help
+        var uri = "help:shotwell";
         if (anchor != null) {
-            sys_show_uri(screen, "help:shotwell" + anchor);
-        } else {
-            sys_show_uri(screen, "help:shotwell");
+            uri += anchor;
         }
+
+        Gtk.show_uri_on_window(window, uri, Gdk.CURRENT_TIME);
     }
     
     public string to_css_color(Gdk.RGBA color) {
diff --git a/src/dialogs/Preferences.vala b/src/dialogs/Preferences.vala
index 0a18547..847edcd 100644
--- a/src/dialogs/Preferences.vala
+++ b/src/dialogs/Preferences.vala
@@ -183,7 +183,7 @@ public class PreferencesDialog : Gtk.Dialog {
     // the help viewer and specify the full path to the subsection we want...
     private bool on_local_pattern_help(string ignore) {
         try {
-            Resources.launch_help(AppWindow.get_instance().get_screen(), "other-files.page");
+            Resources.launch_help(AppWindow.get_instance(), "other-files.page");
         } catch (Error e) {
             message("Unable to launch help: %s", e.message);
         }
diff --git a/src/util/system.vala b/src/util/system.vala
index 38abf1e..0269d3d 100644
--- a/src/util/system.vala
+++ b/src/util/system.vala
@@ -25,10 +25,6 @@ string get_nautilus_install_location() {
     return Environment.find_program_in_path("nautilus");
 }
 
-void sys_show_uri(Gdk.Screen screen, string uri) throws Error {
-    Gtk.show_uri(screen, uri, Gdk.CURRENT_TIME);
-}
-
 void show_file_in_nautilus(string filename) throws Error {
     GLib.Process.spawn_command_line_async(get_nautilus_install_location() + " " + filename);
 }


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