diff options
author | Simon Rettberg | 2019-03-01 15:47:09 +0100 |
---|---|---|
committer | Simon Rettberg | 2019-03-01 15:47:09 +0100 |
commit | f5f798cbabff48d3fcc2315cb47b9fabcfb2bd86 (patch) | |
tree | ec403b394f778f737902f23ef9f656f68ee51f21 /dozentenmodul | |
parent | [client] fix exception when predef netshare has no (diff) | |
download | tutor-module-f5f798cbabff48d3fcc2315cb47b9fabcfb2bd86.tar.gz tutor-module-f5f798cbabff48d3fcc2315cb47b9fabcfb2bd86.tar.xz tutor-module-f5f798cbabff48d3fcc2315cb47b9fabcfb2bd86.zip |
[client] Fix StateWrapper.equals() method
Diffstat (limited to 'dozentenmodul')
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetrulesConfigurator.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetrulesConfigurator.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetrulesConfigurator.java index a6c58fa7..2c93bff8 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetrulesConfigurator.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetrulesConfigurator.java @@ -66,9 +66,8 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout implements if (!(obj instanceof StateWrapper)) return false; StateWrapper o = (StateWrapper) obj; - if (selectedPresets != null && !selectedPresets.equals(o.selectedPresets)) - return false; - if (o.selectedPresets != null && !o.selectedPresets.equals(selectedPresets)) + if (selectedPresets != o.selectedPresets + && (selectedPresets == null || !selectedPresets.equals(o.selectedPresets))) return false; if (customRules == o.customRules) return true; @@ -245,7 +244,6 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout implements if (selectedRules.get() != null) { // User clicked OK lecture.presetNetworkExceptionIds = currentState.selectedPresets = selectedRules.get(); - // TODO: Make it work checkChange = true; fireChangeEvent(); } @@ -293,6 +291,8 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout implements * as a list of NetRule to set the state to */ public void setState(final LectureRead lecture) { + currentState.customRules = lecture.networkExceptions; + currentState.selectedPresets = lecture.presetNetworkExceptionIds; checkChange = true; this.lecture = lecture; this.tpNetworkRules.setText(decodeNetRulesToText(lecture.networkExceptions)); |