[gnome-shell] extensionPrefs: Expose kill-switch
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] extensionPrefs: Expose kill-switch
- Date: Thu, 16 Feb 2017 00:38:34 +0000 (UTC)
commit 5d07832e961046ee989a19661c288e2633fed1f4
Author: Florian Müllner <fmuellner gnome org>
Date: Tue Dec 15 00:15:33 2015 +0100
extensionPrefs: Expose kill-switch
While the extension prefs tool is not meant as the primary way for
users to configure extensions - that will be Tweak Tool - it still
doesn't hurt to expose the extension kill switch to easily turn
extensions back on after a session crash.
https://bugzilla.gnome.org/show_bug.cgi?id=778664
js/extensionPrefs/main.js | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/js/extensionPrefs/main.js b/js/extensionPrefs/main.js
index cdfce78..7bbf0fa 100644
--- a/js/extensionPrefs/main.js
+++ b/js/extensionPrefs/main.js
@@ -149,6 +149,14 @@ const Application = new Lang.Class({
title: _("GNOME Shell Extensions") });
this._window.set_titlebar(this._titlebar);
+ let killSwitch = new Gtk.Switch({ valign: Gtk.Align.CENTER });
+ this._titlebar.pack_end(killSwitch);
+
+ this._settings = new Gio.Settings({ schema_id: 'org.gnome.shell' });
+ this._settings.bind('disable-user-extensions', killSwitch, 'active',
+ Gio.SettingsBindFlags.BIND_DEFAULT |
+ Gio.SettingsBindFlags.INVERT_BOOLEAN);
+
let scroll = new Gtk.ScrolledWindow({ hscrollbar_policy: Gtk.PolicyType.NEVER,
shadow_type: Gtk.ShadowType.IN,
halign: Gtk.Align.CENTER,
@@ -264,6 +272,10 @@ const ExtensionRow = new Lang.Class({
Lang.bind(this, function() {
this._switch.sensitive = this._canEnable();
}));
+ this._settings.connect('changed::disable-user-extensions',
+ Lang.bind(this, function() {
+ this._switch.sensitive = this._canEnable();
+ }));
this._buildUI();
},
@@ -319,7 +331,8 @@ const ExtensionRow = new Lang.Class({
let extension = ExtensionUtils.extensions[this.uuid];
let checkVersion = !this._settings.get_boolean('disable-extension-version-validation');
- return !(checkVersion && ExtensionUtils.isOutOfDate(extension));
+ return !this._settings.get_boolean('disable-user-extensions') &&
+ !(checkVersion && ExtensionUtils.isOutOfDate(extension));
},
_isEnabled: function() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]