move signature settings to Account Prefs
authorPaul Mangan <paul@claws-mail.org>
Fri, 14 Feb 2003 16:45:54 +0000 (16:45 +0000)
committerPaul Mangan <paul@claws-mail.org>
Fri, 14 Feb 2003 16:45:54 +0000 (16:45 +0000)
ChangeLog.claws
configure.ac
src/compose.c
src/prefs_account.c
src/prefs_account.h
src/prefs_common.c
src/prefs_common.h

index b6c70b8..c07f225 100644 (file)
@@ -1,3 +1,10 @@
+2003-02-14 [paul]      0.8.10claws11
+
+       * src/compose.c
+         src/prefs_account.[ch]
+         src/prefs_common.[ch]
+               move signature settings to Account Prefs
+
 2003-02-14 [paul]      0.8.10claws10
 
        * sync with 0.8.10cvs11
index cc6e8a6..d2699f1 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=10
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws10
+EXTRA_VERSION=claws11
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 1e926f8..4c1ed59 100644 (file)
@@ -698,7 +698,7 @@ Compose *compose_generic_new(PrefsAccount *account, const gchar *mailto, FolderI
        text = GTK_STEXT(compose->text);
        gtk_stext_freeze(text);
 
-       if (prefs_common.auto_sig)
+       if (account->auto_sig)
                compose_insert_sig(compose);
        gtk_editable_set_position(GTK_EDITABLE(text), 0);
        gtk_stext_set_point(text, 0);
@@ -876,7 +876,7 @@ static void compose_generic_reply(MsgInfo *msginfo, gboolean quote,
                                              qmark, body);
        }
 
-       if (prefs_common.auto_sig)
+       if (account->auto_sig)
                compose_insert_sig(compose);
 
        if (quote && prefs_common.linewrap_quote)
@@ -986,7 +986,7 @@ Compose *compose_forward(PrefsAccount *account, MsgInfo *msginfo,
                        procmsg_msginfo_free(full_msginfo);
                }
 
-       if (prefs_common.auto_sig)
+       if (account->auto_sig)
                compose_insert_sig(compose);
 
        if (prefs_common.linewrap_quote)
@@ -1065,7 +1065,7 @@ Compose *compose_forward_multiple(PrefsAccount *account, GSList *msginfo_list)
                g_free(msgfile);
        }
 
-       if (prefs_common.auto_sig)
+       if (account->auto_sig)
                compose_insert_sig(compose);
 
        if (prefs_common.linewrap_quote)
