summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndy Hertzfeld <andy@src.gnome.org>2001-01-19 08:57:32 +0000
committerAndy Hertzfeld <andy@src.gnome.org>2001-01-19 08:57:32 +0000
commit18eb8bf36dc8180ea859793b8a46dc716a84ce23 (patch)
tree9c5b5ea1bd9ecd5ce8e131fd75933fca4dd1dd18 /src
parent6f2fbce3b6dc4bedba0bc0665f7194095ccf37be (diff)
downloadnautilus-18eb8bf36dc8180ea859793b8a46dc716a84ce23.tar.gz
more clean-up and fixes for the default theme change
more clean-up and fixes for the default theme change * icons/ardmore/ardmore.xml: * icons/arlo/arlo.xml: * icons/default.xml: * icons/eazel/eazel.xml: * icons/gnome/gnome.xml: * icons/vector/vector.xml: * icons/villanova/villanova.xml: at Arlo's request, capitalized the theme names and also made them localizable, and tweaks to some of the theme files to fix problems caused by the new default * src/nautilus-sidebar-tabs.c: (nautilus_sidebar_tabs_load_theme_data): added a way to specify the non-pixmap tabs, since it uses pixmap ones in the default now * src/nautilus-theme-selector.c: (get_theme_description_and_display_name), (add_theme): made it use a localizable name in the xml file instead of the actual folder name. * src/nautilus-window-toolbars.c: (get_file_name_from_icon_name): added a way to get the stock gnome toolbar icons, now that we have our own in the default theme * nautilus.spec.in: added the throbber component to our package
Diffstat (limited to 'src')
-rw-r--r--src/nautilus-sidebar-tabs.c15
-rw-r--r--src/nautilus-theme-selector.c23
-rw-r--r--src/nautilus-window-toolbars.c6
3 files changed, 33 insertions, 11 deletions
diff --git a/src/nautilus-sidebar-tabs.c b/src/nautilus-sidebar-tabs.c
index e7ede3496..9f4432d45 100644
--- a/src/nautilus-sidebar-tabs.c
+++ b/src/nautilus-sidebar-tabs.c
@@ -36,6 +36,7 @@
#include <libnautilus-extensions/nautilus-gtk-extensions.h>
#include <libnautilus-extensions/nautilus-gtk-macros.h>
#include <libnautilus-extensions/nautilus-scalable-font.h>
+#include <libnautilus-extensions/nautilus-string.h>
#include <libnautilus-extensions/nautilus-theme.h>
#include <math.h>
#include <stdio.h>
@@ -181,11 +182,17 @@ nautilus_sidebar_tabs_load_theme_data (NautilusSidebarTabs *sidebar_tabs)
/* load the tab_pieces image if necessary */
tab_pieces = nautilus_theme_get_theme_data ("sidebar", "TAB_PIECE_IMAGES");
tab_piece_theme = nautilus_theme_get_theme_data ("sidebar", "TAB_PIECE_THEME");
+
if (tab_pieces) {
- if (tab_piece_theme) {
- tab_piece_path = nautilus_theme_get_image_path_from_theme (tab_pieces, tab_piece_theme);
- } else {
- tab_piece_path = nautilus_theme_get_image_path (tab_pieces);
+ /* check for "none" to force non-bitmap tabs, necessary since the default has bitmap ones now */
+ if (nautilus_strcmp (tab_pieces, "none") == 0) {
+ tab_piece_path = NULL;
+ } else {
+ if (tab_piece_theme) {
+ tab_piece_path = nautilus_theme_get_image_path_from_theme (tab_pieces, tab_piece_theme);
+ } else {
+ tab_piece_path = nautilus_theme_get_image_path (tab_pieces);
+ }
}
g_free (tab_pieces);
g_free (tab_piece_theme);
diff --git a/src/nautilus-theme-selector.c b/src/nautilus-theme-selector.c
index d352ba410..5755054db 100644
--- a/src/nautilus-theme-selector.c
+++ b/src/nautilus-theme-selector.c
@@ -676,13 +676,16 @@ has_image_file (const char *path_uri, const char *dir_name, const char *image_fi
/* derive the theme description from the theme name by reading its xml file */
static char*
-make_theme_description (const char *theme_name, const char *theme_path_uri)
+get_theme_description_and_display_name (const char *theme_name, const char *theme_path_uri, char** theme_display_name)
{
char *theme_file_name, *theme_path, *theme_local_path;
char *description_result, *temp_str;
xmlDocPtr theme_document;
description_result = NULL;
+ if (theme_display_name) {
+ *theme_display_name = NULL;
+ }
theme_file_name = g_strdup_printf ("%s.xml", theme_name);
theme_local_path = gnome_vfs_get_local_path_from_uri (theme_path_uri);
@@ -699,6 +702,12 @@ make_theme_description (const char *theme_name, const char *theme_path_uri)
description_result = g_strdup (temp_str);
xmlFree (temp_str);
+ if (theme_display_name) {
+ temp_str = nautilus_xml_get_property_translated (xmlDocGetRootElement (theme_document), "name");
+ *theme_display_name = g_strdup (temp_str);
+ xmlFree (temp_str);
+ }
+
xmlFreeDoc (theme_document);
}
@@ -708,7 +717,7 @@ make_theme_description (const char *theme_name, const char *theme_path_uri)
g_free (theme_file_name);
if (description_result)
return description_result;
- return g_strdup_printf (_("No description available for the \"%s\" theme"), theme_name);
+ return g_strdup_printf (_("No description available for the \"%s\" theme"), *theme_display_name == NULL ? theme_name : *theme_display_name);
}
@@ -795,12 +804,12 @@ add_theme (NautilusThemeSelector *theme_selector, const char *theme_path_uri, co
pix_widget = GTK_WIDGET (gtk_pixmap_new (pixmap, mask));
gtk_widget_show (pix_widget);
- /* install it in the list view */
-
-
+ /* install it in the list view */
clist_entry[0] = NULL;
- clist_entry[1] = g_strdup (theme_name);
- clist_entry[2] = make_theme_description (theme_name, theme_path_uri);
+ clist_entry[2] = get_theme_description_and_display_name (theme_name, theme_path_uri, &clist_entry[1]);
+ if (clist_entry[1] == NULL) {
+ clist_entry[1] = g_strdup (theme_name);
+ }
gtk_clist_append (GTK_CLIST(theme_selector->details->theme_list), clist_entry);
diff --git a/src/nautilus-window-toolbars.c b/src/nautilus-window-toolbars.c
index b603deda7..a38f8261a 100644
--- a/src/nautilus-window-toolbars.c
+++ b/src/nautilus-window-toolbars.c
@@ -183,6 +183,12 @@ get_file_name_from_icon_name (const char *icon_name)
/* look in the theme to see if there's a redirection found */
icon_theme = nautilus_theme_get_theme_data ("toolbar", "ICON_THEME");
if (icon_theme != NULL) {
+ /* special case the "standard" theme which indicates using the stock gnome icons */
+ if (nautilus_strcmp (icon_theme, "standard") == 0) {
+ g_free (icon_theme);
+ return NULL;
+ }
+
theme_path_name = g_strdup_printf ("%s/%s.png", icon_theme, icon_name);
full_path_name = nautilus_pixmap_file (theme_path_name);
g_free (theme_path_name);