diff options
author | Jonathan Bauer | 2016-01-18 18:03:52 +0100 |
---|---|---|
committer | Jonathan Bauer | 2016-01-18 18:03:52 +0100 |
commit | a22954f9fa65bc9a9de4244cb2d0d37c17e1f37b (patch) | |
tree | ac847074a3cc9352aa232867853350f55da7d435 /dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureDetailsWindow.java | |
parent | [client] make the LocationSelectionWindow modal if a parent is given (e.g. Le... (diff) | |
download | tutor-module-a22954f9fa65bc9a9de4244cb2d0d37c17e1f37b.tar.gz tutor-module-a22954f9fa65bc9a9de4244cb2d0d37c17e1f37b.tar.xz tutor-module-a22954f9fa65bc9a9de4244cb2d0d37c17e1f37b.zip |
[client] more location stuff [wip]
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureDetailsWindow.java')
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureDetailsWindow.java | 25 |
1 files changed, 17 insertions, 8 deletions
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 21f41d15..ad5deb0c 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 @@ -107,7 +107,9 @@ public class LectureDetailsWindow extends LectureDetailsWindowLayout implements private boolean metadataChanged = false; - private boolean permissionsChanged; + private boolean permissionsChanged = false; + + private LocationInfo locationInfo = null; /** * Constructor @@ -199,10 +201,13 @@ public class LectureDetailsWindow extends LectureDetailsWindowLayout implements btnLocations.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - List<Integer> locationsList = new ArrayList<Integer>(); - // TODO load the location list from the LectureSummary - List<Integer> newLocationsList = LocationSelectionWindow.open(me, locationsList); - // TODO check if something changed and if so save the change + locationInfo = LocationSelectionWindow.open(me, lecture.locationIds, lecture.limitToLocations); + if (locationInfo == null) { + // nothing changed + return; + } + LOGGER.debug("New location info: " + locationInfo); + reactToChange(); } }); btnSaveChanges.addActionListener(new ActionListener() { @@ -320,6 +325,7 @@ public class LectureDetailsWindow extends LectureDetailsWindowLayout implements originalCustomPermissions.put(entry.getKey(), new LecturePermissions(entry.getValue())); } } + txtTitle.setText(lecture.getLectureName()); txtDescription.setText(lecture.getDescription()); lblOwner.setUser(UserCache.find(lecture.getOwnerId())); @@ -477,7 +483,7 @@ public class LectureDetailsWindow extends LectureDetailsWindowLayout implements DateTimeHelper.getDateFrom(startDate, startTime).getTime() / 1000L, DateTimeHelper.getDateFrom(endDate, endTime).getTime() / 1000L, null, null, chkIsExam.isSelected(), chkHasInternetAccess.isSelected(), - lecture.getDefaultPermissions(), null, false, false); // TODO: Location related + lecture.getDefaultPermissions(), locationInfo.locationList, locationInfo.limitToLocations, false); // TODO: Location related // now trigger the actual action try { ThriftManager.getSatClient().updateLecture(Session.getSatelliteToken(), @@ -594,7 +600,7 @@ public class LectureDetailsWindow extends LectureDetailsWindowLayout implements lblError.setText("Ungültiger Zeitraum!"); return false; } - // TODO check if locations changed + // done with mandatory checks, remove error message lblError.setText(null); @@ -608,7 +614,10 @@ public class LectureDetailsWindow extends LectureDetailsWindowLayout implements || chkIsExam.isSelected() != lecture.isExam || chkHasInternetAccess.isSelected() != lecture.hasInternetAccess || chkIsActive.isSelected() != lecture.isEnabled - || !lecture.defaultPermissions.equals(originalDefaultPermissions) || imageLinkChanged; + || !lecture.defaultPermissions.equals(originalDefaultPermissions) + || (lecture.locationIds != null && !lecture.locationIds.equals(locationInfo.locationList)) + || (locationInfo != null && lecture.limitToLocations != locationInfo.limitToLocations) + || imageLinkChanged; return changed; } |