[gnome-maps/wip/contacts: 1/7] Convert searchResultMarker to placeMarker



commit cd2a258bea6404fff7d616f1ccf5017b948e0725
Author: Jonas Danielsson <jonas threetimestwo org>
Date:   Tue Dec 16 04:33:12 2014 -0500

    Convert searchResultMarker to placeMarker

 src/gnome-maps.data.gresource.xml                |    2 +-
 src/gnome-maps.js.gresource.xml                  |    4 ++--
 src/mapView.js                                   |   18 +++++++++---------
 src/{search-result-bubble.ui => place-bubble.ui} |    0
 src/{searchResultBubble.js => placeBubble.js}    |   13 +++++++------
 src/{searchResultMarker.js => placeMarker.js}    |   10 +++++-----
 6 files changed, 24 insertions(+), 23 deletions(-)
---
diff --git a/src/gnome-maps.data.gresource.xml b/src/gnome-maps.data.gresource.xml
index 9638968..ee59325 100644
--- a/src/gnome-maps.data.gresource.xml
+++ b/src/gnome-maps.data.gresource.xml
@@ -14,7 +14,7 @@
     <file preprocess="xml-stripblanks">notification.ui</file>
     <file preprocess="xml-stripblanks">route-entry.ui</file>
     <file preprocess="xml-stripblanks">map-bubble.ui</file>
-    <file preprocess="xml-stripblanks">search-result-bubble.ui</file>
+    <file preprocess="xml-stripblanks">place-bubble.ui</file>
     <file preprocess="xml-stripblanks">share-dialog.ui</file>
     <file preprocess="xml-stripblanks">user-location-bubble.ui</file>
     <file preprocess="xml-stripblanks">check-in-dialog.ui</file>
diff --git a/src/gnome-maps.js.gresource.xml b/src/gnome-maps.js.gresource.xml
index d3a2709..da355ec 100644
--- a/src/gnome-maps.js.gresource.xml
+++ b/src/gnome-maps.js.gresource.xml
@@ -33,8 +33,8 @@
     <file>routeQuery.js</file>
     <file>routeService.js</file>
     <file>searchPopup.js</file>
-    <file>searchResultBubble.js</file>
-    <file>searchResultMarker.js</file>
+    <file>placeBubble.js</file>
+    <file>placeMarker.js</file>
     <file>shareDialog.js</file>
     <file>turnPointBubble.js</file>
     <file>turnPointMarker.js</file>
diff --git a/src/mapView.js b/src/mapView.js
index dd3e0a6..63ec357 100644
--- a/src/mapView.js
+++ b/src/mapView.js
@@ -29,7 +29,7 @@ const Lang = imports.lang;
 
 const Application = imports.application;
 const MapWalker = imports.mapWalker;
-const SearchResultMarker = imports.searchResultMarker;
+const PlaceMarker = imports.placeMarker;
 const TurnPointMarker = imports.turnPointMarker;
 const UserLocationMarker = imports.userLocationMarker;
 const Utils = imports.utils;
@@ -112,8 +112,8 @@ const MapView = new Lang.Class({
         this.view.add_layer(this._routeLayer);
 
         let mode = Champlain.SelectionMode.SINGLE;
-        this._searchResultLayer = new Champlain.MarkerLayer({ selection_mode: mode });
-        this.view.add_layer(this._searchResultLayer);
+        this._placeLayer = new Champlain.MarkerLayer({ selection_mode: mode });
+        this.view.add_layer(this._placeLayer);
 
         this._instructionMarkerLayer = new Champlain.MarkerLayer({ selection_mode: mode });
         this.view.add_layer(this._instructionMarkerLayer);
@@ -193,14 +193,14 @@ const MapView = new Lang.Class({
     },
 
     showSearchResult: function(place) {
-        this._searchResultLayer.remove_all();
-        let searchResultMarker = new SearchResultMarker.SearchResultMarker({ place: place,
-                                                                             mapView: this });
+        this._placeLayer.remove_all();
+        let placeMarker = new PlaceMarker.PlaceMarker({ place: place,
+                                                        mapView: this });
 
-        this._searchResultLayer.add_marker(searchResultMarker);
-        searchResultMarker.goToAndSelect(true);
+        this._placeLayer.add_marker(placeMarker);
+        placeMarker.goToAndSelect(true);
 
-        return searchResultMarker;
+        return placeMarker;
     },
 
     showRoute: function(route) {
diff --git a/src/search-result-bubble.ui b/src/place-bubble.ui
similarity index 100%
rename from src/search-result-bubble.ui
rename to src/place-bubble.ui
diff --git a/src/searchResultBubble.js b/src/placeBubble.js
similarity index 92%
rename from src/searchResultBubble.js
rename to src/placeBubble.js
index 092d8c6..8426a22 100644
--- a/src/searchResultBubble.js
+++ b/src/placeBubble.js
@@ -20,6 +20,7 @@
  * Author: Damián Nohales <damiannohales gmail com>
  */
 
+const Geocode = imports.gi.GeocodeGlib;
 const Gtk = imports.gi.Gtk;
 const Format = imports.format;
 const Lang = imports.lang;
@@ -33,16 +34,16 @@ const PlaceFormatter = imports.placeFormatter;
 const PlaceStore = imports.placeStore;
 const Utils = imports.utils;
 
-const SearchResultBubble = new Lang.Class({
-    Name: "SearchResultBubble",
+const PlaceBubble = new Lang.Class({
+    Name: "PlaceBubble",
     Extends: MapBubble.MapBubble,
 
     _init: function(params) {
-        let ui = Utils.getUIObject('search-result-bubble', [ 'stack',
-                                                             'box-content',
-                                                             'label-title']);
+        let ui = Utils.getUIObject('place-bubble', [ 'stack',
+                                                     'box-content',
+                                                     'label-title']);
         params.buttons = (MapBubble.Button.ROUTE |
-                          MapBubble.Button.SHARE |
+                          MapBubble.Button.SHARE|
                           MapBubble.Button.FAVORITE);
 
         this.parent(params);
diff --git a/src/searchResultMarker.js b/src/placeMarker.js
similarity index 82%
rename from src/searchResultMarker.js
rename to src/placeMarker.js
index a4fc7f8..914bb1c 100644
--- a/src/searchResultMarker.js
+++ b/src/placeMarker.js
@@ -23,11 +23,11 @@
 const Lang = imports.lang;
 
 const MapMarker = imports.mapMarker;
-const SearchResultBubble = imports.searchResultBubble;
+const PlaceBubble = imports.placeBubble;
 const Utils = imports.utils;
 
-const SearchResultMarker = new Lang.Class({
-    Name: 'SearchResultMarker',
+const PlaceMarker = new Lang.Class({
+    Name: 'PlaceMarker',
     Extends: MapMarker.MapMarker,
 
     _init: function(params) {
@@ -43,8 +43,8 @@ const SearchResultMarker = new Lang.Class({
 
     _createBubble: function() {
         if (this.place.name) {
-            return new SearchResultBubble.SearchResultBubble({ place: this.place,
-                                                               mapView: this._mapView });
+            return new PlaceBubble.PlaceBubble({ place: this.place,
+                                                 mapView: this._mapView });
         } else
             return null;
     }


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