2006-12-12 [colin] 2.6.1cvs22
authorColin Leroy <colin@colino.net>
Tue, 12 Dec 2006 21:51:48 +0000 (21:51 +0000)
committerColin Leroy <colin@colino.net>
Tue, 12 Dec 2006 21:51:48 +0000 (21:51 +0000)
* src/gtk/menu.h
Add another menu data type
* src/prefs_account.c
Complete the completion of bug 1076
(doesn't lose the pref on apply)

ChangeLog
PATCHSETS
configure.ac
src/gtk/menu.h
src/prefs_account.c

index a21d22b..ba14e7d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-12-12 [colin]     2.6.1cvs22
+
+       * src/gtk/menu.h
+               Add another menu data type
+       * src/prefs_account.c
+               Complete the completion of bug 1076
+               (doesn't lose the pref on apply)
+
 2006-12-12 [paul]      2.6.1cvs21
 
        * src/prefs_account.c
index e3af64f..d615913 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.1.2.41 -r 1.1.2.42 src/wizard.c;  ) > 2.6.1cvs19.patchset
 ( cvs diff -u -r 1.1.2.4 -r 1.1.2.5 src/gtk/combobox.c;  ) > 2.6.1cvs20.patchset
 ( cvs diff -u -r 1.105.2.73 -r 1.105.2.74 src/prefs_account.c;  ) > 2.6.1cvs21.patchset
+( cvs diff -u -r 1.4.2.8 -r 1.4.2.9 src/gtk/menu.h;  cvs diff -u -r 1.105.2.74 -r 1.105.2.75 src/prefs_account.c;  ) > 2.6.1cvs22.patchset
index f91d4d8..044d065 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=6
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=21
+EXTRA_VERSION=22
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index a11851f..9294352 100644 (file)
@@ -27,7 +27,8 @@
 #include <gtk/gtkmenushell.h>
 #include <gtk/gtkoptionmenu.h>
 
-#define MENU_VAL_ID "Sylpheed::Menu::ValueID"
+#define MENU_VAL_ID "Claws::Menu::ValueID"
+#define MENU_VAL_DATA "Claws::Menu::ValueDATA"
 
 #define MENUITEM_ADD(menu, menuitem, label, data)               \
 {                                                               \
index ce3434b..548ab1b 100644 (file)
@@ -644,6 +644,10 @@ static void privacy_system_activated(GtkMenuItem *menuitem)
        
        privacy_enabled = strcmp(system_id, "");
 
+       if (g_object_get_data(G_OBJECT(menuitem), MENU_VAL_DATA) == NULL ||
+           GPOINTER_TO_INT(g_object_get_data(G_OBJECT(menuitem), MENU_VAL_DATA)) == FALSE)
+               privacy_enabled = FALSE;
+
        gtk_widget_set_sensitive (privacy.default_encrypt_chkbtn, privacy_enabled);
        gtk_widget_set_sensitive (privacy.default_encrypt_reply_chkbtn, privacy_enabled);
        gtk_widget_set_sensitive (privacy.default_sign_chkbtn, privacy_enabled);
@@ -663,6 +667,7 @@ void update_privacy_system_menu() {
        menuitem = gtk_menu_item_new_with_label(_("None"));
        gtk_widget_show(menuitem);
        g_object_set_data(G_OBJECT(menuitem), MENU_VAL_ID, "");
+       g_object_set_data(G_OBJECT(menuitem), MENU_VAL_DATA, GINT_TO_POINTER(FALSE));
        gtk_menu_append(GTK_MENU(menu), menuitem);
 
        g_signal_connect(G_OBJECT(menuitem), "activate",
@@ -678,6 +683,8 @@ void update_privacy_system_menu() {
                menuitem = gtk_menu_item_new_with_label(name);
                gtk_widget_show(menuitem);
                g_object_set_data_full(G_OBJECT(menuitem), MENU_VAL_ID, id, g_free);
+               g_object_set_data(G_OBJECT(menuitem), MENU_VAL_DATA, GINT_TO_POINTER(TRUE));
+
                gtk_menu_append(GTK_MENU(menu), menuitem);
 
                g_signal_connect(G_OBJECT(menuitem), "activate",
@@ -2862,12 +2869,16 @@ static void prefs_account_set_optmenu_from_string(PrefParam *pparam)
                name = g_strdup_printf(_("%s (plugin not loaded)"), prefsid);
                menuitem = gtk_menu_item_new_with_label(name);
                gtk_widget_show(menuitem);
-               g_object_set_data(G_OBJECT(menuitem), MENU_VAL_ID, "");
+               g_object_set_data(G_OBJECT(menuitem), MENU_VAL_ID, prefsid);
+               g_object_set_data(G_OBJECT(menuitem), MENU_VAL_DATA, GINT_TO_POINTER(FALSE));
                gtk_menu_append(GTK_MENU(menu), menuitem);
                g_free(name);
 
                gtk_option_menu_set_history(GTK_OPTION_MENU(optionmenu), i);
                privacy_system_activated(GTK_MENU_ITEM(menuitem));
+               g_signal_connect(G_OBJECT(menuitem), "activate",
+                                G_CALLBACK(privacy_system_activated),
+                                NULL);
        }
 
        g_list_free(children);