From: Colin Leroy Date: Sun, 7 Oct 2007 09:43:00 +0000 (+0000) Subject: 2007-10-07 [colin] 3.0.2cvs26 X-Git-Tag: rel_3_1_0~134 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=d406d41b50018afe85b8ba99d36a7de4ca2613e7;hp=071ff1ced387183b5503ce387364ac7211649cc3 2007-10-07 [colin] 3.0.2cvs26 * src/prefs_toolbar.c Fix old icon being used when none is selected --- diff --git a/ChangeLog b/ChangeLog index da84188b6..841a38104 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-10-07 [colin] 3.0.2cvs26 + + * src/prefs_toolbar.c + Fix old icon being used when none is selected + 2007-10-07 [colin] 3.0.2cvs25 * src/toolbar.c diff --git a/PATCHSETS b/PATCHSETS index b1a932149..2c1202dea 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -2938,3 +2938,4 @@ ( cvs diff -u -r 1.30.2.38 -r 1.30.2.39 src/prefs_toolbar.c; ) > 3.0.2cvs23.patchset ( cvs diff -u -r 1.30.2.39 -r 1.30.2.40 src/prefs_toolbar.c; cvs diff -u -r 1.43.2.86 -r 1.43.2.87 src/toolbar.c; cvs diff -u -r 1.19.2.23 -r 1.19.2.24 src/toolbar.h; ) > 3.0.2cvs24.patchset ( cvs diff -u -r 1.43.2.87 -r 1.43.2.88 src/toolbar.c; ) > 3.0.2cvs25.patchset +( cvs diff -u -r 1.30.2.40 -r 1.30.2.41 src/prefs_toolbar.c; ) > 3.0.2cvs26.patchset diff --git a/configure.ac b/configure.ac index 1efdac2e7..778045ccc 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=0 MICRO_VERSION=2 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=25 +EXTRA_VERSION=26 EXTRA_RELEASE= EXTRA_GTK2_VERSION= diff --git a/src/prefs_toolbar.c b/src/prefs_toolbar.c index 212158da8..409f05c6e 100644 --- a/src/prefs_toolbar.c +++ b/src/prefs_toolbar.c @@ -385,6 +385,10 @@ static void prefs_toolbar_register(GtkButton *button, ToolbarPage *prefs_toolbar GdkPixbuf *pixbuf; gchar *event, *text; + if (prefs_toolbar->item_icon_file == NULL) { + alertpanel_error(ERROR_MSG_NO_ICON); + return; + } stock_pixbuf_gdk(prefs_toolbar->window, stock_pixmap_get_icon(prefs_toolbar->item_icon_file), &pixbuf); @@ -461,6 +465,10 @@ static void prefs_toolbar_substitute(GtkButton *button, ToolbarPage *prefs_toolb GdkPixbuf *pixbuf; gchar *icon_event, *set_event, *text; + if (prefs_toolbar->item_icon_file == NULL) { + alertpanel_error(ERROR_MSG_NO_ICON); + return; + } stock_pixbuf_gdk(prefs_toolbar->window, stock_pixmap_get_icon(prefs_toolbar->item_icon_file), &pixbuf); @@ -631,6 +639,8 @@ static void item_type_changed(GtkComboBox *item_type_combo, case ITEM_SEPARATOR: gtk_button_set_label(GTK_BUTTON(prefs_toolbar->icon_button), _("None")); gtk_button_set_image(GTK_BUTTON(prefs_toolbar->icon_button), NULL); + g_free(prefs_toolbar->item_icon_file); + prefs_toolbar->item_icon_file = NULL; gtk_combo_box_set_active( GTK_COMBO_BOX(prefs_toolbar->item_func_combo), -1); gtk_combo_box_set_active( @@ -1106,6 +1116,8 @@ static gboolean set_list_selected(GtkTreeSelection *selector, if (g_utf8_collate(toolbar_ret_descr_from_val(A_SEPARATOR), descr) == 0) { gtk_button_set_label(GTK_BUTTON(prefs_toolbar->icon_button), _("None")); + g_free(prefs_toolbar->item_icon_file); + prefs_toolbar->item_icon_file = NULL; gtk_combo_box_set_active(GTK_COMBO_BOX(prefs_toolbar->item_type_combo), ITEM_SEPARATOR); g_free(icon_text);