[gnome-maps/wip/osm-edit] osmEdit: WIP, implement OSM account dialog.



commit e989a4c6ba45ac279469f9239736a1d652a6b753
Author: Marcus Lundblad <ml update uu se>
Date:   Sat Nov 7 12:17:07 2015 +0100

    osmEdit: WIP, implement OSM account dialog.

 data/org.gnome.Maps.data.gresource.xml |    1 +
 data/ui/app-menu.ui                    |    6 ++++++
 src/application.js                     |    7 ++++++-
 src/org.gnome.Maps.src.gresource.xml   |    1 +
 src/osmEdit.js                         |    8 ++++++++
 5 files changed, 22 insertions(+), 1 deletions(-)
---
diff --git a/data/org.gnome.Maps.data.gresource.xml b/data/org.gnome.Maps.data.gresource.xml
index eb68093..04bd08c 100644
--- a/data/org.gnome.Maps.data.gresource.xml
+++ b/data/org.gnome.Maps.data.gresource.xml
@@ -13,6 +13,7 @@
     <file preprocess="xml-stripblanks">ui/main-window.ui</file>
     <file preprocess="xml-stripblanks">ui/map-bubble.ui</file>
     <file preprocess="xml-stripblanks">ui/notification.ui</file>
+    <file preprocess="xml-stripblanks">ui/osm-account-dialog.ui</file>
     <file preprocess="xml-stripblanks">ui/osm-edit-dialog.ui</file>
     <file preprocess="xml-stripblanks">ui/place-bubble.ui</file>
     <file preprocess="xml-stripblanks">ui/place-entry.ui</file>
diff --git a/data/ui/app-menu.ui b/data/ui/app-menu.ui
index a40eb08..8e4bacf 100644
--- a/data/ui/app-menu.ui
+++ b/data/ui/app-menu.ui
@@ -3,6 +3,12 @@
   <menu id="app-menu">
     <section>
       <item>
+       <attribute name="action">app.osm-account-setup</attribute>
+       <attribute name="label" translatable="yes">Setup OpenStreetMap Account</attribute>
+      </item>
+    </section>
+    <section>
+      <item>
         <attribute name="action">win.about</attribute>
         <attribute name="label" translatable="yes">About</attribute>
       </item>
diff --git a/src/application.js b/src/application.js
index d21826d..c942780 100644
--- a/src/application.js
+++ b/src/application.js
@@ -149,6 +149,10 @@ const Application = new Lang.Class({
         this._mainWindow.destroy();
     },
 
+    _onOsmAccountSetupActivate: function() {
+       osmEditManager.showAccountDialog(this._mainWindow);
+    },
+
     _addContacts: function() {
         contactStore.get_contacts().forEach(function(contact) {
             contact.geocode(function() {
@@ -207,7 +211,8 @@ const Application = new Lang.Class({
             'show-contact': {
                 paramType: 's',
                 onActivate: this._onShowContactActivate.bind(this)
-            }
+            },
+           'osm-account-setup': { onActivate: this._onOsmAccountSetupActivate.bind(this) }
         });
 
         Gtk.IconTheme.get_default().append_search_path(GLib.build_filenamev([pkg.pkgdatadir,
diff --git a/src/org.gnome.Maps.src.gresource.xml b/src/org.gnome.Maps.src.gresource.xml
index 98fae43..65b83ba 100644
--- a/src/org.gnome.Maps.src.gresource.xml
+++ b/src/org.gnome.Maps.src.gresource.xml
@@ -28,6 +28,7 @@
     <file>mapWalker.js</file>
     <file>notification.js</file>
     <file>notificationManager.js</file>
+    <file>osmAccountDialog.js</file>
     <file>osmConnection.js</file>
     <file>osmEdit.js</file>
     <file>osmEditDialog.js</file>
diff --git a/src/osmEdit.js b/src/osmEdit.js
index f7318bd..5155055 100644
--- a/src/osmEdit.js
+++ b/src/osmEdit.js
@@ -23,6 +23,7 @@
 const GObject = imports.gi.GObject;
 const Lang = imports.lang;
 
+const OSMAccountDialog = imports.osmAccountDialog;
 const OSMEditDialog = imports.osmEditDialog;
 const OSMConnection = imports.osmConnection;
 const Utils = imports.utils;
@@ -52,6 +53,13 @@ const OSMEdit = new Lang.Class({
         return response;
     },
 
+    showAccountDialog: function(parentWindow) {
+       let dialog = new OSMAccountDialog.OSMAccountDialog( {transient_for: parentWindow });
+       let response = dialog.run();
+       dialog.destroy();
+       return response;
+    },
+    
     fetchObject: function(place, callback, cancellable) {
         let osmType = Utils.osmTypeToString(place.osmType);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]