2009-02-06 [holger] 3.7.0cvs55
[claws.git] / src / prefs_common.c
index 6b65a4f90aaa278253ff2ef368a6e949d19e6428..be9f07c3f4a18504c33eba116ffb91876b593ff5 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2007 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2009 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
@@ -121,10 +121,6 @@ static PrefParam param_os_specific[] = {
         &prefs_common.pixmap_theme_path, P_STRING, NULL, NULL, NULL},
 
        /* Other */
-       {"uri_open_command", NULL,
-        &prefs_common.uri_cmd, P_STRING, NULL, NULL, NULL},
-       {"print_command", "notepad /p %s",
-        &prefs_common.print_cmd, P_STRING, NULL, NULL, NULL},
        {"ext_editor_command", "notepad %s",
         &prefs_common.ext_editor_cmd, P_STRING, NULL, NULL, NULL},
 
@@ -237,23 +233,23 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"linewrap_pastes", "TRUE", &prefs_common.linewrap_pastes, P_BOOL,
         NULL, NULL, NULL},
+       {"primary_paste_unselects", "FALSE", &prefs_common.primary_paste_unselects, P_BOOL,
+        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
+
        {"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,
@@ -264,7 +260,7 @@ static PrefParam param[] = {
         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},
        {"compose_dnd_insert_or_attach", "0", &prefs_common.compose_dnd_mode, P_ENUM,
@@ -636,6 +632,8 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"mainwin_maximised", "FALSE", &prefs_common.mainwin_maximised, P_BOOL,
         NULL, NULL, NULL},
+       {"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},
@@ -813,16 +811,20 @@ static PrefParam param[] = {
         P_INT, NULL, NULL, NULL},
 
        /* Other */
+#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},
        {"cmds_use_system_default", "FALSE",
         &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,
@@ -1094,6 +1096,14 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"print_paper_orientation", "0", &prefs_common.print_paper_orientation, P_INT,
         NULL, NULL, NULL},
+       {"print_margin_top", "-1", &prefs_common.print_margin_top, P_INT,
+        NULL, NULL, NULL},
+       {"print_margin_bottom", "-1", &prefs_common.print_margin_bottom, P_INT,
+        NULL, NULL, NULL},
+       {"print_margin_left", "-1", &prefs_common.print_margin_left, P_INT,
+        NULL, NULL, NULL},
+       {"print_margin_right", "-1", &prefs_common.print_margin_right, P_INT,
+        NULL, NULL, NULL},
        {"print_use_color", "0", &prefs_common.print_use_color, P_INT,
         NULL, NULL, NULL},
        {"print_use_collate", "0", &prefs_common.print_use_collate, P_INT,
@@ -1210,6 +1220,8 @@ void prefs_common_read_config(void)
                prefs_common_read_history(SUMMARY_SEARCH_ADV_CONDITION_HISTORY);
        prefs_common.message_search_history =
                prefs_common_read_history(MESSAGE_SEARCH_HISTORY);
+       prefs_common.compose_save_to_history =
+               prefs_common_read_history(COMPOSE_SAVE_TO_HISTORY);
 
        prefs_common.addressbook_custom_attributes = addressbook_update_custom_attr_from_prefs();
 
@@ -1306,6 +1318,8 @@ void prefs_common_write_config(void)
                prefs_common.summary_search_adv_condition_history);
        prefs_common_save_history(MESSAGE_SEARCH_HISTORY, 
                prefs_common.message_search_history);
+       prefs_common_save_history(COMPOSE_SAVE_TO_HISTORY, 
+               prefs_common.compose_save_to_history);
 
        prefs_common_save_history_to_dir(ADDRBOOK_DIR,
                ADDRESSBOOK_CUSTOM_ATTRIBUTES, 
@@ -1516,6 +1530,9 @@ const gchar *prefs_common_translated_header_name(const gchar *header_name)
 
 const gchar *prefs_common_get_uri_cmd(void)
 {
+#ifdef G_OS_WIN32
+       return NULL;
+#else
        gchar *tmp = NULL;
        
        if (!prefs_common.cmds_use_system_default)
@@ -1527,6 +1544,7 @@ const gchar *prefs_common_get_uri_cmd(void)
        
        g_free(tmp);
        return "xdg-open %s";
+#endif
 }
 
 const gchar *prefs_common_get_ext_editor_cmd(void)
@@ -1552,3 +1570,8 @@ gboolean prefs_common_get_use_shred(void)
 {
        return prefs_common.use_shred;
 }
+
+PrefsCommon *prefs_common_get_prefs(void)
+{
+       return &prefs_common;
+}