+ public static void prepareMonthNames() {
+ instance.prepareMonthNames(false);
+ }
+ public static void setAuthenticationDataFromProfileModel(ProfileDetailModel model) {
+ profileModel = model;
+ }
+ public static void resetAuthenticationData() {
+ profileModel = null;
+ }
+ public static void storeStartupProfileAndTheme(long currentProfileId, int currentTheme) {
+ SharedPreferences prefs = instance.getSharedPreferences(PREF_NAME, MODE_PRIVATE);
+ SharedPreferences.Editor editor = prefs.edit();
+ editor.putLong(PREF_PROFILE_ID, currentProfileId);
+ editor.putInt(PREF_THEME_HUE, currentTheme);
+ editor.apply();
+ }
+ public static long getStartupProfile() {
+ SharedPreferences prefs = instance.getSharedPreferences(PREF_NAME, MODE_PRIVATE);
+ return prefs.getLong(PREF_PROFILE_ID, -1);
+ }
+ public static int getStartupTheme() {
+ SharedPreferences prefs = instance.getSharedPreferences(PREF_NAME, MODE_PRIVATE);
+ return prefs.getInt(PREF_THEME_HUE, Colors.DEFAULT_HUE_DEG);
+ }
+ private String getAuthURL() {
+ if (profileModel != null)
+ return profileModel.getUrl();
+ return Data.getProfile()
+ .getUrl();
+ }
+ private String getAuthUserName() {
+ if (profileModel != null)
+ return profileModel.getAuthUserName();
+ return Data.getProfile()
+ .getAuthUser();
+ }
+ private String getAuthPassword() {
+ if (profileModel != null)
+ return profileModel.getAuthPassword();
+ return Data.getProfile()
+ .getAuthPassword();
+ }
+ private boolean getAuthEnabled() {
+ if (profileModel != null)
+ return profileModel.getUseAuthentication();
+ return Data.getProfile()
+ .useAuthentication();