After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 728117 - Add "links" to clocks/weather
Add "links" to clocks/weather
Status: RESOLVED FIXED
Product: gnome-maps
Classification: Applications
Component: general
3.12.x
Other All
: Normal enhancement
: ---
Assigned To: gnome-maps-maint
gnome-maps-maint
Depends on: 740350 740356
Blocks:
 
 
Reported: 2014-04-13 15:31 UTC by Bastien Nocera
Modified: 2015-08-17 12:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
utils: Add activateAction function (1.78 KB, patch)
2014-11-19 07:42 UTC, Jonas Danielsson
needs-work Details | Review
Add SharePopover (7.72 KB, patch)
2014-11-19 07:42 UTC, Jonas Danielsson
none Details | Review
MapBubble: Add share button (3.52 KB, patch)
2014-11-19 07:43 UTC, Jonas Danielsson
none Details | Review
Add share button to userLocation and searchResult (1.64 KB, patch)
2014-11-19 07:43 UTC, Jonas Danielsson
none Details | Review
Cast of share popover opening weather (954.41 KB, video/webm)
2014-11-19 07:46 UTC, Jonas Danielsson
  Details
Cast of share popover opening Clocks (148.71 KB, video/webm)
2014-11-19 12:15 UTC, Jonas Danielsson
  Details
Add SharePopover (8.62 KB, patch)
2014-11-19 12:28 UTC, Jonas Danielsson
none Details | Review
utils: Add activateAction function (2.06 KB, patch)
2014-11-20 07:42 UTC, Jonas Danielsson
none Details | Review
Add SharePopover (9.72 KB, patch)
2014-11-20 07:42 UTC, Jonas Danielsson
none Details | Review
MapBubble: Add share button (3.63 KB, patch)
2014-11-20 07:42 UTC, Jonas Danielsson
none Details | Review
Add share button to userLocation and searchResult (1.64 KB, patch)
2014-11-20 07:42 UTC, Jonas Danielsson
none Details | Review
New cast! (325.21 KB, video/webm)
2014-11-20 07:42 UTC, Jonas Danielsson
  Details
utils: Add activateAction function (2.06 KB, patch)
2014-11-20 12:38 UTC, Jonas Danielsson
none Details | Review
Add ShareDialog (9.73 KB, patch)
2014-11-20 12:38 UTC, Jonas Danielsson
none Details | Review
MapBubble: Add share button (3.68 KB, patch)
2014-11-20 12:38 UTC, Jonas Danielsson
none Details | Review
Add share button to userLocation and searchResult (1.64 KB, patch)
2014-11-20 12:38 UTC, Jonas Danielsson
none Details | Review
New cast! (1.22 MB, video/webm)
2014-11-20 12:39 UTC, Jonas Danielsson
  Details
Add ShareDialog (13.41 KB, patch)
2014-11-20 12:42 UTC, Jonas Danielsson
none Details | Review
Add ShareDialog (13.77 KB, patch)
2014-11-21 06:12 UTC, Jonas Danielsson
none Details | Review
Add ShareDialog (13.77 KB, patch)
2014-11-21 09:22 UTC, Jonas Danielsson
none Details | Review
New cast! (898.06 KB, video/webm)
2014-11-21 14:06 UTC, Jonas Danielsson
  Details
utils: Add activateAction function (2.06 KB, patch)
2014-11-21 14:15 UTC, Jonas Danielsson
committed Details | Review
Add ShareDialog (13.49 KB, patch)
2014-11-21 14:15 UTC, Jonas Danielsson
committed Details | Review
MapBubble: Add share button (3.68 KB, patch)
2014-11-21 14:15 UTC, Jonas Danielsson
committed Details | Review
Add share button to userLocation and searchResult (1.71 KB, patch)
2014-11-21 14:15 UTC, Jonas Danielsson
committed Details | Review
PlaceStore: Add getModelForPlaceType method (1.03 KB, patch)
2014-11-22 12:42 UTC, Jonas Danielsson
none Details | Review
PlaceStore: Add removePlace method (1.17 KB, patch)
2014-11-22 12:42 UTC, Jonas Danielsson
none Details | Review
Split out PlaceListRow from SearchPopup (8.11 KB, patch)
2014-11-22 12:42 UTC, Jonas Danielsson
none Details | Review
Add FavoritesPopover (8.58 KB, patch)
2014-11-22 12:43 UTC, Jonas Danielsson
none Details | Review
MapBubble: Add favorite button (4.12 KB, patch)
2014-11-22 12:43 UTC, Jonas Danielsson
none Details | Review
MainWindow: Add favorites toggle (4.70 KB, patch)
2014-11-22 12:43 UTC, Jonas Danielsson
none Details | Review
PlaceStore: Add addPlace method (2.30 KB, patch)
2014-11-22 12:43 UTC, Jonas Danielsson
none Details | Review
SearchResultBubble: Add favorite button (2.22 KB, patch)
2014-11-22 12:43 UTC, Jonas Danielsson
none Details | Review

