diff options
author | Simon Rettberg | 2015-07-08 19:39:35 +0200 |
---|---|---|
committer | Simon Rettberg | 2015-07-08 19:39:35 +0200 |
commit | 8d6cd17c330388aa13fd7c39802c7400d85f972c (patch) | |
tree | 5f2c5856f58b1454e24dc16fad10751dfe9d087b /dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/DisclaimerWindow.java | |
parent | oops (diff) | |
download | tutor-module-8d6cd17c330388aa13fd7c39802c7400d85f972c.tar.gz tutor-module-8d6cd17c330388aa13fd7c39802c7400d85f972c.tar.xz tutor-module-8d6cd17c330388aa13fd7c39802c7400d85f972c.zip |
[client] Redo package structure, add comments/TODOs, rename GUI classes
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/DisclaimerWindow.java')
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/DisclaimerWindow.java | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/DisclaimerWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/DisclaimerWindow.java new file mode 100644 index 00000000..6db29f15 --- /dev/null +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/DisclaimerWindow.java @@ -0,0 +1,40 @@ +package org.openslx.dozmod.gui.window; + +import org.apache.log4j.Logger; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.widgets.Shell; +import org.openslx.dozmod.Config; +import org.openslx.dozmod.gui.helper.GuiManager; +import org.openslx.dozmod.gui.window.layout.DisclaimerWindowLayout; + +public class DisclaimerWindow extends DisclaimerWindowLayout{ + + private final static Logger LOGGER = Logger.getLogger(DisclaimerWindow.class); + + public DisclaimerWindow(final Shell mainShell) { + super(mainShell); + + // function for agreement checkbox + agreeBox.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + continueButton.setEnabled(!continueButton.isEnabled()); + } + }); + + // function for continue button + continueButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + // save the agreement to config + if (!Config.setDisclaimerAgreement(true)) + LOGGER.error("Could not set the agreement to the disclaimer in '" + Config.getPath() + "'!"); + Config.store(); + // now check the config to see if the user has agreed to vmware stuff + GuiManager.addContent(new VirtualizerNoticeWindow(getShell())); + } + }); + } + +} |