all: remove all GSettings usage
Since GSettings is not supported in extensions in 3.2, all settings have been replaced by constants in JS files (except for user-theme, whose only purpose is to actually bridge GSettings to the shell). Customizations are still supported in master, and distributions packaging these extensions for system-wide install may consider reverting this bug.
This commit is contained in:
@@ -1,14 +1,3 @@
|
||||
EXTENSION_ID = alternate-tab
|
||||
|
||||
include ../../extension.mk
|
||||
|
||||
gschemas_in = $(gschemabase).alternate-tab.gschema.xml.in
|
||||
|
||||
@INTLTOOL_XML_NOMERGE_RULE@
|
||||
|
||||
gsettings_SCHEMAS = $(gschemas_in:.xml.in=.xml)
|
||||
|
||||
@GSETTINGS_RULES@
|
||||
|
||||
CLEANFILES += $(gschemas_in:.xml.in=.valid) $(gsettings_SCHEMAS)
|
||||
EXTRA_DIST += $(gschemas_in)
|
||||
|
||||
@@ -26,9 +26,9 @@ const N_ = function(e) { return e };
|
||||
|
||||
const POPUP_DELAY_TIMEOUT = 150; // milliseconds
|
||||
|
||||
const SETTINGS_SCHEMA = 'org.gnome.shell.extensions.alternate-tab';
|
||||
const SETTINGS_BEHAVIOUR_KEY = 'behaviour';
|
||||
const SETTINGS_FIRST_TIME_KEY = 'first-time';
|
||||
// Settings: choose one of MODES, the description is in MESSAGE
|
||||
// (master branch has a nice dialog, but we cannot in gnome 3.2)
|
||||
const BEHAVIOUR = 'all_thumbnails';
|
||||
|
||||
const MODES = {
|
||||
all_thumbnails: function(shellwm, binding, mask, window, backwards) {
|
||||
@@ -267,6 +267,8 @@ WindowSwitcher.prototype = {
|
||||
}
|
||||
};
|
||||
|
||||
/* This object is never instantiated in the current branch, but
|
||||
I don't trust git merge enough to remove it */
|
||||
function AltTabSettingsDialog() {
|
||||
this._init();
|
||||
}
|
||||
@@ -598,16 +600,9 @@ function init(metadata) {
|
||||
}
|
||||
|
||||
function doAltTab(shellwm, binding, mask, window, backwards) {
|
||||
let settings = new Gio.Settings({ schema: SETTINGS_SCHEMA });
|
||||
|
||||
|
||||
if(settings.get_boolean(SETTINGS_FIRST_TIME_KEY)) {
|
||||
new AltTabSettingsDialog().open();
|
||||
} else {
|
||||
let behaviour = settings.get_string(SETTINGS_BEHAVIOUR_KEY);
|
||||
if(behaviour in MODES) {
|
||||
MODES[behaviour](shellwm, binding, mask, window, backwards);
|
||||
}
|
||||
let behaviour = BEHAVIOUR;
|
||||
if(behaviour in MODES) {
|
||||
MODES[behaviour](shellwm, binding, mask, window, backwards);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
<schemalist gettext-domain="gnome-shell-extensions">
|
||||
<enum id="org.gnome.shell.extensions.alternate-tab.BehaviourMode">
|
||||
<value value="1" nick="all_thumbnails"/>
|
||||
<value value="2" nick="workspace_icons"/>
|
||||
</enum>
|
||||
<schema id="org.gnome.shell.extensions.alternate-tab" path="/org/gnome/shell/extensions/alternate-tab/">
|
||||
<key name="behaviour" enum="org.gnome.shell.extensions.alternate-tab.BehaviourMode">
|
||||
<default>'all_thumbnails'</default>
|
||||
<_summary>The alt tab behaviour.</_summary>
|
||||
<_description>Sets the Alt-Tab behaviour. Possible values are: native, all_thumbnails and workspace_icons.</_description>
|
||||
</key>
|
||||
<key type="b" name="first-time">
|
||||
<default>true</default>
|
||||
<_summary>Indicates if Alternate Tab is newly installed</_summary>
|
||||
<_description>Ask the user for a default behaviour if true.</_description>
|
||||
</key>
|
||||
</schema>
|
||||
</schemalist>
|
||||
Reference in New Issue
Block a user