[nautilus] Remove always-use-browser option



commit 6124a9c6bbca254b7afdbacd0ce48796a7906bbe
Author: William Jon McCann <jmccann redhat com>
Date:   Wed Aug 15 11:02:20 2012 -0400

    Remove always-use-browser option
    
    This isn't necessary since the removal of spatial mode. Having
    it as a hidden preference is counterproductive because it may
    have been set before and it will silently break the behavior of
    the current version.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=681919

 libnautilus-private/nautilus-global-preferences.h  |    1 -
 libnautilus-private/nautilus.convert               |    1 -
 .../org.gnome.nautilus.gschema.xml.in              |    5 ---
 src/nautilus-canvas-view.c                         |   31 ++++++++-----------
 src/nautilus-list-view.c                           |   11 ++-----
 src/nautilus-places-sidebar.c                      |   28 +++--------------
 src/nautilus-view.c                                |    8 -----
 src/nautilus-window-manage-views.c                 |    4 +--
 8 files changed, 22 insertions(+), 67 deletions(-)
---
diff --git a/libnautilus-private/nautilus-global-preferences.h b/libnautilus-private/nautilus-global-preferences.h
index b897cd2..298c822 100644
--- a/libnautilus-private/nautilus-global-preferences.h
+++ b/libnautilus-private/nautilus-global-preferences.h
@@ -60,7 +60,6 @@ typedef enum
 #define NAUTILUS_PREFERENCES_INSTALL_MIME_ACTIVATION		"install-mime-activation"
 
 /* Spatial or browser mode */
-#define NAUTILUS_PREFERENCES_ALWAYS_USE_BROWSER			"always-use-browser"
 #define NAUTILUS_PREFERENCES_NEW_TAB_POSITION			"tabs-open-position"
 
 #define NAUTILUS_PREFERENCES_ALWAYS_USE_LOCATION_ENTRY		"always-use-location-entry"
diff --git a/libnautilus-private/nautilus.convert b/libnautilus-private/nautilus.convert
index 182694e..237a302 100644
--- a/libnautilus-private/nautilus.convert
+++ b/libnautilus-private/nautilus.convert
@@ -1,6 +1,5 @@
 [org.gnome.nautilus.preferences]
 tabs-open-position = /desktop/gnome/file_views/tabs_open_position
-always-use-browser = /apps/nautilus/preferences/always_use_browser
 always-use-location-entry = /apps/nautilus/preferences/always_use_location_entry
 confirm-trash = /apps/nautilus/preferences/confirm_trash
 enable-delete = /apps/nautilus/preferences/enable_delete
diff --git a/libnautilus-private/org.gnome.nautilus.gschema.xml.in b/libnautilus-private/org.gnome.nautilus.gschema.xml.in
index dffa14b..b6a8896 100644
--- a/libnautilus-private/org.gnome.nautilus.gschema.xml.in
+++ b/libnautilus-private/org.gnome.nautilus.gschema.xml.in
@@ -63,11 +63,6 @@
       <_summary>Where to position newly open tabs in browser windows.</_summary>
       <_description>If set to "after-current-tab", then new tabs are inserted after the current tab. If set to "end", then new tabs are appended to the end of the tab list.</_description>
     </key>
-    <key name="always-use-browser" type="b">
-      <default>true</default>
-      <_summary>Enables the classic Nautilus behavior, where all windows are browsers</_summary>
-      <_description>If set to true, then all Nautilus windows will be browser windows. This is how Nautilus used to behave before version 2.6, and some people prefer this behavior.</_description>
-    </key>
     <key name="always-use-location-entry" type="b">
       <default>false</default>
       <_summary>Always use the location entry, instead of the pathbar</_summary>
