From d23fb65eb699f2d9bca3a81b2e78adab4ade911d Mon Sep 17 00:00:00 2001 From: Jens Granseuer Date: Sun, 29 Jul 2007 18:20:31 +0000 Subject: [PATCH] only create the custom theme entry when changes are made, and delete it 2007-07-29 Jens Granseuer * data/appearance.glade: * appearance-themes.c: (theme_custom_cb): * theme-save.c: (save_dialog_response): only create the custom theme entry when changes are made, and delete it when the theme is saved. These changes obsolete the requirement for a modal details window. svn path=/trunk/; revision=7928 --- capplets/appearance/ChangeLog | 8 ++++++++ capplets/appearance/appearance-themes.c | 4 ---- capplets/appearance/data/appearance.glade | 1 - capplets/appearance/theme-save.c | 8 +++++++- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/capplets/appearance/ChangeLog b/capplets/appearance/ChangeLog index da151c71b..77b1d07af 100644 --- a/capplets/appearance/ChangeLog +++ b/capplets/appearance/ChangeLog @@ -1,3 +1,11 @@ +2007-07-29 Jens Granseuer + + * data/appearance.glade: + * appearance-themes.c: (theme_custom_cb): + * theme-save.c: (save_dialog_response): only create the custom theme + entry when changes are made, and delete it when the theme is saved. + These changes obsolete the requirement for a modal details window. + 2007-07-29 Denis Washington * appearance.h: diff --git a/capplets/appearance/appearance-themes.c b/capplets/appearance/appearance-themes.c index 9aa6b3611..0e6faa443 100644 --- a/capplets/appearance/appearance-themes.c +++ b/capplets/appearance/appearance-themes.c @@ -507,10 +507,6 @@ theme_custom_cb (GtkWidget *button, AppearanceData *data) { GtkWidget *w, *parent; - /* select the "custom" metatheme */ - w = glade_xml_get_widget (data->xml, "theme_list"); - theme_set_custom_from_theme (theme_get_selected (GTK_ICON_VIEW (w), data), data); - w = glade_xml_get_widget (data->xml, "theme_details"); parent = glade_xml_get_widget (data->xml, "appearance_window"); gtk_window_set_transient_for (GTK_WINDOW (w), GTK_WINDOW (parent)); diff --git a/capplets/appearance/data/appearance.glade b/capplets/appearance/data/appearance.glade index ef9b71b20..8635c4ab1 100644 --- a/capplets/appearance/data/appearance.glade +++ b/capplets/appearance/data/appearance.glade @@ -1833,7 +1833,6 @@ Text only Customize Theme GTK_WIN_POS_CENTER_ON_PARENT GDK_WINDOW_TYPE_HINT_DIALOG - True False diff --git a/capplets/appearance/theme-save.c b/capplets/appearance/theme-save.c index c282ad2d6..57f5e5374 100644 --- a/capplets/appearance/theme-save.c +++ b/capplets/appearance/theme-save.c @@ -318,7 +318,13 @@ save_dialog_response (GtkWidget *save_dialog, save_background = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON ( glade_xml_get_widget (data->xml, "save_background_checkbutton"))); - save_theme_to_disk (theme_info, theme_name, theme_description, save_background, &error); + if (save_theme_to_disk (theme_info, theme_name, theme_description, save_background, &error)) { + /* remove the custom theme */ + GtkTreeIter iter; + + if (theme_find_in_model (GTK_TREE_MODEL (data->theme_store), "__custom__", &iter)) + gtk_list_store_remove (data->theme_store, &iter); + } g_free (theme_name); g_free (theme_description);