diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/openslx/util/vm/VmMetaData.java | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/src/main/java/org/openslx/util/vm/VmMetaData.java b/src/main/java/org/openslx/util/vm/VmMetaData.java index 1130f9b..36ecd4c 100644 --- a/src/main/java/org/openslx/util/vm/VmMetaData.java +++ b/src/main/java/org/openslx/util/vm/VmMetaData.java @@ -80,7 +80,7 @@ public abstract class VmMetaData<T, U, V, W> this.displayName = dName; } } - + // Virtual network adapter public static enum EthernetDevType { @@ -137,21 +137,34 @@ public abstract class VmMetaData<T, U, V, W> */ public List<SoundCardType> getSupportedSoundCards() { - return new ArrayList<SoundCardType>( soundCards.keySet() ); + ArrayList<SoundCardType> availables = new ArrayList<SoundCardType>( soundCards.keySet() ); + // availables must be sorted else the user always gets another order of the dropdown list at startup + Collections.sort( availables ); + return availables; } public List<DDAcceleration> getSupportedDDAccs() { - return new ArrayList<DDAcceleration>( ddacc.keySet() ); + ArrayList<DDAcceleration> availables = new ArrayList<DDAcceleration>( ddacc.keySet() ); + // availables must be sorted else the user always gets another order of the dropdown list at startup + Collections.sort( availables ); + return availables; } public List<HWVersion> getSupportedHWVersions() { - return new ArrayList<HWVersion>( hwversion.keySet() ); + ArrayList<HWVersion> availables = new ArrayList<HWVersion>( hwversion.keySet() ); + // availables must be sorted else the user always gets another order of the dropdown list at startup + Collections.sort( availables ); + return availables; } - - public List<EthernetDevType> getSupportedEthernetDevices() { - return new ArrayList<EthernetDevType>( networkCards.keySet() ); + + public List<EthernetDevType> getSupportedEthernetDevices() + { + ArrayList<EthernetDevType> availables = new ArrayList<EthernetDevType>( networkCards.keySet() ); + // availables must be sorted else the user always gets another order of the dropdown list at startup + Collections.sort( availables ); + return availables; } /** @@ -299,7 +312,6 @@ public abstract class VmMetaData<T, U, V, W> public abstract SoundCardType getSoundCard(); - public abstract void setDDAcceleration( DDAcceleration type ); public abstract DDAcceleration getDDAcceleration(); @@ -307,6 +319,7 @@ public abstract class VmMetaData<T, U, V, W> public abstract void setHWVersion( HWVersion type ); public abstract HWVersion getHWVersion(); + // TODO export to VmMetaData like SoundCardType public abstract void setEthernetDevType( int cardIndex, EthernetDevType type ); |