From c728881ddcd978511dd317a74971fbacc329ee2a Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 22 Jan 2016 10:36:54 +0100 Subject: [client] Save locations selected in winzard; check location count; default to "prioritize" --- .../gui/wizard/page/LectureLocationSelectionPage.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/LectureLocationSelectionPage.java') diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/LectureLocationSelectionPage.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/LectureLocationSelectionPage.java index f8f10d27..7d25eb59 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/LectureLocationSelectionPage.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/LectureLocationSelectionPage.java @@ -1,9 +1,12 @@ package org.openslx.dozmod.gui.wizard.page; +import java.util.List; + import org.apache.log4j.Logger; import org.openslx.dozmod.gui.wizard.Wizard; import org.openslx.dozmod.gui.wizard.layout.LectureLocationSelectionPageLayout; import org.openslx.dozmod.state.LectureWizardState; +import org.openslx.dozmod.thrift.Session; @SuppressWarnings("serial") public class LectureLocationSelectionPage extends LectureLocationSelectionPageLayout { @@ -24,7 +27,17 @@ public class LectureLocationSelectionPage extends LectureLocationSelectionPageLa } private boolean updateState() { - // TODO + List locations = locationSelector.getSelectedLocationsAsIds(); + boolean locationExclusive = locationSelector.getOnlyInSelection(); + if (locations.size() > Session.getSatelliteConfig().maxLocationsPerLecture) { + setErrorMessage("Zu viele Räume/Orte ausgewählt"); + locationSelector.setSelectedLocationsAsIds(locations); + locationSelector.collapseFullySelectedNodes(); + return false; + } + state.locations = locations; + state.onlyInSelectedLocations = locationExclusive; + setErrorMessage(null); return true; } -- cgit v1.2.3-55-g7522