2007-05-31 [wwp] 2.9.2cvs26
authorTristan Chabredier <wwp@claws-mail.org>
Thu, 31 May 2007 09:40:46 +0000 (09:40 +0000)
committerTristan Chabredier <wwp@claws-mail.org>
Thu, 31 May 2007 09:40:46 +0000 (09:40 +0000)
* src/prefs_compose_writing.c
* src/prefs_quote.c
Re-organized writing options a bit:
 - renamed the Quoting page to Templates
 - moved all composing templates to that page
 - moved non-templates options to the Writing one,
   grouped reply-related options, reordered reply and
   forward options.

ChangeLog
PATCHSETS
configure.ac
src/prefs_compose_writing.c
src/prefs_quote.c

index 73d4c66964746a3ccce5c08f67cc533d5022d05a..8ce10f737381e397c24e9209f675c24700720a62 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2007-05-31 [wwp]       2.9.2cvs26
+
+       * src/prefs_compose_writing.c
+       * src/prefs_quote.c
+               Re-organized writing options a bit:
+                - renamed the Quoting page to Templates
+                - moved all composing templates to that page
+                - moved non-templates options to the Writing one,
+                  grouped reply-related options, reordered reply and
+                  forward options.
+
 2007-05-31 [wwp]       2.9.2cvs25
 
        * src/compose.c
index eca2ed09f54d4c3b4c4681ae732753cb6b17acca..6229d7ae438f09e6d02da50616d158d62d3dea0c 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.1.2.3 -r 1.1.2.4 src/plugins/bogofilter/Makefile.am;  cvs diff -u -r 1.4.2.7 -r 1.4.2.8 src/plugins/clamav/Makefile.am;  cvs diff -u -r 1.3.2.3 -r 1.3.2.4 src/plugins/demo/Makefile.am;  cvs diff -u -r 1.4.2.5 -r 1.4.2.6 src/plugins/dillo_viewer/Makefile.am;  cvs diff -u -r 1.5.2.6 -r 1.5.2.7 src/plugins/spamassassin/Makefile.am;  ) > 2.9.2cvs23.patchset
 ( cvs diff -u -r 1.60.2.88 -r 1.60.2.89 src/addressbook.c;  ) > 2.9.2cvs24.patchset
 ( cvs diff -u -r 1.382.2.382 -r 1.382.2.383 src/compose.c;  ) > 2.9.2cvs25.patchset
+( cvs diff -u -r 1.1.2.19 -r 1.1.2.20 src/prefs_compose_writing.c;  cvs diff -u -r 1.1.2.19 -r 1.1.2.20 src/prefs_quote.c;  ) > 2.9.2cvs26.patchset
index ea7b1ca483cda50141e774ccaec517d943a4a2a6..385dd3273d83dee29b8312f9f034de7d7836047c 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=2
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=25
+EXTRA_VERSION=26
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 3248a58c8542a30c7e6f39a5e0aa1aaac5542a12..5de6f000a41f042011fc6986ad65a2804f9aa878 100644 (file)
@@ -55,6 +55,7 @@ typedef struct _WritingPage
        GtkWidget *checkbtn_forward_account_autosel;
        GtkWidget *checkbtn_reedit_account_autosel;
        GtkWidget *spinbtn_undolevel;
+       GtkWidget *checkbtn_reply_with_quote;
        GtkWidget *checkbtn_default_reply_list;
        GtkWidget *checkbtn_forward_as_attachment;
        GtkWidget *checkbtn_redirect_keep_from;
@@ -62,9 +63,7 @@ typedef struct _WritingPage
        GtkWidget *checkbtn_autosave;
        GtkWidget *spinbtn_autosave_length;
        GtkWidget *optmenu_dnd_insert_or_attach;
