diff options
author | Andy Hertzfeld <andy@src.gnome.org> | 2000-06-26 08:37:44 +0000 |
---|---|---|
committer | Andy Hertzfeld <andy@src.gnome.org> | 2000-06-26 08:37:44 +0000 |
commit | a59d6685a634b7adad43af864399f6d4f547be24 (patch) | |
tree | 7fa5ddca796620ea7bf91240a14b3fa29864d237 /libnautilus-extensions | |
parent | 173c750acb572249eebdd0eacd84642732de99c3 (diff) | |
download | nautilus-a59d6685a634b7adad43af864399f6d4f547be24.tar.gz |
implemented an xml-based general theme mechanism, and used it for the
implemented an xml-based general theme mechanism, and used it
for the sidebar backgrounds, which isn't quite working yet. Added
xml files to our themes.
Diffstat (limited to 'libnautilus-extensions')
7 files changed, 35 insertions, 13 deletions
diff --git a/libnautilus-extensions/nautilus-global-preferences.c b/libnautilus-extensions/nautilus-global-preferences.c index b24017b49..7f2d86bbd 100644 --- a/libnautilus-extensions/nautilus-global-preferences.c +++ b/libnautilus-extensions/nautilus-global-preferences.c @@ -200,8 +200,8 @@ global_preferences_create_dialog (void) nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (appearance_pane), 1, - NAUTILUS_PREFERENCES_ICON_THEME, - NAUTILUS_PREFERENCE_ITEM_ICON_THEME); + NAUTILUS_PREFERENCES_THEME, + NAUTILUS_PREFERENCE_ITEM_THEME); nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (appearance_pane), "Fonts"); nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (appearance_pane), @@ -543,7 +543,7 @@ global_preferences_register_for_ui (void) FALSE, FALSE); - global_preferences_register_string_with_defaults (NAUTILUS_PREFERENCES_ICON_THEME, + global_preferences_register_string_with_defaults (NAUTILUS_PREFERENCES_THEME, "theme for file icons: ", "default", "default", diff --git a/libnautilus-extensions/nautilus-global-preferences.h b/libnautilus-extensions/nautilus-global-preferences.h index ec793a2c6..43a385057 100644 --- a/libnautilus-extensions/nautilus-global-preferences.h +++ b/libnautilus-extensions/nautilus-global-preferences.h @@ -64,7 +64,7 @@ BEGIN_GNOME_DECLS /* themes */ #define NAUTILUS_PREFERENCES_TOOLBAR_ICON_THEME "preferences/toolbar_icon_theme" -#define NAUTILUS_PREFERENCES_ICON_THEME "preferences/icon_theme" +#define NAUTILUS_PREFERENCES_THEME "preferences/theme" /* File Indexing */ #define NAUTILUS_PREFERENCES_SEARCH_METHOD "preferences/also_do_slow_search" diff --git a/libnautilus-extensions/nautilus-icon-factory.c b/libnautilus-extensions/nautilus-icon-factory.c index 5b6402162..a5e9be6fc 100644 --- a/libnautilus-extensions/nautilus-icon-factory.c +++ b/libnautilus-extensions/nautilus-icon-factory.c @@ -240,14 +240,14 @@ nautilus_get_current_icon_factory (void) if (global_icon_factory == NULL) { char *theme_preference; - theme_preference = nautilus_preferences_get (NAUTILUS_PREFERENCES_ICON_THEME, + theme_preference = nautilus_preferences_get (NAUTILUS_PREFERENCES_THEME, DEFAULT_ICON_THEME); g_assert (theme_preference != NULL); global_icon_factory = nautilus_icon_factory_new (theme_preference); g_free (theme_preference); - nautilus_preferences_add_callback (NAUTILUS_PREFERENCES_ICON_THEME, + nautilus_preferences_add_callback (NAUTILUS_PREFERENCES_THEME, icon_theme_changed_callback, NULL); @@ -343,7 +343,7 @@ nautilus_icon_factory_clear (void) static void nautilus_icon_factory_destroy (NautilusIconFactory *factory) { - nautilus_preferences_remove_callback (NAUTILUS_PREFERENCES_ICON_THEME, + nautilus_preferences_remove_callback (NAUTILUS_PREFERENCES_THEME, icon_theme_changed_callback, NULL); @@ -721,7 +721,7 @@ icon_theme_changed_callback (gpointer user_data) { char *theme_preference; - theme_preference = nautilus_preferences_get (NAUTILUS_PREFERENCES_ICON_THEME, + theme_preference = nautilus_preferences_get (NAUTILUS_PREFERENCES_THEME, DEFAULT_ICON_THEME); g_assert (theme_preference != NULL); diff --git a/libnautilus-extensions/nautilus-preferences-item.c b/libnautilus-extensions/nautilus-preferences-item.c index d7b9c3511..f48c247d4 100644 --- a/libnautilus-extensions/nautilus-preferences-item.c +++ b/libnautilus-extensions/nautilus-preferences-item.c @@ -88,7 +88,7 @@ static void preferences_item_create_editable_string (NautilusPreferencesItem const NautilusPreference *prefrence); static void preferences_item_create_font_family (NautilusPreferencesItem *item, const NautilusPreference *prefrence); -static void preferences_item_create_icon_theme (NautilusPreferencesItem *item, +static void preferences_item_create_theme (NautilusPreferencesItem *item, const NautilusPreference *preference); static void preferences_item_create_toolbar_icon_theme (NautilusPreferencesItem *item, const NautilusPreference *preference); @@ -279,8 +279,8 @@ preferences_item_construct (NautilusPreferencesItem *item, preferences_item_create_font_family (item, preference); break; - case NAUTILUS_PREFERENCE_ITEM_ICON_THEME: - preferences_item_create_icon_theme (item, preference); + case NAUTILUS_PREFERENCE_ITEM_THEME: + preferences_item_create_theme (item, preference); break; case NAUTILUS_PREFERENCE_ITEM_EDITABLE_STRING: preferences_item_create_editable_string (item, preference); @@ -532,7 +532,7 @@ add_icon_themes(NautilusStringList *theme_list, char *required_file) } static void -preferences_item_create_icon_theme (NautilusPreferencesItem *item, +preferences_item_create_theme (NautilusPreferencesItem *item, const NautilusPreference *preference) { char *description; diff --git a/libnautilus-extensions/nautilus-preferences-item.h b/libnautilus-extensions/nautilus-preferences-item.h index 3a8f3a556..24b68a741 100644 --- a/libnautilus-extensions/nautilus-preferences-item.h +++ b/libnautilus-extensions/nautilus-preferences-item.h @@ -67,7 +67,7 @@ typedef enum NAUTILUS_PREFERENCE_ITEM_BOOLEAN, NAUTILUS_PREFERENCE_ITEM_ENUM, NAUTILUS_PREFERENCE_ITEM_FONT_FAMILY, - NAUTILUS_PREFERENCE_ITEM_ICON_THEME, + NAUTILUS_PREFERENCE_ITEM_THEME, NAUTILUS_PREFERENCE_ITEM_EDITABLE_STRING, NAUTILUS_PREFERENCE_ITEM_TOOLBAR_ICON_THEME } NautilusPreferencesItemType; diff --git a/libnautilus-extensions/nautilus-xml-extensions.c b/libnautilus-extensions/nautilus-xml-extensions.c index ebc59a70e..830d00555 100644 --- a/libnautilus-extensions/nautilus-xml-extensions.c +++ b/libnautilus-extensions/nautilus-xml-extensions.c @@ -71,6 +71,26 @@ nautilus_xml_get_child_by_name_and_property (xmlNodePtr parent, return NULL; } +/* return a child of the passed-in node with a matching name */ + +xmlNodePtr +nautilus_xml_get_child_by_name (xmlNodePtr parent, + const char *child_name) +{ + xmlNodePtr child; + + if (parent == NULL) { + return NULL; + } + for (child = nautilus_xml_get_children (parent); child != NULL; child = child->next) { + if (strcmp (child->name, child_name) == 0) { + return child; + } + } + return NULL; +} + + xmlNodePtr nautilus_xml_get_root_child_by_name_and_property (xmlDocPtr document, const char *child_name, diff --git a/libnautilus-extensions/nautilus-xml-extensions.h b/libnautilus-extensions/nautilus-xml-extensions.h index af0a312ae..be9fb7629 100644 --- a/libnautilus-extensions/nautilus-xml-extensions.h +++ b/libnautilus-extensions/nautilus-xml-extensions.h @@ -30,6 +30,8 @@ xmlNodePtr nautilus_xml_get_children (xmlNodePtr parent); xmlNodePtr nautilus_xml_get_root_children (xmlDocPtr document); +xmlNodePtr nautilus_xml_get_child_by_name (xmlNodePtr parent, + const char *child_name); xmlNodePtr nautilus_xml_get_child_by_name_and_property (xmlNodePtr parent, const char *child_name, const char *property_name, |