summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/ThriftActions.java
diff options
context:
space:
mode:
authorJonathan Bauer2015-08-31 15:21:04 +0200
committerJonathan Bauer2015-08-31 15:21:04 +0200
commitd34565d0e7d67e18267252f8f4aa8beb6b6d40cb (patch)
tree7f39a16f4b5cd3fa7047f03fc7d8bf65a91aa572 /dozentenmodul/src/main/java/org/openslx/dozmod/thrift/ThriftActions.java
parent[client] better user feedback if dates are invalid in LectureDetails (diff)
downloadtutor-module-d34565d0e7d67e18267252f8f4aa8beb6b6d40cb.tar.gz
tutor-module-d34565d0e7d67e18267252f8f4aa8beb6b6d40cb.tar.xz
tutor-module-d34565d0e7d67e18267252f8f4aa8beb6b6d40cb.zip
[client] re-enable download button in lectureDetailsWindow if user closes the filechooser
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.java13
1 files changed, 12 insertions, 1 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 8620fcc5..6f48c706 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/ThriftActions.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/ThriftActions.java
@@ -377,8 +377,11 @@ public class ThriftActions {
fc.setDialogTitle("Bitte wählen Sie einen Speicherort");
int action = fc.showSaveDialog(frame);
File selected = fc.getSelectedFile();
- if (action != JFileChooser.APPROVE_OPTION || selected == null)
+ if (action != JFileChooser.APPROVE_OPTION || selected == null) {
+ if (callback != null)
+ callback.downloadInitialized(false);
return;
+ }
final File destDir = new File(selected, generateDirname(imageName, imageVersionId));
destDir.getAbsoluteFile().mkdirs();
@@ -390,12 +393,16 @@ public class ThriftActions {
LOGGER, null);
if (!ret) {
// user aborted
+ if (callback != null)
+ callback.downloadInitialized(false);
return;
}
// delete it
if (!diskFile.delete() && diskFile.exists()) {
Gui.showMessageBox(frame, "Datei konnte nicht überschrieben werden!", MessageType.ERROR,
LOGGER, null);
+ if (callback != null)
+ callback.downloadInitialized(false);
return;
}
}
@@ -406,6 +413,8 @@ public class ThriftActions {
+ "Brauche: " + FormatHelper.bytes(imageSize + SIZE_CHECK_EXTRA_DL, false) + "\n"
+ "Habe: " + FormatHelper.bytes(destDir.getUsableSpace(), false), MessageType.ERROR,
LOGGER, null);
+ if (callback != null)
+ callback.downloadInitialized(false);
return;
}
@@ -416,6 +425,8 @@ public class ThriftActions {
} catch (IOException e) {
Gui.showMessageBox(frame, "Kann die Datei\n" + tmpFile.getAbsolutePath() + "\nnicht erzeugen.",
MessageType.ERROR, LOGGER, e);
+ if (callback != null)
+ callback.downloadInitialized(false);
return;
}