placeEntry: Allow pasting maps: URIs into the search entry
Marcus Lundblad
2 years ago
33 | 33 | const Place = imports.place; |
34 | 34 | const PlaceStore = imports.placeStore; |
35 | 35 | const PlacePopover = imports.placePopover; |
36 | const URIS = imports.uris; | |
36 | 37 | const Utils = imports.utils; |
37 | 38 | |
38 | 39 | // minimum number of characters to start completion |
224 | 225 | parsed = true; |
225 | 226 | } |
226 | 227 | |
228 | if (this.text.startsWith('maps:')) { | |
229 | let query = URIS.parseMapsURI(this.text); | |
230 | ||
231 | if (query) { | |
232 | this.text = query; | |
233 | } else { | |
234 | let msg = _("Failed to parse Maps URI"); | |
235 | Utils.showDialog(msg, Gtk.MessageType.ERROR, this.get_toplevel()); | |
236 | } | |
237 | ||
238 | parsed = true; | |
239 | } | |
240 | ||
227 | 241 | let parsedLocation = Place.Place.parseCoordinates(this.text); |
228 | 242 | if (parsedLocation) { |
229 | 243 | /* if the place was a parsed OSM coordinate URL, it will have |