summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/SatelliteListWindow.java
diff options
context:
space:
mode:
authorSimon Rettberg2015-10-05 14:09:19 +0200
committerSimon Rettberg2015-10-05 14:09:19 +0200
commit60a8be0b0929eff63db610558181778e646981eb (patch)
tree01ebc7983c9e5e7aacdeefb5b59e41d3f7e5b306 /dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/SatelliteListWindow.java
parentMerge branch 'v1.1' of git.openslx.org:openslx-ng/tutor-module into v1.1 (diff)
downloadtutor-module-60a8be0b0929eff63db610558181778e646981eb.tar.gz
tutor-module-60a8be0b0929eff63db610558181778e646981eb.tar.xz
tutor-module-60a8be0b0929eff63db610558181778e646981eb.zip
[client] Show satellite selection dialog again if connect failed but login succeeded
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/SatelliteListWindow.java')
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/SatelliteListWindow.java35
1 files changed, 28 insertions, 7 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/SatelliteListWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/SatelliteListWindow.java
index 566cc99e..c4e02306 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/SatelliteListWindow.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/SatelliteListWindow.java
@@ -16,14 +16,16 @@ import org.openslx.bwlp.thrift.iface.Satellite;
import org.openslx.bwlp.thrift.iface.UserInfo;
import org.openslx.dozmod.Config;
import org.openslx.dozmod.gui.Gui;
+import org.openslx.dozmod.gui.Gui.GuiCallable;
import org.openslx.dozmod.gui.helper.MessageType;
+import org.openslx.dozmod.gui.helper.UiFeedback;
import org.openslx.dozmod.gui.window.layout.SatelliteListWindowLayout;
/**
* Window for selecting an available satellite or setting custom ip.
*/
@SuppressWarnings("serial")
-public class SatelliteListWindow extends SatelliteListWindowLayout {
+public class SatelliteListWindow extends SatelliteListWindowLayout implements UiFeedback {
private Satellite satellite = null;
@@ -31,10 +33,7 @@ public class SatelliteListWindow extends SatelliteListWindowLayout {
public void userAdded(UserInfo user, SatelliteListWindow window);
}
- /**
- * Don't use this, use the static function open instead.
- */
- public SatelliteListWindow(final Window modalParent, List<Satellite> satList) {
+ private SatelliteListWindow(final Window modalParent, List<Satellite> satList) {
super(modalParent, satList);
// Prepare doubleclick listener
MouseListener radioDoubleClick = new MouseAdapter() {
@@ -88,6 +87,13 @@ public class SatelliteListWindow extends SatelliteListWindowLayout {
}
radioCustomIp.addActionListener(listener);
+ // Cancel button
+ cancelButton.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ dispose();
+ }
+ });
// Continue button
nextButton.addActionListener(new ActionListener() {
@Override
@@ -142,8 +148,23 @@ public class SatelliteListWindow extends SatelliteListWindowLayout {
* @param satList The list of satellites to display.
* @return satellite with address to use, or null on error/cancel
*/
- public static Satellite open(Window modalParent, List<Satellite> satList) {
- return new SatelliteListWindow(modalParent, satList).runAndReturn();
+ public static Satellite open(final Window modalParent, final List<Satellite> satList) {
+ return Gui.syncExec(new GuiCallable<Satellite>() {
+ @Override
+ public Satellite run() {
+ return new SatelliteListWindow(modalParent, satList).runAndReturn();
+ }
+ });
+ }
+
+ @Override
+ public boolean wantConfirmQuit() {
+ return false;
+ }
+
+ @Override
+ public void escapePressed() {
+ dispose();
}
}