[gnome-shell] extensionPrefs: Stop handling UUIDs on the command line
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] extensionPrefs: Stop handling UUIDs on the command line
- Date: Mon, 23 Mar 2020 15:52:43 +0000 (UTC)
commit d76162c1c047cae15a569bc649a1a4a660c46a98
Author: Florian Müllner <fmuellner gnome org>
Date: Thu Mar 5 19:44:28 2020 +0100
extensionPrefs: Stop handling UUIDs on the command line
We are jumping through quite some hoops to support showing only the
preference dialog when given a UUID on the command line.
As gnome-shell is about to stop calling out to us for the prefs dialog,
the reason for supporting this is going away, so remove all the special
handling.
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1106
.../data/org.gnome.Extensions.desktop.in.in | 2 +-
js/extensionPrefs/js/main.js | 57 ++--------------------
2 files changed, 5 insertions(+), 54 deletions(-)
---
diff --git a/js/extensionPrefs/data/org.gnome.Extensions.desktop.in.in
b/js/extensionPrefs/data/org.gnome.Extensions.desktop.in.in
index cd22f6adf0..588e68bb9d 100644
--- a/js/extensionPrefs/data/org.gnome.Extensions.desktop.in.in
+++ b/js/extensionPrefs/data/org.gnome.Extensions.desktop.in.in
@@ -4,7 +4,7 @@ Name=Extensions
# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
Icon=@app_id@
Comment=Configure GNOME Shell Extensions
-Exec=@bindir@/@prgname@ %u
+Exec=@bindir@/@prgname@
DBusActivatable=true
Categories=GNOME;GTK;
OnlyShowIn=GNOME;
diff --git a/js/extensionPrefs/js/main.js b/js/extensionPrefs/js/main.js
index fd8c009593..b96319c87d 100644
--- a/js/extensionPrefs/js/main.js
+++ b/js/extensionPrefs/js/main.js
@@ -29,12 +29,6 @@ function loadInterfaceXML(iface) {
return null;
}
-function stripPrefix(string, prefix) {
- if (string.slice(0, prefix.length) == prefix)
- return string.slice(prefix.length);
- return string;
-}
-
function toggleState(action) {
let state = action.get_state();
action.change_state(new GLib.Variant('b', !state.get_boolean()));
@@ -44,10 +38,7 @@ var Application = GObject.registerClass(
class Application extends Gtk.Application {
_init() {
GLib.set_prgname('gnome-shell-extension-prefs');
- super._init({
- application_id: 'org.gnome.Extensions',
- flags: Gio.ApplicationFlags.HANDLES_COMMAND_LINE,
- });
+ super._init({ application_id: 'org.gnome.Extensions' });
}
get shellProxy() {
@@ -76,20 +67,6 @@ class Application extends Gtk.Application {
this._shellProxy = new GnomeShellProxy(Gio.DBus.session, 'org.gnome.Shell', '/org/gnome/Shell');
this._window = new ExtensionsWindow({ application: this });
}
-
- vfunc_command_line(commandLine) {
- let [prgName_, uuid] = commandLine.get_arguments();
-
- if (uuid) {
- // Strip off "extension:///" prefix which fakes a URI, if it exists
- uuid = stripPrefix(uuid, 'extension:///');
-
- this._window.openPrefs(uuid);
- } else {
- this.activate();
- }
- return 0;
- }
});
var ExtensionsWindow = GObject.registerClass({
@@ -108,8 +85,6 @@ var ExtensionsWindow = GObject.registerClass({
_init(params) {
super._init(params);
- this._startupUuid = null;
- this._loaded = false;
this._prefsDialog = null;
this._updatesCheckId = 0;
@@ -177,35 +152,16 @@ var ExtensionsWindow = GObject.registerClass({
}
openPrefs(uuid) {
- if (!this._loaded)
- this._startupUuid = uuid;
- else if (!this._showPrefs(uuid))
- this.present();
- }
-
- _showPrefs(uuid) {
if (this._prefsDialog)
- return false;
+ return;
let row = this._findExtensionRow(uuid);
- if (!row || !row.hasPrefs)
- return false;
-
this._prefsDialog = new ExtensionPrefsDialog(row);
+ this._prefsDialog.set({ transient_for: this, modal: true });
- if (this.visible)
- this._prefsDialog.set({ transient_for: this, modal: true });
-
- this._prefsDialog.connect('destroy', () => {
- this._prefsDialog = null;
-
- if (!this.visible)
- this.destroy();
- });
+ this._prefsDialog.connect('destroy', () => (this._prefsDialog = null));
this._prefsDialog.show();
-
- return true;
}
_showAbout() {
@@ -359,11 +315,6 @@ var ExtensionsWindow = GObject.registerClass({
_extensionsLoaded() {
this._syncListVisibility();
this._checkUpdates();
-
- if (this._startupUuid)
- this._showPrefs(this._startupUuid);
- this._startupUuid = null;
- this._loaded = true;
}
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]