diff --git a/src/nautilus-canvas-view.c b/src/nautilus-canvas-view.c
index a0a1fd7..555f9df 100644
--- a/src/nautilus-canvas-view.c
+++ b/src/nautilus-canvas-view.c
@@ -1580,24 +1580,19 @@ canvas_container_activate_alternate_callback (NautilusCanvasContainer *container
 	open_in_tab = FALSE;
 	open_in_window = FALSE;
 	close_behind = FALSE;
-	
-	if (g_settings_get_boolean (nautilus_preferences,
-				    NAUTILUS_PREFERENCES_ALWAYS_USE_BROWSER)) {
-		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_window = ((button_event->state & GDK_SHIFT_MASK) != 0);
-			open_in_tab = !open_in_window;
-		} 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);
-		}
-	} else {
-		close_behind = TRUE;
-	} 
+
+	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_window = ((button_event->state & GDK_SHIFT_MASK) != 0);
+		open_in_tab = !open_in_window;
+	} 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);
+	}
 
 	if (open_in_tab) {
 		flags |= NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB;
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c
index cc4426a..90d4089 100644
--- a/src/nautilus-list-view.c
+++ b/src/nautilus-list-view.c
@@ -278,15 +278,10 @@ activate_selected_items_alternate (NautilusListView *view,
 
 	flags = 0;
 
-	if (g_settings_get_boolean (nautilus_preferences,
-				    NAUTILUS_PREFERENCES_ALWAYS_USE_BROWSER)) {
-		if (open_in_tab) {
-			flags |= NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB;
-		} else {
-			flags |= NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW;
-		}
+	if (open_in_tab) {
+		flags |= NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB;
 	} else {
-		flags |= NAUTILUS_WINDOW_OPEN_FLAG_CLOSE_BEHIND;
+		flags |= NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW;
 	}
 
 	if (file != NULL) {
diff --git a/src/nautilus-places-sidebar.c b/src/nautilus-places-sidebar.c
index 9fea7a9..22b4e08 100644
--- a/src/nautilus-places-sidebar.c
+++ b/src/nautilus-places-sidebar.c
@@ -2603,15 +2603,11 @@ static void
 bookmarks_build_popup_menu (NautilusPlacesSidebar *sidebar)
 {
 	GtkWidget *item;
-	gboolean use_browser;
 	
 	if (sidebar->popup_menu) {
 		return;
 	}
 
-	use_browser = g_settings_get_boolean (nautilus_preferences,
-					      NAUTILUS_PREFERENCES_ALWAYS_USE_BROWSER);
-
 	sidebar->popup_menu = gtk_menu_new ();
 	gtk_menu_attach_to_widget (GTK_MENU (sidebar->popup_menu),
 			           GTK_WIDGET (sidebar),
@@ -2630,19 +2626,13 @@ bookmarks_build_popup_menu (NautilusPlacesSidebar *sidebar)
 	g_signal_connect (item, "activate",
 			  G_CALLBACK (open_shortcut_in_new_tab_cb), sidebar);
 	gtk_menu_shell_append (GTK_MENU_SHELL (sidebar->popup_menu), item);
-
-	if (use_browser) {
-		gtk_widget_show (item);
-	}
+	gtk_widget_show (item);
 
 	item = gtk_menu_item_new_with_mnemonic (_("Open in New _Window"));
 	g_signal_connect (item, "activate",
 			  G_CALLBACK (open_shortcut_in_new_window_cb), sidebar);
 	gtk_menu_shell_append (GTK_MENU_SHELL (sidebar->popup_menu), item);
-
-	if (use_browser) {
-		gtk_widget_show (item);
-	}
+	gtk_widget_show (item);
 
 	eel_gtk_menu_append_separator (GTK_MENU (sidebar->popup_menu));
 
@@ -2855,14 +2845,9 @@ bookmarks_button_press_event_cb (GtkWidget             *widget,
 	} else if (event->button == 2) {
 		NautilusWindowOpenFlags flags = 0;
 
-		if (g_settings_get_boolean (nautilus_preferences,
-					    NAUTILUS_PREFERENCES_ALWAYS_USE_BROWSER)) {
-			flags = (event->state & GDK_CONTROL_MASK) ?
-				NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW :
-				NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB;
-		} else {
-			flags = NAUTILUS_WINDOW_OPEN_FLAG_CLOSE_BEHIND;
-		}
+		flags = (event->state & GDK_CONTROL_MASK) ?
+			NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW :
+			NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB;
 
 		open_selected_bookmark (sidebar, model, &iter, flags);
 		retval = TRUE;
@@ -3434,9 +3419,6 @@ nautilus_places_sidebar_set_parent_window (NautilusPlacesSidebar *sidebar,
 	g_signal_connect_object (sidebar->volume_monitor, "drive_changed",
 				 G_CALLBACK (drive_changed_callback), sidebar, 0);
 
-	g_signal_connect_swapped (nautilus_preferences, "changed::" NAUTILUS_PREFERENCES_ALWAYS_USE_BROWSER,
-				  G_CALLBACK (bookmarks_popup_menu_detach_cb), sidebar);
-
 	update_places (sidebar);
 }
 
diff --git a/src/nautilus-view.c b/src/nautilus-view.c
index 94019a8..e1daa8c 100644
--- a/src/nautilus-view.c
+++ b/src/nautilus-view.c
@@ -8561,18 +8561,12 @@ real_update_location_menu (NautilusView *view)
 	gboolean is_recent;
 	gboolean can_delete_file, show_delete;
 	gboolean show_separate_delete_command;
-	gboolean show_open_in_new_tab;
-	gboolean show_open_alternate;
 	GList l;
 	char *label;
 	char *tip;
 
-	show_open_in_new_tab = g_settings_get_boolean (nautilus_preferences, NAUTILUS_PREFERENCES_ALWAYS_USE_BROWSER);
-	show_open_alternate = g_settings_get_boolean (nautilus_preferences, NAUTILUS_PREFERENCES_ALWAYS_USE_BROWSER);
-
 	action = gtk_action_group_get_action (view->details->dir_action_group,
 					      NAUTILUS_ACTION_LOCATION_OPEN_ALTERNATE);
-	gtk_action_set_visible (action, show_open_alternate);
 
 	label = _("Open in New _Window");
 	g_object_set (action,
@@ -8581,7 +8575,6 @@ real_update_location_menu (NautilusView *view)
 
 	action = gtk_action_group_get_action (view->details->dir_action_group,
 					      NAUTILUS_ACTION_LOCATION_OPEN_IN_NEW_TAB);
-	gtk_action_set_visible (action, show_open_in_new_tab);
 
 	label = _("Open in New _Tab");
 	g_object_set (action,
@@ -8884,7 +8877,6 @@ real_update_menus (NautilusView *view)
 
 	show_open_alternate = file_list_all_are_folders (selection) &&
 		selection_count > 0 &&
-		g_settings_get_boolean (nautilus_preferences, NAUTILUS_PREFERENCES_ALWAYS_USE_BROWSER) &&
 		!NAUTILUS_IS_DESKTOP_CANVAS_VIEW (view);
 
 	action = gtk_action_group_get_action (view->details->dir_action_group,
diff --git a/src/nautilus-window-manage-views.c b/src/nautilus-window-manage-views.c
index c54134f..8cc1e5b 100644
--- a/src/nautilus-window-manage-views.c
+++ b/src/nautilus-window-manage-views.c
@@ -425,7 +425,7 @@ nautilus_window_slot_open_location_full (NautilusWindowSlot *slot,
 
         target_window = NULL;
 	target_slot = NULL;
-	use_same = FALSE;
+	use_same = TRUE;
 
 	/* this happens at startup */
 	old_uri = nautilus_window_slot_get_location_uri (slot);
@@ -453,8 +453,6 @@ nautilus_window_slot_open_location_full (NautilusWindowSlot *slot,
 			flags ^= NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB;
 			flags |= NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW;
 		}
-	} else {
-		use_same |= g_settings_get_boolean (nautilus_preferences, NAUTILUS_PREFERENCES_ALWAYS_USE_BROWSER);
 	}
 
 	g_assert (!((flags & NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW) != 0 &&



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]