summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java
diff options
context:
space:
mode:
authorJonathan Bauer2015-08-17 13:11:56 +0200
committerJonathan Bauer2015-08-17 13:11:56 +0200
commit5d2fff1be4799006a2f6d761b7c691a12b059de5 (patch)
treebf25333261e7e9b88771bf9828aafc7db52e9c97 /dozentenmodul/src/main/java
parent[client] remove debug code (diff)
parent[client] Remove obsolete TODOs, debug output (diff)
downloadtutor-module-5d2fff1be4799006a2f6d761b7c691a12b059de5.tar.gz
tutor-module-5d2fff1be4799006a2f6d761b7c691a12b059de5.tar.xz
tutor-module-5d2fff1be4799006a2f6d761b7c691a12b059de5.zip
Merge branch 'v1.1' of git.openslx.org:openslx-ng/tutor-module into v1.1
Diffstat (limited to 'dozentenmodul/src/main/java')
-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);
}
-
+
}