[gnome-maps/wip/mlundblad/place-thumbnails: 2/2] WIP: placeBubble: Fetch Wikipedia thumbnails for place



commit 2cf5c97e353e519ce8a3efd17c3fb28dc1b34dde
Author: Marcus Lundblad <ml update uu se>
Date:   Mon Feb 27 23:22:57 2017 +0100

    WIP: placeBubble: Fetch Wikipedia thumbnails for place

 src/placeBubble.js |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/placeBubble.js b/src/placeBubble.js
index 5a1449b..0e89172 100644
--- a/src/placeBubble.js
+++ b/src/placeBubble.js
@@ -35,6 +35,7 @@ const Place = imports.place;
 const PlaceFormatter = imports.placeFormatter;
 const PlaceStore = imports.placeStore;
 const Utils = imports.utils;
+const Wikipedia = imports.wikipedia;
 
 const PlaceBubble = new Lang.Class({
     Name: 'PlaceBubble',
@@ -230,6 +231,18 @@ const PlaceBubble = new Lang.Class({
         this._title.label = formatter.title;
         this._expandButton.visible = expandedContent.length > 0;
         this._stack.visible_child = this._gridContent;
+
+        if (place.wiki)
+            this._requestWikipediaThumbnail(place.wiki);
+    },
+
+    _requestWikipediaThumbnail: function(wiki) {
+        Wikipedia.fetchArticleThumbnail(wiki, 128,
+                                        this._onThumbnailComplete.bind(this));
+    },
+
+    _onThumbnailComplete: function(icon) {
+        //...
     },
 
     // clear the view widgets to be able to re-populate an updated place


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