3
Option to show the full location in the title bar
4
Index: nautilus-2.20.0/libnautilus-private/apps_nautilus_preferences.schemas.in
5
===================================================================
6
--- nautilus-2.20.0.orig/libnautilus-private/apps_nautilus_preferences.schemas.in 2007-09-18 08:51:48.000000000 +0200
7
+++ nautilus-2.20.0/libnautilus-private/apps_nautilus_preferences.schemas.in 2007-09-24 11:39:14.871645609 +0200
13
+ <key>/schemas/apps/nautilus/preferences/location_in_title_bar</key>
14
+ <applyto>/apps/nautilus/preferences/location_in_title_bar</applyto>
15
+ <owner>nautilus</owner>
17
+ <default>false</default>
19
+ <short>Show current location in title bar</short>
21
+ If set to true, windows will have the full location displayed
22
+ in their title bar. Otherwise it will only show the folder name.
28
<key>/schemas/apps/nautilus/preferences/start_with_sidebar</key>
29
<applyto>/apps/nautilus/preferences/start_with_sidebar</applyto>
30
Index: nautilus-2.20.0/libnautilus-private/nautilus-global-preferences.c
31
===================================================================
32
--- nautilus-2.20.0.orig/libnautilus-private/nautilus-global-preferences.c 2007-06-27 09:12:34.000000000 +0200
33
+++ nautilus-2.20.0/libnautilus-private/nautilus-global-preferences.c 2007-09-24 11:39:14.875645837 +0200
36
GINT_TO_POINTER (TRUE)
38
+ { NAUTILUS_PREFERENCES_LOCATION_IN_TITLE_BAR,
40
+ GINT_TO_POINTER (TRUE)
42
{ NAUTILUS_PREFERENCES_START_WITH_SIDEBAR,
44
GINT_TO_POINTER (TRUE)
45
Index: nautilus-2.20.0/libnautilus-private/nautilus-global-preferences.h
46
===================================================================
47
--- nautilus-2.20.0.orig/libnautilus-private/nautilus-global-preferences.h 2007-06-27 09:12:34.000000000 +0200
48
+++ nautilus-2.20.0/libnautilus-private/nautilus-global-preferences.h 2007-09-24 11:39:14.875645837 +0200
50
#define NAUTILUS_PREFERENCES_START_WITH_LOCATION_BAR "preferences/start_with_location_bar"
51
#define NAUTILUS_PREFERENCES_ALWAYS_USE_LOCATION_ENTRY "preferences/always_use_location_entry"
52
#define NAUTILUS_PREFERENCES_START_WITH_STATUS_BAR "preferences/start_with_status_bar"
53
+#define NAUTILUS_PREFERENCES_LOCATION_IN_TITLE_BAR "preferences/location_in_title_bar"
54
#define NAUTILUS_PREFERENCES_START_WITH_SIDEBAR "preferences/start_with_sidebar"
55
#define NAUTILUS_PREFERENCES_START_WITH_TOOLBAR "preferences/start_with_toolbar"
56
#define NAUTILUS_PREFERENCES_SIDE_PANE_VIEW "preferences/side_pane_view"
57
Index: nautilus-2.20.0/src/nautilus-navigation-window.c
58
===================================================================
59
--- nautilus-2.20.0.orig/src/nautilus-navigation-window.c 2007-09-03 16:49:27.000000000 +0200
60
+++ nautilus-2.20.0/src/nautilus-navigation-window.c 2007-09-24 11:39:14.875645837 +0200
63
real_set_title (NautilusWindow *window, const char *title)
69
changed = EEL_CALL_PARENT_WITH_RETURN_VALUE
70
(NAUTILUS_WINDOW_CLASS, set_title, (window, title));
73
- full_title = g_strdup_printf (_("%s - File Browser"), title);
76
+ char *location_titlebar;
78
+ location_titlebar = nautilus_window_set_location_in_titlebar (window, title);
80
+ full_title = g_strdup_printf (_("%s - File Browser"), location_titlebar);
82
window_title = eel_str_middle_truncate (full_title, MAX_TITLE_LENGTH);
83
gtk_window_set_title (GTK_WINDOW (window), window_title);
84
g_free (window_title);
86
+ g_free (location_titlebar);
90
Index: nautilus-2.20.0/src/nautilus-spatial-window.c
91
===================================================================
92
--- nautilus-2.20.0.orig/src/nautilus-spatial-window.c 2007-09-10 08:56:43.000000000 +0200
93
+++ nautilus-2.20.0/src/nautilus-spatial-window.c 2007-09-24 11:39:14.875645837 +0200
95
gtk_window_set_title (GTK_WINDOW (window), _("Nautilus"));
98
+ char *location_titlebar;
100
- window_title = eel_str_middle_truncate (title, MAX_TITLE_LENGTH);
101
+ location_titlebar = nautilus_window_set_location_in_titlebar (window, title);
103
+ window_title = eel_str_middle_truncate (location_titlebar, MAX_TITLE_LENGTH);
104
gtk_window_set_title (GTK_WINDOW (window), window_title);
105
g_free (window_title);
106
+ g_free (location_titlebar);
110
--- nautilus-2.22.0/src/nautilus-window.c.old 2008-03-17 10:49:47.000000000 +0100
111
+++ nautilus-2.22.0/src/nautilus-window.c 2008-03-17 11:11:29.000000000 +0100
112
@@ -1709,3 +1709,71 @@
114
return (nautilus_window_get_window_type (window) != NAUTILUS_WINDOW_DESKTOP);
118
+nautilus_window_set_location_in_titlebar (NautilusWindow *window, const char *title)
120
+ char *location_title;
122
+ char *location = NULL;
124
+ const char *scheme = NULL;
125
+ const char *display_location;
126
+ const char *tmp_location;
127
+ const char *location_prefix;
128
+ int tmp_location_len;
131
+ location_title = g_strdup (title);
133
+ if (eel_preferences_get_boolean (NAUTILUS_PREFERENCES_LOCATION_IN_TITLE_BAR) != TRUE
134
+ || (uri = nautilus_window_get_location (window)) == NULL
135
+ || (location = g_file_get_parse_name (uri)) == NULL
136
+ || location[0] == 0
137
+ || location[1] == 0)
140
+ if ((tmp_location = g_get_home_dir()) == NULL) {
141
+ display_location = location;
142
+ goto construct_title;
145
+ if (strcmp (location, tmp_location) == 0) {
147
+ display_location = "";
148
+ goto construct_title;
151
+ tmp_location_len = strlen (tmp_location);
152
+ if (eel_str_has_prefix (location, tmp_location) == FALSE
153
+ || location[tmp_location_len] != G_DIR_SEPARATOR) {
154
+ display_location = location;
155
+ goto construct_title;
159
+ display_location = location + tmp_location_len;
163
+ g_free (location_title);
166
+ location_prefix = scheme;
167
+ else if(tilde == 1)
168
+ location_prefix = "~";
170
+ location_prefix = "";
172
+ location_title = g_strdup_printf ("%s (%s%s%s)", title, location_prefix, scheme != NULL ? " - " : "", display_location);
176
+ g_object_unref (uri);
178
+ if (location != NULL)
181
+ return (location_title);
184
--- nautilus-2.22.0/src/nautilus-window.h.old 2008-03-17 10:49:50.000000000 +0100
185
+++ nautilus-2.22.0/src/nautilus-window.h 2008-03-17 10:51:45.000000000 +0100
187
void nautilus_window_add_extra_location_widget (NautilusWindow *window,
189
gboolean nautilus_window_has_menubar_and_statusbar (NautilusWindow *window);
190
+char * nautilus_window_set_location_in_titlebar (NautilusWindow *window,
191
+ const char *title);