2007-01-17 [paul] 2.7.1cvs15
[claws.git] / src / prefs_common.c
index c304b5a4b23879259b12c8017312281eb0642936..b56551b23df8b1d5118da99fa747db89fca0bf6c 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2006 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2007 Hiroyuki Yamamoto and the Claws Mail team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -229,6 +229,8 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"dictionary",  "", &prefs_common.dictionary, P_STRING,
         NULL, NULL, NULL},
+       {"alt_dictionary",  "", &prefs_common.alt_dictionary, P_STRING,
+        NULL, NULL, NULL},
        {"aspell_sugmode", "1", &prefs_common.aspell_sugmode, P_INT,
         NULL, NULL, NULL},
        {"use_alternate_dict", "FALSE", &prefs_common.use_alternate, P_BOOL,
@@ -239,6 +241,8 @@ static PrefParam param[] = {
         P_BOOL, NULL, NULL, NULL},
        {"misspelled_color", "16711680", &prefs_common.misspelled_col, P_COLOR,
         NULL, NULL, NULL},
+       {"use_both_dicts", "FALSE", &prefs_common.use_both_dicts, P_BOOL,
+        NULL, NULL, NULL},
 #endif
        {"reply_with_quote", "TRUE", &prefs_common.reply_with_quote, P_BOOL,
         NULL, NULL, NULL},
@@ -637,6 +641,14 @@ static PrefParam param[] = {
        {"apply_per_account_filtering_rules", "0", &prefs_common.apply_per_account_filtering_rules, P_ENUM,
         NULL, NULL, NULL},
 
+       /* Addressbook */
+       {"addressbook_use_editaddress_dialog", "TRUE", &prefs_common.addressbook_use_editaddress_dialog,
+        P_BOOL, NULL, NULL, NULL},
+       {"addressbook_hpaned_pos", "-1", &prefs_common.addressbook_hpaned_pos,
+        P_INT, NULL, NULL, NULL},
+       {"addressbook_vpaned_pos", "-1", &prefs_common.addressbook_vpaned_pos,
+        P_INT, NULL, NULL, NULL},
+
        /* Other */
        {"uri_open_command", DEFAULT_BROWSER_CMD,
         &SPECIFIC_PREFS.uri_cmd, P_STRING, NULL, NULL, NULL},
@@ -644,7 +656,6 @@ static PrefParam param[] = {
         &SPECIFIC_PREFS.print_cmd, P_STRING, NULL, NULL, NULL},
        {"ext_editor_command", DEFAULT_EDITOR_CMD,
         &SPECIFIC_PREFS.ext_editor_cmd, P_STRING, NULL, NULL, NULL},
-
        {"add_address_by_click", "FALSE", &prefs_common.add_address_by_click,
         P_BOOL, NULL, NULL, NULL},
        {"confirm_on_exit", "FALSE", &prefs_common.confirm_on_exit, P_BOOL,
@@ -719,7 +730,7 @@ static PrefParam param[] = {
 
        {"addressbookeditpersonwin_width", "640", &prefs_common.addressbookeditpersonwin_width, P_INT,
         NULL, NULL, NULL},
-       {"addressbookeditpersonwin_height", "-1", &prefs_common.addressbookeditpersonwin_height, P_INT,
+       {"addressbookeditpersonwin_height", "320", &prefs_common.addressbookeditpersonwin_height, P_INT,
         NULL, NULL, NULL},
 
        {"addressbookeditgroupwin_width", "580", &prefs_common.addressbookeditgroupwin_width, P_INT,
@@ -727,7 +738,7 @@ static PrefParam param[] = {
        {"addressbookeditgroupwin_height", "340", &prefs_common.addressbookeditgroupwin_height, P_INT,
         NULL, NULL, NULL},
 
-       {"pluginswin_width", "480", &prefs_common.pluginswin_width, P_INT,
+       {"pluginswin_width", "-1", &prefs_common.pluginswin_width, P_INT,
         NULL, NULL, NULL},
        {"pluginswin_height", "-1", &prefs_common.pluginswin_height, P_INT,
         NULL, NULL, NULL},
@@ -818,6 +829,8 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"hide_quotes", "0", &prefs_common.hide_quotes, P_INT,
         NULL, NULL, NULL},
+       {"unsafe_ssl_certs", "FALSE", &prefs_common.unsafe_ssl_certs, P_BOOL,
+        NULL, NULL, NULL},
 
        {NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
 };
@@ -882,10 +895,26 @@ void prefs_common_read_config(void)
        g_free(prefs_common.date_format);
        prefs_common.date_format = tmp;
 
+       tmp = g_strdup(gettext(prefs_common.compose_body_format));
+       g_free(prefs_common.compose_body_format);
+       prefs_common.compose_body_format = tmp;
+
        prefs_common.mime_open_cmd_history =
                prefs_common_read_history(COMMAND_HISTORY);
        prefs_common.summary_quicksearch_history =
                prefs_common_read_history(QUICKSEARCH_HISTORY);
+       prefs_common.summary_search_from_history =
+               prefs_common_read_history(SUMMARY_SEARCH_FROM_HISTORY);
+       prefs_common.summary_search_to_history =
+               prefs_common_read_history(SUMMARY_SEARCH_TO_HISTORY);
+       prefs_common.summary_search_subject_history =
+               prefs_common_read_history(SUMMARY_SEARCH_SUBJECT_HISTORY);
+       prefs_common.summary_search_body_history =
+               prefs_common_read_history(SUMMARY_SEARCH_BODY_HISTORY);
+       prefs_common.summary_search_adv_condition_history =
+               prefs_common_read_history(SUMMARY_SEARCH_ADV_CONDITION_HISTORY);
+       prefs_common.message_search_history =
+               prefs_common_read_history(MESSAGE_SEARCH_HISTORY);
 
        colorlabel_update_colortable_from_prefs();
 }
@@ -927,6 +956,18 @@ void prefs_common_write_config(void)
                prefs_common.mime_open_cmd_history);
        prefs_common_save_history(QUICKSEARCH_HISTORY, 
                prefs_common.summary_quicksearch_history);
+       prefs_common_save_history(SUMMARY_SEARCH_FROM_HISTORY, 
+               prefs_common.summary_search_from_history);
+       prefs_common_save_history(SUMMARY_SEARCH_TO_HISTORY, 
+               prefs_common.summary_search_to_history);
+       prefs_common_save_history(SUMMARY_SEARCH_SUBJECT_HISTORY, 
+               prefs_common.summary_search_subject_history);
+       prefs_common_save_history(SUMMARY_SEARCH_BODY_HISTORY, 
+               prefs_common.summary_search_body_history);
+       prefs_common_save_history(SUMMARY_SEARCH_ADV_CONDITION_HISTORY, 
+               prefs_common.summary_search_adv_condition_history);
+       prefs_common_save_history(MESSAGE_SEARCH_HISTORY, 
+               prefs_common.message_search_history);
 }
 
 /* make a copy of string 'in' into buffer 'out'. un-escape \ sequences.
@@ -1074,3 +1115,9 @@ gchar *pref_get_pref_from_entry(GtkEntry *entry)
 
        return out?out:"";
 }
+
+/* ugly hack to be able to get this pref from ssl_certificate.c */
+gboolean prefs_common_unsafe_ssl_certs(void)
+{
+       return prefs_common.unsafe_ssl_certs;
+}