summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Zeuthen <davidz@redhat.com>2012-05-15 12:52:08 -0400
committerDavid Zeuthen <davidz@redhat.com>2012-05-15 12:53:05 -0400
commit3ac0a803e4fe58a4ac1b82a5770468c6801e93ab (patch)
treecf64472b7b4d9b966eb232dce0f68b577e4459e0
parentffc6b5a3175259bca65f96e15c7501a6fa2570bb (diff)
downloadgvfs-3ac0a803e4fe58a4ac1b82a5770468c6801e93ab.tar.gz
udisks2: Show "Eject Anyway" (not "Unmount Anyway") if ejecting
... instead of unmounting. Signed-off-by: David Zeuthen <davidz@redhat.com>
-rw-r--r--monitor/udisks2/gvfsudisks2drive.c7
-rw-r--r--monitor/udisks2/gvfsudisks2mount.c13
2 files changed, 19 insertions, 1 deletions
diff --git a/monitor/udisks2/gvfsudisks2drive.c b/monitor/udisks2/gvfsudisks2drive.c
index da095480..87747ac3 100644
--- a/monitor/udisks2/gvfsudisks2drive.c
+++ b/monitor/udisks2/gvfsudisks2drive.c
@@ -646,6 +646,13 @@ gvfs_udisks2_drive_eject_with_operation (GDrive *_drive,
{
GVfsUDisks2Drive *drive = GVFS_UDISKS2_DRIVE (_drive);
+ /* This information is needed in GVfsDdisks2Volume when apps have
+ * open files on the device ... we need to know if the button should
+ * be "Unmount Anyway" or "Eject Anyway"
+ */
+ if (mount_operation != NULL)
+ g_object_set_data (G_OBJECT (mount_operation), "x-udisks2-is-eject", GINT_TO_POINTER (1));
+
/* first we need to go through all the volumes and unmount their assoicated mounts (if any) */
unmount_mounts (drive,
flags,
diff --git a/monitor/udisks2/gvfsudisks2mount.c b/monitor/udisks2/gvfsudisks2mount.c
index e882ba82..cf3b29a7 100644
--- a/monitor/udisks2/gvfsudisks2mount.c
+++ b/monitor/udisks2/gvfsudisks2mount.c
@@ -691,6 +691,10 @@ lsof_command_cb (GObject *source_object,
out:
if (!data->completed)
{
+ gboolean is_eject;
+
+ is_eject = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (data->mount_operation), "x-udisks2-is-eject"));
+
/* We want to emit the 'show-processes' signal even if launching
* lsof(1) failed or if it didn't return any PIDs. This is because
* it won't show e.g. root-owned processes operating on files
@@ -705,7 +709,14 @@ lsof_command_cb (GObject *source_object,
G_CALLBACK (on_mount_op_reply),
data);
}
- choices[0] = _("Unmount Anyway");
+ if (is_eject)
+ {
+ choices[0] = _("Eject Anyway");
+ }
+ else
+ {
+ choices[0] = _("Unmount Anyway");
+ }
choices[1] = _("Cancel");
message = _("Volume is busy\n"
"One or more applications are keeping the volume busy.");