[nautilus] toolbar: move updating of navigation actions in NautilusWindow
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] toolbar: move updating of navigation actions in NautilusWindow
- Date: Sun, 25 Jan 2015 15:23:00 +0000 (UTC)
commit dea4e468e1f6bd2b3c5eacb82797d2769431e045
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Sun Jan 25 13:16:04 2015 +0000
toolbar: move updating of navigation actions in NautilusWindow
src/nautilus-toolbar.c | 19 -------------------
src/nautilus-toolbar.h | 1 -
src/nautilus-window.c | 10 +++++++++-
3 files changed, 9 insertions(+), 21 deletions(-)
---
diff --git a/src/nautilus-toolbar.c b/src/nautilus-toolbar.c
index b8ff2ea..789f196 100644
--- a/src/nautilus-toolbar.c
+++ b/src/nautilus-toolbar.c
@@ -128,25 +128,6 @@ activate_forward_menu_item_callback (GtkMenuItem *menu_item, NautilusWindow *win
activate_back_or_forward_menu_item (menu_item, window, FALSE);
}
-void
-nautilus_toolbar_sync_navigation_buttons (NautilusToolbar *self)
-{
- NautilusWindowSlot *active_slot;
- GAction *action;
- gboolean enabled;
-
- /* Check if the back and forward buttons need enabling or disabling. */
- active_slot = nautilus_window_get_active_slot (self->priv->window);
-
- action = g_action_map_lookup_action (G_ACTION_MAP (self->priv->window), "back");
- enabled = nautilus_window_slot_get_back_history (active_slot) != NULL;
- g_simple_action_set_enabled (G_SIMPLE_ACTION (action), enabled);
-
- action = g_action_map_lookup_action (G_ACTION_MAP (self->priv->window), "forward");
- enabled = nautilus_window_slot_get_forward_history (active_slot) != NULL;
- g_simple_action_set_enabled (G_SIMPLE_ACTION (action), enabled);
-}
-
static void
fill_menu (NautilusWindow *window,
GtkWidget *menu,
diff --git a/src/nautilus-toolbar.h b/src/nautilus-toolbar.h
index cea8042..23d4d75 100644
--- a/src/nautilus-toolbar.h
+++ b/src/nautilus-toolbar.h
@@ -77,7 +77,6 @@ void nautilus_toolbar_action_menu_add_item (NautilusToolbar *self,
const gchar *section_name);
void nautilus_toolbar_reset_menus (NautilusToolbar *self);
-void nautilus_toolbar_sync_navigation_buttons (NautilusToolbar *self);
void nautilus_toolbar_view_menu_widget_set_zoom_level (NautilusToolbar *self,
gdouble level);
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index d252b64..fc3e8b1 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -1336,6 +1336,8 @@ nautilus_window_sync_location_widgets (NautilusWindow *window)
{
NautilusWindowSlot *slot;
GFile *location;
+ GAction *action;
+ gboolean enabled;
slot = window->details->active_slot;
location = nautilus_window_slot_get_location (slot);
@@ -1352,7 +1354,13 @@ nautilus_window_sync_location_widgets (NautilusWindow *window)
nautilus_path_bar_set_path (NAUTILUS_PATH_BAR (path_bar), location);
}
- nautilus_toolbar_sync_navigation_buttons (NAUTILUS_TOOLBAR (window->details->toolbar));
+ action = g_action_map_lookup_action (G_ACTION_MAP (window), "back");
+ enabled = nautilus_window_slot_get_back_history (slot) != NULL;
+ g_simple_action_set_enabled (G_SIMPLE_ACTION (action), enabled);
+
+ action = g_action_map_lookup_action (G_ACTION_MAP (window), "forward");
+ enabled = nautilus_window_slot_get_forward_history (slot) != NULL;
+ g_simple_action_set_enabled (G_SIMPLE_ACTION (action), enabled);
nautilus_window_sync_bookmarks (window);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]