From: Darren Date: Mon, 5 Nov 2012 20:05:32 +0000 (+0000) Subject: Client: CLI access to get/set/save settings X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=600bc234d6e27bf4047cc8080ef32fde68069364;p=KiwiIRC.git Client: CLI access to get/set/save settings --- diff --git a/client/assets/dev/model_application.js b/client/assets/dev/model_application.js index 6d90b70..338e574 100644 --- a/client/assets/dev/model_application.js +++ b/client/assets/dev/model_application.js @@ -757,6 +757,32 @@ _kiwi.model.Application = function () { $script(ev.params[0] + '?' + (new Date().getTime())); }); + + controlbox.on('command_set', function (ev) { + if (!ev.params[0]) return; + + var setting = ev.params[0], + value; + + // Do we have a second param to set a value? + if (ev.params[1]) { + ev.params.shift(); + + value = ev.params.join(' '); + _kiwi.global.settings.set(setting, value); + } + + // Read the value to the user + _kiwi.app.panels.active.addMsg('', setting + ' = ' + _kiwi.global.settings.get(setting)); + }); + + + controlbox.on('command_save', function (ev) { + _kiwi.global.settings.save(); + _kiwi.app.panels.active.addMsg('', 'Settings have been saved'); + }); + + controlbox.on('command_alias', function (ev) { var name, rule;