2006-02-08 [colin] 2.0.0cvs36
authorColin Leroy <colin@colino.net>
Wed, 8 Feb 2006 21:49:06 +0000 (21:49 +0000)
committerColin Leroy <colin@colino.net>
Wed, 8 Feb 2006 21:49:06 +0000 (21:49 +0000)
* src/prefs_common.c
* src/common/defs.h
* src/common/plugin.c
allow windows and linux configurations to coexist
patch by Thomas Gilgin

ChangeLog
PATCHSETS
configure.ac
src/common/defs.h
src/common/plugin.c
src/prefs_common.c

index 1bb187a23de35a7155403b6c3c1c63889b7cc403..44170cb6f7807b8403c56e53d5981c1a08c26157 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-02-08 [colin]     2.0.0cvs36
+
+       * src/prefs_common.c
+       * src/common/defs.h
+       * src/common/plugin.c
+               allow windows and linux configurations to coexist
+               patch by Thomas Gilgin
+
 2006-02-08 [colin]     2.0.0cvs35
 
        * src/filtering.c
@@ -16,6 +24,7 @@
        * src/procmime.h
                Fix bug #905 (damaged attachment)
                text files with raw \0's aren't really text files
+       FOR_STABLE
 
 2006-02-08 [colin]     2.0.0cvs33
 
index c016c8264d3acf96a75f826c635d4f63a315b6de..bba6f3cd8569905ccffdf898c5a90563c5f24738 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.395.2.166 -r 1.395.2.167 src/summaryview.c;  ) > 2.0.0cvs33.patchset
 ( cvs diff -u -r 1.382.2.238 -r 1.382.2.239 src/compose.c;  cvs diff -u -r 1.49.2.70 -r 1.49.2.71 src/procmime.c;  cvs diff -u -r 1.17.2.13 -r 1.17.2.14 src/procmime.h;  ) > 2.0.0cvs34.patchset
 ( cvs diff -u -r 1.60.2.12 -r 1.60.2.13 src/filtering.c;  cvs diff -u -r 1.75.2.15 -r 1.75.2.16 src/matcher.c;  cvs diff -u -r 1.39.2.6 -r 1.39.2.7 src/matcher.h;  cvs diff -u -r 1.25.2.12 -r 1.25.2.13 src/matcher_parser_parse.y;  cvs diff -u -r 1.1.4.24 -r 1.1.4.25 src/prefs_filtering_action.c;  cvs diff -u -r 1.43.2.34 -r 1.43.2.35 src/prefs_matcher.c;  ) > 2.0.0cvs35.patchset
+( cvs diff -u -r 1.204.2.74 -r 1.204.2.75 src/prefs_common.c;  cvs diff -u -r 1.9.2.22 -r 1.9.2.23 src/common/defs.h;  cvs diff -u -r 1.13.2.15 -r 1.13.2.16 src/common/plugin.c;  ) > 2.0.0cvs36.patchset
index 3e3b57ec6ee60c368151067a35c4efa71d01799a..21629aefa0ba0b54bb7a7f524ed12cced86ac406 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=0
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=35
+EXTRA_VERSION=36
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index dac842bb6c1931e04e2791feed0746c84a504cdf..0de58cbdea209ad3c0ca765ea5fbaffa2425f90a 100644 (file)
@@ -60,9 +60,7 @@
 #define FILTERING_RC           "filteringrc"
 #define MATCHER_RC             "matcherrc"
 #define MENU_RC                        "menurc"
-#define ACTIONS_RC             "actionsrc"
 #define RENDERER_RC            "rendererrc"
-#define COMMAND_HISTORY                "command_history"
 #define QUICKSEARCH_HISTORY    "quicksearch_history"
 #define TEMPLATE_DIR           "templates"
 #define TMP_DIR                        "tmp"
 #define MARK_VERSION           2
 
 #ifdef G_OS_WIN32
+#  define ACTIONS_RC           "actionswinrc"
+#  define COMMAND_HISTORY      "command_history_win"
 #  define DEFAULT_SIGNATURE    "signature.txt"
 #else
+#  define ACTIONS_RC           "actionsrc"
+#  define COMMAND_HISTORY      "command_history"
 #  define DEFAULT_SIGNATURE    ".signature"
 #endif
+
 #define DEFAULT_INC_PATH       "/usr/bin/mh/inc"
 #define DEFAULT_INC_PROGRAM    "inc"
 /* #define DEFAULT_INC_PATH    "/usr/bin/imget" */
index 70e340ceed4e519a241945f89df58e8e8ef60cc5..cdc920642ba03f33e32dd1dcf8916e550217e0eb 100644 (file)
@@ -73,7 +73,11 @@ void plugin_save_list(void)
 
        for (type_cur = plugin_types; type_cur != NULL; type_cur = g_slist_next(type_cur)) {
                rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMON_RC, NULL);
