summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolger Berndt <berndth@gmx.de>2009-06-25 02:02:09 +0200
committerAlexander Larsson <alexl@redhat.com>2009-12-10 18:08:17 +0100
commit8bafe8109f2151ee1febfc4a00255b92053c2ef8 (patch)
treedff349336dd0b76511d9fa077a96c1de68700d54
parentee3c49268205cd6fd99694706a4b2b7e3aca8086 (diff)
downloadnautilus-8bafe8109f2151ee1febfc4a00255b92053c2ef8.tar.gz
Fix View -> Location Bar in dual pane mode.
Although each pane has a separate location bar, the show/hide location bar setting is window-global instead of applying to individual panes: Either both panes have a location bar, or neither one does. Inconsistencies with remembered show/hide location bar gconf setting were also fixed.
-rw-r--r--src/nautilus-navigation-window-menus.c24
-rw-r--r--src/nautilus-navigation-window.c13
2 files changed, 31 insertions, 6 deletions
diff --git a/src/nautilus-navigation-window-menus.c b/src/nautilus-navigation-window-menus.c
index 07f6ada17..2926fddef 100644
--- a/src/nautilus-navigation-window-menus.c
+++ b/src/nautilus-navigation-window-menus.c
@@ -204,6 +204,18 @@ action_show_hide_sidebar_callback (GtkAction *action,
}
static void
+pane_show_hide_location_bar (NautilusNavigationWindowPane *pane, gboolean is_active)
+{
+ if (nautilus_navigation_window_pane_location_bar_showing (pane) != is_active) {
+ if (is_active) {
+ nautilus_navigation_window_pane_show_location_bar (pane, TRUE);
+ } else {
+ nautilus_navigation_window_pane_hide_location_bar (pane, TRUE);
+ }
+ }
+}
+
+static void
action_show_hide_location_bar_callback (GtkAction *action,
gpointer user_data)
{
@@ -214,13 +226,13 @@ action_show_hide_location_bar_callback (GtkAction *action,
window = NAUTILUS_WINDOW (user_data);
is_active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
+
+ /* Do the active pane first, because this will trigger an update of the menu items,
+ * which in turn relies on the active pane. */
+ pane_show_hide_location_bar (NAUTILUS_NAVIGATION_WINDOW_PANE (window->details->active_pane), is_active);
+
for (walk = window->details->panes; walk; walk = walk->next) {
- NautilusNavigationWindowPane *pane = walk->data;
- if (is_active) {
- nautilus_navigation_window_pane_show_location_bar (pane, TRUE);
- } else {
- nautilus_navigation_window_pane_hide_location_bar (pane, TRUE);
- }
+ pane_show_hide_location_bar (NAUTILUS_NAVIGATION_WINDOW_PANE (walk->data), is_active);
}
}
diff --git a/src/nautilus-navigation-window.c b/src/nautilus-navigation-window.c
index 3e7c0cd19..e9f147f94 100644
--- a/src/nautilus-navigation-window.c
+++ b/src/nautilus-navigation-window.c
@@ -1254,6 +1254,19 @@ split_view_added_to_container_callback (GtkContainer *container,
GtkWidget *widget,
gpointer user_data)
{
+ NautilusNavigationWindowPane *pane;
+ GtkAction *action;
+
+ /* now that view is ready, show the location bar if the active pane has one, too */
+ pane = NAUTILUS_NAVIGATION_WINDOW_PANE (user_data);
+ action = gtk_action_group_get_action (NAUTILUS_NAVIGATION_WINDOW (NAUTILUS_WINDOW_PANE (pane)->window)->details->navigation_action_group,
+ NAUTILUS_ACTION_SHOW_HIDE_LOCATION_BAR);
+ if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action))) {
+ nautilus_navigation_window_pane_show_location_bar (pane, TRUE);
+ } else {
+ nautilus_navigation_window_pane_hide_location_bar (pane, TRUE);
+ }
+
/* list view doesn't focus automatically */
if (FM_IS_LIST_VIEW (widget)) {
GtkWidget *focus_widget;