+2009-01-09 [colin] 3.7.0cvs19
+
+ * src/prefs_themes.c
+ * src/stock_pixmap.c
+ * src/stock_pixmap.h
+ * src/common/utils.c
+ * src/common/utils.h
+ Win32: Fix bug 1813, 'Installing Theme Creates Error'
+
2009-01-08 [colin] 3.7.0cvs18
* src/mimeview.c
( cvs diff -u -r 1.1.2.23 -r 1.1.2.24 src/plugins/pgpcore/select-keys.c; ) > 3.7.0cvs16.patchset
( cvs diff -u -r 1.12.2.25 -r 1.12.2.26 src/html.c; ) > 3.7.0cvs17.patchset
( cvs diff -u -r 1.83.2.151 -r 1.83.2.152 src/mimeview.c; ) > 3.7.0cvs18.patchset
+( cvs diff -u -r 1.3.2.61 -r 1.3.2.62 src/prefs_themes.c; cvs diff -u -r 1.25.2.62 -r 1.25.2.63 src/stock_pixmap.c; cvs diff -u -r 1.18.2.39 -r 1.18.2.40 src/stock_pixmap.h; cvs diff -u -r 1.36.2.160 -r 1.36.2.161 src/common/utils.c; cvs diff -u -r 1.20.2.65 -r 1.20.2.66 src/common/utils.h; ) > 3.7.0cvs19.patchset
MICRO_VERSION=0
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=18
+EXTRA_VERSION=19
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=
#endif
}
+
+#ifdef G_OS_WIN32
+/* Return the default directory for Themes. */
+const gchar *get_themes_dir(void)
+{
+ static gchar *themes_dir = NULL;
+
+ if (!themes_dir)
+ themes_dir = g_strconcat(w32_get_module_dir(),
+ "\\share\\claws-mail\\themes",
+ NULL);
+ return themes_dir;
+}
+#endif
+
const gchar *get_tmp_dir(void)
{
static gchar *tmp_dir = NULL;
gchar *get_tmp_file (void);
const gchar *get_domain_name (void);
#ifdef G_OS_WIN32
-const gchar *get_cert_file(void);
+const gchar *get_themes_dir (void);
+const gchar *get_cert_file (void);
#endif
/* file / directory handling */
off_t get_file_size (const gchar *file);
static gboolean prefs_themes_is_system_theme(const gchar *dirname)
{
gint len;
-
+ gchar *system_theme_dir;
+ gboolean is_sys = FALSE;
+
g_return_val_if_fail(dirname != NULL, FALSE);
- len = strlen(PACKAGE_DATA_DIR);
- if (strlen(dirname) > len && 0 == strncmp(dirname, PACKAGE_DATA_DIR, len))
- return TRUE;
+ system_theme_dir = stock_pixmap_get_system_theme_dir_for_theme(NULL);
+ len = strlen(system_theme_dir);
+ if (strlen(dirname) > len && 0 == strncmp(dirname, system_theme_dir, len))
+ is_sys = TRUE;
- return FALSE;
+ g_free(system_theme_dir);
+
+ return is_sys;
}
static void prefs_themes_set_themes_menu(GtkComboBox *combo, const ThemesData *tdata)
GTK_STOCK_NO, GTK_STOCK_YES, NULL);
switch (val) {
case G_ALERTALTERNATE:
- cinfo->dest = g_strconcat(PACKAGE_DATA_DIR, G_DIR_SEPARATOR_S,
- PIXMAP_THEME_DIR, G_DIR_SEPARATOR_S,
- themename, NULL);
+ cinfo->dest = stock_pixmap_get_system_theme_dir_for_theme(
+ themename);
break;
case G_ALERTDEFAULT:
break;
closedir(dp);
}
+gchar *stock_pixmap_get_system_theme_dir_for_theme(const gchar *theme)
+{
+ const gchar *sep = NULL;
+ if (theme && *theme)
+ sep = G_DIR_SEPARATOR_S;
+#ifndef G_OS_WIN32
+ return g_strconcat(PACKAGE_DATA_DIR, G_DIR_SEPARATOR_S,
+ PIXMAP_THEME_DIR, sep, theme, NULL);
+#else
+ return g_strconcat(get_themes_dir(), sep, theme, NULL);
+#endif
+}
+
GList *stock_pixmap_themes_list_new(void)
{
gchar *defaulttheme;
defaulttheme = g_strdup(DEFAULT_PIXMAP_THEME);
userthemes = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
PIXMAP_THEME_DIR, NULL);
- systemthemes = g_strconcat(PACKAGE_DATA_DIR, G_DIR_SEPARATOR_S,
- PIXMAP_THEME_DIR, NULL);
+ systemthemes = stock_pixmap_get_system_theme_dir_for_theme(NULL);
list = g_list_append(list, defaulttheme);
-
stock_pixmap_find_themes_in_dir(&list, userthemes);
stock_pixmap_find_themes_in_dir(&list, systemthemes);
OverlayPosition pos,
gint border_x,
gint border_y);
+gchar *stock_pixmap_get_system_theme_dir_for_theme(const gchar *theme);
#endif /* __STOCK_PIXMAP_H__ */