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 602976 - Right click on places
Right click on places
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
2.28.x
Other Linux
: Normal enhancement
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2009-11-25 20:52 UTC by Maciej (Matthew) Piechotka
Modified: 2009-12-18 20:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add eject buttons in places menu for places which support it (5.05 KB, patch)
2009-11-29 15:54 UTC, Florian Müllner
reviewed Details | Review
Add eject buttons in places menu for places which support it (4.60 KB, patch)
2009-12-17 19:37 UTC, Florian Müllner
none Details | Review
Add eject buttons in places menu for places which support it (4.65 KB, patch)
2009-12-18 15:33 UTC, Florian Müllner
none Details | Review
Add eject buttons in places menu for places which support it (4.70 KB, patch)
2009-12-18 19:54 UTC, Florian Müllner
committed Details | Review

Description Maciej (Matthew) Piechotka 2009-11-25 20:52:11 UTC
Currently when I need to unmount or eject some drive I need:
- Create a new workspace, rightclick on drive on desktop and choose unmount
- Open nautilus, choose Go->Computer, rightclick on drive and choose unmount
- Minimalize everything, rightclick on drive and choose unmount

However I should be able to just rightclick in gnome-shell left panel.
Comment 1 Florian Müllner 2009-11-29 15:54:18 UTC
Created attachment 148694 [details] [review]
Add eject buttons in places menu for places which support it

This patch depends on a solution for https://bugzilla.gnome.org/show_bug.cgi?id=563025.
Comment 2 Colin Walters 2009-12-17 15:12:19 UTC
Review of attachment 148694 [details] [review]:

Cool, thanks!  Will conflict with my search patch =(  But I'll deal with that after it lands.  Some small comments follow.

::: js/ui/placeDisplay.js
@@ +54,3 @@
+    isRemovable: function() {
+
+    },

We have this more standard at the top, like:

PlaceDeviceInfo.prototype = {
    __proto__: PlaceInfo.prototype,

    _init: function () {
...

@@ +61,3 @@
+
+    iconFactory: function(size) {
+        let icon=this._mount.get_icon();

Spaces around =

@@ +79,3 @@
+
+        //this._mount.unmount(0, null, Lang.bind(this, this._removeFinish));
+        this._mount.unmount(0, null, this._removeFinish, null);

Why the commented out version?

@@ +357,1 @@
         let text = new St.Label({ style_class: 'places-item',

This should be a St.Button; connect to 'clicked'.  In the near future I'd like to land generic support for prelighting when over St.Button.

@@ +360,3 @@
+        let iconBox = new Big.Box({ y_align: Big.BoxAlignment.CENTER,
+                                  reactive: true });
+                                  text: info.name,

Also while you're here, St.Bin is better now than Big.Box for holding icons, because it defaults to centering.

@@ +370,3 @@
+            let removeIconBox = new Big.Box({ y_align: Big.BoxAlignment.CENTER,
+            let removeIcon = Shell.TextureCache.get_default().load_icon_name ('media-eject', PLACES_ICON_SIZE);
+        if (info.isRemovable()) {

St.Bin here too.

@@ +376,3 @@
+            let removeIconBox = new Big.Box({ y_align: Big.BoxAlignment.CENTER,
+            let removeIcon = Shell.TextureCache.get_default().load_icon_name ('media-eject', PLACES_ICON_SIZE);
+        if (info.isRemovable()) {

Ditto for using a St.Button.
Comment 3 Florian Müllner 2009-12-17 15:43:50 UTC
(In reply to comment #2)
> Review of attachment 148694 [details] [review]:
> 
> Cool, thanks!  Will conflict with my search patch =(  But I'll deal with that
> after it lands.

I know - I already have an updated patch, just waiting for your patch to land.

Some small comments follow.
> 
> ::: js/ui/placeDisplay.js
> @@ +54,3 @@
> +    isRemovable: function() {
> +
> +    },
> 
> We have this more standard at the top, like:
> 
> PlaceDeviceInfo.prototype = {
>     __proto__: PlaceInfo.prototype,
> 
>     _init: function () {
> ...

Yeah, I figured this out myself - this is what I do in current code ...


> 
> @@ +61,3 @@
> +
> +    iconFactory: function(size) {
> +        let icon=this._mount.get_icon();
> 
> Spaces around =

Wooops, thanks for the catch!


> @@ +79,3 @@
> +
> +        //this._mount.unmount(0, null, Lang.bind(this, this._removeFinish));
> +        this._mount.unmount(0, null, this._removeFinish, null);
> 
> Why the commented out version?

The commented version follows the same syntax as connect, idle_add etc. In other words, it is the syntax I'd like to see for callback functions - unfortunately, currently gjs requires to pass null as user_data.
See https://bugzilla.gnome.org/show_bug.cgi?id=603754

 
> @@ +357,1 @@
>          let text = new St.Label({ style_class: 'places-item',
> 
> This should be a St.Button; connect to 'clicked'.  In the near future I'd like
> to land generic support for prelighting when over St.Button.
> 
> @@ +360,3 @@
> +        let iconBox = new Big.Box({ y_align: Big.BoxAlignment.CENTER,
> +                                  reactive: true });
> +                                  text: info.name,
> 
> Also while you're here, St.Bin is better now than Big.Box for holding icons,
> because it defaults to centering.
> 
> @@ +370,3 @@
> +            let removeIconBox = new Big.Box({ y_align:
> Big.BoxAlignment.CENTER,
> +            let removeIcon = Shell.TextureCache.get_default().load_icon_name
> ('media-eject', PLACES_ICON_SIZE);
> +        if (info.isRemovable()) {
> 
> St.Bin here too.
> 
> @@ +376,3 @@
> +            let removeIconBox = new Big.Box({ y_align:
> Big.BoxAlignment.CENTER,
> +            let removeIcon = Shell.TextureCache.get_default().load_icon_name
> ('media-eject', PLACES_ICON_SIZE);
> +        if (info.isRemovable()) {
> 
> Ditto for using a St.Button.

OK, I'll update the code accordingly.
Comment 4 Florian Müllner 2009-12-17 19:37:02 UTC
Created attachment 149932 [details] [review]
Add eject buttons in places menu for places which support it

Updated the patch according to the review.
Comment 5 Florian Müllner 2009-12-18 15:33:31 UTC
Created attachment 150010 [details] [review]
Add eject buttons in places menu for places which support it

Updated patch to apply after landing of the search rewrite.
Comment 6 Florian Müllner 2009-12-18 19:54:47 UTC
Created attachment 150023 [details] [review]
Add eject buttons in places menu for places which support it

The previous patch version broke search in the overlay.
Comment 7 Colin Walters 2009-12-18 20:10:33 UTC
Review of attachment 150023 [details] [review]:

Some comments follow, I took the liberty of fixing them and will push.  Thanks!

::: js/ui/placeDisplay.js
@@ +83,3 @@
+    launch: function() {
+        Gio.app_info_launch_default_for_uri(this._mount.get_root().get_uri(),
+                                            Main.createAppLaunchContext());

This is now global.create_app_launch_context.

@@ +395,3 @@
                                    spacing: 4 });
+                                   label: info.name });
+        let text = new St.Button({ style_class: 'places-item',

This needed x_align: St.Align.START

Otherwise we end up centering the label which is wrong here.

@@ +406,3 @@
+            let removeIconBox = new St.Bin({ child: removeIcon,
+            let removeIcon = Shell.TextureCache.get_default().load_icon_name ('media-eject', PLACES_ICON_SIZE);
+        if (info.isRemovable()) {

This one should be a St.Button.

@@ +408,3 @@
+            let removeIconBox = new St.Bin({ child: removeIcon,
+            let removeIcon = Shell.TextureCache.get_default().load_icon_name ('media-eject', PLACES_ICON_SIZE);
+        if (info.isRemovable()) {

And this should be 'clicked'
Comment 8 Colin Walters 2009-12-18 20:11:28 UTC
Attachment 150023 [details] pushed as 1c4c3af - Add eject buttons in places menu for places which support it