diff options
author | Alexander Larsson <alexl@redhat.com> | 2004-01-07 19:02:14 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2004-01-07 19:02:14 +0000 |
commit | b728ba9241cce17b03b0b6491ebc039562c31728 (patch) | |
tree | 2e1a6bcacdc9160eaef296a53e70f1d4a23e678c /src/nautilus-window.c | |
parent | d7adb0e5370768841677c5427159393bd2ab9a44 (diff) | |
download | nautilus-b728ba9241cce17b03b0b6491ebc039562c31728.tar.gz |
New funciton
2004-01-07 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-file-utilities.[ch]:
(nautilus_get_vfs_method_display_name): New funciton
* src/nautilus-window.c:
Use nautilus_get_vfs_method_display_name to set
the title
* libnautilus-private/nautilus-icon-container.c:
Remove tab icon navigation. Makes normal keynav work.
* src/nautilus-shell-ui.xml:
* src/nautilus-spatial-window.[ch]:
* src/nautilus-window-manage-views.c:
Add location button menu to spatial windows.
Diffstat (limited to 'src/nautilus-window.c')
-rw-r--r-- | src/nautilus-window.c | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/src/nautilus-window.c b/src/nautilus-window.c index 61f482e8c..9f491465a 100644 --- a/src/nautilus-window.c +++ b/src/nautilus-window.c @@ -32,6 +32,7 @@ #include "nautilus-application.h" #include "nautilus-bookmarks-window.h" +#include "nautilus-file-utilities.h" #include "nautilus-information-panel.h" #include "nautilus-main.h" #include "nautilus-signaller.h" @@ -1160,28 +1161,42 @@ nautilus_window_display_error (NautilusWindow *window, const char *error_msg) gtk_widget_show (dialog); } +static gboolean +is_method_root (char *uri) +{ + while (*uri != 0) { + if (*uri == ':') { + break; + } + if (!g_ascii_isalpha (*uri)) { + return FALSE; + } + uri++; + } + return (strcmp (uri, "://") == 0 || + strcmp (uri, ":///") == 0); +} + static char * compute_default_title (const char *text_uri) { NautilusFile *file; char *title; char *canonical_uri; + char *colon; canonical_uri = eel_make_uri_canonical (text_uri); + title = NULL; if (canonical_uri == NULL) { title = g_strdup (""); - } else if (strcmp (canonical_uri, "computer:///") == 0 ) { - title = g_strdup (_("Computer")); - } else if (strcmp (canonical_uri, "network:///") == 0 ) { - title = g_strdup (_("Network")); - } else if (strcmp (canonical_uri, "fonts:///") == 0 ) { - title = g_strdup (_("Fonts")); - } else if (strcmp (canonical_uri, "themes:///") == 0 ) { - title = g_strdup (_("Themes")); - } else if (strcmp (canonical_uri, "burn:///") == 0 ) { - title = g_strdup (_("CD Creator")); - } else { + } else if (is_method_root (canonical_uri)) { + colon = strchr (canonical_uri, ':'); + g_assert (colon != NULL); + *colon = 0; + title = g_strdup (nautilus_get_vfs_method_display_name (canonical_uri)); + } + if (title == NULL) { file = nautilus_file_get (text_uri); title = nautilus_file_get_display_name (file); nautilus_file_unref (file); |