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 695567 - Add selection menu
Add selection menu
Status: RESOLVED FIXED
Product: gnome-weather
Classification: Applications
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME Weather Maintainer(s)
GNOME Weather Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-03-10 14:10 UTC by Paolo Borelli
Modified: 2013-03-12 17:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add selecttion menu (4.54 KB, patch)
2013-03-10 14:11 UTC, Paolo Borelli
none Details | Review
patch (4.59 KB, patch)
2013-03-11 20:51 UTC, Paolo Borelli
reviewed Details | Review

Description Paolo Borelli 2013-03-10 14:10:58 UTC
The patch is against the gjs-experiments branch since you applied the ui file stuff there and I need a ui file for the menu items
Comment 1 Paolo Borelli 2013-03-10 14:11:00 UTC
Created attachment 238523 [details] [review]
Add selecttion menu

Add the selection menu with "Select All" and "Select None".
Comment 2 Paolo Borelli 2013-03-11 20:51:57 UTC
Created attachment 238620 [details] [review]
patch

Rebased to apply to master
Comment 3 Giovanni Campagna 2013-03-12 16:23:06 UTC
Review of attachment 238620 [details] [review]:

::: src/main.js
@@ +77,3 @@
+
+        this.add_accelerator("Escape", "win.exit-selection-mode", null);
+        this.add_accelerator("<Primary>a", "win.select-all", null);

The second accelerator is implied by the menu.

::: src/window.js
@@ +313,3 @@
 
+    _exitSelectionMode: function() {
+        this._worldView.set_selection_mode(false);

Use GObject property setting, not setter functions
(ie worldView.selection_mode = false;)
Comment 4 Paolo Borelli 2013-03-12 16:40:21 UTC
(In reply to comment #3)
> +        this.add_accelerator("<Primary>a", "win.select-all", null);
> 
> The second accelerator is implied by the menu.
> 

Unfortunately it is not, that only works for menus associated with the window, but the menu here is in a widget and the widget is not even displayed in some cases (ctrl+A should switch you to selection mode even if you are not)

On the other hand I also need to keep it in the menu definition otherwise the shortcut is not shown
Comment 5 Giovanni Campagna 2013-03-12 16:45:00 UTC
Ah, bad gtk+!
Looks good then.
Comment 6 Paolo Borelli 2013-03-12 17:37:49 UTC
amended the setter and pushed.