|
@@ -192,7 +192,12 @@ class KMPreferenceManager: NSObject {
|
|
|
|
|
|
}
|
|
}
|
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
|
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
|
|
- NotificationCenter.default.post(name: NSNotification.Name(rawValue: KMPreferenceDidChangeNotificationName), object: [group])
|
|
|
|
|
|
+ let info: [String : Any]? = UserDefaults.standard.value(forKey: KMPreferenceInfoKey) as? [String : Any]
|
|
|
|
+ var groupInfo: [KMPreferenceKey : Any]?
|
|
|
|
+ if (info != nil) {
|
|
|
|
+ groupInfo = info![group.rawValue] as? [KMPreferenceKey : Any]
|
|
|
|
+ }
|
|
|
|
+ NotificationCenter.default.post(name: NSNotification.Name(rawValue: KMPreferenceDidChangeNotificationName), object: [group], userInfo: groupInfo != nil ? groupInfo : [:])
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -202,7 +207,14 @@ class KMPreferenceManager: NSObject {
|
|
UserDefaults.standard.synchronize()
|
|
UserDefaults.standard.synchronize()
|
|
|
|
|
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
|
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
|
|
- NotificationCenter.default.post(name: NSNotification.Name(rawValue: KMPreferenceDidChangeNotificationName), object: [KMPreferenceGroup.general, KMPreferenceGroup.display, KMPreferenceGroup.markup, KMPreferenceGroup.infomation, KMPreferenceGroup.other])
|
|
|
|
|
|
+ var groppInfos: [KMPreferenceKey : Any] = [:]
|
|
|
|
+ for groupInfo in info.values {
|
|
|
|
+ for (key, value) in groupInfo {
|
|
|
|
+ groppInfos.updateValue(value, forKey: key)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ NotificationCenter.default.post(name: NSNotification.Name(rawValue: KMPreferenceDidChangeNotificationName), object: [KMPreferenceGroup.general, KMPreferenceGroup.display, KMPreferenceGroup.markup, KMPreferenceGroup.infomation, KMPreferenceGroup.other], userInfo: groppInfos)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -283,7 +295,7 @@ class KMPreferenceManager: NSObject {
|
|
KMOpenImageFileTypeKey : 0,
|
|
KMOpenImageFileTypeKey : 0,
|
|
KMSetDefaultPDFReaderKey : true,
|
|
KMSetDefaultPDFReaderKey : true,
|
|
KMSavePasswordTypeKey : 2,
|
|
KMSavePasswordTypeKey : 2,
|
|
- KMGeneralAuthorNameKey : "Kdanmobile"],
|
|
|
|
|
|
+ KMGeneralAuthorNameKey : NSFullUserName()],
|
|
KMPreferenceGroup.display.rawValue : [KMViewPageDisplayTypeKey : 1,
|
|
KMPreferenceGroup.display.rawValue : [KMViewPageDisplayTypeKey : 1,
|
|
KMViewZoomScaleTypeKey : 0,
|
|
KMViewZoomScaleTypeKey : 0,
|
|
KMLeftSideDisplayTypeKey : 0,
|
|
KMLeftSideDisplayTypeKey : 0,
|