public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Markus Frank <m.frank@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager v16 2/2] ui: qemu: add clipboard ComboBox as a advanced option in DisplayEdit
Date: Mon,  8 Apr 2024 12:33:05 +0200	[thread overview]
Message-ID: <20240408103305.780097-2-m.frank@proxmox.com> (raw)
In-Reply-To: <20240408103305.780097-1-m.frank@proxmox.com>

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@proxmox.com>
---
 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 17b02ee4..3357794a 100644
--- a/www/manager6/qemu/DisplayEdit.js
+++ b/www/manager6/qemu/DisplayEdit.js
@@ -15,6 +15,7 @@ Ext.define('PVE.qemu.DisplayInputPanel', {
 	data: {
 	    type: '__default__',
 	    nonGUIOptionRegex: /^(serial\d|none)$/,
+	    clipboard: '__default__',
 	},
 	formulas: {
 	    matchNonGUIOption: function(get) {
@@ -35,6 +36,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'),
 	},
     },
 
@@ -70,6 +74,43 @@ Ext.define('PVE.qemu.DisplayInputPanel', {
 	    disabled: '{matchNonGUIOption}',
 	},
     }],
+
+    advancedItems: [
+	{
+	    xtype: 'proxmoxKVComboBox',
+	    name: 'clipboard',
+	    deleteEmpty: false,
+	    fieldLabel: gettext('Clipboard'),
+	    comboItems: [
+		['__default__', Proxmox.Utils.defaultText + ' (SPICE)'],
+		['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





  reply	other threads:[~2024-04-08 10:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-08 10:33 [pve-devel] [PATCH manager v16 1/2] ui: qemu: change DisplayEdit logic to use ViewModel instead of listener function Markus Frank
2024-04-08 10:33 ` Markus Frank [this message]
2024-04-22  9:36   ` [pve-devel] [PATCH manager v16 2/2] ui: qemu: add clipboard ComboBox as a advanced option in DisplayEdit Dominik Csapak
2024-04-22  9:33 ` [pve-devel] [PATCH manager v16 1/2] ui: qemu: change DisplayEdit logic to use ViewModel instead of listener function Dominik Csapak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240408103305.780097-2-m.frank@proxmox.com \
    --to=m.frank@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal