[nautilus] all: merge NautilusNavigationWindowPane into NautilusWindowPane



commit 67384aa0d21e90816d5ee084b56bb43b1e94af60
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Thu Feb 17 14:09:37 2011 -0500

    all: merge NautilusNavigationWindowPane into NautilusWindowPane

 src/Makefile.am                        |    2 -
 src/nautilus-location-bar.c            |    1 -
 src/nautilus-location-bar.h            |    1 -
 src/nautilus-navigation-window-menus.c |   20 +-
 src/nautilus-navigation-window-pane.c  |  792 --------------------------------
 src/nautilus-navigation-window-pane.h  |   82 ----
 src/nautilus-navigation-window-slot.c  |    8 +-
 src/nautilus-navigation-window.c       |   46 +-
 src/nautilus-notebook.c                |    3 +-
 src/nautilus-toolbar.h                 |    2 -
 src/nautilus-window-manage-views.c     |    3 +-
 src/nautilus-window-pane.c             |  769 +++++++++++++++++++++++++++++--
 src/nautilus-window-pane.h             |   33 ++-
 src/nautilus-window.c                  |    1 -
 14 files changed, 800 insertions(+), 963 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 757b680..a7e6d55 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -105,8 +105,6 @@ nautilus_SOURCES = \
 	nautilus-navigation-window-menus.c      \
 	nautilus-navigation-window.c            \
 	nautilus-navigation-window.h            \
-	nautilus-navigation-window-pane.c	\
-	nautilus-navigation-window-pane.h	\
 	nautilus-navigation-window-slot.c	\
 	nautilus-navigation-window-slot.h	\
 	nautilus-notebook.c			\
diff --git a/src/nautilus-location-bar.c b/src/nautilus-location-bar.c
index 6f63ff5..cacbf06 100644
--- a/src/nautilus-location-bar.c
+++ b/src/nautilus-location-bar.c
@@ -36,7 +36,6 @@
 #include "nautilus-location-entry.h"
 #include "nautilus-window-private.h"
 #include "nautilus-window.h"
-#include "nautilus-navigation-window-pane.h"
 #include <eel/eel-accessibility.h>
 #include <eel/eel-glib-extensions.h>
 #include <eel/eel-gtk-macros.h>
diff --git a/src/nautilus-location-bar.h b/src/nautilus-location-bar.h
index f70bcce..4e98320 100644
--- a/src/nautilus-location-bar.h
+++ b/src/nautilus-location-bar.h
@@ -31,7 +31,6 @@
 #define NAUTILUS_LOCATION_BAR_H
 
 #include "nautilus-navigation-window.h"
-#include "nautilus-navigation-window-pane.h"
 #include <libnautilus-private/nautilus-entry.h>
 #include <gtk/gtk.h>
 
diff --git a/src/nautilus-navigation-window-menus.c b/src/nautilus-navigation-window-menus.c
index 6fc3e7c..c1b3ddc 100644
--- a/src/nautilus-navigation-window-menus.c
+++ b/src/nautilus-navigation-window-menus.c
@@ -37,7 +37,7 @@
 #include "nautilus-window-manage-views.h"
 #include "nautilus-window-private.h"
 #include "nautilus-window-bookmarks.h"
-#include "nautilus-navigation-window-pane.h"
+#include "nautilus-window-pane.h"
 
 #include <eel/eel-stock-dialogs.h>
 
@@ -476,9 +476,9 @@ static void
 action_tabs_previous_callback (GtkAction *action,
 			       gpointer user_data)
 {
-	NautilusNavigationWindowPane *pane;
+	NautilusWindowPane *pane;
 
-	pane = NAUTILUS_NAVIGATION_WINDOW_PANE (NAUTILUS_WINDOW (user_data)->details->active_pane);
+	pane = NAUTILUS_WINDOW (user_data)->details->active_pane;
 	nautilus_notebook_set_current_page_relative (NAUTILUS_NOTEBOOK (pane->notebook), -1);
 }
 
@@ -486,9 +486,9 @@ static void
 action_tabs_next_callback (GtkAction *action,
 			   gpointer user_data)
 {
-	NautilusNavigationWindowPane *pane;
+	NautilusWindowPane *pane;
 
-	pane = NAUTILUS_NAVIGATION_WINDOW_PANE (NAUTILUS_WINDOW (user_data)->details->active_pane);
+	pane = NAUTILUS_WINDOW (user_data)->details->active_pane;
 	nautilus_notebook_set_current_page_relative (NAUTILUS_NOTEBOOK (pane->notebook), 1);
 }
 
@@ -496,9 +496,9 @@ static void
 action_tabs_move_left_callback (GtkAction *action,
 				gpointer user_data)
 {
-	NautilusNavigationWindowPane *pane;
+	NautilusWindowPane *pane;
 
-	pane = NAUTILUS_NAVIGATION_WINDOW_PANE (NAUTILUS_WINDOW (user_data)->details->active_pane);
+	pane = NAUTILUS_WINDOW (user_data)->details->active_pane;
 	nautilus_notebook_reorder_current_child_relative (NAUTILUS_NOTEBOOK (pane->notebook), -1);
 }
 
@@ -506,9 +506,9 @@ static void
 action_tabs_move_right_callback (GtkAction *action,
 				 gpointer user_data)
 {
-	NautilusNavigationWindowPane *pane;
+	NautilusWindowPane *pane;
 
-	pane = NAUTILUS_NAVIGATION_WINDOW_PANE (NAUTILUS_WINDOW (user_data)->details->active_pane);
+	pane = NAUTILUS_WINDOW (user_data)->details->active_pane;
 	nautilus_notebook_reorder_current_child_relative (NAUTILUS_NOTEBOOK (pane->notebook), 1);
 }
 
@@ -520,7 +520,7 @@ action_tab_change_action_activate_callback (GtkAction *action, gpointer user_dat
 	window = NAUTILUS_WINDOW (user_data);
 	if (window && window->details->active_pane) {
 		GtkNotebook *notebook;
-		notebook = GTK_NOTEBOOK (NAUTILUS_NAVIGATION_WINDOW_PANE (window->details->active_pane)->notebook);
+		notebook = GTK_NOTEBOOK (window->details->active_pane->notebook);
 		if (notebook) {
 			int num;
 			num = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (action), "num"));
diff --git a/src/nautilus-navigation-window-slot.c b/src/nautilus-navigation-window-slot.c
index edd86a8..0eb76e3 100644
--- a/src/nautilus-navigation-window-slot.c
+++ b/src/nautilus-navigation-window-slot.c
@@ -26,7 +26,7 @@
 #include "nautilus-navigation-window-slot.h"
 #include "nautilus-window-private.h"
 #include "nautilus-search-bar.h"
-#include "nautilus-navigation-window-pane.h"
+#include "nautilus-window-pane.h"
 #include <libnautilus-private/nautilus-file.h>
 #include <eel/eel-gtk-macros.h>
 
@@ -143,7 +143,7 @@ nautilus_navigation_window_slot_update_query_editor (NautilusWindowSlot *slot)
 			query_editor = nautilus_query_editor_new_with_bar (FALSE,
 									   nautilus_search_directory_is_indexed (search_directory),
 									   slot->pane->window->details->active_pane->active_slot == slot,
-									   NAUTILUS_SEARCH_BAR (NAUTILUS_NAVIGATION_WINDOW_PANE (slot->pane)->search_bar),
+									   NAUTILUS_SEARCH_BAR (slot->pane->search_bar),
 									   slot);
 		}
 	}
