[gimp/gtk3-port: 226/444] 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: 226/444] Bug 762279 - "Tip of the day" links opens two links.
- Date: Sun, 13 May 2018 21:56:52 +0000 (UTC)
commit c6c9ac06dd87bf275f608f6b4bac4523b94a8088
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 d1788af..8d8df28 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;
@@ -195,7 +195,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);
@@ -254,7 +254,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)
{
@@ -262,4 +262,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]