From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 09E2E1FF56B for ; Mon, 22 Apr 2024 11:37:21 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id B6F63DBE1; Mon, 22 Apr 2024 11:37:23 +0200 (CEST) Message-ID: <701654f9-5083-4d5b-891b-21202af943a4@proxmox.com> Date: Mon, 22 Apr 2024 11:36:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta To: Proxmox VE development discussion , Markus Frank References: <20240408103305.780097-1-m.frank@proxmox.com> <20240408103305.780097-2-m.frank@proxmox.com> Content-Language: en-US From: Dominik Csapak In-Reply-To: <20240408103305.780097-2-m.frank@proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL 0.015 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 Subject: Re: [pve-devel] [PATCH manager v16 2/2] ui: qemu: add clipboard ComboBox as a advanced option in DisplayEdit 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: , Reply-To: Proxmox VE development discussion Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" a few comments inline On 4/8/24 12:33, Markus Frank wrote: > 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 > --- > 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)'], this '(SPICE)' here implies that the spice clipboard is available anywhere but the hint below implies it's only available with SPICE i'd probably omit it here and just say default and further explain it in the hint. > + ['vnc', 'VNC'], > + ], > + bind: { > + value: '{clipboard}', > + disabled: '{matchNonGUIOption}', > + }, here you have to set the value initially to '__default__' too, otherwise the bind set will mark it as dirty and allow a reset to the empty value i.e. use ----8<---- value: '__default__', ---->8---- > + }, > + { > + 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', { _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel