[gnome-maps/wip/mlundblad/osm-add-location: 16/21] contextMenu: Allow routing from right click



commit 362b1d5662f1f4bdf4296a07c7bb6146085a05bc
Author: Jonas Danielsson <jonas threetimestwo org>
Date:   Mon Sep 7 20:41:30 2015 +0200

    contextMenu: Allow routing from right click
    
    Add item to context menu to allow routing to/from/via the
    right clicked location.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=737322

 data/ui/context-menu.ui |    6 ++++++
 src/contextMenu.js      |    7 +++++++
 2 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/data/ui/context-menu.ui b/data/ui/context-menu.ui
index eb2c7c8..b682885 100644
--- a/data/ui/context-menu.ui
+++ b/data/ui/context-menu.ui
@@ -30,5 +30,11 @@
         <property name="visible">True</property>
       </object>
     </child>
+    <child>
+      <object class="GtkMenuItem" id="addOSMLocationItem">
+        <property name="name">add-osm-location-item</property>
+        <property name="label" translatable="yes">Add Location</property>
+      </object>
+    </child>
   </template>
 </interface>
diff --git a/src/contextMenu.js b/src/contextMenu.js
index 7560adc..d6a51ba 100644
--- a/src/contextMenu.js
+++ b/src/contextMenu.js
@@ -30,6 +30,10 @@ const Application = imports.application;
 const ExportViewDialog = imports.exportViewDialog;
 const Lang = imports.lang;
 const Location = imports.location;
+const OSMAccountDialog = imports.osmAccountDialog;
+const OSMEdit = imports.osmEdit;
+const OSMEditDialog = imports.osmEditDialog;
+const OSMUtils = imports.osmUtils;
 const Place = imports.place;
 const Utils = imports.utils;
 
@@ -40,6 +44,7 @@ const ContextMenu = new Lang.Class({
     InternalChildren: [ 'whatsHereItem',
                         'geoURIItem',
                         'exportItem',
+                        'addOSMLocationItem',
                         'routeItem' ],
 
     _init: function(params) {
@@ -57,6 +62,8 @@ const ContextMenu = new Lang.Class({
                                  this._onGeoURIActivated.bind(this));
         this._exportItem.connect('activate',
                                  this._onExportActivated.bind(this));
+        this._addOSMLocationItem.connect('activate',
+                                         this._onAddOSMLocationActivated.bind(this));
         this._routeItem.connect('activate',
                                 this._onRouteActivated.bind(this));
         Application.routeService.query.connect('notify::points',


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