2012-06-20 [paul] 3.8.0cvs54
[claws.git] / src / prefs_common.c
index 95f4470bb6004e665c039d232b2fc35ba09c303e..302479a6b40d9465630d2c659ad70906472da78a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2009 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2012 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
@@ -59,7 +59,9 @@
 #include "stock_pixmap.h"
 #include "prefswindow.h"
 #include "colorlabel.h"
-#include "addrcustomattr.h"
+#ifndef USE_NEW_ADDRBOOK
+       #include "addrcustomattr.h"
+#endif
 
 enum {
        DATEFMT_FMT,
@@ -226,6 +228,9 @@ static PrefParam param[] = {
         &prefs_common.compose_subject_format, P_STRING, NULL, NULL, NULL},
        {"compose_body_format", N_("Hello,\\n"),
         &prefs_common.compose_body_format, P_STRING, NULL, NULL, NULL},
+       {"show_compose_margin", "FALSE", &prefs_common.show_compose_margin, P_BOOL,
+        NULL, NULL, NULL},
+       
 
        {"linewrap_length", "72", &prefs_common.linewrap_len, P_INT,
         NULL, NULL, NULL},
@@ -441,8 +446,10 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"thread_by_subject", "TRUE", &prefs_common.thread_by_subject, P_BOOL,
         NULL, NULL, NULL},
-       {"date_format", N_("%y/%m/%d(%a) %H:%M"), &prefs_common.date_format,
+       {"date_format", N_("%x(%a) %H:%M"), &prefs_common.date_format,
         P_STRING, NULL, NULL, NULL},
+       {"msgview_date_format", "FALSE", &prefs_common.msgview_date_format, P_BOOL,
+        NULL, NULL, NULL},
 
        {"bold_unread", "TRUE", &prefs_common.bold_unread, P_BOOL,
         NULL, NULL, NULL},
@@ -647,6 +654,8 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"messagewin_height", "540", &prefs_common.msgwin_height, P_INT,
         NULL, NULL, NULL},
