[nautilus] Fix tab menus in split view mode. Only the menu of the active pane is inserted.



commit 7191f6fa4f3013481463c1181b51b705d5c48d9a
Author: Holger Berndt <berndth gmx de>
Date:   Thu Jun 11 21:37:27 2009 +0200

    Fix tab menus in split view mode. Only the menu of the active pane is inserted.

 src/nautilus-navigation-window-menus.c |    5 +++++
 src/nautilus-navigation-window-pane.c  |    5 +++++
 src/nautilus-navigation-window.c       |    2 --
 src/nautilus-window.c                  |    4 ++--
 4 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/src/nautilus-navigation-window-menus.c b/src/nautilus-navigation-window-menus.c
index 78cad26..50b1a04 100644
--- a/src/nautilus-navigation-window-menus.c
+++ b/src/nautilus-navigation-window-menus.c
@@ -565,6 +565,11 @@ reload_tab_menu (NautilusNavigationWindowPane *pane)
 		pane->tabs_menu_action_group = NULL;
 	}
 
+	/* Don't add anything if not active */
+	if (!NAUTILUS_WINDOW_PANE (pane)->is_active) {
+		return;
+	}
+
 	/* Add new tab menu items */
 	pane->tabs_menu_merge_id = gtk_ui_manager_new_merge_id (ui_manager);
 	pane->tabs_menu_action_group = gtk_action_group_new ("TabsMenuGroup");
diff --git a/src/nautilus-navigation-window-pane.c b/src/nautilus-navigation-window-pane.c
index 36f8de9..306c601 100644
--- a/src/nautilus-navigation-window-pane.c
+++ b/src/nautilus-navigation-window-pane.c
@@ -67,6 +67,11 @@ nautilus_navigation_window_pane_set_active (NautilusNavigationWindowPane *pane,
 
 	/* navigation bar (manual entry) */
 	nautilus_location_bar_set_active (NAUTILUS_LOCATION_BAR (pane->navigation_bar), is_active);
+
+	/* if actions/menus exist, update those as well */
+	if (NAUTILUS_NAVIGATION_WINDOW (NAUTILUS_WINDOW_PANE (pane)->window)->details->navigation_action_group) {
+		nautilus_navigation_window_pane_initialize_tabs_menu(pane);
+	}
 }
 
 static gboolean
diff --git a/src/nautilus-navigation-window.c b/src/nautilus-navigation-window.c
index d9c77bd..19afbf0 100644
--- a/src/nautilus-navigation-window.c
+++ b/src/nautilus-navigation-window.c
@@ -1291,8 +1291,6 @@ nautilus_navigation_window_split_view_on (NautilusNavigationWindow *window)
 	slot = nautilus_window_open_slot (NAUTILUS_WINDOW_PANE (pane),
 					  NAUTILUS_WINDOW_OPEN_SLOT_APPEND);
 
-	nautilus_navigation_window_pane_initialize_tabs_menu (pane);
-
 	nautilus_window_set_active_slot (win, slot);
 
 	location = nautilus_window_slot_get_location (old_active_slot);
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index d29c89c..ed5311f 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -773,14 +773,14 @@ real_set_active_pane (NautilusWindow *window, NautilusWindowPane *new_pane)
 	/* make old pane inactive, and new one active.
 	 * Currently active pane may be NULL (after init). */
 	if (NAUTILUS_IS_NAVIGATION_WINDOW (window)) {
-		if (new_pane->window->details->active_pane) {
+		if (new_pane->window->details->active_pane && new_pane->window->details->active_pane != new_pane) {
 			nautilus_navigation_window_pane_set_active
 				(NAUTILUS_NAVIGATION_WINDOW_PANE (new_pane->window->details->active_pane), FALSE);
 		}
 		nautilus_navigation_window_pane_set_active (NAUTILUS_NAVIGATION_WINDOW_PANE (new_pane), TRUE);
 	}
 	else {
-		if (new_pane->window->details->active_pane) {
+		if (new_pane->window->details->active_pane && new_pane->window->details->active_pane != new_pane) {
 			nautilus_window_pane_set_active (new_pane->window->details->active_pane, FALSE);
 		}
 		nautilus_window_pane_set_active (new_pane, TRUE);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]