add hidden pref 'reqrite_first_from'
[claws.git] / src / prefs_common.c
index 09680b313a229ef6f53c19142206c115a57897cd..feeb95696f69a67a2007a563381e3ab48a9e55c4 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2013 Hiroyuki Yamamoto and the Claws Mail team
+ * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 1999-2016 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
  *
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * 
  */
 
 #ifdef HAVE_CONFIG_H
-#  include "config.h"
+#include "config.h"
 #include "claws-features.h"
 #endif
 
@@ -60,7 +59,7 @@
 #include "stock_pixmap.h"
 #include "prefswindow.h"
 #include "colorlabel.h"
-#ifndef USE_NEW_ADDRBOOK
+#ifndef USE_ALT_ADDRBOOK
        #include "addrcustomattr.h"
 #endif
 
@@ -141,6 +140,9 @@ static PrefParam param_os_specific[] = {
  */
 
 static PrefParam param[] = {
+       {"config_version", "0",
+        &prefs_common.config_version, P_INT, NULL, NULL, NULL},
+
        /* Receive */
        {"use_ext_inc", "FALSE", &prefs_common.use_extinc, P_BOOL,
         NULL, NULL, NULL},
@@ -149,7 +151,7 @@ static PrefParam param[] = {
 
        {"autochk_newmail", "FALSE", &prefs_common.autochk_newmail, P_BOOL,
         NULL, NULL, NULL},
-       {"autochk_interval", "10", &prefs_common.autochk_itv, P_INT,
+       {"autochk_interval", "600", &prefs_common.autochk_itv, P_INT,
         NULL, NULL, NULL},
        {"check_on_startup", "FALSE", &prefs_common.chk_on_startup, P_BOOL,
         NULL, NULL, NULL},
@@ -197,9 +199,12 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"outgoing_fallback_to_ascii", "TRUE", &prefs_common.outgoing_fallback_to_ascii, P_BOOL,
         NULL, NULL, NULL},
-        {"warn_empty_subj", "TRUE", &prefs_common.warn_empty_subj,
+        {"rewrite_first_from", "TRUE", &prefs_common.rewrite_first_from,
+         P_BOOL, NULL, NULL, NULL},
+       {"warn_empty_subj", "TRUE", &prefs_common.warn_empty_subj,
+        P_BOOL, NULL, NULL, NULL},
+       {"hide_timezone", "FALSE", &prefs_common.hide_timezone,
         P_BOOL, NULL, NULL, NULL},
-
        {"allow_jisx0201_kana", "FALSE", &prefs_common.allow_jisx0201_kana,
         P_BOOL, NULL, NULL, NULL},
 
@@ -221,6 +226,8 @@ static PrefParam param[] = {
         &prefs_common.compose_body_format, P_STRING, NULL, NULL, NULL},
        {"show_compose_margin", "FALSE", &prefs_common.show_compose_margin, P_BOOL,
         NULL, NULL, NULL},
+       {"type_any_header", "FALSE", &prefs_common.type_any_header, P_BOOL,
+        NULL, NULL, NULL},
        
 
        {"linewrap_length", "72", &prefs_common.linewrap_len, P_INT,
@@ -239,7 +246,7 @@ static PrefParam param[] = {
         P_BOOL, NULL, NULL, NULL},
         {"autosave_length", "50", &prefs_common.autosave_length, P_INT,
         NULL, NULL, NULL},
-        {"autosave_encrypted", "TRUE", &prefs_common.autosave_encrypted,
+        {"autosave_encrypted", "FALSE", &prefs_common.autosave_encrypted,
         P_BOOL, NULL, NULL, NULL},
         {"warn_large_insert", "TRUE", &prefs_common.warn_large_insert,
         P_BOOL, NULL, NULL, NULL},
@@ -435,6 +442,10 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
 
        /* Display: Summary View */
+       {"default_sort_key", "3", &prefs_common.default_sort_key, P_ENUM,
+        NULL, NULL, NULL},
+       {"default_sort_type", "1", &prefs_common.default_sort_type, P_ENUM,
+        NULL, NULL, NULL},
        {"use_address_book", "FALSE", &prefs_common.use_addr_book, P_BOOL,
         NULL, NULL, NULL},
        {"thread_by_subject", "TRUE", &prefs_common.thread_by_subject, P_BOOL,
@@ -444,7 +455,10 @@ static PrefParam param[] = {
        {"msgview_date_format", "FALSE", &prefs_common.msgview_date_format, P_BOOL,
         NULL, NULL, NULL},
 
-       {"bold_unread", "TRUE", &prefs_common.bold_unread, P_BOOL,
+       {"next_on_delete", "FALSE", &prefs_common.next_on_delete, P_BOOL,
+        NULL, NULL, NULL},
+
+        {"bold_unread", "TRUE", &prefs_common.bold_unread, P_BOOL,
         NULL, NULL, NULL},
 
        {"enable_thread", "TRUE", &prefs_common.enable_thread, P_BOOL,
@@ -638,6 +652,8 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"mainwin_fullscreen", "FALSE", &prefs_common.mainwin_fullscreen, P_BOOL,
         NULL, NULL, NULL},
+       {"mainwin_menubar", "TRUE", &prefs_common.mainwin_menubar, P_BOOL,
+        NULL, NULL, NULL},
 #ifndef GENERIC_UMPC
        {"mainwin_width", "800", &prefs_common.mainwin_width, P_INT,
         NULL, NULL, NULL},
@@ -1173,6 +1189,18 @@ static PrefParam param[] = {
        {"diff_hunk_color", "#a52a2a", &prefs_common.diff_hunk_color, P_COLOR,
         NULL, NULL, NULL},
 
+       {"folder_search_wildcard", "TRUE", &prefs_common.folder_search_wildcard, P_BOOL,
+        NULL, NULL, NULL},
+       {"address_search_wildcard", "TRUE", &prefs_common.address_search_wildcard, P_BOOL,
+        NULL, NULL, NULL},
+       {"enable_avatars", "3", &prefs_common.enable_avatars, P_INT, NULL, NULL, NULL},
+#ifndef PASSWORD_CRYPTO_OLD
+       {"use_master_passphrase", FALSE, &prefs_common.use_master_passphrase, P_BOOL, NULL, NULL, NULL },
+       {"master_passphrase", "", &prefs_common.master_passphrase, P_STRING, NULL, NULL, NULL },
+       {"master_passphrase_salt", "", &prefs_common.master_passphrase_salt, P_STRING, NULL, NULL, NULL },
+       {"master_passphrase_pbkdf2_rounds", "50000", &prefs_common.master_passphrase_pbkdf2_rounds, P_INT, NULL, NULL, NULL},
+#endif
+
        {NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
 };
 
@@ -1266,7 +1294,7 @@ void prefs_common_read_config(void)
                prefs_common_read_history(MESSAGE_SEARCH_HISTORY);
        prefs_common.compose_save_to_history =
                prefs_common_read_history(COMPOSE_SAVE_TO_HISTORY);
-#ifndef USE_NEW_ADDRBOOK
+#ifndef USE_ALT_ADDRBOOK
        prefs_common.addressbook_custom_attributes = addressbook_update_custom_attr_from_prefs();
 #endif
        colorlabel_update_colortable_from_prefs();
@@ -1275,7 +1303,7 @@ void prefs_common_read_config(void)
 #define TRY(func) \
 if (!(func)) \
 { \
-       g_warning("failed to write\n"); \
+       g_warning("failed to write"); \
        goto out;                       \
 } \
 
@@ -1365,7 +1393,7 @@ void prefs_common_write_config(void)
        prefs_common_save_history(COMPOSE_SAVE_TO_HISTORY, 
                prefs_common.compose_save_to_history);
 
-#ifndef USE_NEW_ADDRBOOK
+#ifndef USE_ALT_ADDRBOOK
                prefs_common_save_history_to_dir(ADDRBOOK_DIR,
                ADDRESSBOOK_CUSTOM_ATTRIBUTES, 
                prefs_common.addressbook_custom_attributes);
@@ -1461,7 +1489,7 @@ void pref_set_textview_from_pref(GtkTextView *textview, const gchar *txt)
 
                pref_get_unescaped_pref(out, txt);
 
-               gtk_text_buffer_set_text(buffer, out?out:"", -1);
+               gtk_text_buffer_set_text(buffer, out, -1);
                g_free(out);
        }
 }
@@ -1480,7 +1508,7 @@ void pref_set_entry_from_pref(GtkEntry *entry, const gchar *txt)
 
                pref_get_unescaped_pref(out, txt);
 
-               gtk_entry_set_text(entry, out?out:"");
+               gtk_entry_set_text(entry, out);
                g_free(out);
        }
 }