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 v7 4/5] added clipboard checkbox to VM Options
Date: Fri, 21 Apr 2023 12:00:08 +0200	[thread overview]
Message-ID: <20230421100009.98063-5-m.frank@proxmox.com> (raw)
In-Reply-To: <20230421100009.98063-1-m.frank@proxmox.com>

Signed-off-by: Markus Frank <m.frank@proxmox.com>
---
 www/manager6/qemu/DisplayEdit.js |  8 +++++++
 www/manager6/qemu/Options.js     | 37 ++++++++++++++++++++++++++++++++
 2 files changed, 45 insertions(+)

diff --git a/www/manager6/qemu/DisplayEdit.js b/www/manager6/qemu/DisplayEdit.js
index 9bb1763e..ca5baa25 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.vnc_clipboard !== 'undefined') {
+	    values.vnc_clipboard = this.originalConfig.vnc_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..c2943e3c 100644
--- a/www/manager6/qemu/Options.js
+++ b/www/manager6/qemu/Options.js
@@ -154,6 +154,43 @@ Ext.define('PVE.qemu.Options', {
 		    },
 		} : undefined,
 	    },
+	    vga: {
+		header: gettext('Use VNC clipboard'),
+		defaultValue: false,
+		renderer: function(value) {
+		    let vga = PVE.Parser.parsePropertyString(value, 'type');
+		    return vga.vnc_clipboard ? Proxmox.Utils.yesText : Proxmox.Utils.noText;
+		},
+		editor: caps.vms['VM.Config.HWType'] ? {
+		    xtype: 'proxmoxWindowEdit',
+		    subject: gettext('Use VNC clipboard'),
+		    onlineHelp: 'qm_display',
+		    items: {
+			xtype: 'pveDisplayInputPanel',
+			items: {
+			    xtype: 'proxmoxcheckbox',
+			    name: 'vnc_clipboard',
+			    uncheckedValue: 0,
+			    defaultValue: 0,
+			    itemId: 'clipboardBox',
+			    fieldLabel: gettext('Enabled'),
+			},
+			onGetValues: function(values) {
+			    values = Ext.apply(this.originalConfig, values);
+			    PVE.Utils.delete_if_default(values, 'vnc_clipboard', 0, 1);
+			    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',
-- 
2.30.2





  parent reply	other threads:[~2023-04-21 10:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-21 10:00 [pve-devel] [PATCH qemu-server/manager/novnc/docs v7 0/5] Feature noVNC-Clipboard Markus Frank
2023-04-21 10:00 ` [pve-devel] [PATCH qemu-server v7 1/5] enable clipboard parameter in vga_fmt Markus Frank
2023-05-03  7:10   ` Dominik Csapak
2023-04-21 10:00 ` [pve-devel] [PATCH qemu-server v7 2/5] test cases for clipboard spice & std Markus Frank
2023-04-21 10:00 ` [pve-devel] [PATCH novnc v7 3/5] added show clipboard button patch to series Markus Frank
2023-04-21 10:00 ` Markus Frank [this message]
2023-04-21 10:00 ` [pve-devel] [PATCH docs v7 5/5] added noVNC clipboard documentation Markus Frank
2023-04-24 16:24 ` [pve-devel] [PATCH qemu-server/manager/novnc/docs v7 0/5] Feature noVNC-Clipboard Friedrich Weber

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=20230421100009.98063-5-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