let type = value === 'q35' ? 'q35' : 'i440fx';
store.clearFilter();
store.addFilter(val => (val.data.id === 'latest' || val.data.type === type));
- version.setValue('latest');
+ if (!me.getView().isWindows) {
+ version.setValue('latest');
+ } else {
+ store.isWindows = true;
+ }
},
},
setValues: function(values) {
let me = this;
+ me.isWindows = values.isWindows;
+
if (values.machine !== '__default__' && values.machine !== 'q35') {
values.version = values.machine;
values.machine = values.version.match(/q35/) ? 'q35' : '__default__';
},
listeners: {
load: function(records) {
- this.insert(0, { id: 'latest', type: 'any', version: 'latest' });
+ if (!this.isWindows) {
+ this.insert(0, { id: 'latest', type: 'any', version: 'latest' });
+ }
},
},
},
me.load({
success: function(response) {
- let vmconfig = response.result.data;
- let machine = vmconfig.machine || '__default__';
- me.setValues({ machine: machine });
+ let conf = response.result.data;
+ let values = {
+ machine: conf.machine || '__default__',
+ };
+ if (conf.ostype && conf.ostype.match(/^(win|wvista|wxp|w2k)/i)) {
+ values.isWindows = true;
+ }
+ me.setValues(values);
},
});
},