-       GtkWidget *checkbtn_compose_with_format;
-       GtkWidget *entry_subject;
-       GtkWidget *text_format;
+       GtkWidget *entry_quote_chars;
 } WritingPage;
 
 static void prefs_compose_writing_create_widget(PrefsPage *_page, GtkWindow *window, 
@@ -88,6 +87,7 @@ static void prefs_compose_writing_create_widget(PrefsPage *_page, GtkWindow *win
        GtkObject *spinbtn_undolevel_adj;
        GtkWidget *spinbtn_undolevel;
 
+       GtkWidget *checkbtn_reply_with_quote;
        GtkWidget *checkbtn_default_reply_list;
 
        GtkWidget *checkbtn_forward_as_attachment;
@@ -105,6 +105,13 @@ static void prefs_compose_writing_create_widget(PrefsPage *_page, GtkWindow *win
        GtkWidget *menu;
        GtkWidget *menuitem;
 
+       GtkWidget *frame_quote;
+       GtkWidget *hbox1;
+       GtkWidget *hbox2;
+       GtkWidget *vbox_quote;
+       GtkWidget *entry_quote_chars;
+       GtkWidget *label_quote_chars;
+
        vbox1 = gtk_vbox_new (FALSE, VSPACING);
        gtk_widget_show (vbox1);
        gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
@@ -124,14 +131,6 @@ static void prefs_compose_writing_create_widget(PrefsPage *_page, GtkWindow *win
        PACK_CHECK_BUTTON (hbox_autosel, checkbtn_reedit_account_autosel,
                           _("when re-editing"));
 
-       vbox2 = gtkut_get_options_frame(vbox1, &frame, _("Forwarding"));
-
-       PACK_CHECK_BUTTON (vbox2, checkbtn_forward_as_attachment,
-                          _("Forward as attachment"));
-
-       PACK_CHECK_BUTTON (vbox2, checkbtn_redirect_keep_from,
-                          _("Keep the original 'From' header when redirecting"));
-
        vbox2 = gtkut_get_options_frame(vbox1, &frame, _("Editing"));
 
        PACK_CHECK_BUTTON (vbox2, checkbtn_autoextedit,
@@ -172,9 +171,22 @@ static void prefs_compose_writing_create_widget(PrefsPage *_page, GtkWindow *win
        gtk_widget_set_size_request (spinbtn_undolevel, 64, -1);
        gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_undolevel), TRUE);
        
-       PACK_CHECK_BUTTON (vbox1, checkbtn_default_reply_list,
+       vbox2 = gtkut_get_options_frame(vbox1, &frame, _("Replying"));
+
+       PACK_CHECK_BUTTON (vbox2, checkbtn_reply_with_quote,
+                          _("Reply will quote by default"));
+
+       PACK_CHECK_BUTTON (vbox2, checkbtn_default_reply_list,
                           _("Reply button invokes mailing list reply"));
 
+       vbox2 = gtkut_get_options_frame(vbox1, &frame, _("Forwarding"));
+
+       PACK_CHECK_BUTTON (vbox2, checkbtn_forward_as_attachment,
+                          _("Forward as attachment"));
+
+       PACK_CHECK_BUTTON (vbox2, checkbtn_redirect_keep_from,
+                          _("Keep the original 'From' header when redirecting"));
+
        /* dnd insert or attach */
        label_dnd_insert_or_attach = gtk_label_new (_("When dropping files into the Compose window"));
        gtk_misc_set_alignment(GTK_MISC(label_dnd_insert_or_attach), 0, 0.5);
@@ -201,14 +213,33 @@ static void prefs_compose_writing_create_widget(PrefsPage *_page, GtkWindow *win
        SET_TOGGLE_SENSITIVITY (checkbtn_autosave, spinbtn_autosave_length);
        SET_TOGGLE_SENSITIVITY (checkbtn_autosave, label_autosave_length);
 
-       quotefmt_create_new_msg_fmt_widgets(
-                               window,
-                               vbox1,
-                               &prefs_writing->checkbtn_compose_with_format,
-                               _("New message format"),
-                               &prefs_writing->entry_subject,
-                               &prefs_writing->text_format,
-                               TRUE);
+       /* quote chars */
+
+       PACK_FRAME (vbox1, frame_quote, _("Quotation characters"));
+
+       vbox_quote = gtk_vbox_new (FALSE, VSPACING_NARROW);
+       gtk_widget_show (vbox_quote);
+       gtk_container_add (GTK_CONTAINER (frame_quote), vbox_quote);
+       gtk_container_set_border_width (GTK_CONTAINER (vbox_quote), 8);
+
+       hbox1 = gtk_hbox_new (FALSE, 32);
+       gtk_widget_show (hbox1);
+       gtk_box_pack_start (GTK_BOX (vbox_quote), hbox1, FALSE, FALSE, 0);
+
+       hbox2 = gtk_hbox_new (FALSE, 8);
+       gtk_widget_show (hbox2);
+       gtk_box_pack_start (GTK_BOX (hbox1), hbox2, FALSE, FALSE, 0);
+
+       label_quote_chars = gtk_label_new (_("Treat these characters as quotation marks: "));
+       gtk_widget_show (label_quote_chars);
+       gtk_box_pack_start (GTK_BOX (hbox2), label_quote_chars, FALSE, FALSE, 0);
+
+       entry_quote_chars = gtk_entry_new ();
+       gtk_widget_show (entry_quote_chars);
+       gtk_box_pack_start (GTK_BOX (hbox2), entry_quote_chars,
+                           FALSE, FALSE, 0);
+       gtk_widget_set_size_request (entry_quote_chars, 64, -1);
+
 
        prefs_writing->checkbtn_autoextedit = checkbtn_autoextedit;
 
@@ -223,12 +254,14 @@ static void prefs_compose_writing_create_widget(PrefsPage *_page, GtkWindow *win
        
        prefs_writing->checkbtn_forward_as_attachment =
                checkbtn_forward_as_attachment;
-       prefs_writing->checkbtn_redirect_keep_from =
-               checkbtn_redirect_keep_from;
+       prefs_writing->checkbtn_redirect_keep_from = checkbtn_redirect_keep_from;
+       prefs_writing->checkbtn_reply_with_quote     = checkbtn_reply_with_quote;
        prefs_writing->checkbtn_default_reply_list = checkbtn_default_reply_list;
 
        prefs_writing->optmenu_dnd_insert_or_attach = optmenu_dnd_insert_or_attach;
 
+       prefs_writing->entry_quote_chars        = entry_quote_chars;
+
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(prefs_writing->checkbtn_autoextedit),
                prefs_common.auto_exteditor);
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(prefs_writing->checkbtn_forward_as_attachment),
@@ -247,15 +280,14 @@ static void prefs_compose_writing_create_widget(PrefsPage *_page, GtkWindow *win
                prefs_common.forward_account_autosel);
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(prefs_writing->checkbtn_reedit_account_autosel),
                prefs_common.reedit_account_autosel);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(prefs_writing->checkbtn_reply_with_quote),
+                       prefs_common.reply_with_quote);
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(prefs_writing->checkbtn_default_reply_list),
                prefs_common.default_reply_list);
        gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu_dnd_insert_or_attach),
                prefs_common.compose_dnd_mode);
-
-       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(prefs_writing->checkbtn_compose_with_format),
-                       prefs_common.compose_with_format);
-       pref_set_entry_from_pref(GTK_ENTRY(prefs_writing->entry_subject), prefs_common.compose_subject_format);
-       pref_set_textview_from_pref(GTK_TEXT_VIEW(prefs_writing->text_format), prefs_common.compose_body_format);
+       gtk_entry_set_text(GTK_ENTRY(entry_quote_chars), 
+                       prefs_common.quote_chars?prefs_common.quote_chars:"");
 
        prefs_writing->page.widget = vbox1;
 }
