Use new convenience function to open settings

GS 3.36 introduced a portal-like API for actions like opening settings.
That was done in order to make it possible to ship the new extensions
app in a sandboxed manner, e.g. via flatpak.

While talking to the API directly is a bit cumbersome, luckily there
is a convenience function we can make use of (from GS 3.36.2 on).

Closes #260.

Signed-off-by: Jens Lody <jens@jenslody.de>
master
Robert Mader 5 years ago committed by Jens Lody
parent 772c054a9e
commit d9a90d3843
  1. 9
      src/extension.js

@ -965,7 +965,14 @@ class OpenweatherMenuButton extends PanelMenu.Button {
_onPreferencesActivate() { _onPreferencesActivate() {
this.menu.actor.hide(); this.menu.actor.hide();
Util.spawn(["gnome-shell-extension-prefs", "openweather-extension@jenslody.de"]); if (typeof ExtensionUtils.openPrefs === 'function') {
ExtensionUtils.openPrefs();
} else {
Util.spawn([
"gnome-shell-extension-prefs",
Me.uuid
]);
}
return 0; return 0;
} }

Loading…
Cancel
Save