From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 396D1980F4 for ; Fri, 21 Apr 2023 12:00:51 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 1AAAB19CE1 for ; Fri, 21 Apr 2023 12:00:21 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Fri, 21 Apr 2023 12:00:20 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 2FEEA40B11 for ; Fri, 21 Apr 2023 12:00:20 +0200 (CEST) From: Markus Frank To: pve-devel@lists.proxmox.com Date: Fri, 21 Apr 2023 12:00:08 +0200 Message-Id: <20230421100009.98063-5-m.frank@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230421100009.98063-1-m.frank@proxmox.com> References: <20230421100009.98063-1-m.frank@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.057 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pve-devel] [PATCH manager v7 4/5] added clipboard checkbox to VM Options X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Apr 2023 10:00:51 -0000 Signed-off-by: Markus Frank --- 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