ui settings: fix noVNC scaling mode radiogroup setValue

radio groups set and get Value helper are objects, as they are
expected to be key, value, where key is a field-name of the radio
group and values is the inputValue from the radiobutton to be set.

So ensure we extract only the value in the change event handler, as
we do not want to save the whole object. But on restoring (setValue)
we need to wrap it as object again, else radiogroup won't know what
field we want to set..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2019-10-21 15:20:11 +02:00
parent 94666c47dd
commit f5c68a74c7

View File

@ -39,7 +39,7 @@ Ext.define('PVE.window.Settings', {
me.lookupReference('savedUserName').setValue(username);
var vncMode = sp.get('novnc-scaling');
if (vncMode !== undefined) {
me.lookupReference('noVNCScalingGroup').setValue(vncMode);
me.lookupReference('noVNCScalingGroup').setValue({ noVNCScalingField: vncMode });
}
var settings = ['fontSize', 'fontFamily', 'letterSpacing', 'lineHeight'];
@ -377,7 +377,7 @@ Ext.define('PVE.window.Settings', {
listeners: {
change: function(el, newValue, undefined) {
var sp = Ext.state.Manager.getProvider();
sp.set('novnc-scaling', newValue);
sp.set('novnc-scaling', newValue.noVNCScalingField);
}
},
},