Commit 67384aa0 authored by Cosimo Cecchi's avatar Cosimo Cecchi

all: merge NautilusNavigationWindowPane into NautilusWindowPane

parent 0e731404
......@@ -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 \
......
......@@ -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>
......
......@@ -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>
......
......@@ -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"));
......
This diff is collapsed.
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
nautilus-navigation-window-pane.h: Nautilus navigation 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>
*/
#ifndef NAUTILUS_NAVIGATION_WINDOW_PANE_H
#define NAUTILUS_NAVIGATION_WINDOW_PANE_H
#include "nautilus-window-pane.h"
#include "nautilus-navigation-window-slot.h"
#define NAUTILUS_TYPE_NAVIGATION_WINDOW_PANE (nautilus_navigation_window_pane_get_type())
#define NAUTILUS_NAVIGATION_WINDOW_PANE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), NAUTILUS_TYPE_NAVIGATION_WINDOW_PANE, NautilusNavigationWindowPaneClass))
#define NAUTILUS_NAVIGATION_WINDOW_PANE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NAUTILUS_TYPE_NAVIGATION_WINDOW_PANE, NautilusNavigationWindowPane))
#define NAUTILUS_IS_NAVIGATION_WINDOW_PANE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NAUTILUS_TYPE_NAVIGATION_WINDOW_PANE))
#define NAUTILUS_IS_NAVIGATION_WINDOW_PANE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), NAUTILUS_TYPE_NAVIGATION_WINDOW_PANE))
#define NAUTILUS_NAVIGATION_WINDOW_PANE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), NAUTILUS_TYPE_NAVIGATION_WINDOW_PANE, NautilusNavigationWindowPaneClass))
typedef struct _NautilusNavigationWindowPaneClass NautilusNavigationWindowPaneClass;
typedef struct _NautilusNavigationWindowPane NautilusNavigationWindowPane;
#include "nautilus-toolbar.h"
struct _NautilusNavigationWindowPaneClass {
NautilusWindowPaneClass parent_class;
};
struct _NautilusNavigationWindowPane {
NautilusWindowPane parent;
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;
};
#include "nautilus-toolbar.h"
GType nautilus_navigation_window_pane_get_type (void);
NautilusNavigationWindowPane* nautilus_navigation_window_pane_new (NautilusWindow *window);
/* bars */
void nautilus_navigation_window_pane_ensure_location_bar (NautilusNavigationWindowPane *pane);
void nautilus_navigation_window_pane_ensure_search_bar (NautilusNavigationWindowPane *pane);
void nautilus_navigation_window_pane_hide_search_bar (NautilusNavigationWindowPane *pane);
/* notebook */
void nautilus_navigation_window_pane_add_slot_in_tab (NautilusNavigationWindowPane *pane, NautilusWindowSlot *slot, NautilusWindowOpenSlotFlags flags);
void nautilus_navigation_window_pane_remove_page (NautilusNavigationWindowPane *pane, int page_num);
#endif /* NAUTILUS_NAVIGATION_WINDOW_PANE_H */
......@@ -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);
......
......@@ -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);
......
......@@ -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;
......
......@@ -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,
......
......@@ -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);
......
This diff is collapsed.
......@@ -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 */
......@@ -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"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment