2008-10-07 [colin] 3.6.0cvs12
[claws.git] / src / prefs_common.c
index d6c9fb1626c1e75b48624b62105674f064b1325b..2f368fc2bb62af87f03223645aea86ea5ff0fdfe 100644 (file)
@@ -192,8 +192,13 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"confirm_send_queued_messages", "FALSE", &prefs_common.confirm_send_queued_messages,
         P_BOOL, NULL, NULL, NULL},
+#ifndef GENERIC_UMPC
        {"send_dialog_mode", "0", &prefs_common.send_dialog_invisible, P_BOOL,
         NULL, NULL, NULL},
+#else
+       {"send_dialog_mode", "1", &prefs_common.send_dialog_invisible, P_BOOL,
+        NULL, NULL, NULL},
+#endif
        {"sendwin_width", "460", &prefs_common.sendwin_width, P_INT,
         NULL, NULL, NULL},
        {"sendwin_height", "-1", &prefs_common.sendwin_height, P_INT,
@@ -203,6 +208,8 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"encoding_method", "0", &prefs_common.encoding_method, P_ENUM,
         NULL, NULL, NULL},
+       {"outgoing_fallback_to_ascii", "TRUE", &prefs_common.outgoing_fallback_to_ascii, P_BOOL,
+        NULL, NULL, NULL},
 
        {"allow_jisx0201_kana", "FALSE", &prefs_common.allow_jisx0201_kana,
         P_BOOL, NULL, NULL, NULL},
@@ -232,28 +239,26 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"linewrap_auto", "TRUE", &prefs_common.autowrap, P_BOOL,
         NULL, NULL, NULL},
+       {"auto_indent", "TRUE", &prefs_common.auto_indent, P_BOOL,
+        NULL, NULL, NULL},
         {"autosave", "TRUE", &prefs_common.autosave,
         P_BOOL, NULL, NULL, NULL},
         {"autosave_length", "50", &prefs_common.autosave_length, P_INT,
         NULL, NULL, NULL},
-#if USE_ASPELL
+#if USE_ENCHANT
        {"enable_aspell", "TRUE", &prefs_common.enable_aspell, P_BOOL,
         NULL, NULL, NULL},
-       {"aspell_path", ASPELL_PATH, &prefs_common.aspell_path, P_STRING,
-        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,
         NULL, NULL, NULL},
        {"check_while_typing", "TRUE", &prefs_common.check_while_typing, P_BOOL,
         NULL, NULL, NULL},
        {"recheck_when_changing_dict", "TRUE", &prefs_common.recheck_when_changing_dict,
         P_BOOL, NULL, NULL, NULL},
