summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nautilus-window-manage-views.c34
-rw-r--r--src/nautilus-window-manage-views.h1
-rw-r--r--src/nautilus-window-pane.c2
-rw-r--r--src/nautilus-window-private.h1
-rw-r--r--src/nautilus-window.c29
5 files changed, 33 insertions, 34 deletions
diff --git a/src/nautilus-window-manage-views.c b/src/nautilus-window-manage-views.c
index bded52ad2..b5bebca71 100644
--- a/src/nautilus-window-manage-views.c
+++ b/src/nautilus-window-manage-views.c
@@ -257,35 +257,6 @@ handle_go_elsewhere (NautilusWindowSlot *slot,
}
}
-void
-nautilus_window_update_up_button (NautilusWindow *window)
-{
- GtkAction *action;
- GtkActionGroup *action_group;
- NautilusWindowSlot *slot;
- gboolean allowed;
- GFile *parent;
-
- slot = nautilus_window_get_active_slot (window);
-
- allowed = FALSE;
- if (slot->location != NULL) {
- parent = g_file_get_parent (slot->location);
- allowed = parent != NULL;
-
- g_clear_object (&parent);
- }
-
- action_group = nautilus_window_get_main_action_group (window);
-
- action = gtk_action_group_get_action (action_group,
- NAUTILUS_ACTION_UP);
- gtk_action_set_sensitive (action, allowed);
- action = gtk_action_group_get_action (action_group,
- NAUTILUS_ACTION_UP_ACCEL);
- gtk_action_set_sensitive (action, allowed);
-}
-
static void
viewed_file_changed_callback (NautilusFile *file,
NautilusWindowSlot *slot)
@@ -1419,9 +1390,8 @@ update_for_new_location (NautilusWindowSlot *slot)
nautilus_file_unref (file);
if (slot == nautilus_window_get_active_slot (window)) {
- /* Check if we can go up. */
- nautilus_window_update_up_button (window);
-
+ /* Sync up and zoom action states */
+ nautilus_window_sync_up_button (window);
nautilus_window_sync_zoom_widgets (window);
/* Set up the content view menu for this new location. */
diff --git a/src/nautilus-window-manage-views.h b/src/nautilus-window-manage-views.h
index 17734aa3f..4cb9c027c 100644
--- a/src/nautilus-window-manage-views.h
+++ b/src/nautilus-window-manage-views.h
@@ -36,6 +36,5 @@ void nautilus_window_manage_views_close_slot (NautilusWindowPane *pane,
/* NautilusWindowInfo implementation: */
void nautilus_window_report_location_change (NautilusWindow *window);
-void nautilus_window_update_up_button (NautilusWindow *window);
#endif /* NAUTILUS_WINDOW_MANAGE_VIEWS_H */
diff --git a/src/nautilus-window-pane.c b/src/nautilus-window-pane.c
index d735782ec..7a3a0b225 100644
--- a/src/nautilus-window-pane.c
+++ b/src/nautilus-window-pane.c
@@ -921,7 +921,7 @@ nautilus_window_pane_sync_location_widgets (NautilusWindowPane *pane)
/* Update window global UI if this is the active pane */
if (pane == nautilus_window_get_active_pane (pane->window)) {
- nautilus_window_update_up_button (pane->window);
+ nautilus_window_sync_up_button (pane->window);
/* Check if the back and forward buttons need enabling or disabling. */
active_slot = nautilus_window_get_active_slot (pane->window);
diff --git a/src/nautilus-window-private.h b/src/nautilus-window-private.h
index 2be8c8cff..1cdd96a01 100644
--- a/src/nautilus-window-private.h
+++ b/src/nautilus-window-private.h
@@ -150,6 +150,7 @@ void nautilus_window_sync_allow_stop (NautilusWindow *window,
void nautilus_window_sync_title (NautilusWindow *window,
NautilusWindowSlot *slot);
void nautilus_window_sync_zoom_widgets (NautilusWindow *window);
+void nautilus_window_sync_up_button (NautilusWindow *window);
/* window menus */
GtkActionGroup *nautilus_window_create_toolbar_action_group (NautilusWindow *window);
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index eb8431e7c..9c0edcd11 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -1383,6 +1383,35 @@ nautilus_window_load_view_as_menus (NautilusWindow *window)
}
void
+nautilus_window_sync_up_button (NautilusWindow *window)
+{
+ GtkAction *action;
+ GtkActionGroup *action_group;
+ NautilusWindowSlot *slot;
+ gboolean allowed;
+ GFile *parent;
+
+ slot = nautilus_window_get_active_slot (window);
+
+ allowed = FALSE;
+ if (slot->location != NULL) {
+ parent = g_file_get_parent (slot->location);
+ allowed = parent != NULL;
+
+ g_clear_object (&parent);
+ }
+
+ action_group = nautilus_window_get_main_action_group (window);
+
+ action = gtk_action_group_get_action (action_group,
+ NAUTILUS_ACTION_UP);
+ gtk_action_set_sensitive (action, allowed);
+ action = gtk_action_group_get_action (action_group,
+ NAUTILUS_ACTION_UP_ACCEL);
+ gtk_action_set_sensitive (action, allowed);
+}
+
+void
nautilus_window_sync_title (NautilusWindow *window,
NautilusWindowSlot *slot)
{