[gimp/gtk3-port: 389/460] Use gtk_show_uri_on_window(), gtk_show_uri() is deprecated



commit 3e95a0c4f3c8cac3a2bdb59be5c7854ce1342aaf
Author: Michael Natterer <mitch gimp org>
Date:   Thu May 10 15:59:28 2018 +0200

    Use gtk_show_uri_on_window(), gtk_show_uri() is deprecated

 app/widgets/gimpcriticaldialog.c |   16 +++++++++-------
 plug-ins/common/web-browser.c    |   16 +++++++++-------
 2 files changed, 18 insertions(+), 14 deletions(-)
---
diff --git a/app/widgets/gimpcriticaldialog.c b/app/widgets/gimpcriticaldialog.c
index dc51df8..1ae74b6 100644
--- a/app/widgets/gimpcriticaldialog.c
+++ b/app/widgets/gimpcriticaldialog.c
@@ -58,7 +58,8 @@ static void    gimp_critical_dialog_finalize (GObject     *object);
 static void    gimp_critical_dialog_response (GtkDialog   *dialog,
                                               gint         response_id);
 
-static gboolean browser_open_url             (const gchar  *url,
+static gboolean browser_open_url             (GtkWindow    *window,
+                                              const gchar  *url,
                                               GError      **error);
 
 
@@ -208,7 +209,8 @@ gimp_critical_dialog_finalize (GObject *object)
  * cross-platform way need to be a plug-in?
  */
 static gboolean
-browser_open_url (const gchar  *url,
+browser_open_url (GtkWindow    *window,
+                  const gchar  *url,
                   GError      **error)
 {
 #ifdef G_OS_WIN32
@@ -287,10 +289,10 @@ browser_open_url (const gchar  *url,
 
 #else
 
-  return gtk_show_uri (gdk_screen_get_default (),
-                       url,
-                       gtk_get_current_event_time(),
-                       error);
+  return gtk_show_uri_on_window (window,
+                                 url,
+                                 GDK_CURRENT_TIME,
+                                 error);
 
 #endif
 }
@@ -346,7 +348,7 @@ gimp_critical_dialog_response (GtkDialog *dialog,
 
         g_free (temp);
 
-        browser_open_url (url, NULL);
+        browser_open_url (GTK_WINDOW (dialog), url, NULL);
       }
       break;
 
diff --git a/plug-ins/common/web-browser.c b/plug-ins/common/web-browser.c
index d26720b..92184cb 100644
--- a/plug-ins/common/web-browser.c
+++ b/plug-ins/common/web-browser.c
@@ -49,7 +49,8 @@ static void     run              (const gchar      *name,
                                   const GimpParam  *param,
                                   gint             *nreturn_vals,
                                   GimpParam       **return_vals);
-static gboolean browser_open_url (const gchar      *url,
+static gboolean browser_open_url (GtkWindow        *window,
+                                  const gchar      *url,
                                   GError          **error);
 
 const GimpPlugInInfo PLUG_IN_INFO =
@@ -105,7 +106,7 @@ run (const gchar      *name,
       param[0].data.d_string != NULL &&
       strlen (param[0].data.d_string))
     {
-      if (! browser_open_url (param[0].data.d_string, &error))
+      if (! browser_open_url (NULL, param[0].data.d_string, &error))
         {
           status                  = GIMP_PDB_EXECUTION_ERROR;
           *nreturn_vals           = 2;
@@ -123,7 +124,8 @@ run (const gchar      *name,
 }
 
 static gboolean
-browser_open_url (const gchar  *url,
+browser_open_url (GtkWindow    *window,
+                  const gchar  *url,
                   GError      **error)
 {
 #ifdef G_OS_WIN32
@@ -204,10 +206,10 @@ browser_open_url (const gchar  *url,
 
   gimp_ui_init (PLUG_IN_BINARY, FALSE);
 
-  return gtk_show_uri (gdk_screen_get_default (),
-                       url,
-                       gtk_get_current_event_time(),
-                       error);
+  return gtk_show_uri_on_window (window,
+                                 url,
+                                 GDK_CURRENT_TIME,
+                                 error);
 
 #endif
 }


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