summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2015-08-17 12:00:58 +0200
committerSimon Rettberg2015-08-17 12:00:58 +0200
commitc9b0a7539cb93f38c3fea530b71d01fca095fdf8 (patch)
tree3f51e9aa49b86e7da33742ac2e33d69f04347fc7
parent[client] Fix downloading logic (diff)
downloadtutor-module-c9b0a7539cb93f38c3fea530b71d01fca095fdf8.tar.gz
tutor-module-c9b0a7539cb93f38c3fea530b71d01fca095fdf8.tar.xz
tutor-module-c9b0a7539cb93f38c3fea530b71d01fca095fdf8.zip
[client] Remove obsolete TODOs, debug output
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java23
1 files changed, 11 insertions, 12 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java
index 412b2e59..d3d975b9 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java
@@ -79,13 +79,10 @@ public class ImageListWindow extends ImageListWindowLayout {
final PopupMenu pop = new PopupMenu(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (e.getSource().equals(popupItemNewLecture)) {
- // TODO new lecture
- LOGGER.debug("New lecture clicked");
- startLectureWizard();
+ startLectureWizard(imageTable.getSelectedItem());
}
if (e.getSource().equals(popupItemDownload)) {
performImageDownload(imageTable.getSelectedItem());
- LOGGER.debug("Download image clicked");
}
if (e.getSource().equals(popupItemDelete)) {
// TODO delete that image
@@ -106,7 +103,7 @@ public class ImageListWindow extends ImageListWindowLayout {
applyFilterOnTable();
}
});
-
+
imageTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent e) {
@@ -198,10 +195,9 @@ public class ImageListWindow extends ImageListWindowLayout {
});
newLectureButton.addActionListener(new ActionListener() {
-
@Override
public void actionPerformed(ActionEvent e) {
- startLectureWizard();
+ startLectureWizard(imageTable.getSelectedItem());
}
});
@@ -212,15 +208,18 @@ public class ImageListWindow extends ImageListWindowLayout {
MainWindow.showPage(MainMenuWindow.class);
}
});
-
+
updateAvailableOptions(null);
}
- private void startLectureWizard() {
- // determine latest version of the selected image
- final ImageSummaryRead image = getSelectedImage();
+ private void startLectureWizard(ImageSummaryRead image) {
if (image == null)
return;
+ if (image.getLatestVersionId() == null) {
+ Gui.showMessageBox(me, "Das gewählte Image besitzt keine gültige Image-Version",
+ MessageType.ERROR, null, null);
+ return;
+ }
new LectureWizard(SwingUtilities.getWindowAncestor(this), image, image.getLatestVersionId()).setVisible(true);
}
@@ -324,5 +323,5 @@ public class ImageListWindow extends ImageListWindowLayout {
popupItemNewLecture.setEnabled(link);
popupItemDelete.setEnabled(admin);
}
-
+
}