[pve-devel] [PATCH manager 10/10] Propagate the SCSI hw to the Hard Disk panel when selecting an OS

Emmanuel Kasper e.kasper at proxmox.com
Wed Sep 6 10:15:40 CEST 2017


---
 www/manager6/qemu/OSTypeEdit.js | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/www/manager6/qemu/OSTypeEdit.js b/www/manager6/qemu/OSTypeEdit.js
index 162a92ec..a779ab91 100644
--- a/www/manager6/qemu/OSTypeEdit.js
+++ b/www/manager6/qemu/OSTypeEdit.js
@@ -22,18 +22,21 @@ Ext.define('PVE.qemu.OSTypeInputPanel', {
 			    targetValues = PVE.qemu.OSDefaults.generic;
 			}
 
-			me.setWidget('pveBusSelector', targetValues.busType);
-			me.setWidget('pveNetworkCardSelector', targetValues.networkCard);
+			me.queryWidget('pveBusSelector')
+			    .buildDefaultStore(targetValues.scsihw)
+			    .setValue(targetValues.busType);
+
+			me.queryWidget('pveNetworkCardSelector').setValue(targetValues.networkCard);
 			me.setWizardHiddenValue('qemuScsiController', targetValues.scsihw);
 		    }
 	    }
 	},
-	setWidget: function(widget, newValue) {
+	queryWidget: function(widget) {
 	    // changing a widget is safe only if ComponentQuery.query returns us
 	    // a single value array
 	    var widgets = Ext.ComponentQuery.query('pveQemuCreateWizard ' + widget);
 	    if (widgets.length === 1) {
-		widgets[0].setValue(newValue);
+		return widgets[0];
 	    } else {
 		throw 'non unique widget :' + widget + ' in Wizard';
 	    }
-- 
2.11.0





More information about the pve-devel mailing list