After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 676125 - autorun: add a notification when unmounting drives
autorun: add a notification when unmounting drives
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on: 676111
Blocks:
 
 
Reported: 2012-05-15 18:58 UTC by Cosimo Cecchi
Modified: 2012-07-12 00:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
autorun: add a notification when unmounting drives (6.77 KB, patch)
2012-05-15 18:58 UTC, Cosimo Cecchi
needs-work Details | Review
autorun: add a notification when unmounting drives (6.73 KB, patch)
2012-05-15 19:13 UTC, Cosimo Cecchi
accepted-commit_now Details | Review
autorun: add a notification when unmounting drives (7.13 KB, patch)
2012-05-16 19:32 UTC, Cosimo Cecchi
needs-work Details | Review
mount-operation: implement show-unmount-progress (3.16 KB, patch)
2012-07-10 20:00 UTC, Cosimo Cecchi
committed Details | Review

Description Cosimo Cecchi 2012-05-15 18:58:03 UTC
This is proposed as a temporary solution for GNOME 3.4 - for 3.6 we want to integrate a signal that will allow a cleaner implementation directly from GtkMountOperation (see https://bugzilla.gnome.org/show_bug.cgi?id=676111).

See also https://bugzilla.redhat.com/show_bug.cgi?id=819492
Comment 1 Cosimo Cecchi 2012-05-15 18:58:05 UTC
Created attachment 214145 [details] [review]
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
Comment 2 Jasper St. Pierre (not reading bugmail) 2012-05-15 19:06:14 UTC
Review of attachment 214145 [details] [review]:

::: js/ui/autorunManager.js
@@ +286,3 @@
+        this._deviceName = device.get_name();
+
+        this._mountOp.connect('show-processes-2', Lang.bind(this,

You need to explicitly disconnect from these signals and set this._mountOp to null when done with it, otherwise it will hang around forever.
Comment 3 Cosimo Cecchi 2012-05-15 19:13:52 UTC
Created attachment 214146 [details] [review]
autorun: add a notification when unmounting drives

Don't set mountOperation as a member of UnmountNotifier.
Comment 4 Jasper St. Pierre (not reading bugmail) 2012-05-15 19:25:37 UTC
Review of attachment 214146 [details] [review]:

One minor fixup. A quick commit message explaining the problem would also be good.

::: js/ui/autorunManager.js
@@ +336,3 @@
+
+    createNotificationIcon: function() {
+        return new St.Icon ({ icon_name: 'media-removable',

No whitespace.
Comment 5 Cosimo Cecchi 2012-05-16 19:32:42 UTC
Created attachment 214207 [details] [review]
autorun: add a notification when unmounting drives

Improved patch: avoids showing notifications when ejecting optical drives.
Comment 6 André Klapper 2012-05-28 10:12:34 UTC
Patch in comment 5 would add new translatable strings (would need request for string freeze break before committing to stable branch, however no 3.4.3 is GNOME-wide planned, do not know about gnome-shell specifically).
Comment 7 Jasper St. Pierre (not reading bugmail) 2012-05-29 21:02:23 UTC
Review of attachment 214207 [details] [review]:

One minor fix-up that isn't your fault (I pushed a cleanup patch since this was rewritten)

::: js/ui/autorunManager.js
@@ +354,3 @@
+    },
+
+    createNotificationIcon: function() {

This is not needed anymore. Simply pass the icon name and type to Source._init.
Comment 8 Cosimo Cecchi 2012-07-10 20:00:31 UTC
Created attachment 218466 [details] [review]
mount-operation: implement show-unmount-progress

New patch, depends on the new GIO/GVfs API of bug 676111
Comment 9 Jasper St. Pierre (not reading bugmail) 2012-07-10 20:21:06 UTC
Review of attachment 218466 [details] [review]:

Overall, looks fine. Very minor whitespace nit.

::: js/ui/shellMountOperation.js
@@ +248,3 @@
+
+    show: function(message) {
+        let [ header, text ] = message.split('\n');

Should be [header, text].

Also, is there a guarantee there will only be two lines in the message? This might need to be message.split('\n', 1);
Comment 10 Cosimo Cecchi 2012-07-12 00:07:03 UTC
Attachment 218466 [details] pushed as 168e0b5 - mount-operation: implement show-unmount-progress

Thanks, pushed to master with the suggested fix to the limit we apply when splitting the message string.