@@ -174,10 +174,10 @@ nautilus_navigation_window_slot_update_query_editor (NautilusWindowSlot *slot)
 static void
 nautilus_navigation_window_slot_active (NautilusWindowSlot *slot)
 {
-	NautilusNavigationWindowPane *pane;
+	NautilusWindowPane *pane;
 	int page_num;
 
-	pane = NAUTILUS_NAVIGATION_WINDOW_PANE (slot->pane);
+	pane = slot->pane;
 	page_num = gtk_notebook_page_num (GTK_NOTEBOOK (pane->notebook),
 					  slot->content_box);
 	g_assert (page_num >= 0);
diff --git a/src/nautilus-navigation-window.c b/src/nautilus-navigation-window.c
index 3ecb63b..ad35081 100644
--- a/src/nautilus-navigation-window.c
+++ b/src/nautilus-navigation-window.c
@@ -42,7 +42,7 @@
 #include "nautilus-places-sidebar.h"
 #include "nautilus-tree-sidebar.h"
 #include "nautilus-window-manage-views.h"
-#include "nautilus-navigation-window-pane.h"
+#include "nautilus-window-pane.h"
 
 #include <eel/eel-gtk-extensions.h>
 #include <eel/eel-gtk-macros.h>
@@ -157,7 +157,7 @@ nautilus_navigation_window_is_in_temporary_bars (GtkWidget *widget,
 {
 	GList *walk;
 	gboolean is_in_any = FALSE;
-	NautilusNavigationWindowPane *pane;
+	NautilusWindowPane *pane;
 
 	for (walk = NAUTILUS_WINDOW (window)->details->panes; walk; walk = walk->next) {
 		pane = walk->data;
@@ -344,7 +344,7 @@ static void
 real_sync_title (NautilusWindow *window,
 		 NautilusWindowSlot *slot)
 {
-	NautilusNavigationWindowPane *pane;
+	NautilusWindowPane *pane;
 	NautilusNotebook *notebook;
 	char *full_title;
 	char *window_title;
@@ -365,7 +365,7 @@ real_sync_title (NautilusWindow *window,
 		g_free (window_title);
 	}
 
-	pane = NAUTILUS_NAVIGATION_WINDOW_PANE (slot->pane);
+	pane = slot->pane;
 	notebook = NAUTILUS_NOTEBOOK (pane->notebook);
 	nautilus_notebook_sync_tab_label (notebook, slot);
 }
@@ -385,19 +385,19 @@ real_sync_allow_stop (NautilusWindow *window,
 {
 	NautilusNotebook *notebook;
 
-	notebook = NAUTILUS_NOTEBOOK (NAUTILUS_NAVIGATION_WINDOW_PANE (slot->pane)->notebook);
+	notebook = NAUTILUS_NOTEBOOK (slot->pane->notebook);
 	nautilus_notebook_sync_loading (notebook, slot);
 }
 
 static void
 real_prompt_for_location (NautilusWindow *window, const char *initial)
 {
-	NautilusNavigationWindowPane *pane;
+	NautilusWindowPane *pane;
 
 	remember_focus_widget (NAUTILUS_NAVIGATION_WINDOW (window));
 
-	pane = NAUTILUS_NAVIGATION_WINDOW_PANE (window->details->active_pane);
-	nautilus_navigation_window_pane_ensure_location_bar (pane);
+	pane = window->details->active_pane;
+	nautilus_window_pane_ensure_location_bar (pane);
 
 	if (initial) {
 		nautilus_location_bar_set_location (NAUTILUS_LOCATION_BAR (pane->location_bar),
@@ -408,21 +408,21 @@ real_prompt_for_location (NautilusWindow *window, const char *initial)
 void 
 nautilus_navigation_window_show_search (NautilusNavigationWindow *window)
 {
-	NautilusNavigationWindowPane *pane;
+	NautilusWindowPane *pane;
 
 	remember_focus_widget (window);
 
-	pane = NAUTILUS_NAVIGATION_WINDOW_PANE (NAUTILUS_WINDOW (window)->details->active_pane);
+	pane = NAUTILUS_WINDOW (window)->details->active_pane;
 
-	nautilus_navigation_window_pane_ensure_search_bar (pane);
+	nautilus_window_pane_ensure_search_bar (pane);
 }
 
 void
 nautilus_navigation_window_hide_search (NautilusNavigationWindow *window)
 {
-	NautilusNavigationWindowPane *pane = NAUTILUS_NAVIGATION_WINDOW_PANE (NAUTILUS_WINDOW (window)->details->active_pane);
+	NautilusWindowPane *pane = NAUTILUS_WINDOW (window)->details->active_pane;
 
-	nautilus_navigation_window_pane_hide_search_bar (pane);
+	nautilus_window_pane_hide_search_bar (pane);
 	nautilus_navigation_window_restore_focus_widget (window);
 }
 
@@ -563,7 +563,7 @@ real_open_slot (NautilusWindowPane *pane,
 	slot = (NautilusWindowSlot *) g_object_new (NAUTILUS_TYPE_NAVIGATION_WINDOW_SLOT, NULL);
 	slot->pane = pane;
 
-	nautilus_navigation_window_pane_add_slot_in_tab (NAUTILUS_NAVIGATION_WINDOW_PANE (pane), slot, flags);
+	nautilus_window_pane_add_slot_in_tab (pane, slot, flags);
 	gtk_widget_show (slot->content_box);
 
 	return slot;
@@ -576,12 +576,12 @@ real_close_slot (NautilusWindowPane *pane,
 	int page_num;
 	GtkNotebook *notebook;
 
-	notebook = GTK_NOTEBOOK (NAUTILUS_NAVIGATION_WINDOW_PANE (pane)->notebook);
+	notebook = GTK_NOTEBOOK (pane->notebook);
 
 	page_num = gtk_notebook_page_num (notebook, slot->content_box);
 	g_assert (page_num >= 0);
 
-	nautilus_navigation_window_pane_remove_page (NAUTILUS_NAVIGATION_WINDOW_PANE (pane), page_num);
+	nautilus_window_pane_remove_page (pane, page_num);
 
 	gtk_notebook_set_show_tabs (notebook,
 				    gtk_notebook_get_n_pages (notebook) > 1);
@@ -736,7 +736,7 @@ static void
 nautilus_navigation_window_init (NautilusNavigationWindow *window)
 {
 	NautilusWindow *win;
-	NautilusNavigationWindowPane *pane;
+	NautilusWindowPane *pane;
 	GtkWidget *hpaned;
 	GtkWidget *vbox;
 
@@ -776,7 +776,7 @@ nautilus_navigation_window_init (NautilusNavigationWindow *window)
 
 	nautilus_navigation_window_initialize_actions (window);
 
-	pane = nautilus_navigation_window_pane_new (win);
+	pane = nautilus_window_pane_new (win);
 	win->details->panes = g_list_prepend (win->details->panes, pane);
 
 	gtk_paned_pack1 (GTK_PANED(hpaned), pane->widget, TRUE, FALSE);
@@ -846,14 +846,14 @@ static NautilusWindowSlot *
 create_extra_pane (NautilusNavigationWindow *window)
 {
 	NautilusWindow *win;
-	NautilusNavigationWindowPane *pane;
+	NautilusWindowPane *pane;
 	NautilusWindowSlot *slot;
 	GtkPaned *paned;
 
 	win = NAUTILUS_WINDOW (window);
 
 	/* New pane */
-	pane = nautilus_navigation_window_pane_new (win);
+	pane = nautilus_window_pane_new (win);
 	win->details->panes = g_list_append (win->details->panes, pane);
 
 	paned = GTK_PANED (window->details->split_view_hpane);
@@ -866,7 +866,7 @@ create_extra_pane (NautilusNavigationWindow *window)
 	/* slot */
 	slot = nautilus_window_open_slot (NAUTILUS_WINDOW_PANE (pane),
 					  NAUTILUS_WINDOW_OPEN_SLOT_APPEND);
-	NAUTILUS_WINDOW_PANE (pane)->active_slot = slot;
+	pane->active_slot = slot;
 
 	return slot;
 }
@@ -877,7 +877,7 @@ navigation_window_set_search_action_text (NautilusNavigationWindow *nav_window,
 {
 	GtkAction *action;
 	NautilusWindow *window;
-	NautilusNavigationWindowPane *pane;
+	NautilusWindowPane *pane;
 	GList *l;
 
 	window = NAUTILUS_WINDOW (nav_window);
@@ -947,7 +947,7 @@ nautilus_navigation_window_split_view_off (NautilusNavigationWindow *window)
 
 	nautilus_window_set_active_pane (win, active_pane);
 	nautilus_navigation_state_set_master (window->details->nav_state,
-					      NAUTILUS_NAVIGATION_WINDOW_PANE (active_pane)->action_group);
+					      active_pane->action_group);
 
 	nautilus_navigation_window_update_show_hide_menu_items (window);
 	nautilus_navigation_window_update_split_view_actions_sensitivity (window);
diff --git a/src/nautilus-notebook.c b/src/nautilus-notebook.c
index 1ac24bc..1951a10 100644
--- a/src/nautilus-notebook.c
+++ b/src/nautilus-notebook.c
@@ -29,7 +29,6 @@
 #include "nautilus-notebook.h"
 
 #include "nautilus-navigation-window.h"
-#include "nautilus-navigation-window-pane.h"
 #include "nautilus-window-manage-views.h"
 #include "nautilus-window-private.h"
 #include "nautilus-window-slot.h"
@@ -120,7 +119,7 @@ find_notebook_at_pointer (gint abs_x, gint abs_y)
 	/* toplevel should be an NautilusWindow */
 	if (toplevel != NULL && NAUTILUS_IS_NAVIGATION_WINDOW (toplevel))
 	{
-		return NAUTILUS_NOTEBOOK (NAUTILUS_NAVIGATION_WINDOW_PANE (NAUTILUS_WINDOW (toplevel)->details->active_pane)->notebook);
+		return NAUTILUS_NOTEBOOK (NAUTILUS_WINDOW (toplevel)->details->active_pane->notebook);
 	}
 
 	return NULL;
diff --git a/src/nautilus-toolbar.h b/src/nautilus-toolbar.h
index 0a0cf25..582fa1f 100644
--- a/src/nautilus-toolbar.h
+++ b/src/nautilus-toolbar.h
@@ -44,8 +44,6 @@ typedef struct _NautilusToolbar NautilusToolbar;
 typedef struct _NautilusToolbarPriv NautilusToolbarPriv;
 typedef struct _NautilusToolbarClass NautilusToolbarClass;
 
-#include "nautilus-navigation-window-pane.h"
-
 typedef enum {
 	NAUTILUS_TOOLBAR_MODE_PATH_BAR,
 	NAUTILUS_TOOLBAR_MODE_LOCATION_BAR,
diff --git a/src/nautilus-window-manage-views.c b/src/nautilus-window-manage-views.c
index 92bdd84..a5444d4 100644
--- a/src/nautilus-window-manage-views.c
+++ b/src/nautilus-window-manage-views.c
@@ -39,7 +39,6 @@
 #include "nautilus-trash-bar.h"
 #include "nautilus-view-factory.h"
 #include "nautilus-x-content-bar.h"
-#include "nautilus-navigation-window-pane.h"
 #include <eel/eel-accessibility.h>
 #include <eel/eel-debug.h>
 #include <eel/eel-gdk-extensions.h>
@@ -359,7 +358,7 @@ viewed_file_changed_callback (NautilusFile *file,
 					/* multiview-TODO also update NautilusWindowSlot
 					 * [which as of writing doesn't save/store any path bar state]
 					 */
-					nautilus_path_bar_clear_buttons (NAUTILUS_PATH_BAR (NAUTILUS_NAVIGATION_WINDOW_PANE (slot->pane)->path_bar));
+					nautilus_path_bar_clear_buttons (NAUTILUS_PATH_BAR (slot->pane->path_bar));
 				}
 				
 				nautilus_window_slot_go_to (slot, go_to_file, FALSE);
diff --git a/src/nautilus-window-pane.c b/src/nautilus-window-pane.c
index 689f7a5..8b48843 100644
--- a/src/nautilus-window-pane.c
+++ b/src/nautilus-window-pane.c
@@ -1,36 +1,46 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
-
-   nautilus-window-pane.c: Nautilus window pane
-
-   Copyright (C) 2008 Free Software Foundation, Inc.
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public
-   License along with this program; if not, write to the
-   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.
-
-   Author: Holger Berndt <berndth gmx de>
-*/
-
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+
+/*
+ * nautilus-window-pane.c: Nautilus window pane
+ *
+ * Copyright (C) 2008 Free Software Foundation, Inc.
+ * Copyright (C) 2011 Red Hat, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Authors: Holger Berndt <berndth gmx de>
+ *          Cosimo Cecchi <cosimoc redhat com>
+ *
+ */
+
+#include "nautilus-clipboard.h"
+#include "nautilus-location-bar.h"
+#include "nautilus-navigation-window-slot.h"
+#include "nautilus-notebook.h"
+#include "nautilus-pathbar.h"
+#include "nautilus-toolbar.h"
+#include "nautilus-window-manage-views.h"
 #include "nautilus-window-pane.h"
 #include "nautilus-window-private.h"
-#include "nautilus-navigation-window-pane.h"
-#include "nautilus-window-manage-views.h"
-#include <eel/eel-gtk-macros.h>
+
+#include <libnautilus-private/nautilus-global-preferences.h>
+#include <libnautilus-private/nautilus-entry.h>
 
 G_DEFINE_TYPE (NautilusWindowPane, nautilus_window_pane,
 	       G_TYPE_OBJECT)
-#define parent_class nautilus_window_pane_parent_class
 
 static inline NautilusWindowSlot *
 get_first_inactive_slot (NautilusWindowPane *pane)
@@ -48,15 +58,563 @@ get_first_inactive_slot (NautilusWindowPane *pane)
 	return NULL;
 }
 
+static int
+bookmark_list_get_uri_index (GList *list, GFile *location)
+{
+	NautilusBookmark *bookmark;
+	GList *l;
+	GFile *tmp;
+	int i;
+
+	g_return_val_if_fail (location != NULL, -1);
+
+	for (i = 0, l = list; l != NULL; i++, l = l->next) {
+		bookmark = NAUTILUS_BOOKMARK (l->data);
+
+		tmp = nautilus_bookmark_get_location (bookmark);
+		if (g_file_equal (location, tmp)) {
+			g_object_unref (tmp);
+			return i;
+		}
+		g_object_unref (tmp);
+	}
+
+	return -1;
+}
+
+static void
+search_bar_activate_callback (NautilusSearchBar *bar,
+			      NautilusWindowPane *pane)
+{
+	char *uri, *current_uri;
+	NautilusDirectory *directory;
+	NautilusSearchDirectory *search_directory;
+	NautilusQuery *query;
+	GFile *location;
+
+	uri = nautilus_search_directory_generate_new_uri ();
+	location = g_file_new_for_uri (uri);
+	g_free (uri);
+
+	directory = nautilus_directory_get (location);
+
+	g_assert (NAUTILUS_IS_SEARCH_DIRECTORY (directory));
+
+	search_directory = NAUTILUS_SEARCH_DIRECTORY (directory);
+
+	query = nautilus_search_bar_get_query (NAUTILUS_SEARCH_BAR (pane->search_bar));
+	if (query != NULL) {
+		NautilusWindowSlot *slot = pane->active_slot;
+		if (!nautilus_search_directory_is_indexed (search_directory)) {
+			current_uri = nautilus_window_slot_get_location_uri (slot);
+			nautilus_query_set_location (query, current_uri);
+			g_free (current_uri);
+		}
+		nautilus_search_directory_set_query (search_directory, query);
+		g_object_unref (query);
+	}
+
+	nautilus_window_slot_go_to (pane->active_slot, location, FALSE);
+
+	nautilus_directory_unref (directory);
+	g_object_unref (location);
+}
+
+static void
+nautilus_window_pane_hide_temporary_bars (NautilusWindowPane *pane)
+{
+	NautilusWindowSlot *slot;
+	NautilusDirectory *directory;
+
+	slot = pane->active_slot;
+
+	if (pane->temporary_navigation_bar) {
+		directory = nautilus_directory_get (slot->location);
+
+		pane->temporary_navigation_bar = FALSE;
+
+		/* if we're in a search directory, hide the main bar, and show the search
+		 * bar again; otherwise, just hide the whole toolbar.
+		 */
+		if (NAUTILUS_IS_SEARCH_DIRECTORY (directory)) {
+			nautilus_toolbar_set_show_main_bar (NAUTILUS_TOOLBAR (pane->tool_bar), FALSE);
+			nautilus_toolbar_set_show_search_bar (NAUTILUS_TOOLBAR (pane->tool_bar), TRUE);
+		} else {
+			gtk_widget_hide (pane->tool_bar);
+		}
+
+		nautilus_directory_unref (directory);
+	}
+}
+
+static void
+search_bar_cancel_callback (GtkWidget *widget,
+			    NautilusWindowPane *pane)
+{
+	nautilus_toolbar_set_show_search_bar (NAUTILUS_TOOLBAR (pane->tool_bar), FALSE);
+
+	nautilus_window_pane_hide_search_bar (pane);
+	nautilus_navigation_window_restore_focus_widget (NAUTILUS_NAVIGATION_WINDOW (pane->window));
+}
+
+static void
+navigation_bar_cancel_callback (GtkWidget *widget,
+				NautilusWindowPane *pane)
+{
+	nautilus_toolbar_set_show_location_entry (NAUTILUS_TOOLBAR (pane->tool_bar), FALSE);
+
+	nautilus_window_pane_hide_temporary_bars (pane);
+	nautilus_navigation_window_restore_focus_widget (NAUTILUS_NAVIGATION_WINDOW (pane->window));
+}
+
+static void
+navigation_bar_location_changed_callback (GtkWidget *widget,
+					  const char *uri,
+					  NautilusWindowPane *pane)
+{
+	GFile *location;
+
+	nautilus_toolbar_set_show_location_entry (NAUTILUS_TOOLBAR (pane->tool_bar), FALSE);
+	nautilus_window_pane_hide_search_bar (pane);
+	nautilus_window_pane_hide_temporary_bars (pane);
+
+	nautilus_navigation_window_restore_focus_widget (NAUTILUS_NAVIGATION_WINDOW (pane->window));
+
+	location = g_file_new_for_uri (uri);
+	nautilus_window_slot_go_to (pane->active_slot, location, FALSE);
+	g_object_unref (location);
+}
+
+static void
+path_bar_location_changed_callback (GtkWidget *widget,
+				    GFile *location,
+				    NautilusWindowPane *pane)
+{
+	NautilusNavigationWindowSlot *slot;
+	int i;
+
+	slot = NAUTILUS_NAVIGATION_WINDOW_SLOT (pane->active_slot);
+
+	/* check whether we already visited the target location */
+	i = bookmark_list_get_uri_index (slot->back_list, location);
+	if (i >= 0) {
+		nautilus_navigation_window_back_or_forward (NAUTILUS_NAVIGATION_WINDOW (pane->window), TRUE, i, FALSE);
+	} else {
+		nautilus_window_slot_go_to (pane->active_slot, location, FALSE);
+	}
+}
+
+static gboolean
+path_bar_button_pressed_callback (GtkWidget *widget,
+				  GdkEventButton *event,
+				  NautilusWindowPane *pane)
+{
+	NautilusWindowSlot *slot;
+	NautilusView *view;
+	GFile *location;
+	char *uri;
+
+	g_object_set_data (G_OBJECT (widget), "handle-button-release",
+			   GINT_TO_POINTER (TRUE));
+
+	if (event->button == 3) {
+		slot = nautilus_window_get_active_slot (pane->window);
+		view = slot->content_view;
+		if (view != NULL) {
+			location = nautilus_path_bar_get_path_for_button (
+				NAUTILUS_PATH_BAR (pane->path_bar), widget);
+			if (location != NULL) {
+				uri = g_file_get_uri (location);
+				nautilus_view_pop_up_location_context_menu (
+					view, event, uri);
+				g_object_unref (G_OBJECT (location));
+				g_free (uri);
+				return TRUE;
+			}
+		}
+	}
+
+	return FALSE;
+}
+
+static gboolean
+path_bar_button_released_callback (GtkWidget *widget,
+				   GdkEventButton *event,
+				   NautilusWindowPane *pane)
+{
+	NautilusWindowSlot *slot;
+	NautilusWindowOpenFlags flags;
+	GFile *location;
+	int mask;
+	gboolean handle_button_release;
+
+	mask = event->state & gtk_accelerator_get_default_mod_mask ();
+	flags = 0;
+
+	handle_button_release = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (widget),
+						  "handle-button-release"));
+
+	if (event->type == GDK_BUTTON_RELEASE && handle_button_release) {
+		location = nautilus_path_bar_get_path_for_button (NAUTILUS_PATH_BAR (pane->path_bar), widget);
+
+		if (event->button == 2 && mask == 0) {
+			flags = NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB;
+		} else if (event->button == 1 && mask == GDK_CONTROL_MASK) {
+			flags = NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW;
+		}
+
+		if (flags != 0) {
+			slot = nautilus_window_get_active_slot (pane->window);
+			nautilus_window_slot_open_location (slot, location,
+							    flags, NULL);
+			g_object_unref (location);
+			return TRUE;
+		}
+
+		g_object_unref (location);
+	}
+
+	return FALSE;
+}
+
+static void
+path_bar_button_drag_begin_callback (GtkWidget *widget,
+				     GdkEventButton *event,
+				     gpointer user_data)
+{
+	g_object_set_data (G_OBJECT (widget), "handle-button-release",
+			   GINT_TO_POINTER (FALSE));
+}
+
+static void
+notebook_popup_menu_new_tab_cb (GtkMenuItem *menuitem,
+				gpointer user_data)
+{
+	NautilusWindowPane *pane;
+
+	pane = user_data;
+	nautilus_window_new_tab (pane->window);
+}
+
+static void
+path_bar_path_set_callback (GtkWidget *widget,
+			    GFile *location,
+			    NautilusWindowPane *pane)
+{
+	GList *children, *l;
+	GtkWidget *child;
+
+	children = gtk_container_get_children (GTK_CONTAINER (widget));
+
+	for (l = children; l != NULL; l = l->next) {
+		child = GTK_WIDGET (l->data);
+
+		if (!GTK_IS_TOGGLE_BUTTON (child)) {
+			continue;
+		}
+
+		if (!g_signal_handler_find (child,
+					    G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA,
+					    0, 0, NULL,
+					    path_bar_button_pressed_callback,
+					    pane)) {
+			g_signal_connect (child, "button-press-event",
+					  G_CALLBACK (path_bar_button_pressed_callback),
+					  pane);
+			g_signal_connect (child, "button-release-event",
+					  G_CALLBACK (path_bar_button_released_callback),
+					  pane);
+			g_signal_connect (child, "drag-begin",
+					  G_CALLBACK (path_bar_button_drag_begin_callback),
+					  pane);
+		}
+	}
+
+	g_list_free (children);
+}
+
+static void
+notebook_popup_menu_move_left_cb (GtkMenuItem *menuitem,
+				  gpointer user_data)
+{
+	NautilusWindowPane *pane;
+
+	pane = NAUTILUS_WINDOW_PANE (user_data);
+	nautilus_notebook_reorder_current_child_relative (NAUTILUS_NOTEBOOK (pane->notebook), -1);
+}
+
+static void
+notebook_popup_menu_move_right_cb (GtkMenuItem *menuitem,
+				   gpointer user_data)
+{
+	NautilusWindowPane *pane;
+
+	pane = NAUTILUS_WINDOW_PANE (user_data);
+	nautilus_notebook_reorder_current_child_relative (NAUTILUS_NOTEBOOK (pane->notebook), 1);
+}
+
+static void
+notebook_popup_menu_close_cb (GtkMenuItem *menuitem,
+			      gpointer user_data)
+{
+	NautilusWindowPane *pane;
+	NautilusWindowSlot *slot;
+
+	pane = NAUTILUS_WINDOW_PANE (user_data);
+	slot = pane->active_slot;
+	nautilus_window_pane_slot_close (pane, slot);
+}
+
+static void
+notebook_popup_menu_show (NautilusWindowPane *pane,
+			  GdkEventButton *event)
+{
+	GtkWidget *popup;
+	GtkWidget *item;
+	GtkWidget *image;
+	int button, event_time;
+	gboolean can_move_left, can_move_right;
+	NautilusNotebook *notebook;
+
+	notebook = NAUTILUS_NOTEBOOK (pane->notebook);
+
+	can_move_left = nautilus_notebook_can_reorder_current_child_relative (notebook, -1);
+	can_move_right = nautilus_notebook_can_reorder_current_child_relative (notebook, 1);
+
+	popup = gtk_menu_new();
+
+	item = gtk_menu_item_new_with_mnemonic (_("_New Tab"));
+	g_signal_connect (item, "activate",
+			  G_CALLBACK (notebook_popup_menu_new_tab_cb),
+			  pane);
+	gtk_menu_shell_append (GTK_MENU_SHELL (popup),
+			       item);
+
+	gtk_menu_shell_append (GTK_MENU_SHELL (popup),
+			       gtk_separator_menu_item_new ());
+
+	item = gtk_menu_item_new_with_mnemonic (_("Move Tab _Left"));
+	g_signal_connect (item, "activate",
+			  G_CALLBACK (notebook_popup_menu_move_left_cb),
+			  pane);
+	gtk_menu_shell_append (GTK_MENU_SHELL (popup),
+			       item);
+	gtk_widget_set_sensitive (item, can_move_left);
+
+	item = gtk_menu_item_new_with_mnemonic (_("Move Tab _Right"));
+	g_signal_connect (item, "activate",
+			  G_CALLBACK (notebook_popup_menu_move_right_cb),
+			  pane);
+	gtk_menu_shell_append (GTK_MENU_SHELL (popup),
+			       item);
+	gtk_widget_set_sensitive (item, can_move_right);
+
+	gtk_menu_shell_append (GTK_MENU_SHELL (popup),
+			       gtk_separator_menu_item_new ());
+
+	item = gtk_image_menu_item_new_with_mnemonic (_("_Close Tab"));
+	image = gtk_image_new_from_stock (GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU);
+	gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
+	g_signal_connect (item, "activate",
+			  G_CALLBACK (notebook_popup_menu_close_cb), pane);
+	gtk_menu_shell_append (GTK_MENU_SHELL (popup),
+			       item);
+
+	gtk_widget_show_all (popup);
+
+	if (event) {
+		button = event->button;
+		event_time = event->time;
+	} else {
+		button = 0;
+		event_time = gtk_get_current_event_time ();
+	}
+
+	/* TODO is this correct? */
+	gtk_menu_attach_to_widget (GTK_MENU (popup),
+				   pane->notebook,
+				   NULL);
+
+	gtk_menu_popup (GTK_MENU (popup), NULL, NULL, NULL, NULL,
+			button, event_time);
+}
+
+/* emitted when the user clicks the "close" button of tabs */
+static void
+notebook_tab_close_requested (NautilusNotebook *notebook,
+			      NautilusWindowSlot *slot,
+			      NautilusWindowPane *pane)
+{
+	nautilus_window_pane_slot_close (pane, slot);
+}
+
+static gboolean
+notebook_button_press_cb (GtkWidget *widget,
+			  GdkEventButton *event,
+			  gpointer user_data)
+{
+	NautilusWindowPane *pane;
+
+	pane = user_data;
+	if (GDK_BUTTON_PRESS == event->type && 3 == event->button) {
+		notebook_popup_menu_show (pane, event);
+		return TRUE;
+	}
+
+	return FALSE;
+}
+
+static gboolean
+notebook_popup_menu_cb (GtkWidget *widget,
+			gpointer user_data)
+{
+	NautilusWindowPane *pane;
+
+	pane = user_data;
+	notebook_popup_menu_show (pane, NULL);
+	return TRUE;
+}
+
+static gboolean
+notebook_switch_page_cb (GtkNotebook *notebook,
+			 GtkWidget *page,
+			 unsigned int page_num,
+			 NautilusWindowPane *pane)
+{
+	NautilusWindowSlot *slot;
+	GtkWidget *widget;
+
+	widget = gtk_notebook_get_nth_page (GTK_NOTEBOOK (pane->notebook), page_num);
+	g_assert (widget != NULL);
+
+	/* find slot corresponding to the target page */
+	slot = nautilus_window_pane_get_slot_for_content_box (pane, widget);
+	g_assert (slot != NULL);
+
+	nautilus_window_set_active_slot (slot->pane->window, slot);
+
+	return FALSE;
+}
+
+static void
+real_set_active (NautilusWindowPane *pane,
+		 gboolean is_active)
+{
+	if (is_active) {
+		nautilus_navigation_state_set_master (NAUTILUS_NAVIGATION_WINDOW (pane->window)->details->nav_state,
+						      pane->action_group);
+	}
+
+	/* toolbar */
+	gtk_widget_set_sensitive (pane->tool_bar, is_active);
+}
+
+static void
+nautilus_window_pane_setup (NautilusWindowPane *pane)
+{
+	GtkSizeGroup *header_size_group;
+	NautilusNavigationWindow *window;
+	GtkActionGroup *action_group;
+
+	pane->widget = gtk_vbox_new (FALSE, 0);
+	window = NAUTILUS_NAVIGATION_WINDOW (pane->window);
+
+	header_size_group = window->details->header_size_group;
+
+	/* build the toolbar */
+	action_group = nautilus_navigation_window_create_toolbar_action_group (window);
+	pane->tool_bar = nautilus_toolbar_new (action_group);
+	pane->action_group = action_group;
+
+	gtk_box_pack_start (GTK_BOX (pane->widget),
+			    pane->tool_bar,
+			    FALSE, FALSE, 0);
+
+	g_settings_bind (nautilus_window_state,
+			 NAUTILUS_WINDOW_STATE_START_WITH_TOOLBAR,
+			 pane->tool_bar,
+			 "visible",
+			 G_SETTINGS_BIND_GET);
+
+	/* connect to the pathbar signals */
+	pane->path_bar = nautilus_toolbar_get_path_bar (NAUTILUS_TOOLBAR (pane->tool_bar));
+	gtk_size_group_add_widget (header_size_group, pane->path_bar);
+
+	g_signal_connect_object (pane->path_bar, "path-clicked",
+				 G_CALLBACK (path_bar_location_changed_callback), pane, 0);
+	g_signal_connect_object (pane->path_bar, "path-set",
+				 G_CALLBACK (path_bar_path_set_callback), pane, 0);
+
+	/* connect to the location bar signals */
+	pane->location_bar = nautilus_toolbar_get_location_bar (NAUTILUS_TOOLBAR (pane->tool_bar));
+	gtk_size_group_add_widget (header_size_group, pane->location_bar);
+
+	nautilus_clipboard_set_up_editable
+		(GTK_EDITABLE (nautilus_location_bar_get_entry (NAUTILUS_LOCATION_BAR (pane->location_bar))),
+		 nautilus_window_get_ui_manager (NAUTILUS_WINDOW (window)),
+		 TRUE);
+
+	g_signal_connect_object (pane->location_bar, "location-changed",
+				 G_CALLBACK (navigation_bar_location_changed_callback), pane, 0);
+	g_signal_connect_object (pane->location_bar, "cancel",
+				 G_CALLBACK (navigation_bar_cancel_callback), pane, 0);
+
+	/* connect to the search bar signals */
+	pane->search_bar = nautilus_toolbar_get_search_bar (NAUTILUS_TOOLBAR (pane->tool_bar));
+	gtk_size_group_add_widget (header_size_group, pane->search_bar);
+
+	g_signal_connect_object (pane->search_bar, "activate",
+				 G_CALLBACK (search_bar_activate_callback), pane, 0);
+	g_signal_connect_object (pane->search_bar, "cancel",
+				 G_CALLBACK (search_bar_cancel_callback), pane, 0);
+
+	/* initialize the notebook */
+	pane->notebook = g_object_new (NAUTILUS_TYPE_NOTEBOOK, NULL);
+	gtk_box_pack_start (GTK_BOX (pane->widget), pane->notebook,
+			    TRUE, TRUE, 0);
+	g_signal_connect (pane->notebook,
+			  "tab-close-request",
+			  G_CALLBACK (notebook_tab_close_requested),
+			  pane);
+	g_signal_connect_after (pane->notebook,
+				"button_press_event",
+				G_CALLBACK (notebook_button_press_cb),
+				pane);
+	g_signal_connect (pane->notebook, "popup-menu",
+			  G_CALLBACK (notebook_popup_menu_cb),
+			  pane);
+	g_signal_connect (pane->notebook,
+			  "switch-page",
+			  G_CALLBACK (notebook_switch_page_cb),
+			  pane);
+
+	gtk_notebook_set_show_tabs (GTK_NOTEBOOK (pane->notebook), FALSE);
+	gtk_notebook_set_show_border (GTK_NOTEBOOK (pane->notebook), FALSE);
+	gtk_widget_show (pane->notebook);
+	gtk_container_set_border_width (GTK_CONTAINER (pane->notebook), 0);
+
+	/* start as non-active */
+	real_set_active (pane, FALSE);
+
+	/* Ensure that the view has some minimal size and that other parts
+	 * of the UI (like location bar and tabs) don't request more and
+	 * thus affect the default position of the split view paned.
+	 */
+	gtk_widget_set_size_request (pane->widget, 60, 60);
+}
+
 static void
 nautilus_window_pane_dispose (GObject *object)
 {
 	NautilusWindowPane *pane = NAUTILUS_WINDOW_PANE (object);
 
+	pane->window = NULL;
+	gtk_widget_destroy (pane->widget);
+	g_clear_object (&pane->action_group);
+
 	g_assert (pane->slots == NULL);
 
-	pane->window = NULL;
-	G_OBJECT_CLASS (parent_class)->dispose (object);
+	G_OBJECT_CLASS (nautilus_window_pane_parent_class)->dispose (object);
 }
 
 static void
@@ -82,6 +640,9 @@ nautilus_window_pane_new (NautilusWindow *window)
 
 	pane = g_object_new (NAUTILUS_TYPE_WINDOW_PANE, NULL);
 	pane->window = window;
+
+	nautilus_window_pane_setup (pane);
+	
 	return pane;
 }
 
@@ -120,31 +681,74 @@ nautilus_window_pane_set_active (NautilusWindowPane *pane,
 		nautilus_view_set_is_active (view, is_active);
 	}
 
-	EEL_CALL_METHOD (NAUTILUS_WINDOW_PANE_CLASS, pane,
-			 set_active, (pane, is_active));
+	real_set_active (pane, is_active);
 }
 
 void
 nautilus_window_pane_show (NautilusWindowPane *pane)
 {
 	pane->visible = TRUE;
-	EEL_CALL_METHOD (NAUTILUS_WINDOW_PANE_CLASS, pane,
-			 show, (pane));
+	gtk_widget_show (pane->widget);
 }
 
-
 void
 nautilus_window_pane_sync_location_widgets (NautilusWindowPane *pane)
 {
-	EEL_CALL_METHOD (NAUTILUS_WINDOW_PANE_CLASS, pane,
-			 sync_location_widgets, (pane));
+	NautilusNavigationWindowSlot *navigation_slot;
+	NautilusWindowSlot *slot;
+
+	slot = pane->active_slot;
+
+	nautilus_window_pane_hide_temporary_bars (pane);
+
+	/* Change the location bar and path bar to match the current location. */
+	if (slot->location != NULL) {
+		char *uri;
+
+		/* this may be NULL if we just created the slot */
+		uri = nautilus_window_slot_get_location_uri (slot);
+		nautilus_location_bar_set_location (NAUTILUS_LOCATION_BAR (pane->location_bar), uri);
+		g_free (uri);
+		nautilus_path_bar_set_path (NAUTILUS_PATH_BAR (pane->path_bar), slot->location);
+	}
+
+	/* Update window global UI if this is the active pane */
+	if (pane == pane->window->details->active_pane) {
+		nautilus_window_update_up_button (pane->window);
+
+		/* Check if the back and forward buttons need enabling or disabling. */
+		navigation_slot = NAUTILUS_NAVIGATION_WINDOW_SLOT (pane->window->details->active_pane->active_slot);
+		nautilus_navigation_window_allow_back (NAUTILUS_NAVIGATION_WINDOW (pane->window),
+						       navigation_slot->back_list != NULL);
+		nautilus_navigation_window_allow_forward (NAUTILUS_NAVIGATION_WINDOW (pane->window),
+							  navigation_slot->forward_list != NULL);
+	}
 }
 
 void
 nautilus_window_pane_sync_search_widgets (NautilusWindowPane *pane)
 {
-	EEL_CALL_METHOD (NAUTILUS_WINDOW_PANE_CLASS, pane,
-			 sync_search_widgets, (pane));
+	NautilusWindowSlot *slot;
+	NautilusDirectory *directory;
+	NautilusSearchDirectory *search_directory;
+
+	slot = pane->active_slot;
+	search_directory = NULL;
+
+	directory = nautilus_directory_get (slot->location);
+	if (NAUTILUS_IS_SEARCH_DIRECTORY (directory)) {
+		search_directory = NAUTILUS_SEARCH_DIRECTORY (directory);
+	}
+
+	if (search_directory != NULL &&
+	    !nautilus_search_directory_is_saved_search (search_directory)) {
+		nautilus_toolbar_set_show_search_bar (NAUTILUS_TOOLBAR (pane->tool_bar), TRUE);
+		pane->temporary_search_bar = FALSE;
+	} else {
+		nautilus_toolbar_set_show_search_bar (NAUTILUS_TOOLBAR (pane->tool_bar), FALSE);
+	}
+
+	nautilus_directory_unref (directory);
 }
 
 void
@@ -192,3 +796,90 @@ nautilus_window_pane_grab_focus (NautilusWindowPane *pane)
 		nautilus_view_grab_focus (pane->active_slot->content_view);
 	}	
 }
+
+void
+nautilus_window_pane_hide_search_bar (NautilusWindowPane *pane)
+{
+	nautilus_toolbar_set_show_search_bar (NAUTILUS_TOOLBAR (pane->tool_bar), FALSE);
+
+	if (pane->temporary_search_bar) {
+		NautilusNavigationWindow *window;
+
+		window = NAUTILUS_NAVIGATION_WINDOW (NAUTILUS_WINDOW_PANE (pane)->window);
+		nautilus_navigation_window_set_search_button (window, FALSE);
+		pane->temporary_search_bar = FALSE;
+
+		gtk_widget_hide (pane->tool_bar);
+	}
+}
+
+void
+nautilus_window_pane_ensure_location_bar (NautilusWindowPane *pane)
+{
+	nautilus_toolbar_set_show_main_bar (NAUTILUS_TOOLBAR (pane->tool_bar), TRUE);
+	nautilus_toolbar_set_show_location_entry (NAUTILUS_TOOLBAR (pane->tool_bar), TRUE);
+
+	if (!g_settings_get_boolean (nautilus_window_state,
+				     NAUTILUS_WINDOW_STATE_START_WITH_TOOLBAR)) {
+		gtk_widget_show (pane->tool_bar);
+		pane->temporary_navigation_bar = TRUE;
+	}
+
+	nautilus_location_bar_activate
+		(NAUTILUS_LOCATION_BAR (pane->location_bar));
+}
+
+void
+nautilus_window_pane_ensure_search_bar (NautilusWindowPane *pane)
+{
+	nautilus_toolbar_set_show_search_bar (NAUTILUS_TOOLBAR (pane->tool_bar), TRUE);
+
+	if (!g_settings_get_boolean (nautilus_window_state,
+				     NAUTILUS_WINDOW_STATE_START_WITH_TOOLBAR)) {
+		nautilus_toolbar_set_show_main_bar (NAUTILUS_TOOLBAR (pane->tool_bar), FALSE);
+		gtk_widget_show (pane->tool_bar);
+		nautilus_search_bar_clear (NAUTILUS_SEARCH_BAR (pane->search_bar));
+
+		pane->temporary_search_bar = TRUE;
+	}
+
+	nautilus_search_bar_grab_focus (NAUTILUS_SEARCH_BAR (pane->search_bar));
+}
+
+void
+nautilus_window_pane_add_slot_in_tab (NautilusWindowPane *pane,
+				      NautilusWindowSlot *slot,
+				      NautilusWindowOpenSlotFlags flags)
+{
+	NautilusNotebook *notebook;
+
+	notebook = NAUTILUS_NOTEBOOK (pane->notebook);
+	g_signal_handlers_block_by_func (notebook,
+					 G_CALLBACK (notebook_switch_page_cb),
+					 pane);
+	nautilus_notebook_add_tab (notebook,
+				   slot,
+				   (flags & NAUTILUS_WINDOW_OPEN_SLOT_APPEND) != 0 ?
+				   -1 :
+				   gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook)) + 1,
+				   FALSE);
+	g_signal_handlers_unblock_by_func (notebook,
+					   G_CALLBACK (notebook_switch_page_cb),
+					   pane);
+}
+
+void
+nautilus_window_pane_remove_page (NautilusWindowPane *pane,
+				  int page_num)
+{
+	GtkNotebook *notebook;
+	notebook = GTK_NOTEBOOK (pane->notebook);
+
+	g_signal_handlers_block_by_func (notebook,
+					 G_CALLBACK (notebook_switch_page_cb),
+					 pane);
+	gtk_notebook_remove_page (notebook, page_num);
+	g_signal_handlers_unblock_by_func (notebook,
+					   G_CALLBACK (notebook_switch_page_cb),
+					   pane);
+}
diff --git a/src/nautilus-window-pane.h b/src/nautilus-window-pane.h
index 0772394..2b18b56 100644
--- a/src/nautilus-window-pane.h
+++ b/src/nautilus-window-pane.h
@@ -71,11 +71,27 @@ struct _NautilusWindowPane {
 
 	/* whether or not this pane is active */
 	gboolean is_active;
+
+	GtkWidget *widget;
+
+	/* location bar */
+	GtkWidget *location_bar;
+	GtkWidget *path_bar;
+	GtkWidget *search_bar;
+	GtkWidget *tool_bar;
+
+	gboolean temporary_navigation_bar;
+	gboolean temporary_search_bar;
+
+	/* notebook */
+	GtkWidget *notebook;
+
+	GtkActionGroup *action_group;
 };
 
 GType nautilus_window_pane_get_type (void);
-NautilusWindowPane *nautilus_window_pane_new (NautilusWindow *window);
 
+NautilusWindowPane *nautilus_window_pane_new (NautilusWindow *window);
 
 void nautilus_window_pane_show (NautilusWindowPane *pane);
 void nautilus_window_pane_sync_location_widgets (NautilusWindowPane *pane);
@@ -83,8 +99,21 @@ void nautilus_window_pane_sync_search_widgets  (NautilusWindowPane *pane);
 void nautilus_window_pane_set_active (NautilusWindowPane *pane, gboolean is_active);
 void nautilus_window_pane_slot_close (NautilusWindowPane *pane, NautilusWindowSlot *slot);
 
-NautilusWindowSlot* nautilus_window_pane_get_slot_for_content_box (NautilusWindowPane *pane, GtkWidget *content_box);
+NautilusWindowSlot* nautilus_window_pane_get_slot_for_content_box (NautilusWindowPane *pane,
+								   GtkWidget *content_box);
+
 void nautilus_window_pane_grab_focus (NautilusWindowPane *pane);
 
+/* bars */
+void     nautilus_window_pane_ensure_location_bar (NautilusWindowPane *pane);
+void     nautilus_window_pane_ensure_search_bar (NautilusWindowPane *pane);
+void      nautilus_window_pane_hide_search_bar (NautilusWindowPane *pane);
+
+/* notebook */
+void     nautilus_window_pane_add_slot_in_tab (NautilusWindowPane *pane,
+					       NautilusWindowSlot *slot,
+					       NautilusWindowOpenSlotFlags flags);
+void     nautilus_window_pane_remove_page (NautilusWindowPane *pane,
+					   int page_num);
 
 #endif /* NAUTILUS_WINDOW_PANE_H */
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index c9450ef..ad2fef7 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -35,7 +35,6 @@
 #include "nautilus-application.h"
 #include "nautilus-bookmarks-window.h"
 #include "nautilus-mime-actions.h"
-#include "nautilus-navigation-window-pane.h"
 #include "nautilus-navigation-window-slot.h"
 #include "nautilus-search-bar.h"
 #include "nautilus-src-marshal.h"



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