From 016dabda522095dae837c488f56ea22871477039 Mon Sep 17 00:00:00 2001 From: Denis Washington Date: Wed, 25 Jul 2007 17:37:00 +0000 Subject: [PATCH] Implement saving of the cursor theme name in metathemes, and add a 2007-07-25 Denis Washington * appearance-style.c: (prepare_list): * appearance-themes.c: (theme_load_from_gconf): * theme-save.c: (write_theme_to_disk): Implement saving of the cursor theme name in metathemes, and add a "Default Pointer" option to the cursor theme list in Theme Details. svn path=/trunk/; revision=7885 --- capplets/appearance/ChangeLog | 8 ++++++++ capplets/appearance/appearance-style.c | 9 +++++++++ capplets/appearance/appearance-themes.c | 9 +++++++++ capplets/appearance/theme-save.c | 9 +++++++++ 4 files changed, 35 insertions(+) diff --git a/capplets/appearance/ChangeLog b/capplets/appearance/ChangeLog index 661cf8d50..4455c442b 100644 --- a/capplets/appearance/ChangeLog +++ b/capplets/appearance/ChangeLog @@ -1,3 +1,11 @@ +2007-07-25 Denis Washington + + * appearance-style.c: (prepare_list): + * appearance-themes.c: (theme_load_from_gconf): + * theme-save.c: (write_theme_to_disk): + Implement saving of the cursor theme name in metathemes, and add a + "Default Pointer" option to the cursor theme list in Theme Details. + 2007-07-24 Jens Granseuer * appearance-themes.c: (theme_load_from_gconf): when reading current diff --git a/capplets/appearance/appearance-style.c b/capplets/appearance/appearance-style.c index b2315d579..7161780fb 100644 --- a/capplets/appearance/appearance-style.c +++ b/capplets/appearance/appearance-style.c @@ -803,6 +803,15 @@ prepare_list (AppearanceData *data, GtkWidget *list, ThemeType type, GCallback c } g_list_free (themes); + if (type == THEME_TYPE_CURSOR) { + GtkTreeIter i; + gtk_list_store_insert_with_values (store, &i, 0, + COL_LABEL, _("Default Pointer"), + COL_NAME, "default", + COL_THUMBNAIL, NULL, + -1); + } + sort_model = gtk_tree_model_sort_new_with_model (GTK_TREE_MODEL (store)); gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (sort_model), COL_LABEL, GTK_SORT_ASCENDING); diff --git a/capplets/appearance/appearance-themes.c b/capplets/appearance/appearance-themes.c index c783cbe45..bfb2384b9 100644 --- a/capplets/appearance/appearance-themes.c +++ b/capplets/appearance/appearance-themes.c @@ -137,6 +137,11 @@ theme_load_from_gconf (GConfClient *client, GnomeThemeMetaInfo *theme) g_free (theme->icon_theme_name); theme->icon_theme_name = gconf_client_get_string (client, ICON_THEME_KEY, NULL); + + g_free (theme->cursor_theme_name); + theme->cursor_theme_name = gconf_client_get_string (client, CURSOR_THEME_KEY, NULL); + + theme->cursor_size = gconf_client_get_int (client, CURSOR_SIZE_KEY, NULL); } static gchar * @@ -223,6 +228,10 @@ theme_is_equal (const GnomeThemeMetaInfo *a, const GnomeThemeMetaInfo *b) strcmp (a->metacity_theme_name, b->metacity_theme_name)) return FALSE; + if (!(a->cursor_theme_name && b->cursor_theme_name) || + strcmp (a->cursor_theme_name, b->cursor_theme_name)) + return FALSE; + return TRUE; } diff --git a/capplets/appearance/theme-save.c b/capplets/appearance/theme-save.c index 2845c78f4..29ce914d4 100644 --- a/capplets/appearance/theme-save.c +++ b/capplets/appearance/theme-save.c @@ -230,6 +230,15 @@ write_theme_to_disk (GnomeThemeMetaInfo *theme_info, g_free (tmp); } + if (theme_info->cursor_theme_name) { + str = g_strdup_printf ("CursorTheme=%s\n" + "CursorSize=%i\n", + theme_info->cursor_theme_name, + theme_info->cursor_size); + gnome_vfs_write (handle, str, strlen (str), &bytes_written); + g_free (str); + } + if (save_background) { client = gconf_client_get_default (); current_background = gconf_client_get_string (client, BACKGROUND_KEY, NULL);