diff options
author | Marcus Lundblad <ml@update.uu.se> | 2016-01-31 15:01:27 +0100 |
---|---|---|
committer | Marcus Lundblad <ml@update.uu.se> | 2016-02-12 08:34:54 +0100 |
commit | c4c25a8ed6553e081c3b723d2bbc8cd729a6dce8 (patch) | |
tree | d65b18b5ce711a861accbc399958d58614341bd4 /src/osmTypeListRow.js | |
parent | 00aad3df22d846ca862caf36a6e39446cfa5ce6f (diff) | |
download | gnome-maps-c4c25a8ed6553e081c3b723d2bbc8cd729a6dce8.tar.gz |
osmEdit: Add support for creating new locations in the edit dialog
Adds the ability to edit newly created locations in the dialog.
Also adds a module to handle OSM tag key/value mapping to translated
POI types and a list of recently used POI types.
Also enables editing the POI type of existing objects in more simple
cases (known tag values with no combined tags).
https://bugzilla.gnome.org/show_bug.cgi?id=761327
Diffstat (limited to 'src/osmTypeListRow.js')
-rw-r--r-- | src/osmTypeListRow.js | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/osmTypeListRow.js b/src/osmTypeListRow.js new file mode 100644 index 00000000..ae5e17c4 --- /dev/null +++ b/src/osmTypeListRow.js @@ -0,0 +1,51 @@ +/* -*- Mode: JS2; indent-tabs-mode: nil; js2-basic-offset: 4 -*- */ +/* vim: set et ts=4 sw=4: */ +/* + * Copyright (c) 2015 Marcus Lundblad. + * + * GNOME Maps is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * GNOME Maps is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with GNOME Maps; if not, see <http://www.gnu.org/licenses/>. + * + * Author: Marcus Lundblad <ml@update.uu.se> + */ + +const Gtk = imports.gi.Gtk; +const Lang = imports.lang; + +const OSMTypeListRow = new Lang.Class({ + Name: 'OSMTypeListRow', + Extends: Gtk.ListBoxRow, + Template: 'resource:///org/gnome/Maps/ui/osm-type-list-row.ui', + InternalChildren: [ 'name' ], + + _init: function(props) { + this._type = props.type; + delete props.type; + + this.parent(props); + + this._name.label = this._type.title; + }, + + get key() { + return this._type.key; + }, + + get value() { + return this._type.value; + }, + + get title() { + return this._type.title; + } +}); |