Description Bastien Nocera 2014-04-13 15:31:44 UTC
When selecting a location in gnome-maps, it would be nice to be able to add it easily to clocks or weather from within maps.
Comment 1 Rishi Raj Singh Jhelumi 2014-04-15 12:49:32 UTC
I think its severity should be enhancement as its a feature request.
Comment 2 Jonas Danielsson 2014-04-15 14:43:59 UTC
Are there currently any ways/APIs to add locations to clocks or weather? They both seem to store their locations in gsettings.

Key 'locations' for Weather and 'world-clocks' for Clocks.

Maybe we could get some Clocks / Weather devs to comment on the feasibility of this bug.
Comment 3 Giovanni Campagna 2014-04-15 16:54:35 UTC
Gnome-weather is dbus activatable, I'll be happy to add a method that opens the app to a specific location and offers to store it.
The preferred format would obviously be a GWeatherLocation in GVariant, but if you don't want a dependency on libgweather a pair of coordinates would be fine as well.

I'd like that gnome-clocks did not use our settings directly though.
Comment 4 Paolo Borelli 2014-04-15 17:17:28 UTC
(In reply to comment #3)
> I'd like that gnome-clocks did not use our settings directly though.

I guess you mean gnome-maps here.


Same for clocks: I am ok with adding a dbus method to add a clock location.
Comment 5 Jonas Danielsson 2014-04-15 18:05:33 UTC
Thanks for the input guys!
I'm not sure yet that this is a feature that we want but now we know that we can have it :)

Bastian: what are the use cases that you envision? That someone is using Maps to look up something and thinks:
 "I wonder what time it is here?" or "I wonder what the weather is like?"

When adding locations to track weather or time on the natural thing might be to open one of the apps that deals with that. We shouldn't add things to Maps just because we can.

But I can be persuaded. This bug depends on bug #722871, a bug that aims to implement the mockups shown here: https://raw.github.com/gnome-design-team/gnome-mockups/master/maps/v2/markers-and-bubbles.png

If the designers can find a way to get UI for doing this nicely it might be a feature to have.

Thanks!
Comment 6 Bastien Nocera 2014-04-15 18:13:22 UTC
(In reply to comment #5)
> Thanks for the input guys!
> I'm not sure yet that this is a feature that we want but now we know that we
> can have it :)
> 
> Bastian: what are the use cases that you envision? That someone is using Maps
> to look up something and thinks:
>  "I wonder what time it is here?" or "I wonder what the weather is like?"

I'll be travelling there, and I know the weather/time are different, so I want to add check the weather to pack ahead of me going there.
Comment 7 Mattias Bengtsson 2014-04-22 04:24:16 UTC
Yeah this seems like a nice integration, the important thing is to not make the bubbles too cluttered (see current designs here: https://raw.github.com/gnome-design-team/gnome-mockups/020b66b292801ae281c54cb71b11d2eea8536edf/maps/v2/markers-and-bubbles.png).

Android pushes these types of actions into the "share"-menu. Would that make sense? Andreas what do you think?
Comment 8 Jonas Danielsson 2014-11-12 11:08:26 UTC
That seems nice, we could add it to a "share"-button or in a "gear"-button.

Paolo, Giovanni: I would like to request those dbus methods. What kind of data would you need? lat/lon/description?
Comment 9 Giovanni Campagna 2014-11-17 20:18:59 UTC
(In reply to comment #8)
> That seems nice, we could add it to a "share"-button or in a "gear"-button.
> 
> Paolo, Giovanni: I would like to request those dbus methods. What kind of data
> would you need? lat/lon/description?

Ideally, you would just use a serialized GWeatherLocation - and if you do so, gnome-weather will need no changes, it already accepts show-location as a GAction with a single variant parameter (the serialized location).
But I can understand that GWeatherLocation is inconvenient for you, so I'm ok with just latitude/longitude/description. It's a lot better if the description is cleaned up to be the city name only, without the country, because libgweather can figure that out on its own (but if you know how to get that from geocode-glib, please tell me!). And if you could get the ICAO code, that would give the most accurate results.

In any case, please use a GAction (org.freedesktop.Application.ActivateAction) rather than a raw method call, because that deals with startup notification in a transparent way on the receiver side - the sender side is a little more convoluted but it's the only way to do proper complete startup notification (which is needed in case the app is not running yet). Alternatively, if you absolutely want a raw method call, please give us a timestamp to get working focus stealing prevention.
Comment 10 Jonas Danielsson 2014-11-18 06:11:47 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > That seems nice, we could add it to a "share"-button or in a "gear"-button.
> > 
> > Paolo, Giovanni: I would like to request those dbus methods. What kind of data
> > would you need? lat/lon/description?
> 
> Ideally, you would just use a serialized GWeatherLocation - and if you do so,
> gnome-weather will need no changes, it already accepts show-location as a
> GAction with a single variant parameter (the serialized location).
> But I can understand that GWeatherLocation is inconvenient for you, so I'm ok
> with just latitude/longitude/description. It's a lot better if the description
> is cleaned up to be the city name only, without the country, because
> libgweather can figure that out on its own (but if you know how to get that
> from geocode-glib, please tell me!). And if you could get the ICAO code, that
> would give the most accurate results.

Ok, thanks! I can mock it up using GWeatherLocation and see how much hassle it would be for us. We try to clean the city name up our self. Geocode-glib indeed messes up a bit by setting the name property of a place to what is actually a display name returned from the Nominatim service. We do some logic and also uses the Overpass API in some areas to get better information / name. Will do our best to send something pretty to you. Atm we do not use the ICAO code anywhere.


> 
> In any case, please use a GAction (org.freedesktop.Application.ActivateAction)
> rather than a raw method call, because that deals with startup notification in
> a transparent way on the receiver side - the sender side is a little more
> convoluted but it's the only way to do proper complete startup notification
> (which is needed in case the app is not running yet). Alternatively, if you
> absolutely want a raw method call, please give us a timestamp to get working
> focus stealing prevention.

Sure, thanks for the information!
Comment 11 Jonas Danielsson 2014-11-19 07:42:51 UTC
Created attachment 290961 [details] [review]
utils: Add activateAction function
Comment 12 Jonas Danielsson 2014-11-19 07:42:57 UTC
Created attachment 290962 [details] [review]
Add SharePopover

Add the SharePopover module, which includes sharing a place to
GNOME Weather.
Comment 13 Jonas Danielsson 2014-11-19 07:43:01 UTC
Created attachment 290963 [details] [review]
MapBubble: Add share button
Comment 14 Jonas Danielsson 2014-11-19 07:43:06 UTC
Created attachment 290964 [details] [review]
Add share button to userLocation and searchResult
Comment 15 Jonas Danielsson 2014-11-19 07:46:12 UTC
Hi,

So this adds weather to a popover when you press a share button on a map bubble.
This is also a request for mockups because I am not sure how this should look or behave. Will attach a screen cast below.

Giovanni: Review of the activateAction code would be appreciated since I haven't messed about with that before. I seems to made a mistake(?) since weather opens a new window for each request. I would expect it just to come into focus?

Andreas: Atm I use the 'folder-publicshare-symbolic' icon for the button. Do you have an opinion on how this should behave? Should it be 'share'? And in that case should we have our own icon? 

Jonas
Comment 16 Jonas Danielsson 2014-11-19 07:46:54 UTC
Created attachment 290965 [details]
Cast of share popover opening weather
Comment 17 Jonas Danielsson 2014-11-19 07:49:14 UTC
Also as I just noticed when watching the cast again. It seems to open to Malmö first time and second time correct to Stockholm.

Giovanni: Is this a bug on my or your side? :)
Comment 18 Jonas Danielsson 2014-11-19 07:51:15 UTC
Paolo: An action like "add-location" would be nice to have on Clocks, it could take a GWeather.Location if you like.

If you are busy it would be nice if you could just give some details on how it should behave and maybe some one on the Maps side could look into it.
Comment 19 Paolo Borelli 2014-11-19 08:54:01 UTC
A patch for it would be more than welcome and I agree that exposing an action on the bus is the best way.

I am not totally thrilled by exposing GWeather.Location on the public API since for clocks gweather is more of an internal implementation detail, on the other hand I do not have a much better idea out of the top of my head. I guess in the worse case we can just bump the dbus interface to not expose that action if we remove the dependency.

For the implementation it should be relatively easy once the GAction/Dbus yak shaving is done: check how on_new_activate is implemented in world.vala. It pops up a GWeatherLocation dialog, which lets you pick a GWeather.Location and once you have that the codepath should be the same of a the new add-location action
Comment 20 Jonas Danielsson 2014-11-19 08:58:43 UTC
Thanks! Will try to fiddle up a patch for Clocks when I get some time!
Comment 21 Jonas Danielsson 2014-11-19 12:08:55 UTC
Another question for Paolo and Giovanni: Should the names of your applications be translatable? Or is it 'Weather' and 'Clocks' in all languages?
Comment 22 Jonas Danielsson 2014-11-19 12:15:56 UTC
Created attachment 290977 [details]
Cast of share popover opening Clocks
Comment 23 Frederic Peters 2014-11-19 12:19:08 UTC
(In reply to comment #21)
> Another question for Paolo and Giovanni: Should the names of your applications
> be translatable? Or is it 'Weather' and 'Clocks' in all languages?

They are translated in other languages.
Comment 24 Jonas Danielsson 2014-11-19 12:28:55 UTC
Created attachment 290984 [details] [review]
Add SharePopover

Add the SharePopover module, which includes sharing a place to
GNOME Weather.
Comment 25 Giovanni Campagna 2014-11-20 02:54:44 UTC
(In reply to comment #17)
> Also as I just noticed when watching the cast again. It seems to open to Malmö
> first time and second time correct to Stockholm.
> 
> Giovanni: Is this a bug on my or your side? :)

Could perfectly be a bug in gnome-weather... You can verify using the gnome-weather search provider (which uses the same API once you click on a city)

(In reply to comment #21)
> Another question for Paolo and Giovanni: Should the names of your applications
> be translatable? Or is it 'Weather' and 'Clocks' in all languages?

How about you just grab the name from the desktop file? Then we don't duplicate translations, and you can check if the app is installed or not.
Comment 26 Giovanni Campagna 2014-11-20 03:03:30 UTC
Review of attachment 290961 [details] [review]:

::: src/utils.js
@@ +137,3 @@
 
+function _getPlatformData() {
+    let timestamp = Math.round(+new Date() / 1000);

Absolutely no. You need a X11 server time here (which is clock_gettime MONOTONIC, but don't rely on that, and in any case it has nothing to do with wall clock time). Use Gtk.get_current_event_time() if you're inside an event handler, or keep the timestamp from the event that triggered the action otherwise.

@@ +139,3 @@
+    let timestamp = Math.round(+new Date() / 1000);
+    let id = GLib.Variant.new('s', '_TIME' + timestamp);
+    return { "desktop-startup-id": id };

Almost. A desktop-startup-id of _TIMExxxxxx is enough to get focus-stealing-prevention working (so the app will not start in the background and you won't get the annoying "is ready" notification), but it won't do startup notification (which is especially important for gnome-weather because it takes a while to load)

What you want is:
let context = Gdk.Display.get_default().get_app_launch_context()
context.set_timestamp(timestamp);
let id = new GLib.Variant('s', context.get_startup_notify_id());
Comment 27 Giovanni Campagna 2014-11-20 03:09:49 UTC
Review of attachment 290984 [details] [review]:

::: src/sharePopover.js
@@ +64,3 @@
+                                     action,
+                                     new GLib.Variant('v', city.serialize()));
+                Application.application.unmark_busy();

This mark_busy()/unmark_busy() is pointless - the associated dbus messages will be emitted in close succession, and most likely within 16ms, so they will be ignored by the shell.
You can mark_busy() here and unmark_busy() when receiving the dbus reply (which will be after the app is shown and ready), but again startup notification is better - after all it's not clocks who's busy.

@@ +76,3 @@
+            shares = true;
+        else
+            this._weatherRow.destroy();

While it probably works, it doesn't seem a good idea to destroy template children. How about .hide()?
Comment 28 Jonas Danielsson 2014-11-20 06:56:25 UTC
Review of attachment 290961 [details] [review]:

Thanks for review!

The experience is _so_ much better with this, correct, approach.
Comment 29 Jonas Danielsson 2014-11-20 06:58:17 UTC
(In reply to comment #25)
> (In reply to comment #17)
> > Also as I just noticed when watching the cast again. It seems to open to Malmö
> > first time and second time correct to Stockholm.
> > 
> > Giovanni: Is this a bug on my or your side? :)
> 
> Could perfectly be a bug in gnome-weather... You can verify using the
> gnome-weather search provider (which uses the same API once you click on a
> city)
> 

Will try to isolate it, I am still seeing it, it gives me Malmö first time and correct location second itme.

> (In reply to comment #21)
> > Another question for Paolo and Giovanni: Should the names of your applications
> > be translatable? Or is it 'Weather' and 'Clocks' in all languages?
> 
> How about you just grab the name from the desktop file? Then we don't duplicate
> translations, and you can check if the app is installed or not.

Sounds sane, will try that. Any hints on how I get the translated name from the desktop file? Do I need to know the locale and pick the correct name-key, or is there a helper for that somewhere? Will look around.
Comment 30 Jonas Danielsson 2014-11-20 06:59:16 UTC
Review of attachment 290984 [details] [review]:

::: src/sharePopover.js
@@ +64,3 @@
+                                     action,
+                                     new GLib.Variant('v', city.serialize()));
+                Application.application.unmark_busy();

Yeah, you are right, thanks. The startup notification makes this seem silly, lucky you are around!

@@ +76,3 @@
+            shares = true;
+        else
+            this._weatherRow.destroy();

Hide works for me.
Comment 31 Jonas Danielsson 2014-11-20 07:42:05 UTC
Created attachment 291058 [details] [review]
utils: Add activateAction function
Comment 32 Jonas Danielsson 2014-11-20 07:42:11 UTC
Created attachment 291059 [details] [review]
Add SharePopover

Add the SharePopover module, which includes sharing a place to
GNOME Weather.
Comment 33 Jonas Danielsson 2014-11-20 07:42:16 UTC
Created attachment 291060 [details] [review]
MapBubble: Add share button
Comment 34 Jonas Danielsson 2014-11-20 07:42:21 UTC
Created attachment 291061 [details] [review]
Add share button to userLocation and searchResult
Comment 35 Jonas Danielsson 2014-11-20 07:42:57 UTC
Created attachment 291062 [details]
New cast!
Comment 36 Jonas Danielsson 2014-11-20 12:38:22 UTC
Created attachment 291089 [details] [review]
utils: Add activateAction function
Comment 37 Jonas Danielsson 2014-11-20 12:38:31 UTC
Created attachment 291090 [details] [review]
Add ShareDialog

Add the ShareDialog module, which includes sharing a place to
GNOME Weather and GNOME Clocks.
Comment 38 Jonas Danielsson 2014-11-20 12:38:38 UTC
Created attachment 291092 [details] [review]
MapBubble: Add share button
Comment 39 Jonas Danielsson 2014-11-20 12:38:46 UTC
Created attachment 291093 [details] [review]
Add share button to userLocation and searchResult
Comment 40 Jonas Danielsson 2014-11-20 12:39:24 UTC
Created attachment 291094 [details]
New cast!
Comment 41 Jonas Danielsson 2014-11-20 12:42:23 UTC
Created attachment 291095 [details] [review]
Add ShareDialog

Add the ShareDialog module, which includes sharing a place to
GNOME Weather and GNOME Clocks.
Comment 42 Jonas Danielsson 2014-11-20 12:43:08 UTC
Review of attachment 291095 [details] [review]:

::: src/share-dialog.ui
@@ +35,3 @@
+            <style>
+              <class name="text-button"/>
+              <class name="suggested-action"/>

I set this class, but the button is not blue :(
What am I doing wrong?
Comment 43 André Klapper 2014-11-20 13:00:24 UTC
(In reply to comment #41)
> Created an attachment (id=291095) [details] [review]
> Add ShareDialog

+            <property name="label" translatable="yes">_Cancel</property>
+            <property name="label" translatable="yes">_Choose</property>
Are these two buttons (and mnemonics) in the very same dialog?
Comment 44 Jonas Danielsson 2014-11-20 13:53:34 UTC
(In reply to comment #43)
> (In reply to comment #41)
> > Created an attachment (id=291095) [details] [review] [details] [review]
> > Add ShareDialog
> 
> +            <property name="label" translatable="yes">_Cancel</property>
> +            <property name="label" translatable="yes">_Choose</property>
> Are these two buttons (and mnemonics) in the very same dialog?

They are in the same dialog, yes. Have I messed up in some way?

Thanks
Jonas
Comment 45 André Klapper 2014-11-20 14:50:37 UTC
Using the very same mnemonic is just a bit unfortunate.
Comment 46 Jonas Danielsson 2014-11-21 06:12:08 UTC
Created attachment 291139 [details] [review]
Add ShareDialog

Add the ShareDialog module, which includes sharing a place to
GNOME Weather and GNOME Clocks.
Comment 47 Jonas Danielsson 2014-11-21 09:22:55 UTC
Created attachment 291143 [details] [review]
Add ShareDialog

Add the ShareDialog module, which includes sharing a place to
GNOME Weather and GNOME Clocks.
Comment 48 Andreas Nilsson 2014-11-21 13:57:27 UTC
Good to see the buttons being separated now!
They are still very close to each other though, so it would be good with a gap of, say, 6px or so between them. Just to make it look better.

The dialog looks good, but I would rename the button "Choose" to "Share". Choosing is what you do by selecting an item in the list. Sharing is the actual action.
Comment 49 Jonas Danielsson 2014-11-21 14:06:28 UTC
Created attachment 291168 [details]
New cast!

Thanks Andreas!

How about something like this?
Comment 50 Andreas Nilsson 2014-11-21 14:08:33 UTC
Looks great!
Comment 51 Jonas Danielsson 2014-11-21 14:15:20 UTC
Created attachment 291171 [details] [review]
utils: Add activateAction function
Comment 52 Jonas Danielsson 2014-11-21 14:15:25 UTC
Created attachment 291172 [details] [review]
Add ShareDialog

Add the ShareDialog module, which includes sharing a place to
GNOME Weather and GNOME Clocks.
Comment 53 Jonas Danielsson 2014-11-21 14:15:30 UTC
Created attachment 291173 [details] [review]
MapBubble: Add share button
Comment 54 Jonas Danielsson 2014-11-21 14:15:36 UTC
Created attachment 291174 [details] [review]
Add share button to userLocation and searchResult
Comment 55 Mattias Bengtsson 2014-11-21 15:16:39 UTC
Review of attachment 291171 [details] [review]:

Looks good, except for fringe bug and nit (feel free to ignore that one, I know you're not a fan of ternary expressions :))

::: src/utils.js
@@ +146,3 @@
+
+function activateAction(appId, action, parameter, timestamp) {
+    let wrappedParam = [];

let wrappedParam = parameter ? [parameter] : [];

@@ +151,3 @@
+
+    if (parameter)
+        wrappedParam = [parameter];

...and then remove this.

@@ +165,3 @@
+                                  c.call_finish(res);
+                              } catch(e) {
+                                  Utils.debug('ActivateApplication: ' + e);

Just debug (Utils isn't defined here).
Comment 56 Mattias Bengtsson 2014-11-21 15:53:37 UTC
Review of attachment 291172 [details] [review]:

Some code style thoughts and a little bug.

Also do I need weather and clocks from JHBuild for this to work? 
Clocks doesn't start and Weather only shows malmö even if I choose new york.

::: src/shareDialog.js
@@ +61,3 @@
+        this._cancelButton.connect('clicked', (function() {
+            this.response(Response.CANCEL);
+        }).bind(this));

this._cancelButton.connect('clicked', 
                           this.response.bind(this, Response.CANCEL));

@@ +66,3 @@
+            let rows = this._list.get_selected_rows();
+            if (rows.length === 0)
+                this.response(RESPONSE.CANCEL);

RESPONSE → Response

@@ +69,3 @@
+
+            if (rows[0] === this._weatherRow || rows[0] === this._clocksRow) {
+                let world = imports.gi.GWeather.Location.get_world();

Import GWeather above instead and then:
> let world = GWeather.Location.get_world();

@@ +89,3 @@
+                this.response(Response.SUCCESS);
+            }
+        }).bind(this));

Break this out into _onChooseButtonClicked instead.

@@ +115,3 @@
+
+        return shares;
+    },

A version with less state to think about:

> let shareWeather = this._checkWeather();
> let shareClocks = this._checkClocks();
> 
> if (!shareWeather)
>     this._weatherRow.hide();
> if (!shareClocks)
>     this._clocksRow.hide();
> 
> return shareWeather || shareClocks;

@@ +122,3 @@
+            return false;
+
+        return true;

Assuming info can't be undefined:
> let info = Gio.DesktopAppInfo.new(appId + '.desktop');
> return info !== null;

If it can, I'd add this to utils.js:

function hasValue(v) { return v !== undefined && v !== null; }

and then

> let info = Gio.DesktopAppInfo.new(appId + '.desktop');
> return Utils.hasValue(info);

@@ +129,3 @@
+            return false;
+
+        if (!imports.gi.GWeather)

Just GWeather

@@ +132,3 @@
+            return false;
+
+        return true;

This function can be condensed to a (to me) more readable one-liner:

> return (GWeather !== null && this._checkApp(_WEATHER_APPID));

or if GWeather can be undefined as well us the hasValue helper from above:

> return (Utils.hasValue(GWeather) && this._checkApp(_WEATHER_APPID));

@@ +143,3 @@
+
+        return true;
+    }

Same remarks as checkWeather
Comment 57 Mattias Bengtsson 2014-11-21 15:57:57 UTC
Review of attachment 291173 [details] [review]:

ACK
Comment 58 Mattias Bengtsson 2014-11-21 15:58:48 UTC
Review of attachment 291174 [details] [review]:

ACK
Comment 59 Jonas Danielsson 2014-11-21 21:39:48 UTC
Attachment 291171 [details] pushed as 0bdf305 - utils: Add activateAction function
Attachment 291172 [details] pushed as b621c3a - Add ShareDialog
Attachment 291173 [details] pushed as 210c9c8 - MapBubble: Add share button
Attachment 291174 [details] pushed as 990681e - Add share button to userLocation and searchResult
Comment 60 Jonas Danielsson 2014-11-22 12:42:46 UTC
Created attachment 291230 [details] [review]
PlaceStore: Add getModelForPlaceType method

https://bugzilla.gnome.org/show_bug.cgi?id=722102
Comment 61 Jonas Danielsson 2014-11-22 12:42:52 UTC
Created attachment 291231 [details] [review]
PlaceStore: Add removePlace method

https://bugzilla.gnome.org/show_bug.cgi?id=722102
Comment 62 Jonas Danielsson 2014-11-22 12:42:58 UTC
Created attachment 291232 [details] [review]
Split out PlaceListRow from SearchPopup

https://bugzilla.gnome.org/show_bug.cgi?id=722102
Comment 63 Jonas Danielsson 2014-11-22 12:43:04 UTC
Created attachment 291233 [details] [review]
Add FavoritesPopover

https://bugzilla.gnome.org/show_bug.cgi?id=722102
Comment 64 Jonas Danielsson 2014-11-22 12:43:11 UTC
Created attachment 291234 [details] [review]
MapBubble: Add favorite button

https://bugzilla.gnome.org/show_bug.cgi?id=722102
Comment 65 Jonas Danielsson 2014-11-22 12:43:16 UTC
Created attachment 291235 [details] [review]
MainWindow: Add favorites toggle

https://bugzilla.gnome.org/show_bug.cgi?id=722102
Comment 66 Jonas Danielsson 2014-11-22 12:43:23 UTC
Created attachment 291236 [details] [review]
PlaceStore: Add addPlace method

https://bugzilla.gnome.org/show_bug.cgi?id=722102
Comment 67 Jonas Danielsson 2014-11-22 12:43:29 UTC
Created attachment 291237 [details] [review]
SearchResultBubble: Add favorite button

https://bugzilla.gnome.org/show_bug.cgi?id=722102