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 584489 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]
improved shell notifier
unmount-notifier.patch (text/plain), 5.81 KB, created by
Cosimo Cecchi
on 2012-05-14 22:38:51 UTC
(
hide
)
Description:
improved shell notifier
Filename:
MIME Type:
Creator:
Cosimo Cecchi
Created:
2012-05-14 22:38:51 UTC
Size:
5.81 KB
patch
obsolete
>From 2b658e49aa46a00b651d928a859d6dc8b7ef5dd9 Mon Sep 17 00:00:00 2001 >From: Cosimo Cecchi <cosimoc@gnome.org> >Date: Mon, 14 May 2012 18:33:06 -0400 >Subject: [PATCH] autorun: add a notification when unmounting drives > >Initial patch by Adel Gadllah <adel.gadllah@gmail.com> > >https://bugzilla.redhat.com/show_bug.cgi?id=819492 >--- > js/ui/autorunManager.js | 72 +++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 72 insertions(+) > >diff --git a/js/ui/autorunManager.js b/js/ui/autorunManager.js >index 27d89e8..c969bbb 100644 >--- a/js/ui/autorunManager.js >+++ b/js/ui/autorunManager.js >@@ -151,6 +151,7 @@ const AutorunManager = new Lang.Class({ > > this._transDispatcher = new AutorunTransientDispatcher(); > this._createResidentSource(); >+ this._unmountNotifier = new UnmountNotifier(); > > let mounts = this._volumeMonitor.get_mounts(); > >@@ -193,6 +194,10 @@ const AutorunManager = new Lang.Class({ > > ejectMount: function(mount) { > let mountOp = new ShellMountOperation.ShellMountOperation(mount); >+ mountOp.mountOp.connect('show-processes-2', Lang.bind(this, >+ function() { >+ this._unmountNotifier.done(false); >+ })); > > // first, see if we have a drive > let drive = mount.get_drive(); >@@ -201,19 +206,24 @@ const AutorunManager = new Lang.Class({ > if (drive && > drive.get_start_stop_type() == Gio.DriveStartStopType.SHUTDOWN && > drive.can_stop()) { >+ this._unmountNotifier.show(); > drive.stop(0, mountOp.mountOp, null, > Lang.bind(this, this._onStop)); > } else { > if (mount.can_eject()) { >+ this._unmountNotifier.show(); > mount.eject_with_operation(0, mountOp.mountOp, null, > Lang.bind(this, this._onEject)); > } else if (volume && volume.can_eject()) { >+ this._unmountNotifier.show(); > volume.eject_with_operation(0, mountOp.mountOp, null, > Lang.bind(this, this._onEject)); > } else if (drive && drive.can_eject()) { >+ this._unmountNotifier.show(); > drive.eject_with_operation(0, mountOp.mountOp, null, > Lang.bind(this, this._onEject)); > } else if (mount.can_unmount()) { >+ this._unmountNotifier.show(); > mount.unmount_with_operation(0, mountOp.mountOp, null, > Lang.bind(this, this._onUnmount)); > } >@@ -221,8 +231,10 @@ const AutorunManager = new Lang.Class({ > }, > > _onUnmount: function(mount, res) { >+ let success = false; > try { > mount.unmount_with_operation_finish(res); >+ success = true; > } catch (e) { > // FIXME: we need to ignore G_IO_ERROR_FAILED_HANDLED errors here > // but we can't access the error code from JS. >@@ -230,11 +242,15 @@ const AutorunManager = new Lang.Class({ > log('Unable to eject the mount ' + mount.get_name() > + ': ' + e.toString()); > } >+ >+ this._unmountNotifier.done(success); > }, > > _onEject: function(source, res) { >+ let success = false; > try { > source.eject_with_operation_finish(res); >+ success = true; > } catch (e) { > // FIXME: we need to ignore G_IO_ERROR_FAILED_HANDLED errors here > // but we can't access the error code from JS. >@@ -242,11 +258,15 @@ const AutorunManager = new Lang.Class({ > log('Unable to eject the drive ' + source.get_name() > + ': ' + e.toString()); > } >+ >+ this._unmountNotifier.done(success); > }, > > _onStop: function(drive, res) { >+ let success = false; > try { > drive.stop_finish(res); >+ success = true; > } catch (e) { > // FIXME: we need to ignore G_IO_ERROR_FAILED_HANDLED errors here > // but we can't access the error code from JS. >@@ -254,7 +274,59 @@ const AutorunManager = new Lang.Class({ > log('Unable to stop the drive ' + drive.get_name() > + ': ' + e.toString()); > } >+ >+ this._unmountNotifier.done(success); >+ } >+}); >+ >+const UnmountNotifier = new Lang.Class({ >+ Name: 'UnmountNotifier', >+ Extends: MessageTray.Source, >+ >+ _init: function() { >+ this.parent(''); >+ >+ this._notification = null; >+ Main.messageTray.add(this); >+ }, >+ >+ show: function() { >+ let header = _("Writing data to device"); >+ let text = _("Don't unplug until finished"); >+ >+ if (!this._notification) { >+ this._notification = new MessageTray.Notification(this, header, text); >+ } else { >+ this._notification.update(header, text); >+ } >+ >+ this._notification.setTransient(true); >+ this._notification.setUrgency(MessageTray.Urgency.CRITICAL); >+ this.notify(this._notification); >+ }, >+ >+ done: function(success) { >+ if (this._notification) { >+ this._notification.destroy(); >+ this._notification = null; >+ } >+ >+ log('done ' + success); >+ >+ if (success) { >+ let header = _("You can now unplug the device"); >+ let notification = new MessageTray.Notification(this, header, null); >+ notification.setTransient(true); >+ >+ this.notify(notification); >+ } > }, >+ >+ createNotificationIcon: function() { >+ return new St.Icon ({ icon_name: 'media-removable', >+ icon_type: St.IconType.FULLCOLOR, >+ icon_size: this.ICON_SIZE }); >+ } > }); > > const AutorunResidentSource = new Lang.Class({ >-- >1.7.10.1 >
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