2005-04-10 [colin] 1.9.6cvs30
authorColin Leroy <colin@colino.net>
Sun, 10 Apr 2005 15:21:27 +0000 (15:21 +0000)
committerColin Leroy <colin@colino.net>
Sun, 10 Apr 2005 15:21:27 +0000 (15:21 +0000)
* src/prefs_account.c
Update Privacy checkbuttons status based
on the selected privacy system
* src/compose.c
Always connect the "None" privacy system; the
static boolean was probably there to avoid
reconnecting twice in the same compose window,
but as the parent function is only called once
per compose, it's only a bug - as a static is
initialized once per application instance.
Also, don't uncheck Sign and Encrypt when
selecting None as privacy system; just ignore
them when sending/queuing.
Should fix bug #695

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/compose.c
src/prefs_account.c

index be6b24f..ed29d26 100644 (file)
@@ -1,3 +1,20 @@
+2005-04-10 [colin]     1.9.6cvs30
+
+       * src/prefs_account.c
+               Update Privacy checkbuttons status based
+               on the selected privacy system
+       * src/compose.c
+               Always connect the "None" privacy system; the
+               static boolean was probably there to avoid
+               reconnecting twice in the same compose window,
+               but as the parent function is only called once
+               per compose, it's only a bug - as a static is
+               initialized once per application instance.
+               Also, don't uncheck Sign and Encrypt when
+               selecting None as privacy system; just ignore
+               them when sending/queuing.
+               Should fix bug #695
+
 2005-04-08 [colin]     1.9.6cvs29
 
        * src/account.c
index bc67800..5d2229a 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.654.2.479 -r 1.654.2.480 configure.ac; cvs diff -u -r 1.26.2.14 -r 1.26.2.15 src/foldersel.c; cvs diff -u -r 1.17.2.7 -r 1.17.2.8 src/send_message.c; cvs diff -u -r 1.13.2.11 -r 1.13.2.12 src/common/socket.c; cvs diff -u -r 1.2.2.6 -r 1.2.2.7 src/gtk/colorlabel.c; ) > 1.9.6cvs27.patchset
 ( cvs diff -u -r 1.105.2.18 -r 1.105.2.19 src/prefs_account.c; ) > 1.9.6cvs28.patchset
 ( cvs diff -u -r 1.61.2.22 -r 1.61.2.23 src/account.c; cvs diff -u -r 1.105.2.19 -r 1.105.2.20 src/prefs_account.c; cvs diff -u -r 1.49.2.9 -r 1.49.2.10 src/prefs_account.h; ) > 1.9.6cvs29.patchset
+( cvs diff -u -r 1.105.2.20 -r 1.105.2.21 src/prefs_account.c; cvs diff -u -r 1.382.2.116 -r 1.382.2.117 src/compose.c; ) > 1.9.6cvs30.patchset
index 929f31e..a45b5fb 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=6
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=29
+EXTRA_VERSION=30
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index cd7fb88..a5705cb 100644 (file)
@@ -5136,11 +5136,7 @@ static void compose_set_privacy_system_cb(GtkWidget *widget, gpointer data)
 
        ifactory = gtk_item_factory_from_widget(compose->menubar);
        menu_set_sensitive(ifactory, "/Options/Sign", can_sign);
-       if (!can_sign)
-               menu_set_active(ifactory, "/Options/Sign", FALSE);
        menu_set_sensitive(ifactory, "/Options/Encrypt", can_encrypt);
-       if (!can_encrypt)
-               menu_set_active(ifactory, "/Options/Encrypt", FALSE);
 }
 
 static void compose_update_privacy_system_menu_item(Compose * compose)
@@ -5222,7 +5218,6 @@ void compose_update_actions_menu(Compose *compose)
 void compose_update_privacy_systems_menu(Compose *compose)
 {
        static gchar *branch_path = "/Options/Privacy System";
-       static gboolean connected = FALSE;
        GtkItemFactory *ifactory;
        GtkWidget *menuitem;
        GSList *systems, *cur;
@@ -5246,11 +5241,9 @@ void compose_update_privacy_systems_menu(Compose *compose)
 
        system_none = gtk_item_factory_get_widget(ifactory,
                "/Options/Privacy System/None");
-       if (!connected) {
-               g_signal_connect(G_OBJECT(system_none), "activate",
-                       G_CALLBACK(compose_set_privacy_system_cb), compose);
-               connected = TRUE;
-       }
+
+       g_signal_connect(G_OBJECT(system_none), "activate",
+               G_CALLBACK(compose_set_privacy_system_cb), compose);
 
        systems = privacy_get_system_ids();
        for (cur = systems; cur != NULL; cur = g_slist_next(cur)) {
index c72527d..7390bbc 100644 (file)
@@ -580,6 +580,20 @@ typedef struct AccountPage
 
 static AccountPage account_page;
 
+static void privacy_system_activated(GtkMenuItem *menuitem)
+{
+       const gchar* system_id;
+       gboolean privacy_enabled = FALSE;
+       
+       system_id = g_object_get_data(G_OBJECT(menuitem), MENU_VAL_ID);
+       
+       privacy_enabled = strcmp(system_id, "");
+
+       gtk_widget_set_sensitive (privacy.default_encrypt_chkbtn, privacy_enabled);
+       gtk_widget_set_sensitive (privacy.default_sign_chkbtn, privacy_enabled);
+       gtk_widget_set_sensitive (privacy.save_clear_text_chkbtn, privacy_enabled);
+}
+
 void update_privacy_system_menu() {
        GtkWidget *menu;
        GtkWidget *menuitem;
@@ -592,6 +606,10 @@ void update_privacy_system_menu() {
        g_object_set_data(G_OBJECT(menuitem), MENU_VAL_ID, "");
        gtk_menu_append(GTK_MENU(menu), menuitem);
 
+       g_signal_connect(G_OBJECT(menuitem), "activate",
+                        G_CALLBACK(privacy_system_activated),
+                        NULL);
+
        system_ids = privacy_get_system_ids();
        for (cur = system_ids; cur != NULL; cur = g_slist_next(cur)) {
                gchar *id = (gchar *) cur->data;
@@ -602,6 +620,12 @@ void update_privacy_system_menu() {
                gtk_widget_show(menuitem);
                g_object_set_data_full(G_OBJECT(menuitem), MENU_VAL_ID, id, g_free);
                gtk_menu_append(GTK_MENU(menu), menuitem);
+
+               g_signal_connect(G_OBJECT(menuitem), "activate",
+                                G_CALLBACK(privacy_system_activated),
+                                NULL);
+
+               
        }
 
        gtk_option_menu_set_menu(GTK_OPTION_MENU(privacy.default_privacy_system), menu);