summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/ThriftActions.java
diff options
context:
space:
mode:
authorStephan Schwaer2015-09-14 18:28:19 +0200
committerStephan Schwaer2015-09-14 18:28:19 +0200
commit5bd71e253153113a2bf3c87d22d79b8c6f7a96c1 (patch)
tree0278701ee5437a89db2292e9a864cd4a31dd7dba /dozentenmodul/src/main/java/org/openslx/dozmod/thrift/ThriftActions.java
parent[client] space between info text and checkboxes (diff)
downloadtutor-module-5bd71e253153113a2bf3c87d22d79b8c6f7a96c1.tar.gz
tutor-module-5bd71e253153113a2bf3c87d22d79b8c6f7a96c1.tar.xz
tutor-module-5bd71e253153113a2bf3c87d22d79b8c6f7a96c1.zip
[client] Added selection of satellite when more than one available. Shift key to force selection not working yet.
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/thrift/ThriftActions.java')
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/thrift/ThriftActions.java26
1 files changed, 21 insertions, 5 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/ThriftActions.java b/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/ThriftActions.java
index 080fe2f5..88dc755b 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/ThriftActions.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/ThriftActions.java
@@ -1,6 +1,7 @@
package org.openslx.dozmod.thrift;
import java.awt.Frame;
+import java.awt.Window;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
@@ -45,6 +46,7 @@ import org.openslx.dozmod.gui.Gui;
import org.openslx.dozmod.gui.MainWindow;
import org.openslx.dozmod.gui.helper.MessageType;
import org.openslx.dozmod.gui.helper.QFileChooser;
+import org.openslx.dozmod.gui.window.SatelliteListWindow;
import org.openslx.dozmod.thrift.cache.ImageCache;
import org.openslx.dozmod.thrift.cache.LectureCache;
import org.openslx.dozmod.thrift.cache.MetaDataCache;
@@ -61,10 +63,12 @@ import org.openslx.util.vm.DiskImage;
import org.openslx.util.vm.DiskImage.UnknownImageFormatException;
public class ThriftActions {
-
+
private static final Logger LOGGER = Logger.getLogger(ThriftActions.class);
private static final long SIZE_CHECK_EXTRA_DL = 50l * 1024l * 1024l;
private static final long SIZE_CHECK_EXTRA_UL = 150l * 1024l * 1024l;
+
+ public static boolean forceCustomSattelite = false;
/* *******************************************************************************
*
@@ -76,12 +80,13 @@ public class ThriftActions {
* ****
*/
/**
- * @param frame to show user feedback on
+ * @param window the parentWindow
* @param data AuthenticationData as received from a successful login, or
* null if trying to resume a saved sessions
- * @return true if initializing the session worked, false otherwise
+ * @param loginWindow
+ * @return true if initialising the session worked, false otherwise
*/
- public static boolean initSession(AuthenticationData data) {
+ public static boolean initSession(AuthenticationData data, Window window) {
Client client = null;
WhoamiInfo whoami = null;
String address = null;
@@ -105,7 +110,14 @@ public class ThriftActions {
return false;
}
// TODO: Show list if > 1
- Satellite sat = data.satellites.get(0);
+ // Satellite sat = data.satellites.get(0);
+ Satellite sat = null;
+ LOGGER.info(forceCustomSattelite);
+ if (data.satellites.size() == 1 && !forceCustomSattelite)
+ sat = data.satellites.get(0);
+ else
+ sat = SatelliteListWindow.open(window , data.satellites);
+
if (sat.addressList == null || sat.addressList.isEmpty()) {
// TODO: Ask for manual IP address entry
Gui.asyncMessageBox(
@@ -1134,4 +1146,8 @@ public class ThriftActions {
this.hasher = hasher;
}
}
+
+
+
+
}