[gimp/gtk3-port: 231/234] Bug 762279 - "Tip of the day" links opens two links.



commit 87c670a0af8e79e7f6dcb89b4fe97c398a097a15
Author: Jehan <jehan girinstud io>
Date:   Thu Feb 25 20:53:46 2016 +0100

    Bug 762279 - "Tip of the day" links opens two links.
    
    Use the "activate-link" signal instead of "clicked" on tip links, so
    that we can stop signal propagation.
    Otherwise it opens "http://docs.gimp.org/"; everytime.

 app/dialogs/tips-dialog.c |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)
---
diff --git a/app/dialogs/tips-dialog.c b/app/dialogs/tips-dialog.c
index dd357e2..2d76cc4 100644
--- a/app/dialogs/tips-dialog.c
+++ b/app/dialogs/tips-dialog.c
@@ -42,13 +42,13 @@ enum
   RESPONSE_NEXT     = 2
 };
 
-static void  tips_dialog_set_tip  (GimpTip       *tip);
-static void  tips_dialog_response (GtkWidget     *dialog,
-                                   gint           response);
-static void  tips_dialog_destroy  (GtkWidget     *widget,
-                                   GimpGuiConfig *config);
-static void  more_button_clicked  (GtkWidget     *button,
-                                   Gimp          *gimp);
+static void     tips_dialog_set_tip  (GimpTip       *tip);
+static void     tips_dialog_response (GtkWidget     *dialog,
+                                      gint           response);
+static void     tips_dialog_destroy  (GtkWidget     *widget,
+                                      GimpGuiConfig *config);
+static gboolean more_button_clicked  (GtkWidget     *button,
+                                      Gimp          *gimp);
 
 
 static GtkWidget *tips_dialog = NULL;
@@ -194,7 +194,7 @@ tips_dialog_create (Gimp *gimp)
   gtk_widget_show (more_button);
   gtk_box_pack_start (GTK_BOX (hbox), more_button, FALSE, FALSE, 0);
 
-  g_signal_connect (more_button, "clicked",
+  g_signal_connect (more_button, "activate-link",
                     G_CALLBACK (more_button_clicked),
                     gimp);
 
@@ -253,7 +253,7 @@ tips_dialog_set_tip (GimpTip *tip)
   gtk_widget_set_sensitive (more_button, tip->help_id != NULL);
 }
 
-static void
+static gboolean
 more_button_clicked (GtkWidget *button,
                      Gimp      *gimp)
 {
@@ -261,4 +261,7 @@ more_button_clicked (GtkWidget *button,
 
   if (tip->help_id)
     gimp_help (gimp, NULL, NULL, tip->help_id);
+
+  /* Do not run the link set at construction. */
+  return TRUE;
 }


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