2007-10-11 [wwp] 3.0.2cvs60
authorTristan Chabredier <wwp@claws-mail.org>
Thu, 11 Oct 2007 12:46:11 +0000 (12:46 +0000)
committerTristan Chabredier <wwp@claws-mail.org>
Thu, 11 Oct 2007 12:46:11 +0000 (12:46 +0000)
* src/editaddress.c
Disable "Unset picture" menu item when there's
no picture to clear. Fix an extraneous g_unref_object,
add missing initializers.

ChangeLog
PATCHSETS
configure.ac
src/editaddress.c

index 149048acf805c49671224f8869e8aec8e5c0075a..9841fb8b8ba76a09a550b46a33528bc29b4acc80 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-10-11 [wwp]       3.0.2cvs60
+
+       * src/editaddress.c
+               Disable "Unset picture" menu item when there's
+               no picture to clear. Fix an extraneous g_unref_object,
+               add missing initializers.
+
 2007-10-11 [wwp]       3.0.2cvs59
 
        * src/pixmaps/anonymous.xpm
index 42685de9d6e05a978d54108a37c908f3584ac6b1..3ddf1406af972cfd9a5b09c42674ede1437c50b0 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.12.2.49 -r 1.12.2.50 src/prefs_template.c;  ) > 3.0.2cvs57.patchset
 ( cvs diff -u -r 1.94.2.158 -r 1.94.2.159 src/messageview.c;  cvs diff -u -r 1.60.2.52 -r 1.60.2.53 src/prefs_actions.c;  cvs diff -u -r 1.12.2.50 -r 1.12.2.51 src/prefs_template.c;  cvs diff -u -r 1.13.2.32 -r 1.13.2.33 src/common/plugin.c;  cvs diff -u -r 1.2.4.21 -r 1.2.4.22 src/common/template.c;  ) > 3.0.2cvs58.patchset
 ( diff -u /dev/null src/pixmaps/anonymous.xpm;  cvs diff -u -r 1.14.2.37 -r 1.14.2.38 src/editaddress.c;  cvs diff -u -r 1.155.2.78 -r 1.155.2.79 src/Makefile.am;  cvs diff -u -r 1.25.2.48 -r 1.25.2.49 src/stock_pixmap.c;  cvs diff -u -r 1.18.2.31 -r 1.18.2.32 src/stock_pixmap.h;  ) > 3.0.2cvs59.patchset
+( cvs diff -u -r 1.14.2.38 -r 1.14.2.39 src/editaddress.c;  ) > 3.0.2cvs60.patchset
index d8a00a0360c0799cda5e969fa45eb863c2140067..4f6577c7ee20f10fa1c3a2585faa1c4d82897ff4 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=0
 MICRO_VERSION=2
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=59
+EXTRA_VERSION=60
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 05c0777ec4f08a94592626b76e9d10afc3a67550..267eccd16de8b1c803812b749223fa18bfe22578 100644 (file)
@@ -734,6 +734,8 @@ void addressbook_edit_person_set_picture(void)
                        return;
                }
                personeditdlg.picture_set = TRUE;
+               menu_set_sensitive(personeditdlg.editaddr_popupfactory,
+                               "/Unset picture", personeditdlg.picture_set);
                g_free(filename);
                gtk_image_set_from_pixbuf(GTK_IMAGE(personeditdlg.image), pixbuf);
                g_object_unref(pixbuf);
@@ -746,8 +748,9 @@ static void addressbook_edit_person_clear_picture(void)
 
        stock_pixbuf_gdk(NULL, STOCK_PIXMAP_ANONYMOUS, &pixbuf);
        personeditdlg.picture_set = FALSE;
+       menu_set_sensitive(personeditdlg.editaddr_popupfactory,
+                       "/Unset picture", personeditdlg.picture_set);
        gtk_image_set_from_pixbuf(GTK_IMAGE(personeditdlg.image), pixbuf);
-       g_object_unref(pixbuf);
 }
 
 static void addressbook_edit_person_set_picture_menu_cb (void *obj, guint action, void *data)
@@ -762,8 +765,8 @@ static void addressbook_edit_person_unset_picture_menu_cb (void *obj, guint acti
 
 static GtkItemFactoryEntry editaddr_popup_entries[] =
 {
-       {N_("/_Set picture"),           NULL, addressbook_edit_person_set_picture_menu_cb, 0, NULL},
-       {N_("/_Unset picture"),         NULL, addressbook_edit_person_unset_picture_menu_cb, 0, NULL},
+       {N_("/_Set picture"),           NULL, addressbook_edit_person_set_picture_menu_cb, 0, NULL, NULL},
+       {N_("/_Unset picture"),         NULL, addressbook_edit_person_unset_picture_menu_cb, 0, NULL, NULL},
 };
 
 static void addressbook_edit_person_set_picture_cb(GtkWidget *widget, 
@@ -796,7 +799,14 @@ static void addressbook_edit_person_page_basic( gint pageNum, gchar *pageLbl ) {
        hbox = gtk_hbox_new( FALSE, 8 );
 
        gtk_widget_show( vbox );        
-       
+
+       /* set up picture context menu before we call addressbook_edit_person_clear_picture() */        
+       n_entries = sizeof(editaddr_popup_entries) /
+               sizeof(editaddr_popup_entries[0]);
+       personeditdlg.editaddr_popupmenu = menu_create_items(editaddr_popup_entries, n_entries,
+                                     "<EditAddrPopupMenu>", &personeditdlg.editaddr_popupfactory,
+                                     NULL);
+
        /* User's picture */
        ebox_picture = gtk_event_box_new();
        frame_picture = gtk_frame_new(_("Photo"));
@@ -823,12 +833,6 @@ static void addressbook_edit_person_page_basic( gint pageNum, gchar *pageLbl ) {
        g_signal_connect(G_OBJECT(ebox_picture), "button_press_event", 
                        G_CALLBACK(addressbook_edit_person_set_picture_cb), NULL);
 
-       n_entries = sizeof(editaddr_popup_entries) /
-               sizeof(editaddr_popup_entries[0]);
-       personeditdlg.editaddr_popupmenu = menu_create_items(editaddr_popup_entries, n_entries,
-                                     "<EditAddrPopupMenu>", &personeditdlg.editaddr_popupfactory,
-                                     NULL);
-
        table = gtk_table_new( 3, 3, FALSE);
 
 #define ATTACH_ROW(text, entry) \
@@ -1575,6 +1579,8 @@ ItemPerson *addressbook_edit_person( AddressBookFile *abf, ItemFolder *parent_fo
                                        goto no_img;
                                }
                                personeditdlg.picture_set = TRUE;
+                               menu_set_sensitive(personeditdlg.editaddr_popupfactory,
+                                               "/Unset picture", personeditdlg.picture_set);
                        } else {
                                goto no_img;
                        }