|
|
@ -4,25 +4,22 @@ import Cocoa |
|
|
|
import CoreLoggerKit |
|
|
|
import CoreLoggerKit |
|
|
|
|
|
|
|
|
|
|
|
class AppDefaults { |
|
|
|
class AppDefaults { |
|
|
|
class func initialize() { |
|
|
|
class func initialize(with store: DataStore, defaults: UserDefaults) { |
|
|
|
initializeDefaults() |
|
|
|
initializeDefaults(with: store, defaults: defaults) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private class func initializeDefaults() { |
|
|
|
private class func initializeDefaults(with store: DataStore, defaults: UserDefaults) { |
|
|
|
let userDefaults = UserDefaults.standard |
|
|
|
let timezones = store.timezones() |
|
|
|
let dataStore = DataStore.shared() |
|
|
|
let selectedCalendars = defaults.object(forKey: CLSelectedCalendars) |
|
|
|
|
|
|
|
|
|
|
|
let timezones = dataStore.timezones() |
|
|
|
|
|
|
|
let selectedCalendars = userDefaults.object(forKey: CLSelectedCalendars) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Register the usual suspects |
|
|
|
// Register the usual suspects |
|
|
|
userDefaults.register(defaults: defaultsDictionary()) |
|
|
|
defaults.register(defaults: defaultsDictionary()) |
|
|
|
|
|
|
|
|
|
|
|
dataStore.setTimezones(timezones) |
|
|
|
store.setTimezones(timezones) |
|
|
|
userDefaults.set(selectedCalendars, forKey: CLSelectedCalendars) |
|
|
|
defaults.set(selectedCalendars, forKey: CLSelectedCalendars) |
|
|
|
|
|
|
|
|
|
|
|
// Set the theme default as Light! |
|
|
|
// Set the theme default as Light! |
|
|
|
setDefaultTheme(userDefaults) |
|
|
|
setDefaultTheme(defaults) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private class func setDefaultTheme(_ userDefaults: UserDefaults) { |
|
|
|
private class func setDefaultTheme(_ userDefaults: UserDefaults) { |
|
|
|