mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-09-17 23:01:59 +00:00
Don't shortcut the title change when the bookmark name changes. Fixes
2006-02-27 Alexander Larsson <alexl@redhat.com> * src/nautilus-navigation-window.c: * src/nautilus-spatial-window.c: * src/nautilus-window.[ch]: Don't shortcut the title change when the bookmark name changes. Fixes #331383 Patch from Christian Neumair.
This commit is contained in:
parent
69facef412
commit
1dd6a21d79
|
@ -1,3 +1,12 @@
|
|||
2006-02-27 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* src/nautilus-navigation-window.c:
|
||||
* src/nautilus-spatial-window.c:
|
||||
* src/nautilus-window.[ch]:
|
||||
Don't shortcut the title change when the bookmark name changes.
|
||||
Fixes #331383
|
||||
Patch from Christian Neumair.
|
||||
|
||||
2006-02-26 Zbigniew Chyla <mail@zbigniew.chyla.pl>
|
||||
|
||||
Get users' and groups' names via a cache to avoid calling
|
||||
|
|
|
@ -810,21 +810,26 @@ real_load_view_as_menu (NautilusWindow *window)
|
|||
load_view_as_menu (window);
|
||||
}
|
||||
|
||||
static void
|
||||
static gboolean
|
||||
real_set_title (NautilusWindow *window, const char *title)
|
||||
{
|
||||
char *full_title;
|
||||
char *window_title;
|
||||
gboolean changed;
|
||||
|
||||
EEL_CALL_PARENT (NAUTILUS_WINDOW_CLASS,
|
||||
set_title, (window, title));
|
||||
changed = EEL_CALL_PARENT_WITH_RETURN_VALUE
|
||||
(NAUTILUS_WINDOW_CLASS, set_title, (window, title));
|
||||
|
||||
full_title = g_strdup_printf (_("%s - File Browser"), title);
|
||||
if (changed) {
|
||||
full_title = g_strdup_printf (_("%s - File Browser"), title);
|
||||
|
||||
window_title = eel_str_middle_truncate (full_title, MAX_TITLE_LENGTH);
|
||||
gtk_window_set_title (GTK_WINDOW (window), window_title);
|
||||
g_free (window_title);
|
||||
g_free (full_title);
|
||||
window_title = eel_str_middle_truncate (full_title, MAX_TITLE_LENGTH);
|
||||
gtk_window_set_title (GTK_WINDOW (window), window_title);
|
||||
g_free (window_title);
|
||||
g_free (full_title);
|
||||
}
|
||||
|
||||
return changed;
|
||||
}
|
||||
|
||||
static char *
|
||||
|
|
|
@ -394,22 +394,25 @@ real_get_icon_name (NautilusWindow *window)
|
|||
return nautilus_icon_factory_get_icon_for_file (window->details->viewed_file, FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
static gboolean
|
||||
real_set_title (NautilusWindow *window, const char *title)
|
||||
{
|
||||
gboolean changed;
|
||||
|
||||
EEL_CALL_PARENT (NAUTILUS_WINDOW_CLASS,
|
||||
set_title, (window, title));
|
||||
changed = EEL_CALL_PARENT_WITH_RETURN_VALUE
|
||||
(NAUTILUS_WINDOW_CLASS, set_title, (window, title));
|
||||
|
||||
if (title[0] == '\0') {
|
||||
if (changed && title[0] == '\0') {
|
||||
gtk_window_set_title (GTK_WINDOW (window), _("Nautilus"));
|
||||
} else {
|
||||
} else if (changed) {
|
||||
char *window_title;
|
||||
|
||||
window_title = eel_str_middle_truncate (title, MAX_TITLE_LENGTH);
|
||||
gtk_window_set_title (GTK_WINDOW (window), window_title);
|
||||
g_free (window_title);
|
||||
}
|
||||
|
||||
return changed;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -1095,25 +1095,38 @@ nautilus_window_get_title (NautilusWindow *window)
|
|||
get_title, (window));
|
||||
}
|
||||
|
||||
static void
|
||||
static gboolean
|
||||
real_set_title (NautilusWindow *window,
|
||||
const char *title)
|
||||
{
|
||||
gboolean changed;
|
||||
char *copy;
|
||||
|
||||
g_free (window->details->title);
|
||||
window->details->title = g_strdup (title);
|
||||
changed = FALSE;
|
||||
|
||||
if (eel_strcmp (title, window->details->title) != 0) {
|
||||
changed = TRUE;
|
||||
|
||||
g_free (window->details->title);
|
||||
window->details->title = g_strdup (title);
|
||||
}
|
||||
|
||||
if (eel_strlen (window->details->title) > 0 && window->current_location_bookmark &&
|
||||
nautilus_bookmark_set_name (window->current_location_bookmark, window->details->title)) {
|
||||
changed = TRUE;
|
||||
|
||||
/* Name of item in history list changed, tell listeners. */
|
||||
nautilus_send_history_list_changed ();
|
||||
}
|
||||
|
||||
copy = g_strdup (window->details->title);
|
||||
g_signal_emit_by_name (window, "title_changed",
|
||||
copy);
|
||||
g_free (copy);
|
||||
if (changed) {
|
||||
copy = g_strdup (window->details->title);
|
||||
g_signal_emit_by_name (window, "title_changed",
|
||||
copy);
|
||||
g_free (copy);
|
||||
}
|
||||
|
||||
return changed;
|
||||
}
|
||||
|
||||
/* Sets window->details->title, and the actual GtkWindow title which
|
||||
|
@ -1124,11 +1137,6 @@ nautilus_window_set_title (NautilusWindow *window,
|
|||
{
|
||||
g_return_if_fail (NAUTILUS_IS_WINDOW (window));
|
||||
|
||||
if (window->details->title != NULL
|
||||
&& strcmp (title, window->details->title) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
EEL_CALL_METHOD (NAUTILUS_WINDOW_CLASS, window,
|
||||
set_title, (window, title));
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ typedef struct {
|
|||
void (* add_current_location_to_history_list) (NautilusWindow *window);
|
||||
|
||||
char * (* get_title) (NautilusWindow *window);
|
||||
void (* set_title) (NautilusWindow *window, const char *title);
|
||||
gboolean (* set_title) (NautilusWindow *window, const char *title);
|
||||
char * (* get_icon_name) (NautilusWindow *window);
|
||||
|
||||
void (* load_view_as_menu) (NautilusWindow *window);
|
||||
|
|
Loading…
Reference in a new issue