[nautilus] Add skeleton for split view.
- From: Alexander Larsson <alexl src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [nautilus] Add skeleton for split view.
- Date: Thu, 10 Dec 2009 17:15:08 +0000 (UTC)
commit 8babbe1095134861e4e57f482557587ee9b78576
Author: Holger Berndt <berndth gmx de>
Date: Mon May 25 00:03:22 2009 +0200
Add skeleton for split view.
Add a new menu item "View -> Extra pane", and corresponding skeleton
callback functions and UI containers.
src/nautilus-navigation-window-menus.c | 20 ++++++++++++++++++++
src/nautilus-navigation-window-pane.h | 3 +++
src/nautilus-navigation-window-ui.xml | 1 +
src/nautilus-navigation-window.c | 13 +++++++++++++
src/nautilus-navigation-window.h | 2 ++
src/nautilus-window-private.h | 3 +++
6 files changed, 42 insertions(+), 0 deletions(-)
---
diff --git a/src/nautilus-navigation-window-menus.c b/src/nautilus-navigation-window-menus.c
index 2a7871b..78cad26 100644
--- a/src/nautilus-navigation-window-menus.c
+++ b/src/nautilus-navigation-window-menus.c
@@ -214,6 +214,21 @@ action_show_hide_statusbar_callback (GtkAction *action,
}
}
+static void
+action_split_view_callback (GtkAction *action,
+ gpointer user_data)
+{
+ NautilusNavigationWindow *window;
+
+ window = NAUTILUS_NAVIGATION_WINDOW (user_data);
+
+ if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action))) {
+ nautilus_navigation_window_split_view_on (window);
+ } else {
+ nautilus_navigation_window_split_view_off (window);
+ }
+}
+
void
nautilus_navigation_window_update_show_hide_menu_items (NautilusNavigationWindow *window)
{
@@ -937,6 +952,11 @@ static const GtkToggleActionEntry navigation_toggle_entries[] = {
/* tooltip */ N_("Search documents and folders by name"),
G_CALLBACK (action_show_hide_search_callback),
/* is_active */ FALSE },
+ /* name, stock id */ { "Show Hide Extra Pane", NULL,
+ /* label, accelerator */ N_("Extra Pane"), "F3",
+ /* tooltip */ N_("Open an extra folder view side-by-side"),
+ G_CALLBACK (action_split_view_callback),
+ /* is_active */ FALSE },
};
void
diff --git a/src/nautilus-navigation-window-pane.h b/src/nautilus-navigation-window-pane.h
index 7618084..ff38ae2 100644
--- a/src/nautilus-navigation-window-pane.h
+++ b/src/nautilus-navigation-window-pane.h
@@ -65,6 +65,9 @@ struct _NautilusNavigationWindowPane {
/* tab menu */
GtkActionGroup *tabs_menu_action_group;
guint tabs_menu_merge_id;
+
+ /* split view */
+ GtkWidget *split_view_hpane;
};
GType nautilus_navigation_window_pane_get_type (void);
diff --git a/src/nautilus-navigation-window-ui.xml b/src/nautilus-navigation-window-ui.xml
index 1e633d5..ca934e7 100644
--- a/src/nautilus-navigation-window-ui.xml
+++ b/src/nautilus-navigation-window-ui.xml
@@ -19,6 +19,7 @@
<menuitem name="Show Hide Sidebar" action="Show Hide Sidebar"/>
<menuitem name="Show Hide Location Bar" action="Show Hide Location Bar"/>
<menuitem name="Show Hide Statusbar" action="Show Hide Statusbar"/>
+ <menuitem name="Show Hide Extra Pane" action="Show Hide Extra Pane"/>
</placeholder>
</menu>
<placeholder name="Other Menus">
diff --git a/src/nautilus-navigation-window.c b/src/nautilus-navigation-window.c
index bbb1030..419259e 100644
--- a/src/nautilus-navigation-window.c
+++ b/src/nautilus-navigation-window.c
@@ -593,6 +593,7 @@ nautilus_navigation_window_destroy (GtkObject *object)
window->sidebar_panels = NULL;
window->details->content_paned = NULL;
+ window->details->split_view_hpane = NULL;
GTK_OBJECT_CLASS (parent_class)->destroy (object);
}
@@ -1239,3 +1240,15 @@ nautilus_navigation_window_class_init (NautilusNavigationWindowClass *class)
use_extra_mouse_buttons_changed,
NULL);
}
+
+void nautilus_navigation_window_split_view_on (NautilusNavigationWindow *window)
+{
+ /* hhb: TODO: implement this */
+ g_print("hhb: split view on\n");
+}
+
+void nautilus_navigation_window_split_view_off (NautilusNavigationWindow *window)
+{
+ /* hhb: TODO: implement this */
+ g_print("hhb: split view off\n");
+}
diff --git a/src/nautilus-navigation-window.h b/src/nautilus-navigation-window.h
index 42bef4f..b96198b 100644
--- a/src/nautilus-navigation-window.h
+++ b/src/nautilus-navigation-window.h
@@ -106,5 +106,7 @@ void nautilus_navigation_window_hide_search (NautilusNavigationWind
void nautilus_navigation_window_set_search_button (NautilusNavigationWindow *window,
gboolean state);
void nautilus_navigation_window_restore_focus_widget (NautilusNavigationWindow *window);
+void nautilus_navigation_window_split_view_on (NautilusNavigationWindow *window);
+void nautilus_navigation_window_split_view_off (NautilusNavigationWindow *window);
#endif
diff --git a/src/nautilus-window-private.h b/src/nautilus-window-private.h
index ef9aaa3..b3bfc99 100644
--- a/src/nautilus-window-private.h
+++ b/src/nautilus-window-private.h
@@ -109,6 +109,9 @@ struct _NautilusNavigationWindowDetails {
/* focus widget before the location bar has been shown temporarily */
GtkWidget *last_focus_widget;
+
+ /* split view */
+ GtkWidget *split_view_hpane;
};
#define NAUTILUS_MENU_PATH_BACK_ITEM "/menu/Go/Back"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]