@@ -285,6 +317,8 @@ static void prefs_compose_writing_save(PrefsPage *_page)
                gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_forward_account_autosel));
        prefs_common.reedit_account_autosel =
                gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_reedit_account_autosel));
+       prefs_common.reply_with_quote = gtk_toggle_button_get_active(
+                       GTK_TOGGLE_BUTTON(page->checkbtn_reply_with_quote));
        prefs_common.default_reply_list =
                gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_default_reply_list));
        
@@ -293,15 +327,9 @@ static void prefs_compose_writing_save(PrefsPage *_page)
        prefs_common.compose_dnd_mode = GPOINTER_TO_INT
                (g_object_get_data(G_OBJECT(menuitem), MENU_VAL_ID));
 
-       prefs_common.compose_with_format =
-               gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_compose_with_format));
-       prefs_common.compose_subject_format = pref_get_pref_from_entry(
-                       GTK_ENTRY(page->entry_subject));
-       prefs_common.compose_body_format = pref_get_pref_from_textview(
-                       GTK_TEXT_VIEW(page->text_format));
-       quotefmt_check_new_msg_formats(prefs_common.compose_with_format,
-                                                                       prefs_common.compose_subject_format,
-                                                                       prefs_common.compose_body_format);
+       prefs_common.quote_chars = gtk_editable_get_chars(
+                       GTK_EDITABLE(page->entry_quote_chars), 0, -1);
+       remove_space(prefs_common.quote_chars);
 }
 
 static void prefs_compose_writing_destroy_widget(PrefsPage *_page)
