one minor nit inline, but not a blocker for me
did not test again, but the changes are small enough imho
aside from that, this patch (and the series since i already
reviewed the previous versions and there did not change anything)
Reviewed-by: Dominik Csapak <d.csa...@proxmox.com>
On 11/14/23 10:22, Markus Frank wrote:
Signed-off-by: Markus Frank <m.fr...@proxmox.com>
---
www/manager6/qemu/DisplayEdit.js | 8 ++++
www/manager6/qemu/Options.js | 82 ++++++++++++++++++++++++++++++++
2 files changed, 90 insertions(+)
diff --git a/www/manager6/qemu/DisplayEdit.js b/www/manager6/qemu/DisplayEdit.js
index 9bb1763e..d7cd51a9 100644
--- a/www/manager6/qemu/DisplayEdit.js
+++ b/www/manager6/qemu/DisplayEdit.js
@@ -4,6 +4,9 @@ Ext.define('PVE.qemu.DisplayInputPanel', {
onlineHelp: 'qm_display',
onGetValues: function(values) {
+ if (typeof this.originalConfig.clipboard !== 'undefined') {
+ values.clipboard = this.originalConfig.clipboard;
+ }
let ret = PVE.Parser.printPropertyString(values, 'type');
if (ret === '') {
return { 'delete': 'vga' };
@@ -11,6 +14,11 @@ Ext.define('PVE.qemu.DisplayInputPanel', {
return { vga: ret };
},
+ onSetValues: function(values) {
+ this.originalConfig = values;
+ return values;
+ },
+
items: [{
name: 'type',
xtype: 'proxmoxKVComboBox',
diff --git a/www/manager6/qemu/Options.js b/www/manager6/qemu/Options.js
index 7b112400..fd76feb8 100644
--- a/www/manager6/qemu/Options.js
+++ b/www/manager6/qemu/Options.js
@@ -154,6 +154,88 @@ Ext.define('PVE.qemu.Options', {
},
} : undefined,
},
+ vga: {
+ header: gettext('Clipboard'),
+ defaultValue: false,
+ renderer: function(value) {
+ let vga = PVE.Parser.parsePropertyString(value, 'type');
+ if (vga.clipboard) {
+ return vga.clipboard.toUpperCase();
+ } else {
+ return Proxmox.Utils.defaultText + ' (SPICE)';
+ }
+ },
+ editor: caps.vms['VM.Config.HWType'] ? {
+ xtype: 'proxmoxWindowEdit',
+ subject: gettext('Clipboard'),
+ onlineHelp: 'qm_display',
+ items: {
+ xtype: 'pveDisplayInputPanel',
+ referenceHolder: true,
+ items: [
+ {
+ xtype: 'proxmoxKVComboBox',
+ name: 'clipboard',
+ reference: 'clipboard',
+ itemId: 'clipboardBox',
+ fieldLabel: gettext('Clipboard'),
+ deleteDefaultValue: true,
+ listeners: {
+ change: function(field, value) {
+ let inputpanel = field.up("inputpanel");
+ let isVnc = value === 'vnc';
+
inputpanel.lookup('vncHint').setVisible(isVnc);
+
inputpanel.lookup('defaultHint').setVisible(!isVnc);
+ },
+ },
+ value: '__default__',
+ comboItems: [
+ ['__default__', Proxmox.Utils.defaultText +
' (SPICE)'],
+ ['vnc', 'VNC'],
+ ],
+ },
+ {
+ itemId: 'vncHint',
+ name: 'vncHint',
+ reference: 'vncHint',
+ xtype: 'displayfield',
+ userCls: 'pmx-hint',
+ hidden: true,
+ value: gettext('You cannot use the default
SPICE clipboard if the VNC Clipboard is selected.')
+ + ' ' + gettext('VNC Clipboard requires
spice-tools installed in the Guest-VM.'),
+ },
this
+
+ {
+ itemId: 'defaultHint',
+ name: 'defaultHint',
+ reference: 'defaultHint',
+ xtype: 'displayfield',
+ userCls: 'pmx-hint',
+ hidden: false,
+ value: gettext('This option depends on your
display type.') + ' ' +
+ gettext('If the display type uses SPICE you
are able to use the default SPICE Clipboard.'),
+ },
and this should have the same style of line break (iow. + ' ' + ath the end of
the first line
or at the beginning of the second one, but noth both ;)
+
+ ],
+ onGetValues: function(values) {
+ values = Ext.apply(this.originalConfig, values);
+ if (values.delete === "clipboard") {
+ delete values.clipboard;
+ delete values.delete;
+ }
+ let ret = PVE.Parser.printPropertyString(values,
'type');
+ if (ret === "") {
+ return { 'delete': "vga" };
+ }
+ return { vga: ret };
+ },
+ onSetValues: function(values) {
+ this.originalConfig =
PVE.Parser.parsePropertyString(values.vga, 'type');
+ return this.originalConfig;
+ },
+ },
+ } : undefined,
+ },
hotplug: {
header: gettext('Hotplug'),
defaultValue: 'disk,network,usb',
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel