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 756946 - Add keyboard shortcut for going to user location
Add keyboard shortcut for going to user location
Status: RESOLVED FIXED
Product: gnome-maps
Classification: Applications
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: gnome-maps-maint
gnome-maps-maint
: 757838 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-10-22 07:13 UTC by Jonas Danielsson
Modified: 2016-01-04 14:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add a help overlay (5.35 KB, patch)
2015-12-17 07:12 UTC, Jonas Danielsson
committed Details | Review
Screenshot of overlay window (673.85 KB, image/png)
2015-12-17 07:14 UTC, Jonas Danielsson
  Details
Updated About Dialog Box with information about technologies used (5.96 KB, patch)
2015-12-17 10:02 UTC, Karanbir Chahal
none Details | Review
Screenshot (1.08 MB, image/png)
2015-12-17 10:08 UTC, Karanbir Chahal
  Details
Updated patch for shortcut to go to user's location (2.16 KB, patch)
2015-12-18 04:55 UTC, Karanbir Chahal
none Details | Review
Screenshot of updated shortcut's window (294.36 KB, image/png)
2015-12-18 04:58 UTC, Karanbir Chahal
  Details
Made required corrections to patch (1.79 KB, patch)
2015-12-18 11:38 UTC, Karanbir Chahal
none Details | Review
Patch for keyboard shortcut (1.73 KB, patch)
2016-01-04 13:49 UTC, Karanbir Chahal
none Details | Review

Description Jonas Danielsson 2015-10-22 07:13:36 UTC
So help overlay landed in GTK+ master, and we should have one in Maps!

See commit:
https://git.gnome.org/browse/gtk+/commit/?id=f6d9f9f93de1c3c5a7ab5d9c64783e941189d9b5

And for how to use it here:
https://git.gnome.org/browse/gtk+/commit/?id=3306ce68196b38f0c6e26867c597c40de295ebc8

