[nautilus] sidebar: Update eject-tooltip



commit 111b3974885462da1a47a58e3e1949670fe4d058
Author: Corey Berla <corey berla me>
Date:   Wed Apr 27 15:57:58 2022 -0700

    sidebar: Update eject-tooltip
    
    If the mount has no associated drive or volume set the tooltip to
    Disconnect (to match network location behavior in Places).
    If the drive or volume can be ejected set the tooltip to Eject
    otherwise set it to Unmount.
    
    Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2153

 src/gtk/nautilusgtkplacessidebar.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/src/gtk/nautilusgtkplacessidebar.c b/src/gtk/nautilusgtkplacessidebar.c
index ad214d91f..021871f1a 100644
--- a/src/gtk/nautilusgtkplacessidebar.c
+++ b/src/gtk/nautilusgtkplacessidebar.c
@@ -403,6 +403,7 @@ add_place (NautilusGtkPlacesSidebar            *sidebar,
   GtkWidget *row;
   GtkWidget *eject_button;
   GtkGesture *gesture;
+  char *eject_tooltip;
 
   check_unmount_and_eject (mount, volume, drive,
                            &show_unmount, &show_eject);
@@ -411,6 +412,12 @@ add_place (NautilusGtkPlacesSidebar            *sidebar,
     g_assert (place_type != NAUTILUS_GTK_PLACES_BOOKMARK);
 
   show_eject_button = (show_unmount || show_eject);
+  if (mount != NULL && volume == NULL && drive == NULL)
+    eject_tooltip = _("Disconnect");
+  else if (show_eject)
+    eject_tooltip = _("Eject");
+  else
+    eject_tooltip = _("Unmount");
 
   row = g_object_new (NAUTILUS_TYPE_GTK_SIDEBAR_ROW,
                       "sidebar", sidebar,
@@ -419,6 +426,7 @@ add_place (NautilusGtkPlacesSidebar            *sidebar,
                       "label", name,
                       "tooltip", tooltip,
                       "ejectable", show_eject_button,
+                      "eject-tooltip", eject_tooltip,
                       "order-index", index,
                       "section-type", section_type,
                       "place-type", place_type,


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