@@ -1656,25 +1656,24 @@ static void compose_reply_set_entry(Compose *compose, MsgInfo *msginfo,
                } else
                        compose_entry_append(compose,
                                 (compose->replyto && !to_sender)
-                                ? compose->replyto
-                                : msginfo->from ? msginfo->from : "",
-                                COMPOSE_TO);
+                                 ? compose->replyto :
+                                 msginfo->from ? msginfo->from : "",
+                                 COMPOSE_TO);
        } else {
                if (to_sender || (compose->followup_to && 
                        !strncmp(compose->followup_to, "poster", 6)))
                        compose_entry_append
                                (compose, 
                                 ((compose->replyto && !to_sender)
-                                ? compose->replyto
-                                msginfo->from ? msginfo->from : ""),
+                                ? compose->replyto :
+                                msginfo->from ? msginfo->from : ""),
                                 COMPOSE_TO);
                                 
                else if (followup_and_reply_to || to_all) {
                        compose_entry_append
                                (compose,
-                                (compose->replyto
-                                ? compose->replyto
-                                : msginfo->from ? msginfo->from : ""),
+                                (compose->replyto ? compose->replyto :
+                                msginfo->from ? msginfo->from : ""),
                                 COMPOSE_TO);                           
                
                        compose_entry_append
@@ -1831,6 +1830,7 @@ static void compose_exec_sig(Compose *compose, gchar *sigfile)
 
 static void compose_insert_sig(Compose *compose)
 {
+       PrefsAccount *account;
        gchar *sigfile;
 
        if (compose->account && compose->account->sig_path)
@@ -1845,9 +1845,9 @@ static void compose_insert_sig(Compose *compose)
        }
 
        gtk_stext_insert(GTK_STEXT(compose->text), NULL, NULL, NULL, "\n\n", 2);
-       if (prefs_common.sig_sep) {
+       if (account->sig_sep) {
                gtk_stext_insert(GTK_STEXT(compose->text), NULL, NULL, NULL,
-                               prefs_common.sig_sep, -1);
+                               account->sig_sep, -1);
                gtk_stext_insert(GTK_STEXT(compose->text), NULL, NULL, NULL,
                                "\n", 1);
        }
@@ -5178,6 +5178,7 @@ void compose_reflect_prefs_pixmap_theme(void)
 static void compose_template_apply(Compose *compose, Template *tmpl,
                                   gboolean replace)
 {
+       PrefsAccount *account;
        gchar *qmark;
        gchar *parsed_str;
 
@@ -5218,7 +5219,7 @@ static void compose_template_apply(Compose *compose, Template *tmpl,
                        parsed_str = NULL;
        }
 
-       if (replace && parsed_str && prefs_common.auto_sig)
+       if (replace && parsed_str && account->auto_sig)
                compose_insert_sig(compose);
 
        if (replace && parsed_str) {
index 0f7f1da..35171c7 100644 (file)
@@ -114,7 +114,9 @@ static struct Send {
 } p_send;
 
 static struct Compose {
-       GtkWidget *sigpath_entry;
+       GtkWidget *entry_sigpath;
+       GtkWidget *checkbtn_autosig;
+       GtkWidget *entry_sigsep;
        GtkWidget *autocc_chkbtn;
        GtkWidget *autocc_entry;
        GtkWidget *autobcc_chkbtn;
@@ -347,7 +349,15 @@ static PrefParam param[] = {
 
        /* Compose */
        {"signature_path", "~/"DEFAULT_SIGNATURE, &tmp_ac_prefs.sig_path, P_STRING,
-        &compose.sigpath_entry,
+        &compose.entry_sigpath,
+        prefs_set_data_from_entry, prefs_set_entry},
+
+       {"auto_signature", "TRUE", &tmp_ac_prefs.auto_sig, P_BOOL,
+        &compose.checkbtn_autosig,
+        prefs_set_data_from_toggle, prefs_set_toggle},
+        
+       {"signature_separator", "-- ", &tmp_ac_prefs.sig_sep, P_STRING,
+        &compose.entry_sigsep, 
         prefs_set_data_from_entry, prefs_set_entry},
 
        {"set_autocc", "FALSE", &tmp_ac_prefs.set_autocc, P_BOOL,
@@ -1425,9 +1435,15 @@ static void prefs_account_send_create(void)
 static void prefs_account_compose_create(void)
 {
        GtkWidget *vbox1;
-       GtkWidget *hbox;
-       GtkWidget *label;
-       GtkWidget *sigpath_entry;
+       GtkWidget *hbox1;
+       GtkWidget *hbox2;
+       GtkWidget *frame_sig;
+       GtkWidget *vbox_sig;
+       GtkWidget *label_sigpath;
+       GtkWidget *entry_sigpath;
+       GtkWidget *checkbtn_autosig;
+       GtkWidget *label_sigsep;
+       GtkWidget *entry_sigsep;
        GtkWidget *frame;
        GtkWidget *table;
        GtkWidget *autocc_chkbtn;
@@ -1442,17 +1458,39 @@ static void prefs_account_compose_create(void)
        gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
        gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
 
-       hbox = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show (hbox);
-       gtk_box_pack_start (GTK_BOX (vbox1), hbox, FALSE, FALSE, 0);
+       PACK_FRAME(vbox1, frame_sig, _("Signature"));
 
-       label = gtk_label_new (_("Signature file"));
-       gtk_widget_show (label);
-       gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
+       vbox_sig = gtk_vbox_new (FALSE, VSPACING_NARROW);
+       gtk_widget_show (vbox_sig);
+       gtk_container_add (GTK_CONTAINER (frame_sig), vbox_sig);
+       gtk_container_set_border_width (GTK_CONTAINER (vbox_sig), 8);
+
+       PACK_CHECK_BUTTON (vbox_sig, checkbtn_autosig,
+                          _("Insert signature automatically"));
+
+       hbox1 = gtk_hbox_new (FALSE, 8);
+       gtk_widget_show (hbox1);
+       gtk_box_pack_start (GTK_BOX (vbox_sig), hbox1, TRUE, TRUE, 0);
+       label_sigsep = gtk_label_new (_("Signature separator"));
+       gtk_widget_show (label_sigsep);
+       gtk_box_pack_start (GTK_BOX (hbox1), label_sigsep, FALSE, FALSE, 0);
+
+       entry_sigsep = gtk_entry_new ();
+       gtk_widget_show (entry_sigsep);
+       gtk_box_pack_start (GTK_BOX (hbox1), entry_sigsep, FALSE, FALSE, 0);
+
+       gtk_widget_set_usize (entry_sigsep, 64, -1);
+
+       hbox2 = gtk_hbox_new (FALSE, 8);
+       gtk_widget_show (hbox2);
+       gtk_box_pack_start (GTK_BOX (vbox_sig), hbox2, TRUE, TRUE, 0);
+       label_sigpath = gtk_label_new (_("Signature file"));
+       gtk_widget_show (label_sigpath);
+       gtk_box_pack_start (GTK_BOX (hbox2), label_sigpath, FALSE, FALSE, 0);
 
-       sigpath_entry = gtk_entry_new ();
-       gtk_widget_show (sigpath_entry);
-       gtk_box_pack_start (GTK_BOX (hbox), sigpath_entry, TRUE, TRUE, 0);
+       entry_sigpath = gtk_entry_new ();
+       gtk_widget_show (entry_sigpath);
+       gtk_box_pack_start (GTK_BOX (hbox2), entry_sigpath, TRUE, TRUE, 0);
 
        PACK_FRAME (vbox1, frame, _("Automatically set the following addresses"));
 
@@ -1502,7 +1540,9 @@ static void prefs_account_compose_create(void)
 
        SET_TOGGLE_SENSITIVITY (autoreplyto_chkbtn, autoreplyto_entry);
 
-       compose.sigpath_entry = sigpath_entry;
+       compose.entry_sigpath      = entry_sigpath;
+       compose.checkbtn_autosig   = checkbtn_autosig;
+       compose.entry_sigsep       = entry_sigsep;
 
        compose.autocc_chkbtn      = autocc_chkbtn;
        compose.autocc_entry       = autocc_entry;
index 74645c9..99b719d 100644 (file)
@@ -140,7 +140,9 @@ struct _PrefsAccount
        GSList *customhdr_list;
 
        /* Compose */
-       gchar *sig_path;
+       gchar    *sig_path;
+       gboolean  auto_sig;
+       gchar    *sig_sep;
        gboolean  set_autocc;
        gchar    *auto_cc;
        gboolean  set_autobcc;
index ffd921f..e59327c 100644 (file)
@@ -103,9 +103,6 @@ static struct Send {
 } p_send;
 
 static struct Compose {
-       GtkWidget *checkbtn_autosig;
-       GtkWidget *entry_sigsep;
-
        GtkWidget *entry_fw_quotemark;
        GtkWidget *text_fw_quotefmt;
 
@@ -364,12 +361,6 @@ static PrefParam param[] = {
         prefs_common_encoding_set_optmenu},
 
        /* Compose */
-       {"auto_signature", "TRUE", &prefs_common.auto_sig, P_BOOL,
-        &compose.checkbtn_autosig,
-        prefs_set_data_from_toggle, prefs_set_toggle},
-       {"signature_separator", "-- ", &prefs_common.sig_sep, P_STRING,
-        &compose.entry_sigsep, prefs_set_data_from_entry, prefs_set_entry},
-
        {"auto_ext_editor", "FALSE", &prefs_common.auto_exteditor, P_BOOL,
         &compose.checkbtn_autoextedit,
         prefs_set_data_from_toggle, prefs_set_toggle},
@@ -1776,12 +1767,6 @@ static void prefs_compose_create(void)
        GtkWidget *vbox2;
        GtkWidget *hbox1;
 
-       GtkWidget *frame_sig;
-       GtkWidget *vbox_sig;
-       GtkWidget *checkbtn_autosig;
-       GtkWidget *label_sigsep;
-       GtkWidget *entry_sigsep;
-
        GtkWidget *checkbtn_autoextedit;
 
        GtkWidget *frame_autosel;
@@ -1825,29 +1810,6 @@ static void prefs_compose_create(void)
        gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
        gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
 
-       PACK_FRAME(vbox1, frame_sig, _("Signature"));
-
-       vbox_sig = gtk_vbox_new (FALSE, VSPACING_NARROW);
-       gtk_widget_show (vbox_sig);
-       gtk_container_add (GTK_CONTAINER (frame_sig), vbox_sig);
-       gtk_container_set_border_width (GTK_CONTAINER (vbox_sig), 8);
-
-       PACK_CHECK_BUTTON (vbox_sig, checkbtn_autosig,
-                          _("Insert signature automatically"));
-
-       hbox1 = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show (hbox1);
-       gtk_box_pack_start (GTK_BOX (vbox_sig), hbox1, TRUE, TRUE, 0);
-       label_sigsep = gtk_label_new (_("Signature separator"));
-       gtk_widget_show (label_sigsep);
-       gtk_box_pack_start (GTK_BOX (hbox1), label_sigsep, FALSE, FALSE, 0);
-
-       entry_sigsep = gtk_entry_new ();
-       gtk_widget_show (entry_sigsep);
-       gtk_box_pack_start (GTK_BOX (hbox1), entry_sigsep, FALSE, FALSE, 0);
-
-       gtk_widget_set_usize (entry_sigsep, 64, -1);
-
         /* Account autoselection */
        PACK_FRAME(vbox1, frame_autosel, _("Automatic account selection"));
 
@@ -1967,8 +1929,6 @@ static void prefs_compose_create(void)
        compose.entry_quotemark  = entry_quotemark;
        compose.text_quotefmt    = text_quotefmt;
        */
-       compose.checkbtn_autosig = checkbtn_autosig;
-       compose.entry_sigsep     = entry_sigsep;
 
        compose.checkbtn_autoextedit = checkbtn_autoextedit;
 
index ade5c8b..a3750a9 100644 (file)
@@ -85,8 +85,6 @@ struct _PrefsCommon
        TransferEncodingMethod encoding_method;
 
        /* Compose */
-       gboolean auto_sig;
-       gchar *sig_sep;
        gint undolevels;
        gint linewrap_len;
        gboolean linewrap_quote;