diff options
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/VirtDropDownConfigEditorWindow.java')
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/VirtDropDownConfigEditorWindow.java | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/VirtDropDownConfigEditorWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/VirtDropDownConfigEditorWindow.java index 6dba2a08..3edb0642 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/VirtDropDownConfigEditorWindow.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/VirtDropDownConfigEditorWindow.java @@ -23,6 +23,7 @@ import org.openslx.util.vm.VmMetaData.DDAcceleration; import org.openslx.util.vm.VmMetaData.EthernetDevType; import org.openslx.util.vm.VmMetaData.HWVersion; import org.openslx.util.vm.VmMetaData.SoundCardType; +import org.openslx.util.vm.VmMetaData.UsbSpeed; @SuppressWarnings("serial") public class VirtDropDownConfigEditorWindow extends VirtDropDownConfigEditorWindowLayout @@ -37,7 +38,7 @@ public class VirtDropDownConfigEditorWindow extends VirtDropDownConfigEditorWind private final String imageVersionId; private final String originalMachineDescription; private final VirtDropDownConfigEditorWindow me = this; - private final VmMetaData<?, ?, ?, ?> meta; + private final VmMetaData<?, ?, ?, ?, ?> meta; private final ImageDetailsActions actionHandler; protected VirtDropDownConfigEditorWindow(Window modalParent, final ImageDetailsActions actionHandler, @@ -48,7 +49,7 @@ public class VirtDropDownConfigEditorWindow extends VirtDropDownConfigEditorWind this.imageVersionId = imageVersionId; // and now for the meta data - VmMetaData<?, ?, ?, ?> metaCandidate = null; + VmMetaData<?, ?, ?, ?, ?> metaCandidate = null; byte[] machineData = ThriftUtil.unwrapByteBuffer(machineDescription); try { metaCandidate = VmMetaData.getInstance(MetaDataCache.getOperatingSystems(), machineData, @@ -69,6 +70,7 @@ public class VirtDropDownConfigEditorWindow extends VirtDropDownConfigEditorWind initializeDDABox(meta.getSupportedDDAccs()); initializeHWVersBox(meta.getSupportedHWVersions()); initializeEDTBox(meta.getSupportedEthernetDevices()); + initializeUsbBox(meta.getSupportedUsbSpeeds()); //set the initial state of the buttons initializeComboBoxes(meta); @@ -112,6 +114,15 @@ public class VirtDropDownConfigEditorWindow extends VirtDropDownConfigEditorWind btnSave.setEnabled(hasChanged()); } }); + + cboMaxUsbSpeed.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + UsbSpeed selected = (UsbSpeed) cboMaxUsbSpeed.getSelectedItem(); + meta.setMaxUsbSpeed(selected); + btnSave.setEnabled(hasChanged()); + } + }); // listener for the save button btnSave.addActionListener(new ActionListener() { @@ -158,7 +169,7 @@ public class VirtDropDownConfigEditorWindow extends VirtDropDownConfigEditorWind /* setting the boxes to their initial value...value is read from the given metaData * @param: given VmwareMetaData */ - private void initializeComboBoxes(VmMetaData<?, ?, ?, ?> m) { + private void initializeComboBoxes(VmMetaData<?, ?, ?, ?, ?> m) { try { SoundCardType SCT = m.getSoundCard(); cboSound.setSelectedItem(SCT); @@ -168,6 +179,8 @@ public class VirtDropDownConfigEditorWindow extends VirtDropDownConfigEditorWind cboHWVersion.setSelectedItem(HWV); EthernetDevType E0VD = m.getEthernetDevType(0); cboE0VirtDev.setSelectedItem(E0VD); + UsbSpeed usbSpeed = m.getMaxUsbSpeed(); + cboMaxUsbSpeed.setSelectedItem(usbSpeed); } catch (IllegalArgumentException e) { // TODO improve user message Gui.showMessageBox("Sie haben beim letzten Konfigurieren \n" |