+       {"mimeview_tree_height", "60", &prefs_common.mimeview_tree_height, P_INT,
+        NULL, NULL, NULL},      
        {"sourcewin_width", "600", &prefs_common.sourcewin_width, P_INT,
         NULL, NULL, NULL},
        {"sourcewin_height", "500", &prefs_common.sourcewin_height, P_INT,
@@ -673,6 +682,8 @@ static PrefParam param[] = {
        {"compose_height", "470", &prefs_common.compose_height, P_INT,
         NULL, NULL, NULL},
 #endif
+       {"compose_notebook_height", "130", &prefs_common.compose_notebook_height, P_INT,
+        NULL, NULL, NULL},
        {"compose_x", "0", &prefs_common.compose_x, P_INT,
         NULL, NULL, NULL},
        {"compose_y", "0", &prefs_common.compose_y, P_INT,
@@ -730,8 +741,13 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"scroll_half_page", "FALSE", &prefs_common.scroll_halfpage, P_BOOL,
         NULL, NULL, NULL},
+       {"hide_quoted", "TRUE",
+        &prefs_common.hide_quoted, P_BOOL,
+        NULL, NULL, NULL},
        {"respect_flowed_format", "FALSE", &prefs_common.respect_flowed_format, P_BOOL,
         NULL, NULL, NULL},
+       {"show_all_headers", "FALSE", &prefs_common.show_all_headers, P_BOOL,
+        NULL, NULL, NULL},
 
        {"show_other_header", "FALSE", &prefs_common.show_other_header, P_BOOL,
         NULL, NULL, NULL},
@@ -748,6 +764,8 @@ static PrefParam param[] = {
         &SPECIFIC_PREFS.mime_textviewer,   P_STRING, NULL, NULL, NULL},
        {"mime_open_command", "gedit '%s'",
         &SPECIFIC_PREFS.mime_open_cmd,     P_STRING, NULL, NULL, NULL},
+       {"show_inline_attachments", "TRUE", 
+        &prefs_common.show_inline_attachments, P_BOOL, NULL, NULL, NULL},
 
        /* Interface */
 #ifndef GENERIC_UMPC
@@ -793,6 +811,8 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"nextunreadmsg_dialog", "1", &prefs_common.next_unread_msg_dialog, P_ENUM,
         NULL, NULL, NULL},
+       {"summary_from_show", "0", &prefs_common.summary_from_show, P_ENUM,
+        NULL, NULL, NULL},
 
        {"pixmap_theme_path", DEFAULT_PIXMAP_THEME, 
         &SPECIFIC_PREFS.pixmap_theme_path, P_STRING,
@@ -818,8 +838,6 @@ static PrefParam param[] = {
 #ifndef G_OS_WIN32
        {"uri_open_command", DEFAULT_BROWSER_CMD,
         &SPECIFIC_PREFS.uri_cmd, P_STRING, NULL, NULL, NULL},
-       {"print_command", "lpr %s",
-        &SPECIFIC_PREFS.print_cmd, P_STRING, NULL, NULL, NULL},
 #endif
        {"ext_editor_command", DEFAULT_EDITOR_CMD,
         &SPECIFIC_PREFS.ext_editor_cmd, P_STRING, NULL, NULL, NULL},
@@ -920,7 +938,7 @@ static PrefParam param[] = {
        {"filtering_debug_log_length", "500", &prefs_common.filtering_debug_loglength, P_INT,
         NULL, NULL, NULL},
 
-       {"gtk_can_change_accels", "TRUE", &prefs_common.gtk_can_change_accels, P_BOOL,
+       {"gtk_can_change_accels", "FALSE", &prefs_common.gtk_can_change_accels, P_BOOL,
         NULL, NULL, NULL},
 
        {"color_new", "#0000b3", &prefs_common.color_new, P_COLOR,
@@ -1035,6 +1053,11 @@ static PrefParam param[] = {
        {"addrgather_height", "-1", &prefs_common.addrgather_height, P_INT,
         NULL, NULL, NULL},
 
+       {"news_subscribe_width", "450", &prefs_common.news_subscribe_width, P_INT,
+        NULL, NULL, NULL},
+       {"news_subscribe_height", "400", &prefs_common.news_subscribe_height, P_INT,
+        NULL, NULL, NULL},
+
        /* Hidden */
        {"warn_dnd", "1", &prefs_common.warn_dnd, P_INT,
         NULL, NULL, NULL},
@@ -1049,8 +1072,6 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"stripes_color_offset", "4000", &prefs_common.stripes_color_offset, P_INT,
         NULL, NULL, NULL},
-       {"enable_dotted_lines", "FALSE", &prefs_common.enable_dotted_lines, P_BOOL,
-        NULL, NULL, NULL},
        {"enable_hscrollbar", "TRUE", &prefs_common.enable_hscrollbar, P_BOOL,
         NULL, NULL, NULL},
        {"folderview_vscrollbar_policy", "0",
@@ -1146,6 +1167,16 @@ static PrefParam param[] = {
        {"flush_metadata", "TRUE", &prefs_common.flush_metadata, P_BOOL,
         NULL, NULL, NULL},
 
+       {"nav_history_length", "50", &prefs_common.nav_history_length, P_INT,
+        NULL, NULL, NULL},
+
+       {"diff_added_color", "#008b8b", &prefs_common.diff_added_color, P_COLOR,
+        NULL, NULL, NULL},
+       {"diff_deleted_color", "#6a5acd", &prefs_common.diff_deleted_color, P_COLOR,
+        NULL, NULL, NULL},
+       {"diff_hunk_color", "#a52a2a", &prefs_common.diff_hunk_color, P_COLOR,
+        NULL, NULL, NULL},
+
        {NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
 };
 
@@ -1239,9 +1270,9 @@ 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
        prefs_common.addressbook_custom_attributes = addressbook_update_custom_attr_from_prefs();
-
+#endif
        colorlabel_update_colortable_from_prefs();
 }
 
@@ -1338,9 +1369,11 @@ void prefs_common_write_config(void)
        prefs_common_save_history(COMPOSE_SAVE_TO_HISTORY, 
                prefs_common.compose_save_to_history);
 
-       prefs_common_save_history_to_dir(ADDRBOOK_DIR,
+#ifndef USE_NEW_ADDRBOOK
+               prefs_common_save_history_to_dir(ADDRBOOK_DIR,
                ADDRESSBOOK_CUSTOM_ATTRIBUTES, 
                prefs_common.addressbook_custom_attributes);
+#endif
 }
 
 /* make a copy of string 'in' into buffer 'out'. un-escape \ sequences.
@@ -1428,7 +1461,7 @@ void pref_set_textview_from_pref(GtkTextView *textview, const gchar *txt)
        if (!txt) {
                gtk_text_buffer_set_text(buffer, "", -1);
        } else {
-               out = malloc(strlen(txt)+1);
+               out = g_malloc(strlen(txt)+1);
 
                pref_get_unescaped_pref(out, txt);
 
@@ -1447,7 +1480,7 @@ void pref_set_entry_from_pref(GtkEntry *entry, const gchar *txt)
        if (!txt) {
                gtk_entry_set_text(entry, "");
        } else {
-               out = malloc(strlen(txt)+1);
+               out = g_malloc(strlen(txt)+1);
 
                pref_get_unescaped_pref(out, txt);