[gimp/gtk3-port: 232/233] Bug 762279 - "Tip of the day" links opens two links.
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gtk3-port: 232/233] Bug 762279 - "Tip of the day" links opens two links.
- Date: Wed, 30 Mar 2016 21:25:45 +0000 (UTC)
commit 53bd4a364da2fd506c5d52d2b3b999da757e99d8
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 e0fd927..987c26d 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]