[gnome-disk-utility/udisks2-port] Use recently added Eject() method on the Drive interface
- From: David Zeuthen <davidz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-disk-utility/udisks2-port] Use recently added Eject() method on the Drive interface
- Date: Thu, 4 Aug 2011 18:23:27 +0000 (UTC)
commit 532d777cdf4efac1a0e9401e520e060d67add04c
Author: David Zeuthen <davidz redhat com>
Date: Thu Aug 4 14:23:12 2011 -0400
Use recently added Eject() method on the Drive interface
Signed-off-by: David Zeuthen <davidz redhat com>
src/palimpsest/gduwindow.c | 31 ++++++++++++++++++++++++++++++-
1 files changed, 30 insertions(+), 1 deletions(-)
---
diff --git a/src/palimpsest/gduwindow.c b/src/palimpsest/gduwindow.c
index e959965..adf342e 100644
--- a/src/palimpsest/gduwindow.c
+++ b/src/palimpsest/gduwindow.c
@@ -2069,10 +2069,39 @@ on_devtab_action_partition_create_activated (GtkAction *action,
/* ---------------------------------------------------------------------------------------------------- */
static void
+eject_cb (UDisksDrive *drive,
+ GAsyncResult *res,
+ gpointer user_data)
+{
+ GduWindow *window = GDU_WINDOW (user_data);
+ GError *error;
+
+ error = NULL;
+ if (!udisks_drive_call_eject_finish (drive,
+ res,
+ &error))
+ {
+ gdu_window_show_error (window,
+ _("Error ejecting media"),
+ error);
+ g_error_free (error);
+ }
+ g_object_unref (window);
+}
+
+static void
on_devtab_action_eject_activated (GtkAction *action,
gpointer user_data)
{
- g_debug ("%s: TODO", G_STRFUNC);
+ GduWindow *window = GDU_WINDOW (user_data);
+ UDisksDrive *drive;
+
+ drive = udisks_object_peek_drive (window->current_object);
+ udisks_drive_call_eject (drive,
+ g_variant_new ("a{sv}", NULL), /* options */
+ NULL, /* cancellable */
+ (GAsyncReadyCallback) eject_cb,
+ g_object_ref (window));
}
/* ---------------------------------------------------------------------------------------------------- */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]