[latexila] Always use latexila_utils_show_uri() instead of GTK+ function



commit 84e97fa9d9a08bc29e0cc4ad1ca1628deede41fd
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sat Jun 17 13:47:51 2017 +0200

    Always use latexila_utils_show_uri() instead of GTK+ function
    
    latexila_utils_show_uri() is more convenient to use since it takes a
    GtkWidget parameter.

 src/document_view.vala |    2 +-
 src/finance.vala       |    6 +++---
 src/latexila_app.vala  |    5 +----
 src/main_window.vala   |    2 +-
 4 files changed, 6 insertions(+), 9 deletions(-)
---
diff --git a/src/document_view.vala b/src/document_view.vala
index f3e235e..68e2cf3 100644
--- a/src/document_view.vala
+++ b/src/document_view.vala
@@ -326,7 +326,7 @@ public class DocumentView : Tepl.View
         {
             try
             {
-                show_uri (this.get_screen (), "help:latexila/spell_checking",
+                Latexila.utils_show_uri (this, "help:latexila/spell_checking",
                     Gdk.CURRENT_TIME);
             }
             catch (Error e)
diff --git a/src/finance.vala b/src/finance.vala
index cc0e9d4..d177f38 100644
--- a/src/finance.vala
+++ b/src/finance.vala
@@ -95,7 +95,7 @@ namespace Finance
 
             if (response == ResponseType.ACCEPT)
             {
-                open_donate_page (parent_window);
+                open_donate_page (dialog);
                 continue;
             }
 
@@ -155,12 +155,12 @@ namespace Finance
         settings.set_string ("last-shown-date", date);
     }
 
-    private void open_donate_page (Window parent_window)
+    private void open_donate_page (Widget widget)
     {
         try
         {
             string uri = "https://people.gnome.org/~swilmet/latexila/support.html";;
-            show_uri (parent_window.get_screen (), uri, Gdk.CURRENT_TIME);
+            Latexila.utils_show_uri (widget, uri, Gdk.CURRENT_TIME);
         }
         catch (Error e)
         {
diff --git a/src/latexila_app.vala b/src/latexila_app.vala
index fe52017..2f6d187 100644
--- a/src/latexila_app.vala
+++ b/src/latexila_app.vala
@@ -211,14 +211,11 @@ public class LatexilaApp : Gtk.Application
 
     private void help_cb ()
     {
-        Gdk.Screen? screen = null;
         MainWindow? window = get_active_main_window ();
-        if (window != null)
-            screen = window.get_screen ();
 
         try
         {
-            Gtk.show_uri (screen, "help:latexila", Gdk.CURRENT_TIME);
+            Latexila.utils_show_uri (window, "help:latexila", Gdk.CURRENT_TIME);
         }
         catch (Error e)
         {
diff --git a/src/main_window.vala b/src/main_window.vala
index 9ca28ba..c68d180 100644
--- a/src/main_window.vala
+++ b/src/main_window.vala
@@ -1156,7 +1156,7 @@ public class MainWindow : ApplicationWindow
         {
             string uri = Filename.to_uri (Path.build_filename (Config.DATA_DIR,
                 "latexhelp.html", null));
-            show_uri (this.get_screen (), uri, Gdk.CURRENT_TIME);
+            Latexila.utils_show_uri (this, uri, Gdk.CURRENT_TIME);
         }
         catch (Error e)
         {


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