From c9b0a7539cb93f38c3fea530b71d01fca095fdf8 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 17 Aug 2015 12:00:58 +0200 Subject: [client] Remove obsolete TODOs, debug output --- .../openslx/dozmod/gui/window/ImageListWindow.java | 23 +++++++++++----------- 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'dozentenmodul/src/main/java/org') 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); } - + } -- cgit v1.2.3-55-g7522