diff options
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/Config.java')
-rwxr-xr-x | dozentenmodul/src/main/java/org/openslx/dozmod/Config.java | 41 |
1 files changed, 13 insertions, 28 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/Config.java b/dozentenmodul/src/main/java/org/openslx/dozmod/Config.java index b1e771b4..9c8b0b9e 100755 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/Config.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/Config.java @@ -9,8 +9,6 @@ import java.io.InputStream; import java.util.Properties; import org.apache.log4j.Logger; -import org.openslx.dozmod.gui.window.DisclaimerWindow; -import org.openslx.dozmod.gui.window.PrivacyNoticeWindow; import org.openslx.dozmod.util.OsHelper; import org.openslx.util.QuickTimer; import org.openslx.util.QuickTimer.Task; @@ -93,7 +91,7 @@ public class Config { } // Check if we got a path - configFile = new File(configPath + File.separatorChar + "bwSuite" + File.separatorChar + configFile = new File(configPath + File.separatorChar + Branding.getServiceName() + File.separatorChar + "config.properties").getAbsoluteFile(); // Check if the directory exists. @@ -128,7 +126,8 @@ public class Config { private static void forceSaveInternal() throws FileNotFoundException, IOException { synchronized (prop) { - prop.store(new FileOutputStream(configFile), "bwLehrpool Dozentenmodul Client Config"); + prop.store(new FileOutputStream(configFile), + Branding.getServiceName() + " Dozentenmodul Client Config"); } } @@ -192,15 +191,8 @@ public class Config { * * @return version of the disclaimer the user accepted, 0 otherwise. */ - public static int getDisclaimerAgreement() { - int savedVersion = getInteger("disclaimer.accepted_version", 0); - // check if we have a saved version and if it is larger than - // the current version. If it is, reset it to 0. - if (savedVersion != 0 && Math.abs(savedVersion - DisclaimerWindow.DISCLAIMER_VERSION) != 0) { - setDisclaimerAgreement(0); - return 0; - } - return savedVersion; + public static String getDisclaimerAgreement() { + return getString("disclaimer.accepted_version", ""); } /** @@ -208,8 +200,8 @@ public class Config { * * @return true if it succeeded, false otherwise */ - public static void setDisclaimerAgreement(int value) { - setInteger("disclaimer.accepted_version", value); + public static void setDisclaimerAgreement(String value) { + setString("disclaimer.accepted_version", value); } /** @@ -217,15 +209,8 @@ public class Config { * * @return version of the privacy notice the user accepted, 0 otherwise. */ - public static int getPrivacyAgreement() { - int savedVersion = getInteger("privacy.accepted_version", 0); - // check if we have a saved version and if it is larger than - // the current version. If it is, reset it to 0. - if (savedVersion != 0 && Math.abs(savedVersion - PrivacyNoticeWindow.PRIVACY_VERSION) != 0) { - setPrivacyAgreement(0); - return 0; - } - return savedVersion; + public static String getPrivacyAgreement() { + return getString("privacy.accepted_version", ""); } /** @@ -233,8 +218,8 @@ public class Config { * * @return true if it succeeded, false otherwise */ - public static void setPrivacyAgreement(int value) { - setInteger("privacy.accepted_version", value); + public static void setPrivacyAgreement(String value) { + setString("privacy.accepted_version", value); } /** @@ -367,8 +352,8 @@ public class Config { * @return Saved session, or <code>null</code> if no session was saved */ public static SavedSession getSavedSession() { - SavedSession session = new SavedSession(getString("session.address", ""), getString("session.token", - ""), getString("session.mastertoken", "")); + SavedSession session = new SavedSession(getString("session.address", ""), + getString("session.token", ""), getString("session.mastertoken", "")); if (session.token.isEmpty() || session.address.isEmpty() || session.masterToken.isEmpty()) return null; return session; |