[gnome-maps] Convert searchResultMarker to placeMarker



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

    Convert searchResultMarker to placeMarker
    
    https://bugzilla.gnome.org/show_bug.cgi?id=741591

 data/org.gnome.Maps.data.gresource.xml        |    2 +-
 data/ui/place-bubble.ui                       |   40 +++++++++++++++++++++++++
 po/POTFILES.in                                |    2 +-
 src/mapView.js                                |   18 +++++-----
 src/org.gnome.Maps.src.gresource.xml          |    4 +-
 src/{searchResultBubble.js => placeBubble.js} |   10 +++---
 src/{searchResultMarker.js => placeMarker.js} |   10 +++---
 7 files changed, 63 insertions(+), 23 deletions(-)
---
diff --git a/data/org.gnome.Maps.data.gresource.xml b/data/org.gnome.Maps.data.gresource.xml
index a5fb64d..269dace 100644
--- a/data/org.gnome.Maps.data.gresource.xml
+++ b/data/org.gnome.Maps.data.gresource.xml
@@ -11,11 +11,11 @@
     <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/place-bubble.ui</file>
     <file preprocess="xml-stripblanks">ui/place-entry.ui</file>
     <file preprocess="xml-stripblanks">ui/place-list-row.ui</file>
     <file preprocess="xml-stripblanks">ui/route-entry.ui</file>
     <file preprocess="xml-stripblanks">ui/search-popup.ui</file>
-    <file preprocess="xml-stripblanks">ui/search-result-bubble.ui</file>
     <file preprocess="xml-stripblanks">ui/share-dialog.ui</file>
     <file preprocess="xml-stripblanks">ui/sidebar.ui</file>
     <file preprocess="xml-stripblanks">ui/social-place-more-results-row.ui</file>
diff --git a/data/ui/place-bubble.ui b/data/ui/place-bubble.ui
new file mode 100644
index 0000000..c6f2b6a
--- /dev/null
+++ b/data/ui/place-bubble.ui
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.18.1 -->
+<interface>
+  <requires lib="gtk+" version="3.12"/>
+  <object class="GtkStack" id="stack">
+    <property name="visible">True</property>
+    <child>
+      <object class="GtkSpinner" id="spinner">
+        <property name="visible">True</property>
+        <property name="active">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkBox" id="box-content">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <style>
+          <class name="bubble-content"/>
+        </style>
+        <child>
+          <object class="GtkLabel" id="label-title">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="halign">start</property>
+            <property name="vexpand">True</property>
+            <style>
+              <class name="bubble-title"/>
+            </style>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 9413ff5..17b1f18 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -21,7 +21,7 @@ src/mainWindow.js
 src/mapView.js
 src/place.js
 src/routeService.js
-src/searchResultBubble.js
+src/placeBubble.js
 src/sidebar.js
 src/translations.js
 src/utils.js
diff --git a/src/mapView.js b/src/mapView.js
index 39b201d..1b3f5a7 100644
--- a/src/mapView.js
+++ b/src/mapView.js
@@ -31,7 +31,7 @@ const Application = imports.application;
 const Geoclue = imports.geoclue;
 const MapWalker = imports.mapWalker;
 const Place = imports.place;
-const SearchResultMarker = imports.searchResultMarker;
+const PlaceMarker = imports.placeMarker;
 const TurnPointMarker = imports.turnPointMarker;
 const UserLocationMarker = imports.userLocationMarker;
 const Utils = imports.utils;
@@ -116,8 +116,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);
@@ -204,14 +204,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/org.gnome.Maps.src.gresource.xml b/src/org.gnome.Maps.src.gresource.xml
index 38faa17..33bc2b1 100644
--- a/src/org.gnome.Maps.src.gresource.xml
+++ b/src/org.gnome.Maps.src.gresource.xml
@@ -26,17 +26,17 @@
     <file>notificationManager.js</file>
     <file>overpass.js</file>
     <file>place.js</file>
+    <file>placeBubble.js</file>
     <file>placeEntry.js</file>
     <file>placeFormatter.js</file>
     <file>placeListRow.js</file>
+    <file>placeMarker.js</file>
     <file>placeStore.js</file>
     <file>route.js</file>
     <file>routeEntry.js</file>
     <file>routeQuery.js</file>
     <file>routeService.js</file>
     <file>searchPopup.js</file>
-    <file>searchResultBubble.js</file>
-    <file>searchResultMarker.js</file>
     <file>serviceBackend.js</file>
     <file>settings.js</file>
     <file>shareDialog.js</file>
diff --git a/src/searchResultBubble.js b/src/placeBubble.js
similarity index 93%
rename from src/searchResultBubble.js
rename to src/placeBubble.js
index 1dcceac..302ce9f 100644
--- a/src/searchResultBubble.js
+++ b/src/placeBubble.js
@@ -32,14 +32,14 @@ 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.FAVORITE);
diff --git a/src/searchResultMarker.js b/src/placeMarker.js
similarity index 82%
rename from src/searchResultMarker.js
rename to src/placeMarker.js
index f538890..ef4623d 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]