[balsa/threading: 15/16] Apply threading changes on 'Update'



commit e77ed3908853ff951fee25bb05a42a3159bd86d2
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Mon Aug 27 15:39:48 2018 -0400

    Apply threading changes on 'Update'
    
    * src/mailbox-conf.c (thread_messages_toggled),
      (mailbox_conf_view_new_full), (mailbox_conf_view_check):
      apply threading changes on 'Update' instead of instantly on
      checking the boxes.

 ChangeLog          |  9 +++++++++
 src/mailbox-conf.c | 42 ++++++++++++++++++++++++++----------------
 2 files changed, 35 insertions(+), 16 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index fe623517e..22fb544bf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -68,6 +68,15 @@
        * ui/main-window.ui: remove the threading type radio buttons,
        and replace them with a 'Thread messages' check-box.
 
+2018-08-27  Peter Bloomfield  <pbloomfield bellsouth net>
+
+       Apply threading changes on 'Update'
+
+       * src/mailbox-conf.c (thread_messages_toggled),
+       (mailbox_conf_view_new_full), (mailbox_conf_view_check):
+       apply threading changes on 'Update' instead of instantly on
+       checking the boxes.
+
 2018-08-27  Peter Bloomfield  <pbloomfield bellsouth net>
 
        Check for valid msgno
diff --git a/src/mailbox-conf.c b/src/mailbox-conf.c
index 7b3ba5181..4f4d00aab 100644
--- a/src/mailbox-conf.c
+++ b/src/mailbox-conf.c
@@ -1306,20 +1306,6 @@ thread_messages_toggled(GtkWidget * widget,
 
     thread_messages = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
     gtk_widget_set_sensitive(view_info->subject_gather, thread_messages);
-    /* Rethread now */
-    balsa_window_set_thread_messages(balsa_app.main_window, thread_messages);
-}
-
-static void
-subject_gather_toggled(GtkWidget * widget,
-                       BalsaMailboxConfView * view_info)
-{
-    gboolean subject_gather;
-
-    subject_gather = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
-    libbalsa_mailbox_set_subject_gather(view_info->mailbox, subject_gather);
-    /* Rethread now */
-    balsa_window_set_thread_messages(balsa_app.main_window, TRUE);
 }
 
 
@@ -1428,6 +1414,14 @@ mailbox_conf_view_new_full(LibBalsaMailbox * mailbox,
     view_info->thread_messages =
         libbalsa_create_grid_check(_("_Thread messages"), grid, ++row,
                                    thread_messages);
+    if (mcw != NULL) {
+        g_signal_connect(view_info->thread_messages, "toggled",
+                         G_CALLBACK(check_for_blank_fields), mcw);
+    }
+    if (callback != NULL) {
+        g_signal_connect_swapped(view_info->thread_messages, "toggled",
+                                 callback, window);
+    }
     g_signal_connect(view_info->thread_messages, "toggled",
                      G_CALLBACK(thread_messages_toggled), view_info);
 
@@ -1436,9 +1430,15 @@ mailbox_conf_view_new_full(LibBalsaMailbox * mailbox,
         libbalsa_create_grid_check(_("_Merge threads with the same subject"),
                                    grid, ++row,
                                    libbalsa_mailbox_get_subject_gather(mailbox));
+    if (mcw != NULL) {
+        g_signal_connect(view_info->subject_gather, "toggled",
+                         G_CALLBACK(check_for_blank_fields), mcw);
+    }
+    if (callback != NULL) {
+        g_signal_connect_swapped(view_info->subject_gather, "toggled",
+                                 callback, window);
+    }
     gtk_widget_set_sensitive(view_info->subject_gather, thread_messages);
-    g_signal_connect(view_info->subject_gather, "toggled",
-                     G_CALLBACK(subject_gather_toggled), view_info);
 
     return view_info;
 }
@@ -1521,6 +1521,16 @@ mailbox_conf_view_check(BalsaMailboxConfView * view_info,
                                       LB_MAILBOX_SUBSCRIBE_NO))
        changed = TRUE;
 
+    /* Threading */
+
+    active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON
+                                          (view_info->subject_gather));
+    libbalsa_mailbox_set_subject_gather(view_info->mailbox, active);
+
+    active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON
+                                          (view_info->thread_messages));
+    balsa_window_set_thread_messages(balsa_app.main_window, active);
+
 #ifdef HAVE_GPGME
     if (libbalsa_mailbox_set_crypto_mode(mailbox,
                                         balsa_mailbox_conf_get_crypto_mode(view_info)))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]