index e11557e8589cd52c32d20ddc7ac8c03cce2ff154..e6835aae6a59803f2d69151ac328791973cb56ec 100644 (file)
@@ -48,14 +48,15 @@ typedef struct _QuotePage
 
        GtkWidget *window;
 
+       GtkWidget *checkbtn_compose_with_format;
+       GtkWidget *entry_subject;
+       GtkWidget *text_format;
        GtkWidget *entry_quotemark;
        GtkWidget *text_quotefmt;
        GtkWidget *entry_fw_quotemark;
        GtkWidget *text_fw_quotefmt;
-       GtkWidget *entry_quote_chars;
        GtkWidget *label_quote_chars;
        GtkWidget *btn_quotedesc;
-       GtkWidget *checkbtn_reply_with_quote;
 } QuotePage;
 
 static void prefs_quote_create_widget(PrefsPage *_page, GtkWindow *window, 
@@ -63,28 +64,28 @@ static void prefs_quote_create_widget(PrefsPage *_page, GtkWindow *window,
 {
        QuotePage *prefs_quote = (QuotePage *) _page;
        
-       GtkWidget *vbox1;
-       GtkWidget *frame_quote;
-       GtkWidget *vbox_quote;
-       GtkWidget *hbox1;
-       GtkWidget *hbox2;
+       GtkWidget *vbox;
 
-       GtkWidget *entry_quote_chars;
-       GtkWidget *label_quote_chars;
-       
-       GtkWidget *checkbtn_reply_with_quote;
+       vbox = gtk_vbox_new (FALSE, VSPACING);
+       gtk_widget_show (vbox);
+       gtk_container_set_border_width (GTK_CONTAINER (vbox), VBOX_BORDER);
 
-       vbox1 = gtk_vbox_new (FALSE, VSPACING);
-       gtk_widget_show (vbox1);
-       gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
+       /* new message */
 
-       PACK_CHECK_BUTTON (vbox1, checkbtn_reply_with_quote, _("Reply will quote by default"));
+       quotefmt_create_new_msg_fmt_widgets(
+                               window,
+                               vbox,
+                               &prefs_quote->checkbtn_compose_with_format,
+                               _("New message format"),
+                               &prefs_quote->entry_subject,
+                               &prefs_quote->text_format,
+                               FALSE);
 
        /* reply */
 
        quotefmt_create_reply_fmt_widgets(
                                window,
-                               vbox1,
+                               vbox,
                                NULL,
                                NULL,
                                &prefs_quote->entry_quotemark,
@@ -95,7 +96,7 @@ static void prefs_quote_create_widget(PrefsPage *_page, GtkWindow *window,
 
        quotefmt_create_forward_fmt_widgets(
                                window,
-                               vbox1,
+                               vbox,
                                NULL,
                                NULL,
                                &prefs_quote->entry_fw_quotemark,
@@ -104,37 +105,8 @@ static void prefs_quote_create_widget(PrefsPage *_page, GtkWindow *window,
 
        /* info button */
 
-       quotefmt_add_info_button(window, vbox1);
-
-       /* quote chars */
-
-       PACK_FRAME (vbox1, frame_quote, _("Quotation characters"));
-
-       vbox_quote = gtk_vbox_new (FALSE, VSPACING_NARROW);
-       gtk_widget_show (vbox_quote);
-       gtk_container_add (GTK_CONTAINER (frame_quote), vbox_quote);
-       gtk_container_set_border_width (GTK_CONTAINER (vbox_quote), 8);
-
-       hbox1 = gtk_hbox_new (FALSE, 32);
-       gtk_widget_show (hbox1);
-       gtk_box_pack_start (GTK_BOX (vbox_quote), hbox1, FALSE, FALSE, 0);
+       quotefmt_add_info_button(window, vbox);
 
-       hbox2 = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show (hbox2);
-       gtk_box_pack_start (GTK_BOX (hbox1), hbox2, FALSE, FALSE, 0);
-
-       label_quote_chars = gtk_label_new (_("Treat these characters as quotation marks: "));
-       gtk_widget_show (label_quote_chars);
-       gtk_box_pack_start (GTK_BOX (hbox2), label_quote_chars, FALSE, FALSE, 0);
-
-       entry_quote_chars = gtk_entry_new ();
-       gtk_widget_show (entry_quote_chars);
-       gtk_box_pack_start (GTK_BOX (hbox2), entry_quote_chars,
-                           FALSE, FALSE, 0);
-       gtk_widget_set_size_request (entry_quote_chars, 64, -1);
-
-       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(prefs_quote->checkbtn_reply_with_quote),
-                       prefs_common.reply_with_quote);
        gtk_entry_set_text(GTK_ENTRY(prefs_quote->entry_quotemark), 
                        prefs_common.quotemark?prefs_common.quotemark:"");
        pref_set_textview_from_pref(GTK_TEXT_VIEW(prefs_quote->text_quotefmt),
@@ -145,20 +117,23 @@ static void prefs_quote_create_widget(PrefsPage *_page, GtkWindow *window,
        gtk_entry_set_text(GTK_ENTRY(prefs_quote->entry_fw_quotemark), 
                        prefs_common.fw_quotemark?prefs_common.fw_quotemark:"");
 
-       gtk_entry_set_text(GTK_ENTRY(entry_quote_chars), 
-                       prefs_common.quote_chars?prefs_common.quote_chars:"");
-       
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(prefs_quote->checkbtn_compose_with_format),
+                       prefs_common.compose_with_format);
+       pref_set_entry_from_pref(GTK_ENTRY(prefs_quote->entry_subject), prefs_common.compose_subject_format);
+       pref_set_textview_from_pref(GTK_TEXT_VIEW(prefs_quote->text_format), prefs_common.compose_body_format);
+
        prefs_quote->window             = GTK_WIDGET(window);
-       prefs_quote->entry_quote_chars  = entry_quote_chars;
-       prefs_quote->checkbtn_reply_with_quote
-                                       = checkbtn_reply_with_quote;
-       prefs_quote->page.widget = vbox1;
+       prefs_quote->page.widget = vbox;
 }
 
 static void prefs_quote_save(PrefsPage *_page)
 {
        QuotePage *page = (QuotePage *) _page;
        
+       g_free(prefs_common.compose_subject_format); 
+       prefs_common.compose_subject_format = NULL;
+       g_free(prefs_common.compose_body_format); 
+       prefs_common.compose_body_format = NULL;
        g_free(prefs_common.quotefmt); 
        prefs_common.quotefmt = NULL;
        g_free(prefs_common.fw_quotefmt); 
@@ -170,6 +145,16 @@ static void prefs_quote_save(PrefsPage *_page)
        g_free(prefs_common.quote_chars); 
        prefs_common.quote_chars = NULL;
        
+       prefs_common.compose_with_format =
+               gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_compose_with_format));
+       prefs_common.compose_subject_format = pref_get_pref_from_entry(
+                       GTK_ENTRY(page->entry_subject));
+       prefs_common.compose_body_format = pref_get_pref_from_textview(
+                       GTK_TEXT_VIEW(page->text_format));
+       quotefmt_check_new_msg_formats(prefs_common.compose_with_format,
+                                                                       prefs_common.compose_subject_format,
+                                                                       prefs_common.compose_body_format);
+
        prefs_common.quotefmt = pref_get_pref_from_textview(
                        GTK_TEXT_VIEW(page->text_quotefmt));
        quotefmt_check_reply_formats(TRUE, prefs_common.quotefmt);
@@ -182,12 +167,6 @@ static void prefs_quote_save(PrefsPage *_page)
                        GTK_EDITABLE(page->entry_quotemark), 0, -1);
        prefs_common.fw_quotemark = gtk_editable_get_chars(
                        GTK_EDITABLE(page->entry_fw_quotemark), 0, -1);
-       prefs_common.quote_chars = gtk_editable_get_chars(
-                       GTK_EDITABLE(page->entry_quote_chars), 0, -1);
-       prefs_common.reply_with_quote = gtk_toggle_button_get_active(
-                       GTK_TOGGLE_BUTTON(page->checkbtn_reply_with_quote));
-
-       remove_space(prefs_common.quote_chars);
 }
 
 static void prefs_quote_destroy_widget(PrefsPage *_page)
@@ -202,7 +181,7 @@ void prefs_quote_init(void)
        static gchar *path[3];
 
        path[0] = _("Compose");
-       path[1] = _("Quoting");
+       path[1] = _("Templates");
        path[2] = NULL;
 
        page = g_new0(QuotePage, 1);