Commit df516e1f authored by Cosimo Cecchi's avatar Cosimo Cecchi

all: merge NautilusNavigationWindow into NautilusWindow

parent 4cf05a8c
......@@ -102,9 +102,6 @@ nautilus_SOURCES = \
nautilus-navigation-action.h \
nautilus-navigation-state.c \
nautilus-navigation-state.h \
nautilus-navigation-window-menus.c \
nautilus-navigation-window.c \
nautilus-navigation-window.h \
nautilus-notebook.c \
nautilus-notebook.h \
nautilus-pathbar.c \
......
......@@ -39,9 +39,9 @@
#include "nautilus-icon-view.h"
#include "nautilus-image-properties-page.h"
#include "nautilus-list-view.h"
#include "nautilus-navigation-window.h"
#include "nautilus-progress-ui-handler.h"
#include "nautilus-self-check-functions.h"
#include "nautilus-window.h"
#include "nautilus-window-bookmarks.h"
#include "nautilus-window-manage-views.h"
#include "nautilus-window-private.h"
......@@ -509,9 +509,9 @@ open_window (NautilusApplication *application,
DEBUG ("Opening new window at uri %s", uri);
window = nautilus_application_create_navigation_window (application,
startup_id,
screen);
window = nautilus_application_create_window (application,
startup_id,
screen);
nautilus_window_go_to (window, location);
g_object_unref (location);
......@@ -705,7 +705,7 @@ nautilus_application_close_desktop (void)
}
void
nautilus_application_close_all_navigation_windows (NautilusApplication *self)
nautilus_application_close_all_windows (NautilusApplication *self)
{
GList *list_copy;
GList *l;
......@@ -744,7 +744,6 @@ nautilus_window_delete_event_callback (GtkWidget *widget,
static NautilusWindow *
create_window (NautilusApplication *application,
GType window_type,
const char *startup_id,
GdkScreen *screen)
{
......@@ -752,10 +751,10 @@ create_window (NautilusApplication *application,
g_return_val_if_fail (NAUTILUS_IS_APPLICATION (application), NULL);
window = NAUTILUS_WINDOW (gtk_widget_new (window_type,
"app", application,
"screen", screen,
NULL));
window = g_object_new (NAUTILUS_TYPE_WINDOW,
"app", application,
"screen", screen,
NULL);
if (startup_id) {
gtk_window_set_startup_id (GTK_WINDOW (window), startup_id);
......@@ -793,9 +792,9 @@ another_navigation_window_already_showing (NautilusApplication *application,
}
NautilusWindow *
nautilus_application_create_navigation_window (NautilusApplication *application,
const char *startup_id,
GdkScreen *screen)
nautilus_application_create_window (NautilusApplication *application,
const char *startup_id,
GdkScreen *screen)
{
NautilusWindow *window;
char *geometry_string;
......@@ -803,7 +802,7 @@ nautilus_application_create_navigation_window (NautilusApplication *application,
g_return_val_if_fail (NAUTILUS_IS_APPLICATION (application), NULL);
window = create_window (application, NAUTILUS_TYPE_NAVIGATION_WINDOW, startup_id, screen);
window = create_window (application, startup_id, screen);
maximized = g_settings_get_boolean
(nautilus_window_state, NAUTILUS_WINDOW_STATE_MAXIMIZED);
......@@ -824,8 +823,8 @@ nautilus_application_create_navigation_window (NautilusApplication *application,
eel_gtk_window_set_initial_geometry_from_string
(GTK_WINDOW (window),
geometry_string,
NAUTILUS_NAVIGATION_WINDOW_MIN_WIDTH,
NAUTILUS_NAVIGATION_WINDOW_MIN_HEIGHT,
NAUTILUS_WINDOW_MIN_WIDTH,
NAUTILUS_WINDOW_MIN_HEIGHT,
another_navigation_window_already_showing (application, window));
}
g_free (geometry_string);
......
......@@ -71,10 +71,10 @@ NautilusApplication *nautilus_application_dup_singleton (void);
void nautilus_application_quit (NautilusApplication *self);
NautilusWindow * nautilus_application_create_navigation_window (NautilusApplication *application,
const char *startup_id,
GdkScreen *screen);
NautilusWindow * nautilus_application_create_window (NautilusApplication *application,
const char *startup_id,
GdkScreen *screen);
void nautilus_application_close_all_navigation_windows (NautilusApplication *self);
void nautilus_application_close_all_windows (NautilusApplication *self);
#endif /* __NAUTILUS_APPLICATION_H__ */
......@@ -28,12 +28,14 @@
#include <config.h>
#include "nautilus-bookmarks-window.h"
#include "nautilus-window.h"
#include "nautilus-navigation-window.h"
#include <libnautilus-private/nautilus-undo.h>
#include <libnautilus-private/nautilus-global-preferences.h>
#include <libnautilus-private/nautilus-undo-signal-handlers.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-gnome-extensions.h>
#include <libnautilus-private/nautilus-undo-signal-handlers.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
......
......@@ -79,9 +79,9 @@ nautilus_connect_server_dialog_display_location_async (NautilusConnectServerDial
application = nautilus_application_dup_singleton ();
window = nautilus_application_create_navigation_window (application,
NULL,
gtk_widget_get_screen (widget));
window = nautilus_application_create_window (application,
NULL,
gtk_widget_get_screen (widget));
nautilus_window_go_to_full (window, location,
window_go_to_cb, self);
......
......@@ -45,7 +45,7 @@ struct NautilusDesktopWindowDetails {
};
G_DEFINE_TYPE (NautilusDesktopWindow, nautilus_desktop_window,
NAUTILUS_TYPE_NAVIGATION_WINDOW);
NAUTILUS_TYPE_WINDOW);
static void
nautilus_desktop_window_init (NautilusDesktopWindow *window)
......
......@@ -28,7 +28,7 @@
#ifndef NAUTILUS_DESKTOP_WINDOW_H
#define NAUTILUS_DESKTOP_WINDOW_H
#include "nautilus-navigation-window.h"
#include "nautilus-window.h"
#include "nautilus-application.h"
#define NAUTILUS_TYPE_DESKTOP_WINDOW nautilus_desktop_window_get_type()
......@@ -46,13 +46,13 @@
typedef struct NautilusDesktopWindowDetails NautilusDesktopWindowDetails;
typedef struct {
NautilusNavigationWindow parent_spot;
NautilusWindow parent_spot;
NautilusDesktopWindowDetails *details;
gboolean affect_desktop_on_next_location_change;
} NautilusDesktopWindow;
typedef struct {
NautilusNavigationWindowClass parent_spot;
NautilusWindowClass parent_spot;
} NautilusDesktopWindowClass;
GType nautilus_desktop_window_get_type (void);
......
......@@ -1804,7 +1804,6 @@ icon_container_activate_alternate_callback (NautilusIconContainer *container,
GdkEventButton *button_event;
GdkEventKey *key_event;
gboolean open_in_tab;
NautilusWindow *window;
NautilusWindowOpenFlags flags;
g_assert (NAUTILUS_IS_ICON_VIEW (icon_view));
......@@ -1812,24 +1811,20 @@ icon_container_activate_alternate_callback (NautilusIconContainer *container,
open_in_tab = FALSE;
window = nautilus_view_get_nautilus_window (NAUTILUS_VIEW (icon_view));
if (nautilus_window_get_window_type (window) == NAUTILUS_WINDOW_NAVIGATION) {
event = gtk_get_current_event ();
if (event->type == GDK_BUTTON_PRESS ||
event->type == GDK_BUTTON_RELEASE ||
event->type == GDK_2BUTTON_PRESS ||
event->type == GDK_3BUTTON_PRESS) {
button_event = (GdkEventButton *) event;
open_in_tab = (button_event->state & GDK_SHIFT_MASK) == 0;
} else if (event->type == GDK_KEY_PRESS ||
event->type == GDK_KEY_RELEASE) {
key_event = (GdkEventKey *) event;
open_in_tab = !((key_event->state & GDK_SHIFT_MASK) != 0 &&
(key_event->state & GDK_CONTROL_MASK) != 0);
} else {
open_in_tab = TRUE;
}
event = gtk_get_current_event ();
if (event->type == GDK_BUTTON_PRESS ||
event->type == GDK_BUTTON_RELEASE ||
event->type == GDK_2BUTTON_PRESS ||
event->type == GDK_3BUTTON_PRESS) {
button_event = (GdkEventButton *) event;
open_in_tab = (button_event->state & GDK_SHIFT_MASK) == 0;
} else if (event->type == GDK_KEY_PRESS ||
event->type == GDK_KEY_RELEASE) {
key_event = (GdkEventKey *) event;
open_in_tab = !((key_event->state & GDK_SHIFT_MASK) != 0 &&
(key_event->state & GDK_CONTROL_MASK) != 0);
} else {
open_in_tab = TRUE;
}
flags = NAUTILUS_WINDOW_OPEN_FLAG_CLOSE_BEHIND;
......
......@@ -94,10 +94,10 @@ static const GtkTargetEntry drop_types [] = {
G_DEFINE_TYPE (NautilusLocationBar, nautilus_location_bar,
GTK_TYPE_HBOX);
static NautilusNavigationWindow *
static NautilusWindow *
nautilus_location_bar_get_window (GtkWidget *bar)
{
return NAUTILUS_NAVIGATION_WINDOW (gtk_widget_get_ancestor (bar, NAUTILUS_TYPE_WINDOW));
return NAUTILUS_WINDOW (gtk_widget_get_ancestor (bar, NAUTILUS_TYPE_WINDOW));
}
/**
......@@ -151,8 +151,7 @@ drag_data_received_callback (GtkWidget *widget,
char **names;
NautilusApplication *application;
int name_count;
NautilusWindow *new_window;
NautilusNavigationWindow *window;
NautilusWindow *new_window, *window;
GdkScreen *screen;
gboolean new_windows_for_extras;
char *prompt;
......@@ -217,7 +216,7 @@ drag_data_received_callback (GtkWidget *widget,
screen = gtk_window_get_screen (GTK_WINDOW (window));
for (i = 1; names[i] != NULL; ++i) {
new_window = nautilus_application_create_navigation_window (application, NULL, screen);
new_window = nautilus_application_create_window (application, NULL, screen);
location = g_file_new_for_uri (names[i]);
nautilus_window_go_to (new_window, location);
g_object_unref (location);
......@@ -299,10 +298,10 @@ static gboolean
label_button_pressed_callback (GtkWidget *widget,
GdkEventButton *event)
{
NautilusNavigationWindow *window;
NautilusWindowSlot *slot;
NautilusView *view;
GtkWidget *label;
NautilusWindow *window;
NautilusWindowSlot *slot;
NautilusView *view;
GtkWidget *label;
if (event->button != 3) {
return FALSE;
......
......@@ -30,7 +30,6 @@
#ifndef NAUTILUS_LOCATION_BAR_H
#define NAUTILUS_LOCATION_BAR_H
#include "nautilus-navigation-window.h"
#include <libnautilus-private/nautilus-entry.h>
#include <gtk/gtk.h>
......
......@@ -1826,8 +1826,7 @@ activate_files (ActivateParameters *parameters)
if (open_in_app_parameters != NULL ||
unhandled_open_in_app_uris != NULL) {
if ((parameters->flags & NAUTILUS_WINDOW_OPEN_FLAG_CLOSE_BEHIND) != 0 &&
window != NULL &&
nautilus_window_get_window_type (window) == NAUTILUS_WINDOW_SPATIAL) {
window != NULL) {
nautilus_window_close (window);
}
}
......
......@@ -32,7 +32,7 @@
#include "nautilus-navigation-action.h"
#include "nautilus-navigation-window.h"
#include "nautilus-window.h"
#include <gtk/gtk.h>
#include <eel/eel-gtk-extensions.h>
......@@ -42,7 +42,7 @@ G_DEFINE_TYPE (NautilusNavigationAction, nautilus_navigation_action, GTK_TYPE_AC
struct NautilusNavigationActionPrivate
{
NautilusNavigationWindow *window;
NautilusWindow *window;
NautilusNavigationDirection direction;
char *arrow_tooltip;
......@@ -75,33 +75,33 @@ should_open_in_new_tab (void)
static void
activate_back_or_forward_menu_item (GtkMenuItem *menu_item,
NautilusNavigationWindow *window,
NautilusWindow *window,
gboolean back)
{
int index;
g_assert (GTK_IS_MENU_ITEM (menu_item));
g_assert (NAUTILUS_IS_NAVIGATION_WINDOW (window));
index = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (menu_item), "user_data"));
nautilus_navigation_window_back_or_forward (window, back, index, should_open_in_new_tab ());
nautilus_window_back_or_forward (window, back, index, should_open_in_new_tab ());
}
static void
activate_back_menu_item_callback (GtkMenuItem *menu_item, NautilusNavigationWindow *window)
activate_back_menu_item_callback (GtkMenuItem *menu_item,
NautilusWindow *window)
{
activate_back_or_forward_menu_item (menu_item, window, TRUE);
}
static void
activate_forward_menu_item_callback (GtkMenuItem *menu_item, NautilusNavigationWindow *window)
activate_forward_menu_item_callback (GtkMenuItem *menu_item, NautilusWindow *window)
{
activate_back_or_forward_menu_item (menu_item, window, FALSE);
}
static void
fill_menu (NautilusNavigationWindow *window,
fill_menu (NautilusWindow *window,
GtkWidget *menu,
gboolean back)
{
......@@ -110,9 +110,7 @@ fill_menu (NautilusNavigationWindow *window,
int index;
GList *list;
g_assert (NAUTILUS_IS_NAVIGATION_WINDOW (window));
slot = nautilus_window_get_active_slot (NAUTILUS_WINDOW (window));
slot = nautilus_window_get_active_slot (window);
list = back ? slot->back_list : slot->forward_list;
index = 0;
......@@ -137,7 +135,7 @@ show_menu (NautilusNavigationAction *self,
guint button,
guint32 event_time)
{
NautilusNavigationWindow *window;
NautilusWindow *window;
GtkWidget *menu;
window = self->priv->window;
......@@ -317,7 +315,7 @@ nautilus_navigation_action_set_property (GObject *object,
nav->priv->direction = g_value_get_int (value);
break;
case PROP_WINDOW:
nav->priv->window = NAUTILUS_NAVIGATION_WINDOW (g_value_get_object (value));
nav->priv->window = g_value_get_object (value);
break;
}
}
......@@ -381,7 +379,7 @@ nautilus_navigation_action_class_init (NautilusNavigationActionClass *class)
g_param_spec_object ("window",
"Window",
"The navigation window",
NAUTILUS_TYPE_NAVIGATION_WINDOW,
NAUTILUS_TYPE_WINDOW,
G_PARAM_READWRITE));
g_type_class_add_private (object_class, sizeof(NautilusNavigationActionPrivate));
......
This diff is collapsed.
This diff is collapsed.
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/*
* Nautilus
*
* Copyright (C) 1999, 2000 Red Hat, Inc.
* Copyright (C) 1999, 2000, 2001 Eazel, Inc.
* Copyright (C) 2003 Ximian, Inc.
*
* Nautilus 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.
*
* Nautilus 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Authors: Elliot Lee <sopwith@redhat.com>
* Darin Adler <darin@bentspoon.com>
*
*/
/* nautilus-navigation-window.h: Interface of the navigation window object */
#ifndef NAUTILUS_NAVIGATION_WINDOW_H
#define NAUTILUS_NAVIGATION_WINDOW_H
#include <gtk/gtk.h>
#include <libnautilus-private/nautilus-bookmark.h>
#include "nautilus-window.h"
#define NAUTILUS_TYPE_NAVIGATION_WINDOW nautilus_navigation_window_get_type()
#define NAUTILUS_NAVIGATION_WINDOW(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), NAUTILUS_TYPE_NAVIGATION_WINDOW, NautilusNavigationWindow))
#define NAUTILUS_NAVIGATION_WINDOW_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_NAVIGATION_WINDOW, NautilusNavigationWindowClass))
#define NAUTILUS_IS_NAVIGATION_WINDOW(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), NAUTILUS_TYPE_NAVIGATION_WINDOW))
#define NAUTILUS_IS_NAVIGATION_WINDOW_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_NAVIGATION_WINDOW))
#define NAUTILUS_NAVIGATION_WINDOW_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), NAUTILUS_TYPE_NAVIGATION_WINDOW, NautilusNavigationWindowClass))
typedef struct _NautilusNavigationWindow NautilusNavigationWindow;
typedef struct _NautilusNavigationWindowClass NautilusNavigationWindowClass;
typedef struct _NautilusNavigationWindowDetails NautilusNavigationWindowDetails;
#define NAUTILUS_NAVIGATION_WINDOW_SIDEBAR_PLACES "places"
#define NAUTILUS_NAVIGATION_WINDOW_SIDEBAR_TREE "tree"
struct _NautilusNavigationWindow {
NautilusWindow parent_object;
NautilusNavigationWindowDetails *details;
};
struct _NautilusNavigationWindowClass {
NautilusWindowClass parent_spot;
};
GType nautilus_navigation_window_get_type (void);
void nautilus_navigation_window_allow_back (NautilusNavigationWindow *window,
gboolean allow);
void nautilus_navigation_window_allow_forward (NautilusNavigationWindow *window,
gboolean allow);
void nautilus_navigation_window_clear_back_list (NautilusNavigationWindow *window);
void nautilus_navigation_window_clear_forward_list (NautilusNavigationWindow *window);
void nautilus_forget_history (void);
gint nautilus_navigation_window_get_base_page_index (NautilusNavigationWindow *window);
void nautilus_navigation_window_hide_sidebar (NautilusNavigationWindow *window);
void nautilus_navigation_window_show_sidebar (NautilusNavigationWindow *window);
void nautilus_navigation_window_back_or_forward (NautilusNavigationWindow *window,
gboolean back,
guint distance,
gboolean new_tab);
void nautilus_navigation_window_show_search (NautilusNavigationWindow *window);
void nautilus_navigation_window_hide_search (NautilusNavigationWindow *window);
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);
gboolean nautilus_navigation_window_split_view_showing (NautilusNavigationWindow *window);
#endif
......@@ -28,7 +28,7 @@
#include "nautilus-notebook.h"
#include "nautilus-navigation-window.h"
#include "nautilus-window.h"
#include "nautilus-window-manage-views.h"
#include "nautilus-window-private.h"
#include "nautilus-window-slot.h"
......@@ -117,7 +117,7 @@ find_notebook_at_pointer (gint abs_x, gint abs_y)
gdk_window_get_user_data (toplevel_win, &toplevel);
/* toplevel should be an NautilusWindow */
if (toplevel != NULL && NAUTILUS_IS_NAVIGATION_WINDOW (toplevel))
if (toplevel != NULL && NAUTILUS_IS_WINDOW (toplevel))
{
return NAUTILUS_NOTEBOOK (NAUTILUS_WINDOW (toplevel)->details->active_pane->notebook);
}
......
......@@ -1751,9 +1751,9 @@ volume_mounted_cb (GVolume *volume,
cur = NAUTILUS_WINDOW (sidebar->window);
app = nautilus_application_dup_singleton ();
new = nautilus_application_create_navigation_window (app,
NULL,
gtk_window_get_screen (GTK_WINDOW (cur)));
new = nautilus_application_create_window (app,
NULL,
gtk_window_get_screen (GTK_WINDOW (cur)));
nautilus_window_go_to (new, location);
g_object_unref (app);
......@@ -1828,9 +1828,9 @@ open_selected_bookmark (NautilusPlacesSidebar *sidebar,
cur = NAUTILUS_WINDOW (sidebar->window);
app = nautilus_application_dup_singleton ();
new = nautilus_application_create_navigation_window (app,
NULL,
gtk_window_get_screen (GTK_WINDOW (cur)));
new = nautilus_application_create_window (app,
NULL,
gtk_window_get_screen (GTK_WINDOW (cur)));
nautilus_window_go_to (new, location);
g_object_unref (app);
......
......@@ -7570,7 +7570,7 @@ clipboard_targets_received (GtkClipboard *clipboard,
static gboolean
should_show_empty_trash (NautilusView *view)
{
return (showing_trash_directory (view) || nautilus_window_get_window_type (view->details->window) == NAUTILUS_WINDOW_NAVIGATION);
return (showing_trash_directory (view));
}
static gboolean
......@@ -8265,21 +8265,15 @@ real_update_location_menu (NautilusView *view)
char *tip;
show_open_folder_window = FALSE;
show_open_in_new_tab = FALSE;
show_open_in_new_tab = TRUE;
if (nautilus_window_get_window_type (view->details->window) == NAUTILUS_WINDOW_NAVIGATION) {
if (g_settings_get_boolean (nautilus_preferences, NAUTILUS_PREFERENCES_ALWAYS_USE_BROWSER)) {
label = _("Open in New _Window");
} else {
label = _("Browse in New _Window");
show_open_folder_window = TRUE;
}
show_open_in_new_tab = TRUE;
if (g_settings_get_boolean (nautilus_preferences, NAUTILUS_PREFERENCES_ALWAYS_USE_BROWSER)) {
label = _("Open in New _Window");
} else {
label = g_strdup (ngettext ("_Browse Folder",
"_Browse Folders", 1));
label = _("Browse in New _Window");
show_open_folder_window = TRUE;
}
action = gtk_action_group_get_action (view->details->dir_action_group,
NAUTILUS_ACTION_LOCATION_OPEN_ALTERNATE);
g_object_set (action,
......@@ -8580,31 +8574,26 @@ real_update_menus (NautilusView *view)
!(nautilus_window_get_window_type (view->details->window) == NAUTILUS_WINDOW_DESKTOP &&
g_settings_get_boolean (nautilus_preferences, NAUTILUS_PREFERENCES_ALWAYS_USE_BROWSER));
show_open_folder_window = FALSE;
if (nautilus_window_get_window_type (view->details->window) == NAUTILUS_WINDOW_NAVIGATION) {
if (g_settings_get_boolean (nautilus_preferences, NAUTILUS_PREFERENCES_ALWAYS_USE_BROWSER)) {
if (selection_count == 0 || selection_count == 1) {
label_with_underscore = g_strdup (_("Open in New _Window"));
} else {
label_with_underscore = g_strdup_printf (ngettext("Open in %'d New _Window",
"Open in %'d New _Windows",
selection_count),
selection_count);
}
if (g_settings_get_boolean (nautilus_preferences, NAUTILUS_PREFERENCES_ALWAYS_USE_BROWSER)) {
if (selection_count == 0 || selection_count == 1) {
label_with_underscore = g_strdup (_("Open in New _Window"));
} else {
if (selection_count == 0 || selection_count == 1) {
label_with_underscore = g_strdup (_("Browse in New _Window"));
} else {
label_with_underscore = g_strdup_printf (ngettext("Browse in %'d New _Window",
"Browse in %'d New _Windows",
selection_count),
selection_count);
}
show_open_folder_window = show_open_alternate;
label_with_underscore = g_strdup_printf (ngettext("Open in %'d New _Window",
"Open in %'d New _Windows",
selection_count),
selection_count);
}
} else {
label_with_underscore = g_strdup (ngettext ("_Browse Folder",
"_Browse Folders",
selection_count));
if (selection_count == 0 || selection_count == 1) {
label_with_underscore = g_strdup (_("Browse in New _Window"));
} else {
label_with_underscore = g_strdup_printf (ngettext("Browse in %'d New _Window",
"Browse in %'d New _Windows",
selection_count),
selection_count);
}
show_open_folder_window = show_open_alternate;
}
action = gtk_action_group_get_action (view->details->dir_action_group,
......@@ -8617,51 +8606,33 @@ real_update_menus (NautilusView *view)
gtk_action_set_sensitive (action, selection_count != 0);
gtk_action_set_visible (action, show_open_alternate);
/* Open in New Tab action */
if (nautilus_window_get_window_type (view->details->window) == NAUTILUS_WINDOW_NAVIGATION) {
if (g_settings_get_boolean (nautilus_preferences, NAUTILUS_PREFERENCES_ALWAYS_USE_BROWSER)) {
if (selection_count == 0 || selection_count == 1) {
label_with_underscore = g_strdup (_("Open in New _Tab"));
} else {
label_with_underscore = g_strdup_printf (ngettext("Open in %'d New _Tab",
"Open in %'d New _Tabs",
selection_count),
selection_count);
}
if (g_settings_get_boolean (nautilus_preferences, NAUTILUS_PREFERENCES_ALWAYS_USE_BROWSER)) {
if (selection_count == 0 || selection_count == 1) {
label_with_underscore = g_strdup (_("Open in New _Tab"));
} else {
if (selection_count == 0 || selection_count == 1) {
label_with_underscore = g_strdup (_("Browse in New _Tab"));
} else {
label_with_underscore = g_strdup_printf (ngettext("Browse in %'d New _Tab",
"Browse in %'d New _Tabs",
selection_count),
selection_count);
}
label_with_underscore = g_strdup_printf (ngettext<