From: Dominik Csapak <d.csapak@proxmox.com>
To: Jakob Klocker <j.klocker@proxmox.com>, pve-devel@lists.proxmox.com
Subject: Re: [PATCH manager v2] fix #7896: ui: qemu: show effective machine version for Windows guests
Date: Mon, 31 Aug 2026 10:03:55 +0200 [thread overview]
Message-ID: <da240c9d-701f-45f5-96f6-88ee6a967726@proxmox.com> (raw)
In-Reply-To: <DL2XX88O92GD.12UZ8WKZO4RT3@proxmox.com>
On 8/31/26 9:11 AM, Jakob Klocker wrote:
> On Wed Aug 26, 2026 at 10:36 AM CEST, Dominik Csapak wrote:
>> one comment inline
>>
>> On 8/24/26 3:01 PM, Jakob Klocker wrote:
>> [snip]
>>> q35: (get) => get('type') === 'q35',
>>> @@ -102,10 +104,21 @@ Ext.define('PVE.qemu.MachineInputPanel', {
>>> }
>>>
>>> if (me.isWindows) {
>>> - if (values.machine === '__default__') {
>>> - values.version = 'pc-i440fx-5.1';
>>> - } else if (values.machine === 'q35') {
>>> - values.version = 'pc-q35-5.1';
>>> + if (values.machine === '__default__' || values.machine === 'q35') {
>>> + let effective = PVE.Utils.qemu_implicit_machine_version(
>>> + values.machine,
>>> + values.creationQemu,
>>> + values.arch,
>>> + );
>>> + me.getViewModel().set({
>>> + effectiveVersionLabel: effective + ' ' + gettext('(implicit)'),
>>> + implicitVersion: true,
>>> + });
>>> + me.setAdvancedVisible(true);
>>
>>
>>> + // flush the binding, then re-baseline the reset value to it
>>> + // otherwise the Reset button reverts to the field's empty initial value
>>> + me.getViewModel().notify();
>>> + me.lookup('effectiveVersion').resetOriginalValue();
>>
>> under which circumstances is this necessary?
>>
>> even with those two statements deleted, i can't trigger it to have
>> the reset button enabled?
>>
>> in general, we probably shouldn't mess with the 'resetOriginalValue' too
>> much, but if we do, having the steps where this is necessary
>> would be good (does not have to be a comment, in the commit message is
>> fine for me)
> Than for taking a look at the patch.
>
> I'm not quite sure what you mean with 'reset button enabled'. The reset
> button enables just like in other UI forms; in the Machine case that's
> when you select a different value in the dropdowns (e.g. change
> `Machine`, `Version` or `vIOMMU`). I'm talking about the
> `Reset from Data` button on the top right.
>
> The `resetOriginalValue` is necessary because the
> `effectiveVersionLabel` value is empty on page load, and only gets set
> when `setValues` is called. Since `setValues` is not called on a reset,
> this would display an empty current version on a reset. Therefore I
> replace the field's empty initial value with the actual current version
> on page load, so a reset reverts to the correct value instead of an
> empty one.
>
> I thought adding the comment above the code, saying that on reset the
> value is empty made this clear -- if not, I can mention why exactly I
> used this in the commit message as well.
ok i misunderstood what you meant from the comment, i get it now and
could reproduce the misbehavior with the lines deleted.
(i simply looked for a different thing)
there is a much easier method instead of manipulating the value itself
and notifying the viewmodel:
since both the effectiveVersion field and the hint are only modified
once, we don't need to use the viewmodel here at all?
just have the field value set via the normal 'value' object
but set 'submitValue: false' so it does not get submitted on
clicking ok. (the setValue parent handler then calls resetOriginal value
anyway)
same for the hint, we can show/hide it in the setValue method, but
don't have to use the viewmodel for it.
In general the viewmodel is only really helpful if we change their
values dynamically while the user has the editor open
which isn't the case for the 'setValue' method (this is only
called once on opening)
next prev parent reply other threads:[~2026-08-31 8:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-24 13:01 [PATCH manager v2] fix #7896: ui: qemu: show effective machine version for Windows guests Jakob Klocker
2026-08-26 8:36 ` Dominik Csapak
2026-08-31 7:11 ` Jakob Klocker
2026-08-31 8:03 ` Dominik Csapak [this message]
2026-08-31 8:42 ` Jakob Klocker
2026-08-31 9:48 ` superseded: " Jakob Klocker
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=da240c9d-701f-45f5-96f6-88ee6a967726@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=j.klocker@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