Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 584696 Details for
Bug 819492
GVfs apps should convey when eject/unmount takes a long time
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
nautilus patch
x.patch (text/plain), 6.15 KB, created by
Tomáš Bžatek
on 2012-05-15 15:34:53 UTC
(
hide
)
Description:
nautilus patch
Filename:
MIME Type:
Creator:
Tomáš Bžatek
Created:
2012-05-15 15:34:53 UTC
Size:
6.15 KB
patch
obsolete
>diff --git a/src/nautilus-places-sidebar.c b/src/nautilus-places-sidebar.c >index 26dd93e..12c4d83 100644 >--- a/src/nautilus-places-sidebar.c >+++ b/src/nautilus-places-sidebar.c >@@ -53,6 +53,8 @@ > #include "nautilus-window.h" > #include "nautilus-window-slot.h" > >+#include <libnotify/notify.h> >+ > #define DEBUG_FLAG NAUTILUS_DEBUG_PLACES > #include <libnautilus-private/nautilus-debug.h> > >@@ -2128,22 +2130,79 @@ unmount_shortcut_cb (GtkMenuItem *item, > do_unmount_selection (sidebar); > } > >+typedef struct { >+ NautilusWindow *window; >+ GMountOperation *mount_op; >+ guint timeout_id; >+ NotifyNotification *notify; >+} EjectOpData; >+ >+static void >+free_eject_op_data (EjectOpData *data) >+{ >+ if (data->timeout_id > 0) >+ g_source_remove (data->timeout_id); >+ >+ if (data->notify != NULL) { >+ /* Notification was shown, let's update it we're finished */ >+ notify_notification_update (data->notify, >+ _("You can now unplug the device"), >+ NULL, >+ "media-removable"); >+ >+ notify_notification_set_urgency (data->notify, NOTIFY_URGENCY_LOW); >+ notify_notification_set_timeout (data->notify, NOTIFY_EXPIRES_DEFAULT); >+ notify_notification_show (data->notify, NULL); >+ g_object_unref (data->notify); >+ } >+ >+ g_object_unref (data->mount_op); >+ g_free (data); >+} >+ >+static void >+pop_down_notification (EjectOpData *data) >+{ >+ if (data->timeout_id > 0) { >+ g_source_remove (data->timeout_id); >+ data->timeout_id = 0; >+ } >+ >+ if (data->notify != NULL) { >+ notify_notification_close (data->notify, NULL); >+ g_object_unref (data->notify); >+ data->notify = NULL; >+ } >+} >+ >+static void >+mount_op_show_processes (GMountOperation *op, >+ gchar *message, >+ GArray *processes, >+ GStrv choices, >+ gpointer user_data) >+{ >+ EjectOpData *data = user_data; >+ >+ pop_down_notification (data); >+} >+ > static void > drive_eject_cb (GObject *source_object, > GAsyncResult *res, > gpointer user_data) > { >- NautilusWindow *window; >+ EjectOpData *data = user_data; > GError *error; > char *primary; > char *name; > >- window = user_data; >- g_object_unref (window); >+ g_object_unref (data->window); > > error = NULL; > if (!g_drive_eject_with_operation_finish (G_DRIVE (source_object), res, &error)) { > if (error->code != G_IO_ERROR_FAILED_HANDLED) { >+ pop_down_notification (data); > name = g_drive_get_name (G_DRIVE (source_object)); > primary = g_strdup_printf (_("Unable to eject %s"), name); > g_free (name); >@@ -2154,6 +2213,8 @@ drive_eject_cb (GObject *source_object, > } > g_error_free (error); > } >+ >+ free_eject_op_data (data); > } > > static void >@@ -2161,17 +2222,17 @@ volume_eject_cb (GObject *source_object, > GAsyncResult *res, > gpointer user_data) > { >- NautilusWindow *window; >+ EjectOpData *data = user_data; > GError *error; > char *primary; > char *name; > >- window = user_data; >- g_object_unref (window); >+ g_object_unref (data->window); > > error = NULL; > if (!g_volume_eject_with_operation_finish (G_VOLUME (source_object), res, &error)) { > if (error->code != G_IO_ERROR_FAILED_HANDLED) { >+ pop_down_notification (data); > name = g_volume_get_name (G_VOLUME (source_object)); > primary = g_strdup_printf (_("Unable to eject %s"), name); > g_free (name); >@@ -2182,6 +2243,8 @@ volume_eject_cb (GObject *source_object, > } > g_error_free (error); > } >+ >+ free_eject_op_data (data); > } > > static void >@@ -2189,17 +2252,17 @@ mount_eject_cb (GObject *source_object, > GAsyncResult *res, > gpointer user_data) > { >- NautilusWindow *window; >+ EjectOpData *data = user_data; > GError *error; > char *primary; > char *name; > >- window = user_data; >- g_object_unref (window); >+ g_object_unref (data->window); > > error = NULL; > if (!g_mount_eject_with_operation_finish (G_MOUNT (source_object), res, &error)) { > if (error->code != G_IO_ERROR_FAILED_HANDLED) { >+ pop_down_notification (data); > name = g_mount_get_name (G_MOUNT (source_object)); > primary = g_strdup_printf (_("Unable to eject %s"), name); > g_free (name); >@@ -2210,6 +2273,26 @@ mount_eject_cb (GObject *source_object, > } > g_error_free (error); > } >+ >+ free_eject_op_data (data); >+} >+ >+static gboolean >+eject_timeout (gpointer user_data) >+{ >+ EjectOpData *data = user_data; >+ >+ data->timeout_id = 0; >+ >+ data->notify = notify_notification_new (_("Writing data to device"), >+ _("Don't unplug until finished"), >+ "media-removable"); >+ notify_notification_set_urgency (data->notify, NOTIFY_URGENCY_CRITICAL); >+ notify_notification_set_timeout (data->notify, NOTIFY_EXPIRES_NEVER); >+ >+ notify_notification_show (data->notify, NULL); >+ >+ return FALSE; > } > > static void >@@ -2218,20 +2301,27 @@ do_eject (GMount *mount, > GDrive *drive, > NautilusPlacesSidebar *sidebar) > { >- GMountOperation *mount_op; >+ EjectOpData *data; >+ >+ >+ data = g_malloc0 (sizeof (EjectOpData)); >+ data->window = g_object_ref (sidebar->window); >+ data->mount_op = gtk_mount_operation_new (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (sidebar)))); > >- mount_op = gtk_mount_operation_new (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (sidebar)))); > if (mount != NULL) { >- g_mount_eject_with_operation (mount, 0, mount_op, NULL, mount_eject_cb, >- g_object_ref (sidebar->window)); >+ g_mount_eject_with_operation (mount, 0, data->mount_op, NULL, mount_eject_cb, data); > } else if (volume != NULL) { >- g_volume_eject_with_operation (volume, 0, mount_op, NULL, volume_eject_cb, >- g_object_ref (sidebar->window)); >+ g_volume_eject_with_operation (volume, 0, data->mount_op, NULL, volume_eject_cb, data); > } else if (drive != NULL) { >- g_drive_eject_with_operation (drive, 0, mount_op, NULL, drive_eject_cb, >- g_object_ref (sidebar->window)); >+ g_drive_eject_with_operation (drive, 0, data->mount_op, NULL, drive_eject_cb, data); >+ } >+ >+ /* Display a notification of ongoing operation after a timeout */ >+ if (mount != NULL || volume != NULL || drive != NULL) { >+ data->timeout_id = g_timeout_add_seconds (1, (GSourceFunc) eject_timeout, data); >+ g_signal_connect (G_OBJECT (data->mount_op), "show-processes", >+ G_CALLBACK (mount_op_show_processes), data); > } >- g_object_unref (mount_op); > } > > static void
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 819492
:
582641
|
582657
|
584469
|
584470
|
584471
|
584476
|
584477
|
584478
|
584479
|
584489
|
584491
| 584696 |
584797