Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updating to new payloads with schemas in the option blocks.

  • Loading branch information...
commit 0cf9681d3048ea76edfc01e78e0919dc2fbafb8e 1 parent b2834c6
@sgithens sgithens authored
View
55 node_modules/gsettingsBridge/gsettings_bridge.js
@@ -26,20 +26,25 @@ https://github.com/gpii/universal/LICENSE.txt
gpii.gsettings.get = function(settingsarray) {
var togo = fluid.copy(settingsarray);
- for (var i = 0; i < togo.length; i++) {
- var settings = togo[i];
- for (var schemaId in settings) {
- if (settings[schemaId] === null) {
- var keys = nodeGSettings.get_gsetting_keys(schemaId);
- settings[schemaId] = {};
- for (var k = 0; k < keys.length; k++) {
- var key = keys[k];
- settings[schemaId][key] = nodeGSettings.get_gsetting(schemaId,key);
+ for (var i = 0; i < togo.length; i++) {
+ var app = togo[i];
+ for (var appId in app) {
+ for (var j = 0; j < app[appId].length; j++) {
+ var schemaId = app[appId][j].options.schema;
+ var settings = app[appId][j].settings;
+ if (settings === null) {
+ var keys = nodeGSettings.get_gsetting_keys(schemaId);
+ app[appId][j].settings = {};
+ for (var k = 0; k < keys.length; k++) {
+ var key = keys[k];
+ app[appId][j].settings[key] = nodeGSettings.get_gsetting(schemaId,key);
+ }
}
- }
- else {
- for (var settingKey in settings[schemaId]) {
- settings[schemaId][settingKey] = nodeGSettings.get_gsetting(schemaId,settingKey);
+ else {
+ for (var settingKey in settings) {
+ settings[settingKey] = nodeGSettings.get_gsetting(schemaId,settingKey);
+ }
+
}
}
}
@@ -50,16 +55,20 @@ https://github.com/gpii/universal/LICENSE.txt
gpii.gsettings.set = function(settingsarray) {
var togo = fluid.copy(settingsarray);
for (var i = 0; i < togo.length; i++) {
- var settings = togo[i];
- for (var schemaId in settings) {
- for (var settingKey in settings[schemaId].settings) {
- var value = settings[schemaId].settings[settingKey];
- var oldValue = nodeGSettings.get_gsetting(schemaId,settingKey);
- nodeGSettings.set_gsetting(schemaId,settingKey,value);
- settings[schemaId].settings[settingKey] = {
- "oldValue": oldValue,
- "newValue": value
- };
+ var app = togo[i];
+ for (var appId in app) {
+ for (var j = 0; j < app[appId].length; j++) {
+ var schemaId = app[appId][j].options.schema;
+ var settings = app[appId][j].settings;
+ for (var settingKey in settings) {
+ var value = settings[settingKey];
+ var oldValue = nodeGSettings.get_gsetting(schemaId,settingKey);
+ nodeGSettings.set_gsetting(schemaId,settingKey,value);
+ settings[settingKey] = {
+ "oldValue": oldValue,
+ "newValue": value
+ };
+ }
}
}
}
View
21 node_modules/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example-GET.json
@@ -0,0 +1,21 @@
+[
+ {
+ "com.gnome.builtin.magnification": [
+ {
+ "settings": {
+ "cross-hairs-clip": false,
+ "cross-hairs-color": "#ff0020"
+ },
+ "options": {
+ "schema": "org.gnome.desktop.a11y.magnifier"
+ }
+ },
+ {
+ "settings": null,
+ "options": {
+ "schema": "org.gnome.desktop.a11y.mouse"
+ }
+ }
+ ]
+ }
+]
View
23 node_modules/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example.json
@@ -0,0 +1,23 @@
+[
+ {
+ "com.gnome.builtin.magnification": [
+ {
+ "settings": {
+ "cross-hairs-clip": true,
+ "cross-hairs-color": "#ff0020"
+ },
+ "options": {
+ "schema": "org.gnome.desktop.a11y.magnifier"
+ }
+ },
+ {
+ "settings": {
+ "dwell-threshold": 11
+ },
+ "options": {
+ "schema": "org.gnome.desktop.a11y.mouse"
+ }
+ }
+ ]
+ }
+]
Please sign in to comment.
Something went wrong with that request. Please try again.