diff options
author | Stephan Schwaer | 2015-10-02 18:09:41 +0200 |
---|---|---|
committer | Stephan Schwaer | 2015-10-02 18:09:41 +0200 |
commit | b65660066da25cc9ec7968ba19b0e2bca13cbb07 (patch) | |
tree | b68a58d5cc1f54390a31e28ea4af6d01e2a899b6 /dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadSummaryPage.java | |
parent | [server] Fix NPE (diff) | |
download | tutor-module-b65660066da25cc9ec7968ba19b0e2bca13cbb07.tar.gz tutor-module-b65660066da25cc9ec7968ba19b0e2bca13cbb07.tar.xz tutor-module-b65660066da25cc9ec7968ba19b0e2bca13cbb07.zip |
[client] Wizard can now be opened after creating image. Added notice to options window regarding mails.
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadSummaryPage.java')
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadSummaryPage.java | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadSummaryPage.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadSummaryPage.java index ef96d234..642f8fc5 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadSummaryPage.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadSummaryPage.java @@ -1,15 +1,22 @@ package org.openslx.dozmod.gui.wizard.page; +import java.awt.KeyboardFocusManager; +import java.awt.Window; + import org.apache.log4j.Logger; +import org.openslx.bwlp.thrift.iface.ImageSummaryRead; import org.openslx.bwlp.thrift.iface.TransferState; import org.openslx.dozmod.filetransfer.TransferEvent; import org.openslx.dozmod.filetransfer.TransferEventListener; import org.openslx.dozmod.gui.Gui; import org.openslx.dozmod.gui.MainWindow; +import org.openslx.dozmod.gui.wizard.LectureWizard; import org.openslx.dozmod.gui.wizard.Wizard; import org.openslx.dozmod.gui.wizard.layout.ImageUploadSummaryPageLayout; import org.openslx.dozmod.state.UploadWizardState; +import org.openslx.dozmod.thrift.ThriftActions; import org.openslx.dozmod.thrift.UploadInitiator.UploadInitState; +import org.openslx.dozmod.thrift.cache.ImageCache; import org.openslx.util.QuickTimer; @SuppressWarnings("serial") @@ -108,6 +115,10 @@ public class ImageUploadSummaryPage extends ImageUploadSummaryPageLayout { if (initState == UploadInitState.UPLOAD_STARTED) { setPageComplete(true); } + if (state.upload.getUploadTask() != null && state.upload.getUploadTask().isComplete()) { + chkCreateLecture.setEnabled(true); + } + } }); } @@ -132,10 +143,30 @@ public class ImageUploadSummaryPage extends ImageUploadSummaryPageLayout { if (!pageIsVisible) return; pageIsVisible = false; + + + // optional lectureWizard state.upload.getUploadTask().removeListener(uploadListener); if (!wizard.isCancelled() && !state.upload.getUploadTask().isCanceled()) { MainWindow.addUpload(state); } + if (!wizard.isCancelled() && chkCreateLecture.isSelected()) { + wizard.setVisible(false); + Window parent = KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow(); + ImageSummaryRead image = null; + for (ImageSummaryRead tmpImage : ImageCache.get(true)) { + if (tmpImage.imageBaseId.equals(state.uuid)) { + image = tmpImage; + break; + } + } + if (image != null) { + new LectureWizard(parent, image, state.upload.getToken()).setVisible(true); + } else { + LOGGER.error("Couldn't find the new image in the image cache."); + //TODO could this happen? Show messagebox then? + } + } } } |