[gnome-weather/wip/ewlsh/gtk4] Remove profiles, fix dark mode, add removed icon, fix welcoem screen.
- From: Evan Welsh <ewlsh src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-weather/wip/ewlsh/gtk4] Remove profiles, fix dark mode, add removed icon, fix welcoem screen.
- Date: Sun, 6 Feb 2022 05:49:54 +0000 (UTC)
commit 3814232941338252ecd75cb4fde4d35d601f2167
Author: Evan Welsh <contact evanwelsh com>
Date: Sat Feb 5 21:49:47 2022 -0800
Remove profiles, fix dark mode, add removed icon, fix welcoem screen.
.gitignore | 1 +
.gitlab-ci.yml | 2 +-
README.md | 2 +-
.../scalable/status/weather-hourly-symbolic.svg | 7 +++
data/icons/meson.build | 8 ++--
data/org.gnome.Weather.data.gresource.xml | 2 +-
data/org.gnome.Weather.search-provider.ini.in | 2 +-
data/style-dark.css | 1 +
data/{application.css => style.css} | 7 ++-
data/weather-widget.ui | 2 +-
data/window.ui | 31 +++++++++-----
meson.build | 2 +-
org.gnome.Weather.json | 2 +-
src/app/application.js | 8 +---
src/app/hourlyForecast.js | 14 +-----
src/app/window.js | 31 ++++++--------
src/app/world.js | 16 +++----
src/misc/util.js | 14 ------
src/org.gnome.Weather.BackgroundService.in | 2 +-
....Weather.BackgroundService.src.gresource.xml.in | 2 +-
src/org.gnome.Weather.in | 2 +-
src/org.gnome.Weather.src.gresource.xml.in | 2 +-
src/service/searchProvider.js | 50 +++++++++++-----------
src/shared/world.js | 3 +-
24 files changed, 94 insertions(+), 119 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index c11c957..6f9a211 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@ _build
**/__pycache__
.fenv/
.flatpak-builder/
+.flatpak*/
\ No newline at end of file
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2ae78be..7ff58b1 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -9,7 +9,7 @@ flatpak:
MANIFEST_PATH: "org.gnome.Weather.json"
FLATPAK_MODULE: "gnome-weather"
RUNTIME_REPO: "https://nightly.gnome.org/gnome-nightly.flatpakrepo"
- APP_ID: "org.gnome.WeatherDevel"
+ APP_ID: "org.gnome.Weather"
extends: .flatpak
nightly:
diff --git a/README.md b/README.md
index 21475ea..393dc96 100644
--- a/README.md
+++ b/README.md
@@ -33,7 +33,7 @@ $ flatpak remote-add gnome-nightly https://nightly.gnome.org/gnome-nightly.flatp
Then, run the following command to install the development version of Weather:
```
-$ flatpak install org.gnome.WeatherDevel
+$ flatpak install org.gnome.Weather
```
## Hacking on Weather
diff --git a/data/icons/hicolor/scalable/status/weather-hourly-symbolic.svg
b/data/icons/hicolor/scalable/status/weather-hourly-symbolic.svg
new file mode 100644
index 0000000..ef275dc
--- /dev/null
+++ b/data/icons/hicolor/scalable/status/weather-hourly-symbolic.svg
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg height="16px" viewBox="0 0 16 16" width="16px" xmlns="http://www.w3.org/2000/svg">
+ <g fill="#2e3436">
+ <path d="m 8 0 c -4.40625 0 -8 3.59375 -8 8 s 3.59375 8 8 8 s 8 -3.59375 8 -8 s -3.59375 -8 -8 -8 z
m 0 2 c 3.324219 0 6 2.671875 6 6 c 0 3.324219 -2.675781 6 -6 6 s -6 -2.675781 -6 -6 c 0 -3.328125 2.675781
-6 6 -6 z m 0 0"/>
+ <path d="m 4.929688 4.953125 c -0.132813 0.003906 -0.257813 0.058594 -0.351563 0.152344 c -0.191406
0.195312 -0.1875 0.511719 0.007813 0.707031 l 3.113281 3.042969 c 0.105469 0.097656 0.246093 0.144531
0.386719 0.128906 h 2.914062 c 0.277344 0 0.5 -0.222656 0.5 -0.5 c 0 -0.273437 -0.222656 -0.5 -0.5 -0.5 h
-2.761719 l -2.953125 -2.886719 c -0.09375 -0.09375 -0.222656 -0.144531 -0.355468 -0.144531 z m 0 0"/>
+ </g>
+</svg>
\ No newline at end of file
diff --git a/data/icons/meson.build b/data/icons/meson.build
index 22e3cc6..1fd6b0d 100644
--- a/data/icons/meson.build
+++ b/data/icons/meson.build
@@ -1,8 +1,6 @@
-if profile == 'Devel'
- icon = '@0@.svg'.format(weather_id)
-else
- icon = '@0@.svg'.format(default_id)
-endif
+
+icon = '@0@.svg'.format(default_id)
+
scalable_icondir = join_paths('hicolor', 'scalable', 'apps')
install_data (
diff --git a/data/org.gnome.Weather.data.gresource.xml b/data/org.gnome.Weather.data.gresource.xml
index 22f274b..56934d0 100644
--- a/data/org.gnome.Weather.data.gresource.xml
+++ b/data/org.gnome.Weather.data.gresource.xml
@@ -7,7 +7,7 @@
<file preprocess="xml-stripblanks">window.ui</file>
<file preprocess="xml-stripblanks">hour-entry.ui</file>
<file preprocess="xml-stripblanks">day-entry.ui</file>
- <file>application.css</file>
+ <file>style.css</file>
</gresource>
<gresource prefix="/org/gnome/shell">
<file>ShellWeatherIntegration.xml</file>
diff --git a/data/org.gnome.Weather.search-provider.ini.in b/data/org.gnome.Weather.search-provider.ini.in
index 0e57c24..0b1b678 100644
--- a/data/org.gnome.Weather.search-provider.ini.in
+++ b/data/org.gnome.Weather.search-provider.ini.in
@@ -1,6 +1,6 @@
[Shell Search Provider]
DesktopId=@APP_ID@.desktop
BusName=@APP_ID@.BackgroundService
-ObjectPath=/org/gnome/Weather@PROFILE@/BackgroundService
+ObjectPath=/org/gnome/Weather/BackgroundService
Version=2
DefaultDisabled=true
diff --git a/data/style-dark.css b/data/style-dark.css
new file mode 100644
index 0000000..e4b9fd7
--- /dev/null
+++ b/data/style-dark.css
@@ -0,0 +1 @@
+@define-color temp_chart_fill_color rgba(248, 228, 92, 0.15);
\ No newline at end of file
diff --git a/data/application.css b/data/style.css
similarity index 93%
rename from data/application.css
rename to data/style.css
index a2b63f7..2d1d4f0 100644
--- a/data/application.css
+++ b/data/style.css
@@ -122,8 +122,7 @@ WeatherThermometer > label.low {
#daily-forecast-box,
#hourly-forecast-box {
- /* TODO: Pull from theme/elsewhere */
- background-color: white;
+ background-color: @view_bg_color;
}
#updated-time-label {
@@ -155,8 +154,8 @@ button.osd.circular > image {
}
.search-view scrolledwindow {
- background-color: @theme_selected_bg_color;
- color: @theme_selected_fg_color;
+ background-color: @accent_bg_color;
+ color: @accent_fg_color;
}
.search-view .large-title {
diff --git a/data/weather-widget.ui b/data/weather-widget.ui
index 1550c7a..cc84729 100644
--- a/data/weather-widget.ui
+++ b/data/weather-widget.ui
@@ -99,7 +99,7 @@
<object class="AdwViewStackPage">
<property name="name">hourly</property>
<property name="title" translatable="yes">Hourly</property>
- <property name="icon-name">preferences-system-time-symbolic</property>
+ <property name="icon-name">weather-hourly-symbolic</property>
<property name="child">
<object class="GtkScrolledWindow" id="forecastHourlyScrollWindow">
<style>
diff --git a/data/window.ui b/data/window.ui
index 7ea66bb..44aa22a 100644
--- a/data/window.ui
+++ b/data/window.ui
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
- <requires lib="gtk" version="4.0"/>
+ <requires lib="gtk" version="4.0" />
<menu id="primary-menu">
<submenu>
<attribute translatable="yes" name="label">_Temperature Unit</attribute>
@@ -48,7 +48,7 @@
</child>
<child type="title">
<object class="GtkStack" id="titleStack">
- <property name="visible-child-name" bind-source="stack" bind-property="visible-child-name"
bind-flags="bidirectional|sync-create"/>
+ <property name="visible-child-name" bind-source="stack" bind-property="visible-child-name"
bind-flags="bidirectional|sync-create" />
<property name="transition_type">crossfade</property>
<child>
<object class="GtkStackPage">
@@ -61,7 +61,7 @@
<property name="width-chars">5</property>
<property name="label" translatable="yes">Select Location</property>
<style>
- <class name="title"/>
+ <class name="title" />
</style>
</object>
</property>
@@ -102,15 +102,24 @@
<property name="title" translatable="yes">Welcome to Weather!</property>
<property name="description" translatable="yes">To get started, select a
location.</property>
<child>
- <object class="Gjs_LocationSearchEntry" id="searchEntry">
- <!-- TODO: Our custom widget doesn't have these properties <property
name="hexpand">False</property>
- <property name="halign">center</property>
- <property name="width-request">246</property> -->
- <!-- <property name="placeholder_text" translatable="yes">Search for a city or
country</property> -->
+ <object class="GtkBox">
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="Gjs_LocationSearchEntry" id="searchEntry">
+ <!-- TODO: Our custom widget doesn't have these properties <property
name="hexpand">False</property>
+ <property name="halign">center</property>
+ <property name="width-request">246</property> -->
+ <!-- <property name="placeholder_text" translatable="yes">Search for a city or
country</property> -->
+ </object>
+ </child>
+ <child>
+ <object class="GtkListView" id="searchListView"></object>
+ </child>
</object>
</child>
+
<style>
- <class name="search-view"/>
+ <class name="search-view" />
</style>
</object>
</property>
@@ -121,10 +130,10 @@
</child>
<child>
<object class="AdwViewSwitcherBar" id="forecastStackSwitcherBar">
- <property name="reveal" bind-source="forecastStackSwitcher" bind-property="title-visible"
bind-flags="sync-create"/>
+ <property name="reveal" bind-source="forecastStackSwitcher" bind-property="title-visible"
bind-flags="sync-create" />
</object>
</child>
</object>
</child>
</template>
-</interface>
+</interface>
\ No newline at end of file
diff --git a/meson.build b/meson.build
index 15ab279..28246da 100644
--- a/meson.build
+++ b/meson.build
@@ -30,7 +30,7 @@ else
endif
default_id = 'org.gnome.Weather'
-weather_id = default_id + profile
+weather_id = default_id
weather_prefix = get_option('prefix')
weather_libdir = join_paths(weather_prefix, get_option('libdir'))
diff --git a/org.gnome.Weather.json b/org.gnome.Weather.json
index a8ad2e9..83cf3bd 100644
--- a/org.gnome.Weather.json
+++ b/org.gnome.Weather.json
@@ -1,5 +1,5 @@
{
- "app-id" : "org.gnome.WeatherDevel",
+ "app-id" : "org.gnome.Weather",
"runtime" : "org.gnome.Platform",
"runtime-version" : "master",
"sdk" : "org.gnome.Sdk",
diff --git a/src/app/application.js b/src/app/application.js
index dda2961..3d71dc8 100644
--- a/src/app/application.js
+++ b/src/app/application.js
@@ -41,9 +41,7 @@ export const Application = GObject.registerClass(
flags: Gio.ApplicationFlags.CAN_OVERRIDE_APP_ID,
});
let name_prefix = '';
- if (pkg.name.endsWith('Devel')) {
- name_prefix = '(Development) ';
- }
+
GLib.set_application_name(name_prefix + _("Weather"));
Gtk.Window.set_default_icon_name(pkg.name);
@@ -82,8 +80,6 @@ export const Application = GObject.registerClass(
vfunc_startup() {
super.vfunc_startup();
- Util.loadStyleSheet('resource:///org/gnome/Weather/application.css');
-
this.world = GWeather.Location.get_world();
this.model = new World.WorldModel(this.world, true);
this.currentLocationController = new
CurrentLocationController.CurrentLocationController(this.model);
@@ -190,7 +186,7 @@ export const Application = GObject.registerClass(
timeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 1000, function () {
log('Timeout during model load, perhaps the network is not available?');
model.disconnect(notifyId);
-
+
return false;
});
notifyId = this.model.connect('notify::loading', function (model) {
diff --git a/src/app/hourlyForecast.js b/src/app/hourlyForecast.js
index 1559d4c..ca6e07e 100644
--- a/src/app/hourlyForecast.js
+++ b/src/app/hourlyForecast.js
@@ -201,11 +201,6 @@ export const HourlyForecastBox = GObject.registerClass(class HourlyForecastBox e
let [, fillColor] = this.get_style_context().lookup_color('temp_chart_fill_color');
- if (Util.isDarkTheme()) {
- fillColor = new Gdk.RGBA();
- fillColor.parse("rgba(248, 228, 92, 0.15)");
- };
-
Gdk.cairo_set_source_rgba(cr, fillColor);
cr.lineTo(width, height);
@@ -227,19 +222,12 @@ export const HourEntry = GObject.registerClass({
super._init({ ...params });
Object.assign(this.layoutManager, {
- orientation: Gtk.Orientation.VERTICAL,
+ orientation: Gtk.Orientation.VERTICAL,
});
this._timeLabel.label = timeLabel;
this._image.iconName = info.get_icon_name() + '-small';
this._temperatureLabel.label = Util.getTempString(info);
-
- // TODO:
- // if (Util.isDarkTheme()) {
- // const color = "#f6d32d";
- // const label = "<span color=\"" + color + "\">" + this.temperatureLabel.label + "</span>";
- // this.temperatureLabel.set_markup(label);
- // };
}
});
diff --git a/src/app/window.js b/src/app/window.js
index 486438d..32d1d77 100644
--- a/src/app/window.js
+++ b/src/app/window.js
@@ -32,7 +32,7 @@ const Page = {
export const MainWindow = GObject.registerClass({
Template: 'resource:///org/gnome/Weather/window.ui',
InternalChildren: ['header', 'refreshRevealer', 'refresh', 'forecastStackSwitcher', 'stack',
- 'titleStack', 'searchEntry', 'searchView', 'forecastStackSwitcherBar']
+ 'titleStack', 'searchEntry', 'searchListView', 'searchView', 'forecastStackSwitcherBar']
}, class MainWindow extends Adw.ApplicationWindow {
_init(params) {
super._init(params);
@@ -60,12 +60,12 @@ export const MainWindow = GObject.registerClass({
this._searchView.icon_name = pkg.name;
- // this._searchEntry.connect('notify::location', (entry, location) => {
- // if (location) {
- // let info = this._model.addNewLocation(location);
- // this._model.setSelectedLocation(info);
- // }
- // });
+ this._searchEntry.connect('notify::location', (entry) => {
+ if (entry.location) {
+ let info = this._model.addNewLocation(entry.location);
+ this._model.setSelectedLocation(info);
+ }
+ });
this._pageWidgets[Page.CITY].push(this._refresh);
@@ -82,11 +82,6 @@ export const MainWindow = GObject.registerClass({
for (let i = 0; i < this._pageWidgets[Page.CITY].length; i++)
this._pageWidgets[Page.CITY][i].hide();
- if (pkg.name.endsWith('Devel')) {
- let ctx = this.get_style_context();
- ctx.add_class('devel')
- }
-
this._showingDefault = false;
}
@@ -116,7 +111,7 @@ export const MainWindow = GObject.registerClass({
this._showingDefault = true;
this._refreshRevealer.reveal_child = false;
let clc = this.application.currentLocationController;
-
+
let mostRecent = this._model.getRecent();
if (mostRecent)
this.showInfo(mostRecent);
@@ -127,12 +122,13 @@ export const MainWindow = GObject.registerClass({
showSearch(text) {
this._showingDefault = false;
this._refreshRevealer.reveal_child = true;
- this._cityView.setTimeVisible(false);
+ // this._cityView.setTimeVisible(false);
this._stack.set_visible_child(this._searchView);
this._goToPage(Page.SEARCH);
this._searchEntry.text = text;
- if (text.length > 0)
- this._searchEntry.get_completion().complete();
+ this._searchEntry.setListView(this._searchListView);
+ // if (text.length > 0)
+ // this._searchEntry.get_completion().complete();
}
updateCurrentLocation(info) { }
@@ -163,9 +159,6 @@ export const MainWindow = GObject.registerClass({
'Jim Pennucci'];
let name_prefix = '';
- if (pkg.name.endsWith('Devel')) {
- name_prefix = '(Development) ';
- }
let copyright = 'Copyright 2013-2015 The Weather Developers';
let attribution = this._cityView.info ? this._cityView.info.get_attribution() : '';
diff --git a/src/app/world.js b/src/app/world.js
index 0eaf5bf..383213e 100644
--- a/src/app/world.js
+++ b/src/app/world.js
@@ -69,7 +69,7 @@ class _WorldContentView extends Gtk.Popover {
this._locationEntry.connect('notify::location', (entry) => {
if (entry.searchText)
entry.searchText = '';
-
+
this._locationChanged(entry.location);
this._syncStackPopover();
@@ -85,7 +85,7 @@ class _WorldContentView extends Gtk.Popover {
this._listbox.connect('row-activated', (listbox, row) => {
if (row._info)
- this.model.setSelectedLocation(row._info);
+ this.model.setSelectedLocation(row._info);
this.popdown();
});
@@ -155,16 +155,14 @@ class _WorldContentView extends Gtk.Popover {
}
}
-
- // vfunc_unmap() {
-
-
- // super.vfunc_unmap();
- // }
-
_onLocationAdded(model) {
const infos = model.getAll();
+ // TODO: This just re-populates the listbox on each updated.
+ // Working on a model-backed version to re-use components but
+ // the current "model" can't simply be converted as the code
+ // is shared across the service and UI and it would complicate
+ // the service
[...this._listbox].forEach(row => this._listbox.remove(row));
for (const info of infos) {
diff --git a/src/misc/util.js b/src/misc/util.js
index b390dbf..33bc7e2 100644
--- a/src/misc/util.js
+++ b/src/misc/util.js
@@ -45,14 +45,6 @@ function loadUI(resourcePath, objects) {
return ui;
}
-function loadStyleSheet(resource) {
- let provider = new Gtk.CssProvider();
- provider.load_from_file(Gio.File.new_for_uri(resource));
- Gtk.StyleContext.add_provider_for_display(Gdk.Display.get_default(),
- provider,
- Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
-}
-
function arrayEqual(one, two) {
if (one.length !== two.length)
return false;
@@ -182,24 +174,18 @@ function getTempString(info) {
return formatTemperature(temp);
}
-function isDarkTheme() {
- return Adw.StyleManager.get_default().dark;
-}
-
export {
loadUI,
formatTemperature,
getDateTime,
getTemp,
getEvening,
- isDarkTheme,
getAfternoon,
getTempString,
getNight,
normalizeCasefoldAndUnaccent,
arrayEqual,
getSettings,
- loadStyleSheet,
getMorning,
getTemperature,
getDay,
diff --git a/src/org.gnome.Weather.BackgroundService.in b/src/org.gnome.Weather.BackgroundService.in
index 03f47c0..c7bda28 100755
--- a/src/org.gnome.Weather.BackgroundService.in
+++ b/src/org.gnome.Weather.BackgroundService.in
@@ -4,7 +4,7 @@ imports.package.init({ name: "@APP_ID@",
prefix: "@prefix@",
libdir: "@libdir@" });
-import('resource:///org/gnome/Weather@profile@/js/service/main.js').then(({ main }) => {
+import('resource:///org/gnome/Weather/js/service/main.js').then(({ main }) => {
main([imports.system.programInvocationName, ...imports.system.programArgs]);
}).catch(error => {
logError(error);
diff --git a/src/org.gnome.Weather.BackgroundService.src.gresource.xml.in
b/src/org.gnome.Weather.BackgroundService.src.gresource.xml.in
index 74aedf0..d4dcd96 100644
--- a/src/org.gnome.Weather.BackgroundService.src.gresource.xml.in
+++ b/src/org.gnome.Weather.BackgroundService.src.gresource.xml.in
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
- <gresource prefix="/org/gnome/Weather@profile@/BackgroundService/js">
+ <gresource prefix="/org/gnome/Weather/BackgroundService/js">
<file>service/main.js</file>
<file>service/searchProvider.js</file>
<file>misc/util.js</file>
diff --git a/src/org.gnome.Weather.in b/src/org.gnome.Weather.in
index 901f7d1..be7353d 100755
--- a/src/org.gnome.Weather.in
+++ b/src/org.gnome.Weather.in
@@ -4,7 +4,7 @@ imports.package.init({ name: "@APP_ID@",
prefix: "@prefix@",
libdir: "@libdir@" });
-import(`resource:///org/gnome/Weather@profile@/js/app/main.js`).catch(error => {
+import(`resource:///org/gnome/Weather/js/app/main.js`).catch(error => {
console.error(error);
imports.system.exit(1);
});
diff --git a/src/org.gnome.Weather.src.gresource.xml.in b/src/org.gnome.Weather.src.gresource.xml.in
index 8b06e1d..1631802 100644
--- a/src/org.gnome.Weather.src.gresource.xml.in
+++ b/src/org.gnome.Weather.src.gresource.xml.in
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
- <gresource prefix="/org/gnome/Weather@profile@/js">
+ <gresource prefix="/org/gnome/Weather/js">
<file>app/application.js</file>
<file>app/city.js</file>
<file>app/currentLocationController.js</file>
diff --git a/src/service/searchProvider.js b/src/service/searchProvider.js
index 0b650fc..e302771 100644
--- a/src/service/searchProvider.js
+++ b/src/service/searchProvider.js
@@ -29,7 +29,7 @@ const SearchProviderInterface = new TextDecoder().decode(
function getCountryName(location) {
while (location &&
- location.get_level() > GWeather.LocationLevel.COUNTRY)
+ location.get_level() > GWeather.LocationLevel.COUNTRY)
location = location.get_parent();
return location.get_name();
@@ -180,11 +180,12 @@ export class WeatherSearchProvider {
It's the current weather conditions followed by the temperature,
like "Clear sky, 14 °C" */
let summary = _("%s, %s").format(conditions, info.get_temp());
- ret.push({ name: new GLib.Variant('s', name),
- id: new GLib.Variant('s', identifiers[i]),
- description: new GLib.Variant('s', summary),
- icon: (new Gio.ThemedIcon({ name: info.get_icon_name() })).serialize()
- });
+ ret.push({
+ name: new GLib.Variant('s', name),
+ id: new GLib.Variant('s', identifiers[i]),
+ description: new GLib.Variant('s', summary),
+ icon: (new Gio.ThemedIcon({ name: info.get_icon_name() })).serialize()
+ });
}
this._app.release();
@@ -193,7 +194,7 @@ export class WeatherSearchProvider {
}
_getPlatformData(timestamp) {
- return {'desktop-startup-id': new GLib.Variant('s', '_TIME' + timestamp) };
+ return { 'desktop-startup-id': new GLib.Variant('s', '_TIME' + timestamp) };
}
_activateAction(action, parameter, timestamp) {
@@ -204,27 +205,24 @@ export class WeatherSearchProvider {
wrappedParam = [];
profile = '';
- if (pkg.name.endsWith('Devel')) {
- profile = 'Devel';
- }
Gio.DBus.session.call(pkg.name,
- '/org/gnome/Weather' + profile,
- 'org.freedesktop.Application',
- 'ActivateAction',
- new GLib.Variant('(sava{sv})', [action, wrappedParam,
- this._getPlatformData(timestamp)]),
- null,
- Gio.DBusCallFlags.NONE,
- -1, null, (connection, result) => {
- try {
- connection.call_finish(result);
- } catch(e) {
- log('Failed to launch application: ' + e);
- }
-
- this._app.release();
- });
+ '/org/gnome/Weather' + profile,
+ 'org.freedesktop.Application',
+ 'ActivateAction',
+ new GLib.Variant('(sava{sv})', [action, wrappedParam,
+ this._getPlatformData(timestamp)]),
+ null,
+ Gio.DBusCallFlags.NONE,
+ -1, null, (connection, result) => {
+ try {
+ connection.call_finish(result);
+ } catch (e) {
+ log('Failed to launch application: ' + e);
+ }
+
+ this._app.release();
+ });
}
ActivateResult(id, terms, timestamp) {
diff --git a/src/shared/world.js b/src/shared/world.js
index b404264..7b96a2a 100644
--- a/src/shared/world.js
+++ b/src/shared/world.js
@@ -123,7 +123,8 @@ export const WorldModel = GObject.registerClass({
info = this._addLocationInternal(location);
}
- this.setSelectedLocation(info)
+ if (info)
+ this.setSelectedLocation(info)
}
_updateLoadingCount(delta) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]