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 691035 - messageTray: Add context menu with clear item
messageTray: Add context menu with clear item
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: message-tray
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 651289 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-01-02 20:49 UTC by drago01
Modified: 2013-03-02 12:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
messageTray: Add context menu with clear item (4.79 KB, patch)
2013-01-02 20:49 UTC, drago01
reviewed Details | Review
messageTray: Add context menu (5.94 KB, patch)
2013-02-10 10:50 UTC, drago01
reviewed Details | Review
messageTray: Add context menu (6.04 KB, patch)
2013-02-11 22:43 UTC, drago01
none Details | Review
messageTray: Add context menu (6.04 KB, patch)
2013-02-11 22:44 UTC, drago01
none Details | Review
messageTray: Add context menu (3.60 KB, patch)
2013-02-11 22:54 UTC, drago01
committed Details | Review

Description drago01 2013-01-02 20:49:23 UTC
See patch.
Comment 1 drago01 2013-01-02 20:49:25 UTC
Created attachment 232569 [details] [review]
messageTray: Add context menu with clear item

Add a context menu to the tray that clean's up the sources.
Comment 2 Jasper St. Pierre (not reading bugmail) 2013-01-02 21:18:10 UTC
Review of attachment 232569 [details] [review]:

::: js/ui/messageTray.js
@@ +1582,3 @@
+    _buildRightClickMenu: function() {
+        let item;
+        let rightClickMenu = new St.BoxLayout({ name: 'summary-right-click-menu',

Yikes. We use a BoxLayout + BoxPointer combo right now for message tray items but that's because we have an existing BoxPointer. We really should be using a PopupMenu, and there's no reason you shouldn't be either.
Comment 3 Matthias Clasen 2013-01-23 17:41:18 UTC
Th context menu might be a good place to add a "Notification Settings" item too.
A menu with one item looks stupid anyway.
Comment 4 drago01 2013-02-10 10:50:31 UTC
Created attachment 235615 [details] [review]
messageTray: Add context menu

Add a context menu to the tray that allows cleaning up sources
and open the notification settings panel.
Comment 5 drago01 2013-02-10 10:53:06 UTC
(In reply to comment #2)
> Review of attachment 232569 [details] [review]:
> 
> ::: js/ui/messageTray.js
> @@ +1582,3 @@
> +    _buildRightClickMenu: function() {
> +        let item;
> +        let rightClickMenu = new St.BoxLayout({ name:
> 'summary-right-click-menu',
> 
> Yikes. We use a BoxLayout + BoxPointer combo right now for message tray items
> but that's because we have an existing BoxPointer. We really should be using a
> PopupMenu, and there's no reason you shouldn't be either.

Uses a PopupMenu now ... didn't change the api though my attempt ended up kind of messy so I went with the "dummy actor pattern" we use in the rest of the code.
Comment 6 drago01 2013-02-11 22:43:38 UTC
Created attachment 235752 [details] [review]
messageTray: Add context menu

Add a context menu to the tray that allows cleaning up sources
and open the notification settings panel.


Added separator before the settings entry.
Comment 7 Jasper St. Pierre (not reading bugmail) 2013-02-11 22:44:05 UTC
Review of attachment 235615 [details] [review]:

Mostly OK.

::: js/ui/messageTray.js
@@ +1480,3 @@
+
+        this.addAction(_("Notification Settings"), function () {
+            Util.spawn(['gnome-control-center', 'notifications']);

We should probably make a .desktop file for this.

@@ +1481,3 @@
+        this.addAction(_("Notification Settings"), function () {
+            Util.spawn(['gnome-control-center', 'notifications']);
+            tray.escapeTray();

_escapeTray is supposed to be an internal method to popping down the tray. I'd prefer to have a close() method that calls this._escapeTray.
Comment 8 drago01 2013-02-11 22:44:34 UTC
Created attachment 235753 [details] [review]
messageTray: Add context menu

Add a context menu to the tray that allows cleaning up sources
and open the notification settings panel.
Comment 9 Matthias Clasen 2013-02-11 22:51:00 UTC
the control-center already installs gnome-notifications-panel.desktop
Comment 10 drago01 2013-02-11 22:54:07 UTC
Created attachment 235754 [details] [review]
messageTray: Add context menu

Add a context menu to the tray that allows cleaning up sources
and open the notification settings panel.


* Add a public close() method instead of calling espaceTray
* Use the desktop file to launch the settings.
Comment 11 Jasper St. Pierre (not reading bugmail) 2013-02-11 23:32:07 UTC
Review of attachment 235754 [details] [review]:

OK.
Comment 12 drago01 2013-02-12 07:39:38 UTC
Attachment 235754 [details] pushed as 9133f6d - messageTray: Add context menu
Comment 13 Joern 2013-02-12 14:47:04 UTC
May i ask/suggest, why not have a Context Menu on *any* click within a blank area of the Message Tray? 
Currently it seems to be limited to just right-click.
Comment 14 drago01 2013-02-12 15:15:58 UTC
(In reply to comment #13)
> May i ask/suggest, why not have a Context Menu on *any* click within a blank
> area of the Message Tray? 
> Currently it seems to be limited to just right-click.

No this would be really annoying.
Comment 15 Jasper St. Pierre (not reading bugmail) 2013-02-12 15:24:12 UTC
It could happen on long press, but I'm not sure that's the best idea.
Comment 16 Joern 2013-02-12 15:36:33 UTC
I just had this thought thinking about how i would open the Context Menu on e.g. a Touchscreen, so just having it pop-up on any click/touch made sense to me.

Of course there's always the risk of accidental clicks, so yeah that could get pretty annoying if one tends to do that a lot.


Another thing i'd like to bring up is the Label of the clear action. I was wondering, if there is nothing to clear, should it even be visible? Or maybe it could be inactive with a Label like "Nothing to clear".
Comment 17 drago01 2013-02-13 14:08:11 UTC
(In reply to comment #16)
> I just had this thought thinking about how i would open the Context Menu on
> e.g. a Touchscreen, so just having it pop-up on any click/touch made sense to
> me.
> 

We should do long press for that, feel free to file a new bug for that.

> 
> 
> Another thing i'd like to bring up is the Label of the clear action. I was
> wondering, if there is nothing to clear, should it even be visible? Or maybe it
> could be inactive with a Label like "Nothing to clear".

http://git.gnome.org/browse/gnome-shell/commit/?id=2138fc2349b27e5f943af236e71ece0512a7c513
Comment 18 Allan Day 2013-03-02 12:58:34 UTC
*** Bug 651289 has been marked as a duplicate of this bug. ***