+#ifdef G_OS_WIN32
+               block = g_strconcat("PluginsWin32_", type_cur->data, NULL);
+#else
                block = g_strconcat("Plugins_", type_cur->data, NULL);
+#endif
                if ((pfile = prefs_write_open(rcpath)) == NULL ||
                    (prefs_set_block_label(pfile, block) < 0)) {
                        g_warning("failed to write plugin list\n");
@@ -302,7 +306,11 @@ void plugin_load_all(const gchar *type)
        plugin_types = g_slist_append(plugin_types, g_strdup(type));
 
        rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMON_RC, NULL); 
+#ifdef G_OS_WIN32
+       block = g_strconcat("PluginsWin32_", type, NULL);
+#else
        block = g_strconcat("Plugins_", type, NULL);
+#endif
        if ((pfile = prefs_read_open(rcpath)) == NULL ||
            (prefs_set_block_label(pfile, block) < 0)) {
                g_free(rcpath);
index 39ba419e4d026fcd9b527f6363ad25862b06f8ec..b2c8a9ab9ea46d4b2a9af1921d517697d7228bd2 100644 (file)
@@ -69,6 +69,68 @@ PrefsCommon prefs_common;
 
 GtkWidget *notebook;
 
+#ifdef G_OS_WIN32
+/*
+ * In the Windows version prefs_common contains
+ *   - the non-OS-specific settings of the "Common" section and
+ *   - the OS-specific settings of the "CommonWin32" section
+ * The OS-specific settings of the "Common" section are not used
+ * but saved in prefs_unix.
+ */
+
+#  define SPECIFIC_PREFS prefs_unix
+
+static PrefsCommon prefs_unix;
+
+static PrefParam param_os_specific[] = {
+       /* Receive */
+       {"ext_inc_path", "",
+        &prefs_common.extinc_cmd, P_STRING, NULL, NULL, NULL},
+       {"newmail_notify_cmd", "",
+        &prefs_common.newmail_notify_cmd, P_STRING, NULL, NULL, NULL},
+
+       /* new fonts */
+       {"widget_font_gtk2",    NULL,
+         &prefs_common.widgetfont,             P_STRING, NULL, NULL, NULL},
+       {"message_font_gtk2",   "Monospace 9",
+        &prefs_common.textfont,                P_STRING, NULL, NULL, NULL},
+       {"small_font_gtk2",     "Sans 9",
+         &prefs_common.smallfont,              P_STRING, NULL, NULL, NULL},
+       {"normal_font_gtk2",    "Sans 9",
+         &prefs_common.normalfont,             P_STRING, NULL, NULL, NULL},
+
+       /* Message */
+       {"attach_save_directory", NULL,
+        &prefs_common.attach_save_dir, P_STRING, NULL, NULL, NULL},
+       {"attach_load_directory", NULL,
+        &prefs_common.attach_load_dir, P_STRING, NULL, NULL, NULL},
+
+       /* MIME viewer */
+       {"mime_image_viewer", NULL,
+        &prefs_common.mime_image_viewer, P_STRING, NULL, NULL, NULL},
+       {"mime_audio_player", NULL,
+        &prefs_common.mime_audio_player, P_STRING, NULL, NULL, NULL},
+       {"mime_open_command", "notepad '%s'",
+        &prefs_common.mime_open_cmd, P_STRING, NULL, NULL, NULL},
+
+       /* Interface */
+       {"pixmap_theme_path", DEFAULT_PIXMAP_THEME, 
+        &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},
+
+       {NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
+};
+#else
+#  define SPECIFIC_PREFS prefs_common
+#endif
+
 /*
    parameter name, default value, pointer to the prefs variable, data type,
    pointer to the widget pointer,
@@ -80,7 +142,7 @@ static PrefParam param[] = {
        /* Receive */
        {"use_ext_inc", "FALSE", &prefs_common.use_extinc, P_BOOL,
         NULL, NULL, NULL},
-       {"ext_inc_path", DEFAULT_INC_PATH, &prefs_common.extinc_cmd, P_STRING,
+       {"ext_inc_path", DEFAULT_INC_PATH, &SPECIFIC_PREFS.extinc_cmd, P_STRING,
         NULL, NULL, NULL},
 
        {"autochk_newmail", "FALSE", &prefs_common.autochk_newmail, P_BOOL,
@@ -97,7 +159,7 @@ static PrefParam param[] = {
         P_BOOL, NULL, NULL, NULL},
        {"newmail_notify_auto", "FALSE", &prefs_common.newmail_notify_auto,
        P_BOOL, NULL, NULL, NULL},
-       {"newmail_notify_cmd", "", &prefs_common.newmail_notify_cmd, P_STRING,
+       {"newmail_notify_cmd", "", &SPECIFIC_PREFS.newmail_notify_cmd, P_STRING,
         NULL, NULL, NULL},
        {"receive_dialog_mode", "1", &prefs_common.recv_dialog_mode, P_ENUM,
         NULL, NULL, NULL},
@@ -212,13 +274,13 @@ static PrefParam param[] = {
 
        /* new fonts */
        {"widget_font_gtk2",    NULL,
-         &prefs_common.widgetfont,             P_STRING, NULL, NULL, NULL},
+         &SPECIFIC_PREFS.widgetfont,           P_STRING, NULL, NULL, NULL},
        {"message_font_gtk2",   "Monospace 9",
-        &prefs_common.textfont,                P_STRING, NULL, NULL, NULL},
+        &SPECIFIC_PREFS.textfont,                      P_STRING, NULL, NULL, NULL},
        {"small_font_gtk2",     "Sans 9",
-         &prefs_common.smallfont,              P_STRING, NULL, NULL, NULL},
+         &SPECIFIC_PREFS.smallfont,            P_STRING, NULL, NULL, NULL},
        {"normal_font_gtk2",    "Sans 9",
-         &prefs_common.normalfont,             P_STRING, NULL, NULL, NULL},
+         &SPECIFIC_PREFS.normalfont,           P_STRING, NULL, NULL, NULL},
 
        /* image viewer */
        {"display_image", "TRUE", &prefs_common.display_img, P_BOOL,
@@ -461,17 +523,17 @@ static PrefParam param[] = {
        {"attach_desc", "TRUE", &prefs_common.attach_desc, P_BOOL,
         NULL, NULL, NULL},
        {"attach_save_directory", NULL,
-        &prefs_common.attach_save_dir, P_STRING, NULL, NULL, NULL},
+        &SPECIFIC_PREFS.attach_save_dir, P_STRING, NULL, NULL, NULL},
        {"attach_load_directory", NULL,
-        &prefs_common.attach_load_dir, P_STRING, NULL, NULL, NULL},
+        &SPECIFIC_PREFS.attach_load_dir, P_STRING, NULL, NULL, NULL},
 
        /* MIME viewer */
        {"mime_image_viewer", DEFAULT_IMAGE_VIEWER_CMD,
-        &prefs_common.mime_image_viewer, P_STRING, NULL, NULL, NULL},
+        &SPECIFIC_PREFS.mime_image_viewer,     P_STRING, NULL, NULL, NULL},
        {"mime_audio_player", DEFAULT_AUDIO_PLAYER_CMD,
-        &prefs_common.mime_audio_player, P_STRING, NULL, NULL, NULL},
+        &SPECIFIC_PREFS.mime_audio_player, P_STRING, NULL, NULL, NULL},
        {"mime_open_command", "gedit '%s'",
-        &prefs_common.mime_open_cmd, P_STRING, NULL, NULL, NULL},
+        &SPECIFIC_PREFS.mime_open_cmd, P_STRING, NULL, NULL, NULL},
 
        /* Interface */
        {"separate_folder", "FALSE", &prefs_common.sep_folder, P_BOOL,
@@ -498,7 +560,7 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
 
        {"pixmap_theme_path", DEFAULT_PIXMAP_THEME, 
-        &prefs_common.pixmap_theme_path, P_STRING,
+        &SPECIFIC_PREFS.pixmap_theme_path, P_STRING,
         NULL, NULL, NULL},
 
        {"ask_mark_all_read", "TRUE", &prefs_common.ask_mark_all_read, P_BOOL,
@@ -506,11 +568,11 @@ static PrefParam param[] = {
 
        /* Other */
        {"uri_open_command", DEFAULT_BROWSER_CMD,
-        &prefs_common.uri_cmd, P_STRING, NULL, NULL, NULL},
-       {"print_command", "lpr %s", &prefs_common.print_cmd, P_STRING,
-        NULL, NULL, NULL},
+        &SPECIFIC_PREFS.uri_cmd, P_STRING, NULL, NULL, NULL},
+       {"print_command", "lpr %s",
+        &SPECIFIC_PREFS.print_cmd, P_STRING, NULL, NULL, NULL},
        {"ext_editor_command", DEFAULT_EDITOR_CMD,
-        &prefs_common.ext_editor_cmd, P_STRING, NULL, NULL, NULL},
+        &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},
@@ -684,6 +746,10 @@ void prefs_common_read_config(void)
 
        rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMON_RC, NULL);
        prefs_read_config(param, "Common", rcpath, NULL);
+#ifdef G_OS_WIN32
+       prefs_read_config(param_os_specific, "CommonWin32", rcpath, NULL);
+#endif
+
        g_free(rcpath);
 
        prefs_common.quotefmt = gettext(prefs_common.quotefmt);
@@ -725,6 +791,9 @@ void prefs_common_save_history(const gchar *history, GList *list)
 void prefs_common_write_config(void)
 {
        prefs_write_config(param, "Common", COMMON_RC);
+#ifdef G_OS_WIN32
+       prefs_write_config(param_os_specific, "CommonWin32", COMMON_RC);
+#endif
 
        prefs_common_save_history(COMMAND_HISTORY, 
                prefs_common.mime_open_cmd_history);