[nautilus/wip/gaction_reordered: 3/12] nautilus-view: Dont allow opening multiple files
- From: Carlos Soriano Sánchez <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/gaction_reordered: 3/12] nautilus-view: Dont allow opening multiple files
- Date: Wed, 7 Jan 2015 15:56:26 +0000 (UTC)
commit 4b760e30cb07eea7e884060811eed529fc95776d
Author: Carlos Soriano <carlos sorian89 gmail com>
Date: Mon Jan 5 13:59:57 2015 +0100
nautilus-view: Dont allow opening multiple files
src/nautilus-view.c | 72 ++++++++-------------------------------------------
1 files changed, 11 insertions(+), 61 deletions(-)
---
diff --git a/src/nautilus-view.c b/src/nautilus-view.c
index 2380ce1..cff1007 100644
--- a/src/nautilus-view.c
+++ b/src/nautilus-view.c
@@ -280,8 +280,6 @@ static void nautilus_view_set_show_hidden_files (NautilusView
gboolean show_hidden);
static void clipboard_changed_callback (NautilusClipboardMonitor *monitor,
NautilusView *view);
-static void open_one_in_new_window (gpointer data,
- gpointer callback_data);
static void schedule_update_menus (NautilusView *view);
static void remove_update_menus_timeout_callback (NautilusView *view);
static void schedule_update_status (NautilusView *view);
@@ -880,39 +878,6 @@ nautilus_view_get_containing_window (NautilusView *view)
}
static gboolean
-nautilus_view_confirm_multiple (GtkWindow *parent_window,
- int count,
- gboolean tabs)
-{
- GtkDialog *dialog;
- char *prompt;
- char *detail;
- int response;
-
- if (count <= SILENT_WINDOW_OPEN_LIMIT) {
- return TRUE;
- }
-
- prompt = _("Are you sure you want to open all files?");
- if (tabs) {
- detail = g_strdup_printf (ngettext("This will open %'d separate tab.",
- "This will open %'d separate tabs.", count), count);
- } else {
- detail = g_strdup_printf (ngettext("This will open %'d separate window.",
- "This will open %'d separate windows.", count), count);
- }
- dialog = eel_show_yes_no_dialog (prompt, detail,
- _("_OK"), _("_Cancel"),
- parent_window);
- g_free (detail);
-
- response = gtk_dialog_run (dialog);
- gtk_widget_destroy (GTK_WIDGET (dialog));
-
- return response == GTK_RESPONSE_YES;
-}
-
-static gboolean
selection_contains_one_item_in_menu_callback (NautilusView *view, GList *selection)
{
if (g_list_length (selection) == 1) {
@@ -976,10 +941,11 @@ nautilus_view_activate_selection (NautilusView *view)
GList *selection;
selection = nautilus_view_get_selection (view);
- nautilus_view_activate_files (view,
- selection,
- 0,
- TRUE);
+ if (g_list_length (selection) == 1)
+ nautilus_view_activate_files (view,
+ selection,
+ 0,
+ TRUE);
nautilus_file_list_free (selection);
}
@@ -1083,16 +1049,15 @@ action_open_alternate_callback (GtkAction *action,
{
NautilusView *view;
GList *selection;
- GtkWindow *window;
view = NAUTILUS_VIEW (callback_data);
selection = nautilus_view_get_selection (view);
- window = nautilus_view_get_containing_window (view);
-
- if (nautilus_view_confirm_multiple (window, g_list_length (selection), FALSE)) {
- g_list_foreach (selection, open_one_in_new_window, view);
- }
+ if (g_list_length (selection) == 1)
+ nautilus_view_activate_files (view,
+ selection,
+ NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB,
+ FALSE);
nautilus_file_list_free (selection);
}
@@ -1103,19 +1068,15 @@ action_open_new_tab_callback (GtkAction *action,
{
NautilusView *view;
GList *selection;
- GtkWindow *window;
view = NAUTILUS_VIEW (callback_data);
selection = nautilus_view_get_selection (view);
- window = nautilus_view_get_containing_window (view);
-
- if (nautilus_view_confirm_multiple (window, g_list_length (selection), TRUE)) {
+ if (g_list_length (selection) == 1)
nautilus_view_activate_files (view,
selection,
NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB,
FALSE);
- }
nautilus_file_list_free (selection);
}
@@ -4028,17 +3989,6 @@ update_context_menu_position_from_event (NautilusView *view,
/* handle the open command */
-static void
-open_one_in_new_window (gpointer data, gpointer callback_data)
-{
- g_assert (NAUTILUS_IS_FILE (data));
- g_assert (NAUTILUS_IS_VIEW (callback_data));
-
- nautilus_view_activate_file (NAUTILUS_VIEW (callback_data),
- NAUTILUS_FILE (data),
- NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW);
-}
-
NautilusFile *
nautilus_view_get_directory_as_file (NautilusView *view)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]