summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2019-07-01 11:21:26 +0200
committerSimon Rettberg2019-07-01 11:21:26 +0200
commit220d85cf336118063fd52ea9575f605b56f6a282 (patch)
treeac5047e2438b2ceedb0e088a7c89f92f91d7f630
parentAdd TODOs for refactoring (diff)
downloadtutor-module-220d85cf336118063fd52ea9575f605b56f6a282.tar.gz
tutor-module-220d85cf336118063fd52ea9575f605b56f6a282.tar.xz
tutor-module-220d85cf336118063fd52ea9575f605b56f6a282.zip
Implement CONFIG_USB feature
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/VirtDropDownConfigEditorWindow.java20
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/VirtDropDownConfigEditorWindowLayout.java10
-rw-r--r--dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/SupportedFeatures.java1
3 files changed, 20 insertions, 11 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 3edb0642..072d648e 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
@@ -13,8 +13,10 @@ import org.openslx.dozmod.gui.helper.MessageType;
import org.openslx.dozmod.gui.helper.UiFeedback;
import org.openslx.dozmod.gui.window.layout.VirtDropDownConfigEditorWindowLayout;
import org.openslx.dozmod.thrift.ImageDetailsActions;
+import org.openslx.dozmod.thrift.Session;
import org.openslx.dozmod.thrift.ImageDetailsActions.VirtConfCallback;
import org.openslx.dozmod.thrift.cache.MetaDataCache;
+import org.openslx.sat.thrift.version.Feature;
import org.openslx.util.ThriftUtil;
import org.openslx.util.XmlHelper;
import org.openslx.util.vm.VboxMetaData;
@@ -115,14 +117,16 @@ public class VirtDropDownConfigEditorWindow extends VirtDropDownConfigEditorWind
}
});
- cboMaxUsbSpeed.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- UsbSpeed selected = (UsbSpeed) cboMaxUsbSpeed.getSelectedItem();
- meta.setMaxUsbSpeed(selected);
- btnSave.setEnabled(hasChanged());
- }
- });
+ if (Session.hasFeature(Feature.CONFIGURE_USB)) {
+ 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() {
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/VirtDropDownConfigEditorWindowLayout.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/VirtDropDownConfigEditorWindowLayout.java
index ba707bf4..6e8cc749 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/VirtDropDownConfigEditorWindowLayout.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/VirtDropDownConfigEditorWindowLayout.java
@@ -22,6 +22,8 @@ import org.openslx.dozmod.gui.control.ComboBox;
import org.openslx.dozmod.gui.control.ComboBox.ComboBoxRenderer;
import org.openslx.dozmod.gui.control.WordWrapLabel;
import org.openslx.dozmod.gui.helper.GridManager;
+import org.openslx.dozmod.thrift.Session;
+import org.openslx.sat.thrift.version.Feature;
import org.openslx.util.vm.VmMetaData.DDAcceleration;
import org.openslx.util.vm.VmMetaData.EthernetDevType;
import org.openslx.util.vm.VmMetaData.HWVersion;
@@ -123,9 +125,11 @@ public class VirtDropDownConfigEditorWindowLayout extends JDialog {
grid.add(new JLabel("Netzwerkkarte")).fill(true, false).expand(false, false);
grid.add(cboE0VirtDev).fill(true, false).expand(true, false);
grid.nextRow();
- grid.add(new JLabel("USB")).fill(true, false).expand(false, false);
- grid.add(cboMaxUsbSpeed).fill(true, false).expand(true, false);
- grid.nextRow();
+ if (Session.hasFeature(Feature.CONFIGURE_USB)) {
+ grid.add(new JLabel("USB")).fill(true, false).expand(false, false);
+ grid.add(cboMaxUsbSpeed).fill(true, false).expand(true, false);
+ grid.nextRow();
+ }
grid.add(Box.createVerticalGlue(), 2).expand(true, true);
grid.nextRow();
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/SupportedFeatures.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/SupportedFeatures.java
index 5f21c22f..c59ddd47 100644
--- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/SupportedFeatures.java
+++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/SupportedFeatures.java
@@ -12,6 +12,7 @@ public class SupportedFeatures {
registerFeature(Feature.MULTIPLE_HYPERVISORS);
registerFeature(Feature.SERVER_SIDE_COPY);
registerFeature(Feature.LECTURE_FILTER_LDAP);
+ registerFeature(Feature.CONFIGURE_USB);
}
public static String getFeatureString() {