Commit 784c0b7e authored by Florian Müllner's avatar Florian Müllner

dateMenu: Try harder finding a reasonable weather location name

Weather stations can have unwieldy long names, which don't fit the
limited space we have available. City names are usually more suitable,
so use the name of the nearest city instead if possible.

GNOME/gnome-shell#1927
parent f2df9f1a
......@@ -388,7 +388,12 @@ class WeatherSection extends St.Button {
}
let info = this._weatherClient.info;
this._titleLocation.text = info.get_location().get_name();
let loc = info.get_location();
if (loc.get_level() !== GWeather.LocationLevel.CITY && loc.has_coords()) {
let world = GWeather.Location.get_world();
loc = world.find_nearest_city(...loc.get_coords());
}
this._titleLocation.text = loc.get_name();
if (this._weatherClient.loading) {
this._setStatusLabel(_("Loading…"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment