diff options
author | Alexander Larsson <alexl@redhat.com> | 2009-04-13 18:11:52 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2009-04-13 18:11:52 +0000 |
commit | 99e702d497e41d42be4b7b3078ca3764f6aef359 (patch) | |
tree | 7e453509a90cfffbdbceddd5f49cc5ef20a81732 | |
parent | cb087ce4d1de7ca414b9fbceaa19c9da3a783fc5 (diff) | |
download | nautilus-99e702d497e41d42be4b7b3078ca3764f6aef359.tar.gz |
Don't show eject if not mounted.NAUTILUS_2_26_2
2009-04-13 Alexander Larsson <alexl@redhat.com>
* src/nautilus-places-sidebar.c:
(add_place):
Don't show eject if not mounted.
svn path=/trunk/; revision=15181
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/nautilus-places-sidebar.c | 13 |
2 files changed, 16 insertions, 3 deletions
@@ -1,5 +1,11 @@ 2009-04-13 Alexander Larsson <alexl@redhat.com> + * src/nautilus-places-sidebar.c: + (add_place): + Don't show eject if not mounted. + +2009-04-13 Alexander Larsson <alexl@redhat.com> + * NEWS: Update for release diff --git a/src/nautilus-places-sidebar.c b/src/nautilus-places-sidebar.c index b7d3564a4..2212bc395 100644 --- a/src/nautilus-places-sidebar.c +++ b/src/nautilus-places-sidebar.c @@ -218,6 +218,7 @@ add_place (NautilusPlacesSidebar *sidebar, NautilusIconInfo *icon_info; int icon_size; gboolean show_eject, show_unmount; + gboolean show_eject_button; icon_size = nautilus_get_icon_size_for_stock_size (GTK_ICON_SIZE_MENU); icon_info = nautilus_icon_info_lookup (icon, icon_size); @@ -230,7 +231,13 @@ add_place (NautilusPlacesSidebar *sidebar, if (show_unmount || show_eject) { g_assert (place_type != PLACES_BOOKMARK); } - + + if (mount == NULL) { + show_eject_button = FALSE; + } else { + show_eject_button = (show_unmount || show_eject); + } + gtk_list_store_append (sidebar->store, &iter); gtk_list_store_set (sidebar->store, &iter, PLACES_SIDEBAR_COLUMN_ICON, pixbuf, @@ -241,8 +248,8 @@ add_place (NautilusPlacesSidebar *sidebar, PLACES_SIDEBAR_COLUMN_MOUNT, mount, PLACES_SIDEBAR_COLUMN_ROW_TYPE, place_type, PLACES_SIDEBAR_COLUMN_INDEX, index, - PLACES_SIDEBAR_COLUMN_EJECT, (show_unmount || show_eject), - PLACES_SIDEBAR_COLUMN_NO_EJECT, !(show_unmount || show_eject), + PLACES_SIDEBAR_COLUMN_EJECT, show_eject_button, + PLACES_SIDEBAR_COLUMN_NO_EJECT, !show_eject_button, PLACES_SIDEBAR_COLUMN_BOOKMARK, place_type != PLACES_BOOKMARK, PLACES_SIDEBAR_COLUMN_NO_BOOKMARK, place_type == PLACES_BOOKMARK, -1); |