2007-10-07 [colin] 3.0.2cvs26
authorColin Leroy <colin@colino.net>
Sun, 7 Oct 2007 09:43:00 +0000 (09:43 +0000)
committerColin Leroy <colin@colino.net>
Sun, 7 Oct 2007 09:43:00 +0000 (09:43 +0000)
* src/prefs_toolbar.c
Fix old icon being used when none is selected

ChangeLog
PATCHSETS
configure.ac
src/prefs_toolbar.c

index da84188..841a381 100644 (file)
--- 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
index b1a9321..2c1202d 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( 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
index 1efdac2..778045c 100644 (file)
@@ -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=
 
index 212158d..409f05c 100644 (file)
@@ -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);