From ac940f2cffc3dddfe85148fb50cff39b7d50e01c Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Fri, 22 Nov 2002 18:06:36 +0000 Subject: [PATCH] allow to configure whether tips are shown on startup. 2002-11-22 Sven Neumann * app/gui/preferences-dialog.c: allow to configure whether tips are shown on startup. * app/gui/tips-dialog.c: threw out lots of code and use gimp_prop_check_button_new() instead. --- ChangeLog | 8 ++++++++ app/dialogs/preferences-dialog.c | 3 +++ app/dialogs/tips-dialog.c | 22 ++++------------------ app/gui/preferences-dialog.c | 3 +++ app/gui/tips-dialog.c | 22 ++++------------------ 5 files changed, 22 insertions(+), 36 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1f7cb4ee0c..3bc024021d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2002-11-22 Sven Neumann + + * app/gui/preferences-dialog.c: allow to configure whether tips + are shown on startup. + + * app/gui/tips-dialog.c: threw out lots of code and use + gimp_prop_check_button_new() instead. + 2002-11-21 Maurits Rijk * plug-ins/common/blinds.c: use gimp_get_bg_guchar diff --git a/app/dialogs/preferences-dialog.c b/app/dialogs/preferences-dialog.c index f470598788..88f60ce2e4 100644 --- a/app/dialogs/preferences-dialog.c +++ b/app/dialogs/preferences-dialog.c @@ -1253,6 +1253,9 @@ prefs_dialog_new (Gimp *gimp, prefs_check_button_add (config, "use-help", _("Context Sensitive _Help with \"F1\""), GTK_BOX (vbox2)); + prefs_check_button_add (config, "show-tips", + _("Show Tips on _Startup"), + GTK_BOX (vbox2)); vbox2 = prefs_frame_new (_("Help Browser"), GTK_CONTAINER (vbox)); diff --git a/app/dialogs/tips-dialog.c b/app/dialogs/tips-dialog.c index f671091e93..5ac824bf7f 100644 --- a/app/dialogs/tips-dialog.c +++ b/app/dialogs/tips-dialog.c @@ -34,6 +34,8 @@ #include "core/gimp.h" +#include "widgets/gimppropwidgets.h" + #include "tips-dialog.h" #include "tips-parser.h" @@ -47,8 +49,6 @@ static void tips_show_previous (GtkWidget *widget, gpointer data); static void tips_show_next (GtkWidget *widget, gpointer data); -static void tips_toggle_update (GtkWidget *widget, - gpointer data); static GtkWidget *tips_dialog = NULL; @@ -171,16 +171,11 @@ tips_dialog_create (Gimp *gimp) gtk_box_pack_end (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); - button = - gtk_check_button_new_with_mnemonic (_("Show tip next time GIMP starts")); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), config->show_tips); + button = gimp_prop_check_button_new (G_OBJECT (config), "show-tips", + _("Show tip next time GIMP starts")); gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); gtk_widget_show (button); - g_signal_connect (G_OBJECT (button), "toggled", - G_CALLBACK (tips_toggle_update), - config); - bbox = gtk_hbutton_box_new (); gtk_box_pack_end (GTK_BOX (hbox), bbox, FALSE, FALSE, 0); gtk_widget_show (bbox); @@ -278,12 +273,3 @@ tips_show_next (GtkWidget *widget, tips_set_labels (current_tip->data); } - -static void -tips_toggle_update (GtkWidget *widget, - gpointer data) -{ - g_object_set (G_OBJECT (data), - "show-tips", gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)), - NULL); -} diff --git a/app/gui/preferences-dialog.c b/app/gui/preferences-dialog.c index f470598788..88f60ce2e4 100644 --- a/app/gui/preferences-dialog.c +++ b/app/gui/preferences-dialog.c @@ -1253,6 +1253,9 @@ prefs_dialog_new (Gimp *gimp, prefs_check_button_add (config, "use-help", _("Context Sensitive _Help with \"F1\""), GTK_BOX (vbox2)); + prefs_check_button_add (config, "show-tips", + _("Show Tips on _Startup"), + GTK_BOX (vbox2)); vbox2 = prefs_frame_new (_("Help Browser"), GTK_CONTAINER (vbox)); diff --git a/app/gui/tips-dialog.c b/app/gui/tips-dialog.c index f671091e93..5ac824bf7f 100644 --- a/app/gui/tips-dialog.c +++ b/app/gui/tips-dialog.c @@ -34,6 +34,8 @@ #include "core/gimp.h" +#include "widgets/gimppropwidgets.h" + #include "tips-dialog.h" #include "tips-parser.h" @@ -47,8 +49,6 @@ static void tips_show_previous (GtkWidget *widget, gpointer data); static void tips_show_next (GtkWidget *widget, gpointer data); -static void tips_toggle_update (GtkWidget *widget, - gpointer data); static GtkWidget *tips_dialog = NULL; @@ -171,16 +171,11 @@ tips_dialog_create (Gimp *gimp) gtk_box_pack_end (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); - button = - gtk_check_button_new_with_mnemonic (_("Show tip next time GIMP starts")); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), config->show_tips); + button = gimp_prop_check_button_new (G_OBJECT (config), "show-tips", + _("Show tip next time GIMP starts")); gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); gtk_widget_show (button); - g_signal_connect (G_OBJECT (button), "toggled", - G_CALLBACK (tips_toggle_update), - config); - bbox = gtk_hbutton_box_new (); gtk_box_pack_end (GTK_BOX (hbox), bbox, FALSE, FALSE, 0); gtk_widget_show (bbox); @@ -278,12 +273,3 @@ tips_show_next (GtkWidget *widget, tips_set_labels (current_tip->data); } - -static void -tips_toggle_update (GtkWidget *widget, - gpointer data) -{ - g_object_set (G_OBJECT (data), - "show-tips", gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)), - NULL); -}