summaryrefslogtreecommitdiffstats
path: root/deluge/ui/web/js/deluge-all/preferences/InterfacePage.js
diff options
context:
space:
mode:
Diffstat (limited to 'deluge/ui/web/js/deluge-all/preferences/InterfacePage.js')
-rw-r--r--deluge/ui/web/js/deluge-all/preferences/InterfacePage.js54
1 files changed, 54 insertions, 0 deletions
diff --git a/deluge/ui/web/js/deluge-all/preferences/InterfacePage.js b/deluge/ui/web/js/deluge-all/preferences/InterfacePage.js
index 1b710f2..a5a7909 100644
--- a/deluge/ui/web/js/deluge-all/preferences/InterfacePage.js
+++ b/deluge/ui/web/js/deluge-all/preferences/InterfacePage.js
@@ -88,6 +88,33 @@ Deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, {
})
);
+ var themePanel = this.add({
+ xtype: 'fieldset',
+ border: false,
+ title: _('Theme'),
+ style: 'margin-bottom: 0px; padding-bottom: 5px; padding-top: 5px',
+ autoHeight: true,
+ labelWidth: 1,
+ defaultType: 'checkbox',
+ });
+ this.theme = om.bind(
+ 'theme',
+ themePanel.add({
+ xtype: 'combo',
+ name: 'theme',
+ labelSeparator: '',
+ mode: 'local',
+ width: 200,
+ store: new Ext.data.ArrayStore({
+ fields: ['id', 'text'],
+ }),
+ editable: false,
+ triggerAction: 'all',
+ valueField: 'id',
+ displayField: 'text',
+ })
+ );
+
fieldset = this.add({
xtype: 'fieldset',
border: false,
@@ -217,6 +244,24 @@ Deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, {
icon: Ext.MessageBox.QUESTION,
});
}
+ if ('theme' in changed) {
+ deluge.client.web.set_theme(changed['theme']);
+ Ext.Msg.show({
+ title: _('WebUI Theme Changed'),
+ msg: _(
+ 'Do you want to refresh the page now to use the new theme?'
+ ),
+ buttons: {
+ yes: _('Refresh'),
+ no: _('Close'),
+ },
+ multiline: false,
+ fn: function (btnText) {
+ if (btnText === 'yes') location.reload();
+ },
+ icon: Ext.MessageBox.QUESTION,
+ });
+ }
}
if (this.oldPassword.getValue() || this.newPassword.getValue()) {
this.onPasswordChange();
@@ -237,6 +282,11 @@ Deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, {
this.language.setValue(this.optionsManager.get('language'));
},
+ onGotThemes: function (info, obj, response, request) {
+ this.theme.store.loadData(info);
+ this.theme.setValue(this.optionsManager.get('theme'));
+ },
+
onPasswordChange: function () {
var newPassword = this.newPassword.getValue();
if (newPassword != this.confirmPassword.getValue()) {
@@ -295,6 +345,10 @@ Deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, {
success: this.onGotLanguages,
scope: this,
});
+ deluge.client.webutils.get_themes({
+ success: this.onGotThemes,
+ scope: this,
+ });
},
onSSLCheck: function (e, checked) {