[nautilus] places: hide "Open in new Tab/Window" when using separate windows
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] places: hide "Open in new Tab/Window" when using separate windows
- Date: Mon, 21 Mar 2011 16:26:39 +0000 (UTC)
commit 76e10b322b5e0689c16881f10a3854e207a44c09
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Mon Mar 21 12:25:39 2011 -0400
places: hide "Open in new Tab/Window" when using separate windows
src/nautilus-places-sidebar.c | 21 ++++++++++++++++-----
1 files changed, 16 insertions(+), 5 deletions(-)
---
diff --git a/src/nautilus-places-sidebar.c b/src/nautilus-places-sidebar.c
index 0db9891..0d032e3 100644
--- a/src/nautilus-places-sidebar.c
+++ b/src/nautilus-places-sidebar.c
@@ -1660,8 +1660,6 @@ bookmarks_check_popup_sensitivity (NautilusPlacesSidebar *sidebar)
-1);
}
- gtk_widget_show (sidebar->popup_menu_open_in_new_tab_item);
-
gtk_widget_set_sensitive (sidebar->popup_menu_remove_item, (type == PLACES_BOOKMARK));
gtk_widget_set_sensitive (sidebar->popup_menu_rename_item, (type == PLACES_BOOKMARK));
gtk_widget_set_sensitive (sidebar->popup_menu_empty_trash_item, !nautilus_trash_monitor_is_empty ());
@@ -2555,11 +2553,15 @@ 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),
@@ -2577,15 +2579,21 @@ bookmarks_build_popup_menu (NautilusPlacesSidebar *sidebar)
sidebar->popup_menu_open_in_new_tab_item = item;
g_signal_connect (item, "activate",
G_CALLBACK (open_shortcut_in_new_tab_cb), sidebar);
- gtk_widget_show (item);
gtk_menu_shell_append (GTK_MENU_SHELL (sidebar->popup_menu), item);
+ if (use_browser) {
+ 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_widget_show (item);
gtk_menu_shell_append (GTK_MENU_SHELL (sidebar->popup_menu), item);
+ if (use_browser) {
+ gtk_widget_show (item);
+ }
+
eel_gtk_menu_append_separator (GTK_MENU (sidebar->popup_menu));
item = gtk_image_menu_item_new_with_label (_("Remove"));
@@ -3317,6 +3325,9 @@ 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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]