-       {"misspelled_color", "16711680", &prefs_common.misspelled_col, P_COLOR,
+       {"misspelled_color", "#ff0000", &prefs_common.misspelled_col, P_COLOR,
         NULL, NULL, NULL},
        {"use_both_dicts", "FALSE", &prefs_common.use_both_dicts, P_BOOL,
         NULL, NULL, NULL},
@@ -277,7 +282,7 @@ static PrefParam param[] = {
        {"default_reply_list", "TRUE", &prefs_common.default_reply_list, P_BOOL,
         NULL, NULL, NULL},
 
-#ifndef MAEMO
+#ifndef GENERIC_UMPC
        {"show_ruler", "TRUE", &prefs_common.show_ruler, P_BOOL,
         NULL, NULL, NULL},
 #else
@@ -288,16 +293,17 @@ static PrefParam param[] = {
        /* Quote */
        {"reply_quote_mark", "> ", &prefs_common.quotemark, P_STRING,
         NULL, NULL, NULL},
-       {"reply_quote_format", N_("On %d\\n%f wrote:\\n\\n%q"),
+       {"reply_quote_format", N_("On %d\\n%f wrote:\\n\\n%q\\n%X"),
         &prefs_common.quotefmt, P_STRING, NULL, NULL, NULL},
 
        {"forward_quote_mark", "> ", &prefs_common.fw_quotemark, P_STRING,
         NULL, NULL, NULL},
        {"forward_quote_format",
         N_("\\n\\nBegin forwarded message:\\n\\n"
-        "?d{Date: %d\\n}?f{From: %f\\n}?t{To: %t\\n}?c{Cc: %c\\n}"
-        "?n{Newsgroups: %n\\n}?s{Subject: %s\\n}\\n\\n%M"),
-        &prefs_common.fw_quotefmt, P_STRING, NULL, NULL, NULL},
+        "?d{Date: %d\\n}?f{From: %f\\n}?t{To: %t\\n}?c{Cc: %c\\n}"
+        "?n{Newsgroups: %n\\n}?s{Subject: %s\\n}\\n\\n%M"),
+        &prefs_common.fw_quotefmt, P_STRING,
+        NULL, NULL, NULL},
        {"quote_chars", ">", &prefs_common.quote_chars, P_STRING,
         NULL, NULL, NULL},
 
@@ -315,7 +321,7 @@ static PrefParam param[] = {
          &prefs_common.normalfont_gtk1,        P_STRING, NULL, NULL, NULL},
 
        /* new fonts */
-#ifndef MAEMO
+#ifndef GENERIC_UMPC
        {"widget_font_gtk2",    NULL,
          &SPECIFIC_PREFS.widgetfont,           P_STRING, NULL, NULL, NULL},
        {"message_font_gtk2",   "Monospace 9",
@@ -441,7 +447,7 @@ static PrefParam param[] = {
 
        {"enable_thread", "TRUE", &prefs_common.enable_thread, P_BOOL,
         NULL, NULL, NULL},
-#ifndef MAEMO
+#ifndef GENERIC_UMPC
        {"toolbar_style", "3", &prefs_common.toolbar_style, P_ENUM,
         NULL, NULL, NULL},
 #else
@@ -452,7 +458,7 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"show_col_headers", "TRUE", &prefs_common.show_col_headers, P_BOOL,
         NULL, NULL, NULL},
-#ifndef MAEMO
+#ifndef GENERIC_UMPC
        {"show_statusbar", "TRUE", &prefs_common.show_statusbar, P_BOOL,
         NULL, NULL, NULL},
        {"show_searchbar", "TRUE", &prefs_common.show_searchbar, P_BOOL,
@@ -520,7 +526,7 @@ static PrefParam param[] = {
         &prefs_common.summary_col_size[S_COL_STATUS], P_INT, NULL, NULL, NULL},
        {"summary_col_size_mime", "10",
         &prefs_common.summary_col_size[S_COL_MIME], P_INT, NULL, NULL, NULL},
-#ifndef MAEMO
+#ifndef GENERIC_UMPC
        {"summary_col_size_subject", "200",
         &prefs_common.summary_col_size[S_COL_SUBJECT], P_INT, NULL, NULL, NULL},
        {"summary_col_size_from", "120",
@@ -579,7 +585,7 @@ static PrefParam param[] = {
        {"folder_col_pos_total", "3",
         &prefs_common.folder_col_pos[F_COL_TOTAL], P_INT, NULL, NULL, NULL},
 
-#ifndef MAEMO
+#ifndef GENERIC_UMPC
        {"folder_col_size_folder", "120",
         &prefs_common.folder_col_size[F_COL_FOLDER], P_INT, NULL, NULL, NULL},
        {"folder_col_size_new", "32",
@@ -628,7 +634,9 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"mainwin_maximised", "FALSE", &prefs_common.mainwin_maximised, P_BOOL,
         NULL, NULL, NULL},
-#ifndef MAEMO
+       {"mainwin_fullscreen", "FALSE", &prefs_common.mainwin_fullscreen, P_BOOL,
+        NULL, NULL, NULL},
+#ifndef GENERIC_UMPC
        {"mainwin_width", "800", &prefs_common.mainwin_width, P_INT,
         NULL, NULL, NULL},
        {"mainwin_height", "600", &prefs_common.mainwin_height, P_INT,
@@ -671,27 +679,27 @@ static PrefParam param[] = {
        {"enable_color", "TRUE", &prefs_common.enable_color, P_BOOL,
         NULL, NULL, NULL},
 
-       {"quote_level1_color", "179", &prefs_common.quote_level1_col, P_COLOR,
+       {"quote_level1_color", "#0000b3", &prefs_common.quote_level1_col, P_COLOR,
         NULL, NULL, NULL},
-       {"quote_level2_color", "179", &prefs_common.quote_level2_col, P_COLOR,
+       {"quote_level2_color", "#0000b3", &prefs_common.quote_level2_col, P_COLOR,
         NULL, NULL, NULL},
-       {"quote_level3_color", "179", &prefs_common.quote_level3_col, P_COLOR,
+       {"quote_level3_color", "#0000b3", &prefs_common.quote_level3_col, P_COLOR,
         NULL, NULL, NULL},
        {"enable_bgcolor", "FALSE", &prefs_common.enable_bgcolor, P_BOOL,
         NULL, NULL, NULL},
-       {"quote_level1_bgcolor", "13421772", &prefs_common.quote_level1_bgcol, P_COLOR,
+       {"quote_level1_bgcolor", "#cccccc", &prefs_common.quote_level1_bgcol, P_COLOR,
         NULL, NULL, NULL},
-       {"quote_level2_bgcolor", "13948116", &prefs_common.quote_level2_bgcol, P_COLOR,
+       {"quote_level2_bgcolor", "#d4d4d4", &prefs_common.quote_level2_bgcol, P_COLOR,
         NULL, NULL, NULL},
-       {"quote_level3_bgcolor", "14540253", &prefs_common.quote_level3_bgcol, P_COLOR,
+       {"quote_level3_bgcolor", "#dddddd", &prefs_common.quote_level3_bgcol, P_COLOR,
         NULL, NULL, NULL},
-       {"uri_color", "32512", &prefs_common.uri_col, P_COLOR,
+       {"uri_color", "#007f00", &prefs_common.uri_col, P_COLOR,
         NULL, NULL, NULL},
-       {"emphasis_color", "207", &prefs_common.emphasis_col, P_COLOR,
+       {"emphasis_color", "#0000cf", &prefs_common.emphasis_col, P_COLOR,
         NULL, NULL, NULL},
-       {"target_folder_color", "14294218", &prefs_common.tgt_folder_col, P_COLOR,
+       {"target_folder_color", "#da1cca", &prefs_common.tgt_folder_col, P_COLOR,
         NULL, NULL, NULL},
-       {"signature_color", "7960953", &prefs_common.signature_col, P_COLOR,
+       {"signature_color", "#797979", &prefs_common.signature_col, P_COLOR,
         NULL, NULL, NULL},
        {"recycle_quote_colors", "FALSE", &prefs_common.recycle_quote_colors,
         P_BOOL, NULL, NULL, NULL},
@@ -706,6 +714,8 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"invoke_plugin_on_html", "FALSE", &prefs_common.invoke_plugin_on_html, P_BOOL,
         NULL, NULL, NULL},
+       {"promote_html_part", "FALSE", &prefs_common.promote_html_part, P_BOOL,
+        NULL, NULL, NULL},
        {"line_space", "2", &prefs_common.line_space, P_INT,
         NULL, NULL, NULL},
        {"never_send_retrcpt", "FALSE", &prefs_common.never_send_retrcpt, P_BOOL,
@@ -738,7 +748,7 @@ static PrefParam param[] = {
         &SPECIFIC_PREFS.mime_open_cmd,     P_STRING, NULL, NULL, NULL},
 
        /* Interface */
-#ifndef MAEMO
+#ifndef GENERIC_UMPC
        {"layout_mode", "0", &prefs_common.layout_mode, P_INT,
         NULL, NULL, NULL},
 #else
@@ -747,9 +757,9 @@ static PrefParam param[] = {
 #endif
        /* {"emulate_emacs", "FALSE", &prefs_common.emulate_emacs, P_BOOL,
         NULL, NULL, NULL}, */
-       {"always_show_message_when_selected", "FALSE",
+       {"always_show_message_when_selected", "0",
         &prefs_common.always_show_msg,
-        P_BOOL, NULL, NULL, NULL},
+        P_ENUM, NULL, NULL, NULL},
        {"select_on_entry", "3", &prefs_common.select_on_entry,
         P_ENUM, NULL, NULL, NULL},
        {"show_tooltips", "TRUE", &prefs_common.show_tooltips,
@@ -813,6 +823,8 @@ static PrefParam param[] = {
         &prefs_common.cmds_use_system_default, P_BOOL, NULL, NULL, NULL},
        {"add_address_by_click", "FALSE", &prefs_common.add_address_by_click,
         P_BOOL, NULL, NULL, NULL},
+       {"session_passwords", "FALSE", &prefs_common.session_passwords,
+        P_BOOL, NULL, NULL, NULL},
        {"confirm_on_exit", "FALSE", &prefs_common.confirm_on_exit, P_BOOL,
         NULL, NULL, NULL},
        {"clean_trash_on_exit", "FALSE", &prefs_common.clean_on_exit, P_BOOL,
@@ -825,7 +837,7 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"summary_quicksearch_type", "0", &prefs_common.summary_quicksearch_type, P_INT,
         NULL, NULL, NULL},
-#ifndef MAEMO
+#ifndef GENERIC_UMPC
        {"summary_quicksearch_recurse", "1", &prefs_common.summary_quicksearch_recurse, P_INT,
         NULL, NULL, NULL},
 #else
@@ -833,8 +845,13 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
 #endif
 
+#if defined(__OpenBSD__)
+       {"io_timeout_secs", "80", &prefs_common.io_timeout_secs,
+        P_INT, NULL, NULL, NULL},
+#else
        {"io_timeout_secs", "60", &prefs_common.io_timeout_secs,
         P_INT, NULL, NULL, NULL},
+#endif
        {"hide_score", "-9999", &prefs_common.kill_score, P_INT,
         NULL, NULL, NULL},
        {"important_score", "1", &prefs_common.important_score, P_INT,
@@ -844,7 +861,7 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"log_length", "500", &prefs_common.loglength, P_INT,
         NULL, NULL, NULL},
-#ifndef MAEMO
+#ifndef GENERIC_UMPC
        {"enable_log_standard", "TRUE", &prefs_common.enable_log_standard, P_BOOL,
         NULL, NULL, NULL},
        {"enable_log_warning", "TRUE", &prefs_common.enable_log_warning, P_BOOL,
@@ -902,7 +919,7 @@ static PrefParam param[] = {
        {"gtk_can_change_accels", "TRUE", &prefs_common.gtk_can_change_accels, P_BOOL,
         NULL, NULL, NULL},
 
-       {"color_new", "179", &prefs_common.color_new, P_COLOR,
+       {"color_new", "#0000b3", &prefs_common.color_new, P_COLOR,
         NULL, NULL, NULL},
 
        /* Some windows' sizes */
@@ -1030,7 +1047,7 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"hover_timeout", "500", &prefs_common.hover_timeout, P_INT,
         NULL, NULL, NULL},
-#ifndef MAEMO
+#ifndef GENERIC_UMPC
        {"cache_max_mem_usage", "4096", &prefs_common.cache_max_mem_usage, P_INT,
         NULL, NULL, NULL},
        {"cache_min_keep_time", "15", &prefs_common.cache_min_keep_time, P_INT,
@@ -1067,7 +1084,7 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"unsafe_ssl_certs", "FALSE", &prefs_common.unsafe_ssl_certs, P_BOOL,
         NULL, NULL, NULL},
-#ifndef MAEMO
+#ifndef GENERIC_UMPC
        {"real_time_sync", "FALSE", &prefs_common.real_time_sync, P_BOOL,
         NULL, NULL, NULL},
 #else
@@ -1093,6 +1110,16 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"print_previewwin_height", "-1", &prefs_common.print_previewwin_height, P_INT,
         NULL, NULL, NULL},
+       {"use_networkmanager", "TRUE", &prefs_common.use_networkmanager, P_BOOL,
+        NULL, NULL, NULL},
+       {"use_shred", "FALSE", &prefs_common.use_shred, P_BOOL,
+        NULL, NULL, NULL},
+
+       {"two_line_vertical", "TRUE", &prefs_common.two_line_vert,
+       P_BOOL, NULL, NULL, NULL },
+
+       {"inherit_folder_properties", "FALSE", &prefs_common.inherit_folder_props, P_BOOL,
+        NULL, NULL, NULL},
 
        {NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
 };
@@ -1165,22 +1192,10 @@ void prefs_common_read_config(void)
 
        g_free(rcpath);
 
-       tmp = g_strdup(gettext(prefs_common.quotefmt));
-       g_free(prefs_common.quotefmt);
-       prefs_common.quotefmt = tmp;
-
-       tmp = g_strdup(gettext(prefs_common.fw_quotefmt));
-       g_free(prefs_common.fw_quotefmt);
-       prefs_common.fw_quotefmt = tmp;
-       
        tmp = g_strdup(gettext(prefs_common.date_format));
        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 =
@@ -1246,7 +1261,7 @@ static void prefs_common_save_history_to_dir(const gchar *dirname, const gchar *
        }
        fp = NULL;
 #ifdef G_OS_WIN32
-       g_unlink(path);
+       claws_unlink(path);
 #endif
        if (g_rename(tmp_path, path) < 0) {
                FILE_OP_ERROR(path, "rename");
@@ -1534,3 +1549,13 @@ const gchar *prefs_common_get_ext_editor_cmd(void)
        return "xdg-open %s";
 #endif 
 }
+
+gboolean prefs_common_get_use_shred(void)
+{
+       return prefs_common.use_shred;
+}
+
+PrefsCommon *prefs_common_get_prefs(void)
+{
+       return &prefs_common;
+}