[pve-devel] [PATCH manager v17 2/2] ui: qemu: add clipboard ComboBox as a advanced option in DisplayEdit

Markus Frank m.frank at proxmox.com
Mon Apr 22 12:27:56 CEST 2024


For SPICE and VNC, a different message is displayed.

The backend code for the clipboard option can be found in the
'config: enable vnc clipboard parameter in vga_fmt'-commit in qemu-server.

Signed-off-by: Markus Frank <m.frank at proxmox.com>
---
v17:
* added "value: '__default__'" to clipboard ComboBox so that reset does
 not clear this field.
* "(SPICE)" has been removed from the default field, as it is likely to
 confuse the user. 

 www/manager6/qemu/DisplayEdit.js | 41 ++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/www/manager6/qemu/DisplayEdit.js b/www/manager6/qemu/DisplayEdit.js
index f2649c1c..7acc25d6 100644
--- a/www/manager6/qemu/DisplayEdit.js
+++ b/www/manager6/qemu/DisplayEdit.js
@@ -35,6 +35,9 @@ Ext.define('PVE.qemu.DisplayInputPanel', {
 		    return Proxmox.Utils.defaultText;
 		}
 	    },
+	    isVNC: get => get('clipboard') === 'vnc',
+	    hideDefaultHint: get => get('isVNC') || get('matchNonGUIOption'),
+	    hideVNCHint: get => !get('isVNC') || get('matchNonGUIOption'),
 	},
     },
 
@@ -71,6 +74,44 @@ Ext.define('PVE.qemu.DisplayInputPanel', {
 	    disabled: '{matchNonGUIOption}',
 	},
     }],
+
+    advancedItems: [
+	{
+	    xtype: 'proxmoxKVComboBox',
+	    name: 'clipboard',
+	    deleteEmpty: false,
+	    value: '__default__',
+	    fieldLabel: gettext('Clipboard'),
+	    comboItems: [
+		['__default__', Proxmox.Utils.defaultText],
+		['vnc', 'VNC'],
+	    ],
+	    bind: {
+		value: '{clipboard}',
+		disabled: '{matchNonGUIOption}',
+	    },
+	},
+	{
+	    xtype: 'displayfield',
+	    name: 'vncHint',
+	    userCls: 'pmx-hint',
+	    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.'),
+	    bind: {
+		hidden: '{hideVNCHint}',
+	    },
+	},
+	{
+	    xtype: 'displayfield',
+	    name: 'defaultHint',
+	    userCls: 'pmx-hint',
+	    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.'),
+	    bind: {
+		hidden: '{hideDefaultHint}',
+	    },
+	},
+    ],
 });
 
 Ext.define('PVE.qemu.DisplayEdit', {
-- 
2.39.2





More information about the pve-devel mailing list