What is it exactly? See design page here:
https://wiki.gnome.org/Design/OS/HelpOverlay#Tentative_Design
Comment 1 Jonas Danielsson 2015-11-09 17:13:11 UTC
*** Bug 757838 has been marked as a duplicate of this bug. ***
Comment 2 Karanbir Chahal 2015-11-30 03:50:56 UTC
I'm interested in solving this bug, do you want the help overlay in the space where the about dialog box is?
Comment 3 Jonas Danielsson 2015-11-30 12:42:28 UTC
(In reply to Karanbir Chahal from comment #2)
> I'm interested in solving this bug, do you want the help overlay in the
> space where the about dialog box is?

Hi,

No I want it implemented the way it is described in the links above. It should appear on the given keyboard shortcut that is already defined. Read all the links above and implement it in the same way as in the second link!

This is something that is added to GTK+ we need to implement a specific UI file in our resources and it should work. Read the links above.

thanks!
Comment 4 Jonas Danielsson 2015-11-30 13:24:46 UTC
For more information about UI files, please check the data/ui directory of Maps and read here: https://developer.gnome.org/gtk3/stable/GtkBuilder.html
Comment 5 Karanbir Chahal 2015-11-30 18:08:01 UTC
Alright thanks.I'm on it
Comment 6 Jonas Danielsson 2015-12-17 07:12:20 UTC
Created attachment 317544 [details] [review]
Add a help overlay

GNOME has a new Goal: Adding shortcut windows.

GTK+ 3.19.x includes a new widget called GtkShortcutsWindow.
This is a dialog window that shows an overview of shortcuts
(keyboard shortcuts and touch gestures) for an application.

To add a help overlay we need to create an UI file in our
resources at $(gresource prefix)/gtk/.

And the rest should be magical.
Comment 7 Jonas Danielsson 2015-12-17 07:14:17 UTC
Created attachment 317545 [details]
Screenshot of overlay window
Comment 8 Jonas Danielsson 2015-12-17 07:15:32 UTC
Maybe we could add some more shortcuts as well?

Karan: How about adding keyboard short cut for goto user location?
Comment 9 Karanbir Chahal 2015-12-17 08:45:38 UTC
Yeah thanks!! 
Great patch, I had no idea so many changes were required
Comment 10 Karanbir Chahal 2015-12-17 10:02:52 UTC
Created attachment 317548 [details] [review]
Updated About Dialog Box with information about technologies used
Comment 11 Karanbir Chahal 2015-12-17 10:05:29 UTC
You didn't commit the above patch hence I need to copy what you did and add the accel for user location. I hope you don't mind
Comment 12 Karanbir Chahal 2015-12-17 10:08:43 UTC
Created attachment 317549 [details]
Screenshot
Comment 13 Allan Day 2015-12-17 10:16:54 UTC
I would generally place quit last in its group - it makes sense logically.
Comment 14 Jonas Danielsson 2015-12-17 10:45:31 UTC
(In reply to Karanbir Chahal from comment #11)
> You didn't commit the above patch hence I need to copy what you did and add
> the accel for user location. I hope you don't mind

I do mind a bit actually :)

I do not want these in the same patch. Please create a clean patch that _only_ adds the accel to goto-user-location.
Comment 15 Jonas Danielsson 2015-12-17 10:45:50 UTC
Review of attachment 317548 [details] [review]:

To much going on here and you destroyed my pretty commit message.
Comment 16 Jonas Danielsson 2015-12-17 11:05:18 UTC
(In reply to Jonas Danielsson from comment #14)
> (In reply to Karanbir Chahal from comment #11)
> > You didn't commit the above patch hence I need to copy what you did and add
> > the accel for user location. I hope you don't mind
> 
> I do mind a bit actually :)
> 
> I do not want these in the same patch. Please create a clean patch that
> _only_ adds the accel to goto-user-location.

You can apply my patch then do 1 commit that adds the accel and adds it to the short-cut. Treat my patch as already applied.
Comment 17 Karanbir Chahal 2015-12-18 04:55:23 UTC
Created attachment 317600 [details] [review]
Updated patch for shortcut to go to user's location
Comment 18 Karanbir Chahal 2015-12-18 04:58:05 UTC
Created attachment 317602 [details]
Screenshot of updated shortcut's window
Comment 19 Karanbir Chahal 2015-12-18 04:58:37 UTC
I'm sorry about the mess,Is this alright?
Comment 20 Jonas Danielsson 2015-12-18 06:03:49 UTC
(In reply to Karanbir Chahal from comment #19)
> I'm sorry about the mess,Is this alright?

No problem! Thank you for working on this!
Will comment some on the patch.
Comment 21 Jonas Danielsson 2015-12-18 06:08:05 UTC
Review of attachment 317600 [details] [review]:

Thanks!


About the commit message, please see the guide here:
https://wiki.gnome.org/Git/CommitMessages

In this case I would think a head line like:

"Add keyboard shortcut for going to current location"

There is no need to mention what files have been altered in the commit message we will see that from the git patch itself and from the commit log.
And just paste the bugzilla link at the end, no need for a label.

::: data/org.gnome.Maps.desktop.in
@@ +1,1 @@
+

Unrelated change, please remove in next version.

::: data/ui/help-overlay.ui
@@ +34,3 @@
               <object class="GtkShortcutsShortcut">
                 <property name="visible">1</property>
+                <property name="title" translatable="yes">Go to User's Location</property>

I think "Go to current location" describes this better. Andreas / Allan, comments?

@@ +35,3 @@
                 <property name="visible">1</property>
+                <property name="title" translatable="yes">Go to User's Location</property>
+                <property name="accelerator">&lt;Primary&gt;L</property>

What is the reasoning behind using >primary>L here? L should be for location?

Andreas / Allan / Someone else: Comments?
Comment 22 Jonas Danielsson 2015-12-18 06:22:02 UTC
(In reply to Allan Day from comment #13)
> I would generally place quit last in its group - it makes sense logically.

Thanks Allan! Other than that does it look ok? The groups atm is General and Map View. And the only stuff in Map View right now is zoom in/zoom out? What more could be in that group? Go to current location? Switch from street / aerial? Switch between upcomming custom layers?
Comment 23 Karanbir Chahal 2015-12-18 07:47:13 UTC
Yeah L should mean location,we could also use something like U for user
It's up to you guys.
I'll update the patch with the changes you mentioned
Comment 24 Karanbir Chahal 2015-12-18 11:38:05 UTC
Created attachment 317626 [details] [review]
Made required corrections to patch
Comment 25 Jonas Danielsson 2015-12-18 11:44:02 UTC
Review of attachment 317626 [details] [review]:

Thanks!

Karanbir: Maybe you could move this to a new bug, so that this bug can be just about the help overlay?
And add this bug as a dependency for that bug?

About commit message: The body looks to long, maybe breakt it up into two lines? No need to talk about the help overlay, all shortcuts we add from now will be added to it, it is implicit.
Talk about the shortcut itself.

::: data/ui/help-overlay.ui
@@ +35,3 @@
                 <property name="visible">1</property>
+                <property name="title" translatable="yes">Go to current location</property>
+                <property name="accelerator">&lt;Primary&gt;L</property>

Maybe this should be added to the Map View section and not the General one? Since it affects the map view in the same sense that a zoom does.

::: src/mainWindow.js
@@ +186,3 @@
             },
             'goto-user-location': {
+                  accels: ['<Primary>L'],

Is this aligned correctly?
Comment 26 Jonas Danielsson 2015-12-18 11:45:13 UTC
Allan: Do keyboard navigation keys belong in the overlay? like using the arrow keys for panning, it only applies of the map view has focus tho.
Comment 27 Jonas Danielsson 2015-12-28 08:53:45 UTC
Comment on attachment 317544 [details] [review]
Add a help overlay

Attachment 317544 [details] pushed as 6c07319 - Add a help overlay
Comment 28 Karanbir Chahal 2016-01-02 10:34:18 UTC
Sorry for the late response,I had gone on holiday ,No internet for 10 days :/
I made a new bug and filed the patch.Please check it out and let me know
Comment 29 Karanbir Chahal 2016-01-04 13:49:04 UTC
Created attachment 318211 [details] [review]
Patch for keyboard shortcut
Comment 30 Jonas Danielsson 2016-01-04 13:51:02 UTC
Did you add this patch to the wrong bug?
Did you mean: https://bugzilla.gnome.org/show_bug.cgi?id=760066
Comment 31 Karanbir Chahal 2016-01-04 14:11:32 UTC
Oh sorry,I'll fix it.