blob: 5b5e066fbc39f740545b42ba37f733cc6ac06411 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
package org.openslx.dozmod.gui.wizard.page;
import java.util.List;
import org.openslx.bwlp.thrift.iface.NetRule;
import org.openslx.dozmod.gui.helper.I18n;
import org.openslx.dozmod.gui.wizard.Wizard;
import org.openslx.dozmod.gui.wizard.layout.LectureOptionsPageLayout;
import org.openslx.dozmod.state.LectureWizardState;
import org.openslx.dozmod.thrift.Session;
public class LectureOptionsPage extends LectureOptionsPageLayout {
/**
* Version for serialization.
*/
private static final long serialVersionUID = -3108044488988318613L;
private LectureWizardState state = null;
private List<NetRule> currentNetrules;
private String currentRunscript = new String("");
/**
* Page for lecture options
*/
public LectureOptionsPage(final Wizard wizard, LectureWizardState state) {
super(wizard);
this.state = state;
this.currentNetrules = state.netRules;
this.currentRunscript = state.runScriptText;
setPageComplete(true);
if (!Session.isLectureRestrictionsSupported()) {
chkIsExam.setEnabled(false);
chkInternetEnabled.setEnabled(false);
chkUsbEnabled.setEnabled(false);
}
}
@Override
protected boolean wantNextOrFinish() {
return updateState();
}
/**
* Set the selected options in state
*/
private boolean updateState() {
state.isExam = chkIsExam.isSelected();
state.autoUpdate = chkAutoUpdate.isSelected();
state.internetAccess = chkInternetEnabled.isSelected();
state.isEnabled = chkIsActive.isSelected();
state.usbAllowed = chkUsbEnabled.isSelected();
state.netRules = currentNetrules;
state.runScriptText = currentRunscript;
setDescription(I18n.PAGE.getString("LectureOptions.WizardPage.description"));
return true;
}
}
|