diff options
author | ralph isenmann | 2021-03-18 15:56:41 +0100 |
---|---|---|
committer | ralph isenmann | 2021-03-18 15:56:41 +0100 |
commit | 52c43409abd7268da4ee4798a1eb4572a71a11b1 (patch) | |
tree | ea92ca24fc85f3bbfd025b7cd1d366e6def627bc | |
parent | [client] Wording Container (diff) | |
download | tutor-module-52c43409abd7268da4ee4798a1eb4572a71a11b1.tar.gz tutor-module-52c43409abd7268da4ee4798a1eb4572a71a11b1.tar.xz tutor-module-52c43409abd7268da4ee4798a1eb4572a71a11b1.zip |
[client] Fix not showing warning Message
4 files changed, 16 insertions, 14 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 b77e41e7..bc30c3c5 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 @@ -38,6 +38,7 @@ import org.openslx.dozmod.thrift.ThriftActions; import org.openslx.dozmod.thrift.ThriftActions.DeleteCallback; import org.openslx.dozmod.thrift.ThriftActions.DownloadCallback; import org.openslx.dozmod.thrift.cache.LectureCache; +import org.openslx.dozmod.util.ContainerUtils; import org.openslx.util.QuickTimer; import org.openslx.util.QuickTimer.Task; @@ -313,6 +314,10 @@ public class ImageListWindow extends ImageListWindowLayout implements DownloadCa private void startLectureWizard(ImageSummaryRead image) { if (!hasLatestVersion(image)) return; + if (ContainerUtils.isContainerImageLinked(image)){ + ContainerUtils.showWarning(me,LOGGER); + return; + } new LectureWizard(SwingUtilities.getWindowAncestor(this), image, image.getLatestVersionId()).setVisible(true); } diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureDetailsWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureDetailsWindow.java index 97301092..11c0d605 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureDetailsWindow.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureDetailsWindow.java @@ -198,8 +198,7 @@ public class LectureDetailsWindow extends LectureDetailsWindowLayout implements if (newImage == null) return; if (ContainerUtils.isContainerImageLinked(newImage)) { - Gui.showMessageBox(me, I18n.WINDOW.getString("LectureDetails.Message.error.containerLinkedWithLecture"), - MessageType.WARNING, LOGGER, null); + ContainerUtils.showWarning(me, LOGGER); return; } final ImageMetaCallback callback = new ImageMetaCallback() { diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/LectureWizard.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/LectureWizard.java index 018c0206..59c79a88 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/LectureWizard.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/LectureWizard.java @@ -15,7 +15,6 @@ import org.openslx.dozmod.thrift.Session; import org.openslx.dozmod.thrift.ThriftActions; import org.openslx.dozmod.thrift.cache.LectureCache; import org.openslx.dozmod.thrift.cache.MetaDataCache; -import org.openslx.dozmod.util.ContainerUtils; import javax.swing.*; import java.awt.*; @@ -60,17 +59,6 @@ public class LectureWizard extends Wizard implements UiFeedback { } } - @Override public void setVisible(boolean b) { - if (state.image != null && state.imageVersionId != null) { - if (ContainerUtils.isContainerImageLinked(state.image)) { - dispose(); - super.setVisible(false); - return; - } - } - super.setVisible(true); - } - @Override public String getWindowTitle() { return I18n.WIZARD.getString("Lecture.Wizard.title"); diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/util/ContainerUtils.java b/dozentenmodul/src/main/java/org/openslx/dozmod/util/ContainerUtils.java index 1b83fdfc..eeaae891 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/util/ContainerUtils.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/util/ContainerUtils.java @@ -1,10 +1,15 @@ package org.openslx.dozmod.util; +import org.apache.log4j.Logger; import org.openslx.bwlp.thrift.iface.ImageSummaryRead; import org.openslx.bwlp.thrift.iface.LectureSummary; +import org.openslx.dozmod.gui.Gui; +import org.openslx.dozmod.gui.helper.I18n; +import org.openslx.dozmod.gui.helper.MessageType; import org.openslx.dozmod.thrift.cache.LectureCache; import org.openslx.thrifthelper.TConst; +import java.awt.*; import java.util.List; /** @@ -29,4 +34,9 @@ public class ContainerUtils { } return false; } + + public static void showWarning(Component c, Logger logger) { + Gui.showMessageBox(c, I18n.WINDOW.getString("LectureDetails.Message.error.containerLinkedWithLecture"), + MessageType.WARNING, logger, null); + } } |