Commit b8d5b4a7 authored by William Jon McCann's avatar William Jon McCann

Remove extra panes

Extra Pane mode was somewhat useful before GNOME 3 had side by side window mode.
The combination of panes and tabs is just too much. It is inconsistent
with the file chooser and doesn't work well with touch.  We would like to
add a more explicit copy/move feature shortly.

https://bugzilla.gnome.org/show_bug.cgi?id=676858
parent 3a9181eb
......@@ -166,8 +166,6 @@ nautilus_SOURCES = \
nautilus-window-manage-views.c \
nautilus-window-manage-views.h \
nautilus-window-menus.c \
nautilus-window-pane.c \
nautilus-window-pane.h \
nautilus-window-private.h \
nautilus-window-slot.c \
nautilus-window-slot.h \
......
......@@ -35,7 +35,6 @@
#define NAUTILUS_ACTION_FORWARD "Forward"
#define NAUTILUS_ACTION_SHOW_HIDE_SIDEBAR "Show Hide Sidebar"
#define NAUTILUS_ACTION_SHOW_HIDE_LOCATION_BAR "Show Hide Location Bar"
#define NAUTILUS_ACTION_SHOW_HIDE_EXTRA_PANE "Show Hide Extra Pane"
#define NAUTILUS_ACTION_GO_TO_BURN_CD "Go to Burn CD"
#define NAUTILUS_ACTION_GO_TO_LOCATION "Go to Location"
#define NAUTILUS_ACTION_GO_HOME "Home"
......@@ -77,8 +76,6 @@
#define NAUTILUS_ACTION_LOCATION_COPY "LocationCopy"
#define NAUTILUS_ACTION_PASTE "Paste"
#define NAUTILUS_ACTION_PASTE_FILES_INTO "Paste Files Into"
#define NAUTILUS_ACTION_COPY_TO_NEXT_PANE "Copy to next pane"
#define NAUTILUS_ACTION_MOVE_TO_NEXT_PANE "Move to next pane"
#define NAUTILUS_ACTION_LOCATION_PASTE_FILES_INTO "LocationPasteFilesInto"
#define NAUTILUS_ACTION_RENAME "Rename"
#define NAUTILUS_ACTION_DUPLICATE "Duplicate"
......
......@@ -570,19 +570,14 @@ mount_removed_callback (GVolumeMonitor *monitor,
window = NAUTILUS_WINDOW (node->data);
if (window != NULL && !NAUTILUS_IS_DESKTOP_WINDOW (window)) {
GList *l;
GList *lp;
for (lp = window->details->panes; lp != NULL; lp = lp->next) {
NautilusWindowPane *pane;
pane = (NautilusWindowPane*) lp->data;
for (l = pane->slots; l != NULL; l = l->next) {
slot = l->data;
n_slots++;
if (nautilus_window_slot_should_close_with_mount (slot, mount)) {
close_list = g_list_prepend (close_list, slot);
}
} /* for all slots */
} /* for all panes */
for (l = window->details->slots; l != NULL; l = l->next) {
slot = l->data;
n_slots++;
if (nautilus_window_slot_should_close_with_mount (slot, mount)) {
close_list = g_list_prepend (close_list, slot);
}
} /* for all slots */
}
}
......@@ -598,11 +593,11 @@ mount_removed_callback (GVolumeMonitor *monitor,
slot = node->data;
if (slot != force_no_close_slot) {
nautilus_window_pane_slot_close (slot->pane, slot);
nautilus_window_slot_close (slot->window, slot);
} else {
computer = g_file_new_for_path (g_get_home_dir ());
nautilus_window_slot_open_location (slot, computer, 0);
g_object_unref(computer);
g_object_unref (computer);
}
}
......
......@@ -69,12 +69,6 @@
<menuitem name="Duplicate" action="Duplicate"/>
<menuitem name="Create Link" action="Create Link"/>
<menuitem name="Rename" action="Rename"/>
<menu action="CopyToMenu">
<menuitem name="Copy to next pane" action="Copy to next pane"/>
</menu>
<menu action="MoveToMenu">
<menuitem name="Move to next pane" action="Move to next pane"/>
</menu>
</placeholder>
<placeholder name="Dangerous File Items Placeholder">
<menuitem name="Trash" action="Trash"/>
......@@ -161,12 +155,6 @@
<placeholder name="File Actions">
<menuitem name="Properties" action="Properties"/>
<menuitem name="Rename" action="Rename"/>
<menu action="CopyToMenu">
<menuitem name="Copy to next pane" action="Copy to next pane"/>
</menu>
<menu action="MoveToMenu">
<menuitem name="Move to next pane" action="Move to next pane"/>
</menu>
</placeholder>
<separator name="Dangerous separator"/>
<placeholder name="Dangerous File Actions">
......
......@@ -2109,9 +2109,9 @@ focus_in_event_callback (GtkWidget *widget, GdkEventFocus *event, gpointer user_
NautilusWindowSlot *slot;
NautilusIconView *icon_view = NAUTILUS_ICON_VIEW (user_data);
/* make the corresponding slot (and the pane that contains it) active */
/* make the corresponding slot (and the window that contains it) active */
slot = nautilus_view_get_nautilus_window_slot (NAUTILUS_VIEW (icon_view));
nautilus_window_slot_make_hosting_pane_active (slot);
nautilus_window_slot_make_hosting_window_active (slot);
return FALSE;
}
......
......@@ -1527,9 +1527,9 @@ focus_in_event_callback (GtkWidget *widget, GdkEventFocus *event, gpointer user_
NautilusWindowSlot *slot;
NautilusListView *list_view = NAUTILUS_LIST_VIEW (user_data);
/* make the corresponding slot (and the pane that contains it) active */
/* make the corresponding slot (and the window that contains it) active */
slot = nautilus_view_get_nautilus_window_slot (NAUTILUS_VIEW (list_view));
nautilus_window_slot_make_hosting_pane_active (slot);
nautilus_window_slot_make_hosting_window_active (slot);
return FALSE;
}
......
......@@ -120,7 +120,7 @@ find_notebook_at_pointer (gint abs_x, gint abs_y)
/* toplevel should be an NautilusWindow */
if (toplevel != NULL && NAUTILUS_IS_WINDOW (toplevel))
{
return NAUTILUS_NOTEBOOK (NAUTILUS_WINDOW (toplevel)->details->active_pane->notebook);
return NAUTILUS_NOTEBOOK (NAUTILUS_WINDOW (toplevel)->details->notebook);
}
return NULL;
......
<ui>
<accelerator action="Search"/>
<accelerator action="SplitViewNextPane"/>
<accelerator action="TabsPrevious"/>
<accelerator action="TabsNext"/>
<accelerator action="TabsMoveLeft"/>
......@@ -37,8 +36,6 @@
<placeholder name="Clipboard Actions">
</placeholder>
<separator/>
<placeholder name="Copy Move to Placeholder"/>
<separator/>
<placeholder name="Select Items"/>
<separator/>
<placeholder name="File Items Placeholder"/>
......@@ -63,7 +60,6 @@
<separator/>
<menuitem name="Show Hide Sidebar" action="Show Hide Sidebar"/>
</menu>
<menuitem name="Show Hide Extra Pane" action="Show Hide Extra Pane"/>
</placeholder>
<separator/>
<placeholder name="View Preferences Placeholder"/>
......@@ -88,7 +84,6 @@
<menuitem name="Up" action="Up"/>
<menuitem name="Back" action="Back"/>
<menuitem name="Forward" action="Forward"/>
<menuitem name="SplitViewSameLocationMenu" action="SplitViewSameLocation"/>
</placeholder>
<separator/>
<menuitem name="Home" action="Home"/>
......
......@@ -5086,23 +5086,6 @@ get_strings_for_environment_variables (NautilusView *view, GList *selected_files
}
}
static NautilusView *
get_directory_view_of_extra_pane (NautilusView *view)
{
NautilusWindowSlot *slot;
NautilusView *next_view;
slot = nautilus_window_get_extra_slot (nautilus_view_get_nautilus_window (view));
if (slot != NULL) {
next_view = nautilus_window_slot_get_current_view (slot);
if (NAUTILUS_IS_VIEW (next_view)) {
return NAUTILUS_VIEW (next_view);
}
}
return NULL;
}
/*
* Set up some environment variables that scripts can use
* to take advantage of the current Nautilus state.
......@@ -5114,7 +5097,6 @@ set_script_environment_variables (NautilusView *view, GList *selected_files)
char *uris;
char *uri;
char *geometry_string;
NautilusView *next_view;
get_strings_for_environment_variables (view, selected_files,
&file_paths, &uris, &uri);
......@@ -5132,30 +5114,6 @@ set_script_environment_variables (NautilusView *view, GList *selected_files)
(GTK_WINDOW (nautilus_view_get_containing_window (view)));
g_setenv ("NAUTILUS_SCRIPT_WINDOW_GEOMETRY", geometry_string, TRUE);
g_free (geometry_string);
/* next pane */
next_view = get_directory_view_of_extra_pane (view);
if (next_view) {
GList *next_pane_selected_files;
next_pane_selected_files = nautilus_view_get_selection (next_view);
get_strings_for_environment_variables (next_view, next_pane_selected_files,
&file_paths, &uris, &uri);
nautilus_file_list_free (next_pane_selected_files);
} else {
file_paths = g_strdup("");
uris = g_strdup("");
uri = g_strdup("");
}
g_setenv ("NAUTILUS_SCRIPT_NEXT_PANE_SELECTED_FILE_PATHS", file_paths, TRUE);
g_free (file_paths);
g_setenv ("NAUTILUS_SCRIPT_NEXT_PANE_SELECTED_URIS", uris, TRUE);
g_free (uris);
g_setenv ("NAUTILUS_SCRIPT_NEXT_PANE_CURRENT_URI", uri, TRUE);
g_free (uri);
}
/* Unset all the special script environment variables. */
......@@ -5166,9 +5124,6 @@ unset_script_environment_variables (void)
g_unsetenv ("NAUTILUS_SCRIPT_SELECTED_URIS");
g_unsetenv ("NAUTILUS_SCRIPT_CURRENT_URI");
g_unsetenv ("NAUTILUS_SCRIPT_WINDOW_GEOMETRY");
g_unsetenv ("NAUTILUS_SCRIPT_NEXT_PANE_SELECTED_FILE_PATHS");
g_unsetenv ("NAUTILUS_SCRIPT_NEXT_PANE_SELECTED_URIS");
g_unsetenv ("NAUTILUS_SCRIPT_NEXT_PANE_CURRENT_URI");
}
static void
......@@ -5757,10 +5712,7 @@ action_open_scripts_folder_callback (GtkAction *action,
"NAUTILUS_SCRIPT_SELECTED_FILE_PATHS: newline-delimited paths for selected files (only if local)\n\n"
"NAUTILUS_SCRIPT_SELECTED_URIS: newline-delimited URIs for selected files\n\n"
"NAUTILUS_SCRIPT_CURRENT_URI: URI for current location\n\n"
"NAUTILUS_SCRIPT_WINDOW_GEOMETRY: position and size of current window\n\n"
"NAUTILUS_SCRIPT_NEXT_PANE_SELECTED_FILE_PATHS: newline-delimited paths for selected files in the inactive pane of a split-view window (only if local)\n\n"
"NAUTILUS_SCRIPT_NEXT_PANE_SELECTED_URIS: newline-delimited URIs for selected files in the inactive pane of a split-view window\n\n"
"NAUTILUS_SCRIPT_NEXT_PANE_CURRENT_URI: URI for current location in the inactive pane of a split-view window"),
"NAUTILUS_SCRIPT_WINDOW_GEOMETRY: position and size of current window\n\n"),
nautilus_view_get_containing_window (view));
}
......@@ -5859,77 +5811,6 @@ action_copy_files_callback (GtkAction *action,
nautilus_file_list_free (selection);
}
static void
move_copy_selection_to_location (NautilusView *view,
int copy_action,
char *target_uri)
{
GList *selection, *uris, *l;
selection = nautilus_view_get_selection_for_file_transfer (view);
if (selection == NULL) {
return;
}
uris = NULL;
for (l = selection; l != NULL; l = l->next) {
uris = g_list_prepend (uris,
nautilus_file_get_uri ((NautilusFile *) l->data));
}
uris = g_list_reverse (uris);
nautilus_view_move_copy_items (view, uris, NULL, target_uri,
copy_action,
0, 0);
g_list_free_full (uris, g_free);
nautilus_file_list_free (selection);
}
static void
move_copy_selection_to_next_pane (NautilusView *view,
int copy_action)
{
NautilusWindowSlot *slot;
char *dest_location;
slot = nautilus_window_get_extra_slot (nautilus_view_get_nautilus_window (view));
g_return_if_fail (slot != NULL);
dest_location = nautilus_window_slot_get_current_uri (slot);
g_return_if_fail (dest_location != NULL);
move_copy_selection_to_location (view, copy_action, dest_location);
}
static void
action_copy_to_next_pane_callback (GtkAction *action, gpointer callback_data)
{
NautilusView *view;
view = NAUTILUS_VIEW (callback_data);
move_copy_selection_to_next_pane (view,
GDK_ACTION_COPY);
}
static void
action_move_to_next_pane_callback (GtkAction *action, gpointer callback_data)
{
NautilusWindowSlot *slot;
char *dest_location;
NautilusView *view;
view = NAUTILUS_VIEW (callback_data);
slot = nautilus_window_get_extra_slot (nautilus_view_get_nautilus_window (view));
g_return_if_fail (slot != NULL);
dest_location = nautilus_window_slot_get_current_uri (slot);
g_return_if_fail (dest_location != NULL);
move_copy_selection_to_location (view, GDK_ACTION_MOVE, dest_location);
}
static void
action_cut_files_callback (GtkAction *action,
gpointer callback_data)
......@@ -7238,13 +7119,6 @@ static const GtkActionEntry directory_view_entries[] = {
/* label, accelerator */ N_("_Properties"), NULL,
/* tooltip */ N_("View or modify the properties of this folder"),
G_CALLBACK (action_location_properties_callback) },
/* name, stock id, label */ {NAUTILUS_ACTION_COPY_TO_NEXT_PANE, NULL, N_("_Other pane"),
NULL, N_("Copy the current selection to the other pane in the window"),
G_CALLBACK (action_copy_to_next_pane_callback) },
/* name, stock id, label */ {NAUTILUS_ACTION_MOVE_TO_NEXT_PANE, NULL, N_("_Other pane"),
NULL, N_("Move the current selection to the other pane in the window"),
G_CALLBACK (action_move_to_next_pane_callback) },
};
static void
......@@ -8272,18 +8146,6 @@ can_delete_all (GList *files)
return TRUE;
}
static gboolean
has_writable_extra_pane (NautilusView *view)
{
NautilusView *other_view;
other_view = get_directory_view_of_extra_pane (view);
if (other_view != NULL) {
return !nautilus_view_is_read_only (other_view);
}
return FALSE;
}
static void
real_update_menus (NautilusView *view)
{
......@@ -8310,7 +8172,6 @@ real_update_menus (NautilusView *view)
GAppInfo *app;
GIcon *app_icon;
GtkWidget *menuitem;
gboolean next_pane_is_writable;
gboolean show_properties;
selection = nautilus_view_get_selection (view);
......@@ -8625,20 +8486,6 @@ real_update_menus (NautilusView *view)
update_templates_menu (view);
}
next_pane_is_writable = has_writable_extra_pane (view);
/* next pane: works if file is copyable, and next pane is writable */
action = gtk_action_group_get_action (view->details->dir_action_group,
NAUTILUS_ACTION_COPY_TO_NEXT_PANE);
gtk_action_set_sensitive (action, can_copy_files && next_pane_is_writable);
gtk_action_set_visible (action, next_pane_is_writable);
/* move to next pane: works if file is cuttable, and next pane is writable */
action = gtk_action_group_get_action (view->details->dir_action_group,
NAUTILUS_ACTION_MOVE_TO_NEXT_PANE);
gtk_action_set_sensitive (action, can_delete_files && next_pane_is_writable);
gtk_action_set_visible (action, next_pane_is_writable);
action = gtk_action_group_get_action (view->details->dir_action_group,
"CopyToMenu");
gtk_action_set_sensitive (action, can_copy_files);
......
......@@ -37,6 +37,7 @@
#include "nautilus-window-private.h"
#include "nautilus-window-slot.h"
#include "nautilus-trash-bar.h"
#include "nautilus-toolbar.h"
#include "nautilus-view-factory.h"
#include "nautilus-x-content-bar.h"
#include <eel/eel-accessibility.h>
......@@ -265,7 +266,7 @@ viewed_file_changed_callback (NautilusFile *file,
gboolean is_in_trash, was_in_trash;
g_assert (NAUTILUS_IS_FILE (file));
g_assert (NAUTILUS_IS_WINDOW_PANE (slot->pane));
g_assert (NAUTILUS_IS_WINDOW (slot->window));
g_assert (file == slot->viewed_file);
if (!nautilus_file_is_not_yet_confirmed (file)) {
......@@ -313,11 +314,14 @@ viewed_file_changed_callback (NautilusFile *file,
/* the path bar URI will be set to go_to_uri immediately
* in begin_location_change, but we don't want the
* inexistant children to show up anymore */
if (slot == slot->pane->active_slot) {
if (slot == slot->window->details->active_slot) {
GtkWidget *path_bar;
/* 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 (slot->pane->path_bar));
path_bar = nautilus_toolbar_get_path_bar (NAUTILUS_TOOLBAR (slot->window->details->toolbar));
nautilus_path_bar_clear_buttons (NAUTILUS_PATH_BAR (path_bar));
}
nautilus_window_slot_open_location (slot, go_to_file, 0);
......@@ -335,8 +339,8 @@ viewed_file_changed_callback (NautilusFile *file,
slot->location)) {
g_object_unref (slot->location);
slot->location = new_location;
if (slot == slot->pane->active_slot) {
nautilus_window_pane_sync_location_widgets (slot->pane);
if (slot == slot->window->details->active_slot) {
nautilus_window_sync_location_widgets (slot->window);
}
} else {
/* TODO?
......@@ -408,13 +412,11 @@ nautilus_window_slot_open_location_full (NautilusWindowSlot *slot,
{
NautilusWindow *window;
NautilusWindow *target_window;
NautilusWindowPane *pane;
NautilusWindowSlot *target_slot;
NautilusWindowOpenFlags slot_flags;
GFile *old_location;
char *old_uri, *new_uri;
int new_slot_position;
GList *l;
gboolean use_same;
gboolean is_desktop;
......@@ -485,8 +487,8 @@ nautilus_window_slot_open_location_full (NautilusWindowSlot *slot,
slot_flags = NAUTILUS_WINDOW_OPEN_SLOT_APPEND;
}
target_slot = nautilus_window_pane_open_slot (nautilus_window_get_active_pane (window),
slot_flags);
target_slot = nautilus_window_open_slot (window,
slot_flags);
}
/* close the current window if the flags say so */
......@@ -527,17 +529,6 @@ nautilus_window_slot_open_location_full (NautilusWindowSlot *slot,
begin_location_change (target_slot, location, old_location, new_selection,
NAUTILUS_LOCATION_CHANGE_STANDARD, 0, NULL, callback, user_data);
/* Additionally, load this in all slots that have no location, this means
we load both panes in e.g. a newly opened dual pane window. */
for (l = target_window->details->panes; l != NULL; l = l->next) {
pane = l->data;
slot = pane->active_slot;
if (slot->location == NULL && slot->pending_location == NULL) {
begin_location_change (slot, location, old_location, new_selection,
NAUTILUS_LOCATION_CHANGE_STANDARD, 0, NULL, NULL, NULL);
}
}
g_clear_object (&old_location);
}
......@@ -924,7 +915,7 @@ got_file_info_for_view_selection_callback (NautilusFile *file,
/* We're missing a previous location (if opened location
* in a new tab) so close it and return */
if (slot->location == NULL) {
nautilus_window_pane_slot_close (slot->pane, slot);
nautilus_window_slot_close (slot->window, slot);
} else {
/* We disconnected this, so we need to re-connect it */
viewed_file = nautilus_file_get (slot->location);
......@@ -1420,11 +1411,11 @@ update_for_new_location (NautilusWindowSlot *slot)
nautilus_window_slot_update_title (slot);
nautilus_window_slot_update_icon (slot);
if (slot == slot->pane->active_slot) {
nautilus_window_pane_sync_location_widgets (slot->pane);
if (slot == slot->window->details->active_slot) {
nautilus_window_sync_location_widgets (slot->window);
if (location_really_changed) {
nautilus_window_pane_sync_search_widgets (slot->pane);
nautilus_window_sync_search_widgets (slot->window);
}
}
}
......
......@@ -28,7 +28,6 @@
#define NAUTILUS_WINDOW_MANAGE_VIEWS_H
#include "nautilus-window.h"
#include "nautilus-window-pane.h"
void nautilus_window_manage_views_close_slot (NautilusWindowSlot *slot);
......
......@@ -75,7 +75,7 @@ action_close_window_slot_callback (GtkAction *action,
window = NAUTILUS_WINDOW (user_data);
slot = nautilus_window_get_active_slot (window);
nautilus_window_pane_slot_close (slot->pane, slot);
nautilus_window_slot_close (window, slot);
}
static void
......@@ -394,35 +394,6 @@ action_forward_callback (GtkAction *action,
FALSE, 0, nautilus_event_get_window_open_flags ());
}
static void
action_split_view_switch_next_pane_callback(GtkAction *action,
gpointer user_data)
{
nautilus_window_pane_grab_focus (nautilus_window_get_next_pane (NAUTILUS_WINDOW (user_data)));
}
static void
action_split_view_same_location_callback (GtkAction *action,
gpointer user_data)
{
NautilusWindow *window;
NautilusWindowPane *next_pane;
GFile *location;
window = NAUTILUS_WINDOW (user_data);
next_pane = nautilus_window_get_next_pane (window);
if (!next_pane) {
return;
}
location = nautilus_window_slot_get_location (next_pane->active_slot);
if (location) {
nautilus_window_slot_open_location (nautilus_window_get_active_slot (window),
location, 0);
g_object_unref (location);
}
}
static void
action_show_hide_sidebar_callback (GtkAction *action,
gpointer user_data)
......@@ -438,78 +409,6 @@ action_show_hide_sidebar_callback (GtkAction *action,
}
}
static void
action_split_view_callback (GtkAction *action,
gpointer user_data)
{
NautilusWindow *window;
gboolean is_active;
window = NAUTILUS_WINDOW (user_data);
is_active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
if (is_active != nautilus_window_split_view_showing (window)) {
NautilusWindowSlot *slot;
if (is_active) {
nautilus_window_split_view_on (window);
} else {
nautilus_window_split_view_off (window);
}
slot = nautilus_window_get_active_slot (window);
if (slot != NULL) {
nautilus_view_update_menus (slot->content_view);
}
}
}
static void
nautilus_window_update_split_view_actions_sensitivity (NautilusWindow *window)
{
GtkActionGroup *action_group;
GtkAction *action;
gboolean have_multiple_panes;
gboolean next_pane_is_in_same_location;
GFile *active_pane_location;
GFile *next_pane_location;
NautilusWindowPane *next_pane;
NautilusWindowSlot *active_slot;
active_slot = nautilus_window_get_active_slot (window);
action_group = nautilus_window_get_main_action_group (window);
/* collect information */
have_multiple_panes = nautilus_window_split_view_showing (window);
if (active_slot != NULL) {
active_pane_location = nautilus_window_slot_get_location (active_slot);
} else {
active_pane_location = NULL;
}
next_pane = nautilus_window_get_next_pane (window);
if (next_pane && next_pane->active_slot) {
next_pane_location = nautilus_window_slot_get_location (next_pane->active_slot);
next_pane_is_in_same_location = (active_pane_location && next_pane_location &&
g_file_equal (active_pane_location, next_pane_location));
} else {
next_pane_location = NULL;
next_pane_is_in_same_location = FALSE;
}
/* switch to next pane */
action = gtk_action_group_get_action (action_group, "SplitViewNextPane");
gtk_action_set_sensitive (action, have_multiple_panes);
/* same location */
action = gtk_action_group_get_action (action_group, "SplitViewSameLocation");
gtk_action_set_sensitive (action, have_multiple_panes && !next_pane_is_in_same_location);
/* clean up */
g_clear_object (&active_pane_location);
g_clear_object (&next_pane_location);
}
/* TODO: bind all of this with g_settings_bind and GBinding */
static guint
sidebar_id_to_value (const gchar *sidebar_id)
......@@ -531,12 +430,6 @@ nautilus_window_update_show_hide_menu_items (NautilusWindow *window)
action_group = nautilus_window_get_main_action_group (window);
action = gtk_action_group_get_action (action_group,
NAUTILUS_ACTION_SHOW_HIDE_EXTRA_PANE);
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
nautilus_window_split_view_showing (window));
nautilus_window_update_split_view_actions_sensitivity (window);
action = gtk_action_group_get_action (action_group,
"Sidebar Places");
current_value = sidebar_id_to_value (window->details->sidebar_id);
......@@ -630,67 +523,54 @@ action_go_to_location_callback (GtkAction *action,
gpointer user_data)
{
NautilusWindow *window = user_data;
NautilusWindowPane *pane;
pane = nautilus_window_get_active_pane (window);
nautilus_window_pane_ensure_location_bar (pane);
nautilus_window_ensure_location_bar (window);
}
static void
action_tabs_previous_callback (GtkAction *action,
gpointer user_data)
{
NautilusWindowPane *pane;
NautilusWindow *window = user_data;
pane = nautilus_window_get_active_pane (window);
nautilus_notebook_set_current_page_relative (NAUTILUS_NOTEBOOK (pane->notebook), -1);
nautilus_notebook_set_current_page_relative (NAUTILUS_NOTEBOOK (window->details->notebook), -1);
}
static void
action_tabs_next_callback (GtkAction *action,
gpointer user_data)
{
NautilusWindowPane *pane;
NautilusWindow *window = user_data;
pane = nautilus_window_get_active_pane (window);
nautilus_notebook_set_current_page_relative (NAUTILUS_NOTEBOOK (pane->notebook), 1);
nautilus_notebook_set_current_page_relative (NAUTILUS_NOTEBOOK (window->details->notebook), 1);
}
static void
action_tabs_move_left_callback (GtkAction *action,
gpointer user_data)
{
NautilusWindowPane *pane;
NautilusWindow *window = user_data;
pane = nautilus_window_get_active_pane (window);
nautilus_notebook_reorder_current_child_relative (NAUTILUS_NOTEBOOK (pane->notebook), -1);
nautilus_notebook_reorder_current_child_relative (NAUTILUS_NOTEBOOK (window->details->notebook), -1);
}
static void
action_tabs_move_right_callback (GtkAction *action,
gpointer user_data)
{
NautilusWindowPane *pane;
NautilusWindow *window = user_data;
pane = nautilus_window_get_active_pane (window);
nautilus_notebook_reorder_current_child_relative (NAUTILUS_NOTEBOOK (pane->notebook), 1);
nautilus_notebook_reorder_current_child_relative (NAUTILUS_NOTEBOOK (window->details->notebook), 1);
}
static void
action_tab_change_action_activate_callback (GtkAction *action,
gpointer user_data)
{
NautilusWindowPane *pane;
NautilusWindow *window = user_data;
GtkNotebook *notebook;
int num;
pane = nautilus_window_get_active_pane (window);
notebook = GTK_NOTEBOOK (pane->notebook);
notebook = GTK_NOTEBOOK (window->details->notebook);
num = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (action), "num"));
if (num < gtk_notebook_get_n_pages (notebook)) {
......@@ -834,12 +714,6 @@ static const GtkActionEntry main_entries[] = {
/* name, stock id, label */ { "Go to Location", NULL, N_("_Location..."),
"<control>L", N_("Specify a location to open"),
G_CALLBACK (action_go_to_location_callback) },
/* name, stock id, label */ { "SplitViewNextPane", NULL, N_("S_witch to Other Pane"),
"F6", N_("Move focus to the other pane in a split view window"),
G_CALLBACK (action_split_view_switch_next_pane_callback) },
/* name, stock id, label */ { "SplitViewSameLocation", NULL, N_("Sa_me Location as Other Pane"),
NULL, N_("Go to the same location as in the extra pane"),
G_CALLBACK (action_split_view_same_location_callback) },
/* name, stock id, label */ { "Add Bookmark", GTK_STOCK_ADD, N_("_Add Bookmark"),
"<control>d", N_("Add a bookmark for the current location to this menu"),
G_CALLBACK (action_add_bookmark_callback) },
......@@ -877,11 +751,6 @@ static const GtkToggleActionEntry main_toggle_entries[] = {
/* tooltip */ N_("Search documents and folders by name"),
NULL,
/* is_active */ FALSE },
/* name, stock id */ { NAUTILUS_ACTION_SHOW_HIDE_EXTRA_PANE, NULL,
/* label, accelerator */ N_("E_xtra Pane"), "F3",
/* tooltip */ N_("Open an extra folder view side-by-side"),
G_CALLBACK (action_split_view_callback),
/* is_active */ FALSE },
};
static const GtkRadioActionEntry main_radio_entries[] = {
......@@ -997,10 +866,6 @@ nautilus_window_initialize_actions (NautilusWindow *window)
window_menus_set_bindings (window);
nautilus_window_update_show_hide_menu_items (window);