瀏覽代碼

【填写与签名】新增KMProfileInfoWindowController

tangchao 1 年之前
父節點
當前提交
dc50ffdbd8

+ 34 - 0
PDF Office/PDF Master.xcodeproj/project.pbxproj

@@ -2228,6 +2228,12 @@
 		BB2F615B2966B69D001CB369 /* KMWatermarkPropertyHomeController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BB2F61572966B69D001CB369 /* KMWatermarkPropertyHomeController.xib */; };
 		BB2F615C2966B69D001CB369 /* KMWatermarkPropertyHomeController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BB2F61572966B69D001CB369 /* KMWatermarkPropertyHomeController.xib */; };
 		BB2F615D2966B69D001CB369 /* KMWatermarkPropertyHomeController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BB2F61572966B69D001CB369 /* KMWatermarkPropertyHomeController.xib */; };
+		BB2F9AA32AFC8D5A00F9DD93 /* KMProfileInfoWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = BB2F9AA02AFC8D5900F9DD93 /* KMProfileInfoWindowController.m */; };
+		BB2F9AA42AFC8D5A00F9DD93 /* KMProfileInfoWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = BB2F9AA02AFC8D5900F9DD93 /* KMProfileInfoWindowController.m */; };
+		BB2F9AA52AFC8D5A00F9DD93 /* KMProfileInfoWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = BB2F9AA02AFC8D5900F9DD93 /* KMProfileInfoWindowController.m */; };
+		BB2F9AA62AFC8D5A00F9DD93 /* KMProfileInfoWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BB2F9AA22AFC8D5900F9DD93 /* KMProfileInfoWindowController.xib */; };
+		BB2F9AA72AFC8D5A00F9DD93 /* KMProfileInfoWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BB2F9AA22AFC8D5900F9DD93 /* KMProfileInfoWindowController.xib */; };
+		BB2F9AA82AFC8D5A00F9DD93 /* KMProfileInfoWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BB2F9AA22AFC8D5900F9DD93 /* KMProfileInfoWindowController.xib */; };
 		BB3198122AC5142900107371 /* NSMenu+KMExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB3198112AC5142900107371 /* NSMenu+KMExtension.swift */; };
 		BB3198132AC5142900107371 /* NSMenu+KMExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB3198112AC5142900107371 /* NSMenu+KMExtension.swift */; };
 		BB3198142AC5142900107371 /* NSMenu+KMExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB3198112AC5142900107371 /* NSMenu+KMExtension.swift */; };
@@ -4461,6 +4467,9 @@
 		BB2F614F2966A91D001CB369 /* KMBackgroundPropertyHomeController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMBackgroundPropertyHomeController.xib; sourceTree = "<group>"; };
 		BB2F61562966B69D001CB369 /* KMWatermarkPropertyHomeController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMWatermarkPropertyHomeController.swift; sourceTree = "<group>"; };
 		BB2F61572966B69D001CB369 /* KMWatermarkPropertyHomeController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMWatermarkPropertyHomeController.xib; sourceTree = "<group>"; };
+		BB2F9AA02AFC8D5900F9DD93 /* KMProfileInfoWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KMProfileInfoWindowController.m; sourceTree = "<group>"; };
+		BB2F9AA12AFC8D5900F9DD93 /* KMProfileInfoWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KMProfileInfoWindowController.h; sourceTree = "<group>"; };
+		BB2F9AA22AFC8D5900F9DD93 /* KMProfileInfoWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = KMProfileInfoWindowController.xib; sourceTree = "<group>"; };
 		BB3198112AC5142900107371 /* NSMenu+KMExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSMenu+KMExtension.swift"; sourceTree = "<group>"; };
 		BB3198152AC55E6D00107371 /* CPDFDocument+KMExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CPDFDocument+KMExtension.swift"; sourceTree = "<group>"; };
 		BB3198192AC567B500107371 /* CPDFSelection+PDFListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CPDFSelection+PDFListView.swift"; sourceTree = "<group>"; };
@@ -5532,6 +5541,7 @@
 		9F1F82C6292F631A0092C4B4 /* PDFTools */ = {
 			isa = PBXGroup;
 			children = (
+				BB2F9A9E2AFC8D1100F9DD93 /* SelfSign */,
 				BB853CA02AF8F947009C20C1 /* AddHeaderFooter */,
 				BB35C49C297535C800D46EE2 /* Redact */,
 				BB1EC7FA2967B24100EC0BC3 /* PageEdit */,
@@ -7697,6 +7707,24 @@
 			path = Base;
 			sourceTree = "<group>";
 		};
+		BB2F9A9E2AFC8D1100F9DD93 /* SelfSign */ = {
+			isa = PBXGroup;
+			children = (
+				BB2F9A9F2AFC8D1100F9DD93 /* Window */,
+			);
+			path = SelfSign;
+			sourceTree = "<group>";
+		};
+		BB2F9A9F2AFC8D1100F9DD93 /* Window */ = {
+			isa = PBXGroup;
+			children = (
+				BB2F9AA12AFC8D5900F9DD93 /* KMProfileInfoWindowController.h */,
+				BB2F9AA02AFC8D5900F9DD93 /* KMProfileInfoWindowController.m */,
+				BB2F9AA22AFC8D5900F9DD93 /* KMProfileInfoWindowController.xib */,
+			);
+			path = Window;
+			sourceTree = "<group>";
+		};
 		BB32BF212A5EA02900D11348 /* Analytics */ = {
 			isa = PBXGroup;
 			children = (
@@ -9442,6 +9470,7 @@
 				BB90E4EA2AF347A700B04B9F /* PreferenceWindow.xib in Resources */,
 				ADE3C1AE29A4779E00793B13 /* KMPrintAccessoryController.xib in Resources */,
 				BBEC00BA295C2C1600A26C98 /* KMBatesPropertyHomeController.xib in Resources */,
+				BB2F9AA62AFC8D5A00F9DD93 /* KMProfileInfoWindowController.xib in Resources */,
 				BB65A0502AF8B64B003A27A0 /* DisplayPreferences.xib in Resources */,
 				AD1CA3FA2A05FCB60070541F /* KMAnnotationScreenViewController.xib in Resources */,
 				BBC2BCC9295DA8F30036B983 /* KMCropPreviewController.xib in Resources */,
@@ -9798,6 +9827,7 @@
 				AD8810A429A8459000178CA1 /* KMComparativeTableViewController.xib in Resources */,
 				AD0FA4F629A8582C00EDEB50 /* KMComparativeTableView.xib in Resources */,
 				ADAFDA112AE8DD6600F084BC /* KMAdvertisementCollectionHeadView.xib in Resources */,
+				BB2F9AA72AFC8D5A00F9DD93 /* KMProfileInfoWindowController.xib in Resources */,
 				ADD1B6CC2942E85300C3FFF7 /* KMPrintBottomView.xib in Resources */,
 				9F0CB4732967E63100007028 /* KMPropertiesPanelNameSubVC.xib in Resources */,
 				9FF94F1529A7476000B1EF69 /* KMDesignPropertySelector.xib in Resources */,
@@ -10132,6 +10162,7 @@
 				AD1D480D2AFB18DA007AC1F0 /* KMCompressWIndowControllerNew.xib in Resources */,
 				AD85D1A92AF09864000F4D28 /* KMHomeQuickToolsWindowController.xib in Resources */,
 				BB49ED03293F459500C82CA2 /* KMConvertPPTsWindowController.xib in Resources */,
+				BB2F9AA82AFC8D5A00F9DD93 /* KMProfileInfoWindowController.xib in Resources */,
 				BB89723F294B3C840045787C /* KMWatermarkPropertyController.xib in Resources */,
 				BB49ECFB293F44DC00C82CA2 /* KMConvertExcelWindowController.xib in Resources */,
 				AD2D74B229F0CEB300EDC5E4 /* KMCancellationWindowController.xib in Resources */,
@@ -10852,6 +10883,7 @@
 				AD68782129A5FADC005B5210 /* KMLightMemberCache.swift in Sources */,
 				AD8F06172999DB5900D93CBC /* KMPrintDrawPage.swift in Sources */,
 				BB14702F299DC0D100784A6A /* OIDTokenUtilities.m in Sources */,
+				BB2F9AA32AFC8D5A00F9DD93 /* KMProfileInfoWindowController.m in Sources */,
 				89752E042939DB42003FF08E /* KMToolbarViewController.swift in Sources */,
 				BB146FD5299DC0D100784A6A /* GTLRObject.m in Sources */,
 				8942F7F02926087200389627 /* KMSearchViewController.swift in Sources */,
@@ -11869,6 +11901,7 @@
 				ADD1B6B829420B2300C3FFF7 /* KMPrintChooseView.swift in Sources */,
 				9FCFEC9D2AD152FA00EAD2CB /* CustomAlertView.swift in Sources */,
 				BB147000299DC0D100784A6A /* OIDRedirectHTTPHandler.m in Sources */,
+				BB2F9AA42AFC8D5A00F9DD93 /* KMProfileInfoWindowController.m in Sources */,
 				BB147003299DC0D100784A6A /* OIDScopeUtilities.m in Sources */,
 				AD867FA729DFB77500F00440 /* KMAnnotationOutlineView.swift in Sources */,
 				BBB9B32C299A5D6D004F3235 /* GTMOAuth2KeychainCompatibility.m in Sources */,
@@ -12276,6 +12309,7 @@
 				9FCFEC762AC56ECE00EAD2CB /* CPDFListStampAnnotation.swift in Sources */,
 				BBA388152AEF9A42004FE93F /* NSWindow+KMExtension.swift in Sources */,
 				9FD0D2A92AD4EFB000DA3FF8 /* KMSavePanelAccessoryController.swift in Sources */,
+				BB2F9AA52AFC8D5A00F9DD93 /* KMProfileInfoWindowController.m in Sources */,
 				9F1FE4D129406E4700E952CA /* CTTabController.m in Sources */,
 				9F8539E029470A0700DF644E /* KMTabStripView.swift in Sources */,
 				BBA8B7AC2935DC120097D183 /* KMRemovePasswordResultTipView.swift in Sources */,

+ 32 - 0
PDF Office/PDF Master.xcodeproj/xcuserdata/kdanmobile.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -452,5 +452,37 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "4D93AA09-0E5B-4BA4-8FA1-A4C5CD46424B"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "PDF Master/Class/Preference/Controller/KMGeneralPreferences.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "317"
+            endingLineNumber = "317"
+            landmarkName = "defaultsDidRevert()"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "C2E1DBEB-7852-4C5E-B4FB-F109704A80B7"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "PDF Master/Class/Preference/Window/KMPreferenceController.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "460"
+            endingLineNumber = "460"
+            landmarkName = "_resetCurrentSheetDidEnd(_:_:_:)"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

+ 21 - 0
PDF Office/PDF Master/Class/PDFTools/SelfSign/Window/KMProfileInfoWindowController.h

@@ -0,0 +1,21 @@
+//
+//  KMProfileInfoWindowController.h
+//  PDF Reader Pro Edition
+//
+//  Created by 蒋志鹏 on 2019-07-19.
+//
+
+#import <Cocoa/Cocoa.h>
+
+@class SKMainWindowController;
+
+NS_ASSUME_NONNULL_BEGIN
+typedef void(^profileInfoAddtoDocCallBack)(NSString *string);
+
+@interface KMProfileInfoWindowController : NSWindowController
+
+@property (nonatomic, copy) profileInfoAddtoDocCallBack callBack;//回调
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 919 - 0
PDF Office/PDF Master/Class/PDFTools/SelfSign/Window/KMProfileInfoWindowController.m

@@ -0,0 +1,919 @@
+//
+//  KMProfileInfoWindowController.m
+//  PDF Reader Pro Edition
+//
+//  Created by 蒋志鹏 on 2019-07-19.
+//
+
+#import "KMProfileInfoWindowController.h"
+//#import "NSWindowController_SKExtensions.h"
+//#import "KMProfileCellView.h"
+//#import "KMProfileTitleCellView.h"
+//#import "NSButton+TitleColor.h"
+#import <PDF_Master-Swift.h>
+
+static NSString *KMProfileUnarchiveKey = @"KMProfileUnarchiveKeyTemp1";
+
+static NSString *KMProfileSaveInfoFullNameKey = @"KMProfileSaveInfoFullNameKey";
+static NSString *KMProfileSaveInfoFirstNameKey = @"KMProfileSaveInfoFirstNameKey";
+static NSString *KMProfileSaveInfoMiddleNameKey = @"KMProfileSaveInfoMiddleNameKey";
+static NSString *KMProfileSaveInfoLastNameKey = @"KMProfileSaveInfoLastNameKey";
+
+static NSString *KMProfileSaveInfoStreet1Key = @"KMProfileSaveInfoStreet1Key";
+static NSString *KMProfileSaveInfoStreet2Key = @"KMProfileSaveInfoStreet2Key";
+static NSString *KMProfileSaveInfoCityKey = @"KMProfileSaveInfoCityKey";
+static NSString *KMProfileSaveInfoStateKey = @"KMProfileSaveInfoStateKey";
+static NSString *KMProfileSaveInfoZipKey = @"KMProfileSaveInfoZipKey";
+static NSString *KMProfileSaveInfoCountryKey = @"KMProfileSaveInfoCountryKey";
+
+static NSString *KMProfileSaveInfoEmailKey = @"KMProfileSaveInfoEmailKey";
+static NSString *KMProfileSaveInfoTelKey = @"KMProfileSaveInfoTelKey";
+static NSString *KMProfileSaveInfoBirthDateKey = @"KMProfileSaveInfoBirthDateKey";
+static NSString *KMProfileSaveInfoCustomInfoKey = @"KMProfileSaveInfoCustomInfoKey";
+
+@interface KMProfileInfo : NSObject <NSCoding>
+
+@property (nonatomic, retain) NSString *fullName;
+@property (nonatomic, retain) NSString *firstName;
+@property (nonatomic, retain) NSString *middleName;
+@property (nonatomic, retain) NSString *lastName;
+
+@property (nonatomic, retain) NSString *street1;
+@property (nonatomic, retain) NSString *street2;
+@property (nonatomic, retain) NSString *city;
+@property (nonatomic, retain) NSString *state;
+@property (nonatomic, retain) NSString *zip;
+@property (nonatomic, retain) NSString *country;
+
+@property (nonatomic, retain) NSString *email;
+@property (nonatomic, retain) NSString *tel;
+
+@property (nonatomic, retain) NSString *birthDate;
+
+@property (nonatomic, retain) NSMutableArray *customInfoArray;
+
+@end
+
+@implementation KMProfileInfo
+
+#pragma mark - Getter & setter
+
+- (void)setFullName:(NSString *)fullName {
+//    if (![fullName isEqualToString:_fullName]) {
+//        [_fullName release];
+//        _fullName = [fullName retain];
+        
+    _fullName = fullName;
+        [self saveInfo];
+//    }
+}
+
+- (void)setFirstName:(NSString *)firstName {
+//    if (![_firstName isEqualToString:firstName]) {
+//        [_firstName release];
+//        _firstName = [firstName retain];
+        
+    _firstName = firstName;
+        [self saveInfo];
+//    }
+}
+
+- (void)setMiddleName:(NSString *)middleName {
+//    if (![_middleName isEqualToString:middleName]) {
+//        [_middleName release];
+//        _middleName = [middleName retain];
+        
+    _middleName = middleName;
+        [self saveInfo];
+//    }
+}
+
+- (void)setLastName:(NSString *)lastName {
+//    if (![_lastName isEqualToString:lastName]) {
+//        [_lastName release];
+//        _lastName = [lastName retain];
+    _lastName = lastName;
+        [self saveInfo];
+//    }
+}
+
+- (void)setStreet1:(NSString *)street1 {
+//    if (![_street1 isEqualToString:street1]) {
+//        [_street1 release];
+//        _street1 = [street1 retain];
+        
+    _street1 = street1;
+        [self saveInfo];
+//    }
+}
+
+- (void)setStreet2:(NSString *)street2 {
+//    if (![_street2 isEqualToString:street2]) {
+//        [_street2 release];
+//        _street2 = [street2 retain];
+        
+    _street2 = street2;
+        [self saveInfo];
+//    }
+}
+
+- (void)setCity:(NSString *)city {
+//    if (![_city isEqualToString:city]) {
+//        [_city release];
+//        _city = [city retain];
+        
+    _city = city;
+        [self saveInfo];
+//    }
+}
+
+- (void)setState:(NSString *)state {
+//    if (![_state isEqualToString:state]) {
+//        [_state release];
+//        _state = [state retain];
+        
+    _state = state;
+        [self saveInfo];
+//    }
+}
+
+- (void)setZip:(NSString *)zip {
+//    if (![_zip isEqualToString:zip]) {
+//        [_zip release];
+//        _zip = [zip retain];
+        
+    _zip = zip;
+        [self saveInfo];
+//    }
+}
+
+- (void)setCountry:(NSString *)country {
+//    if (![_country isEqualToString:country]) {
+//        [_country release];
+//        _country = [country retain];
+        
+    _country = country;
+        [self saveInfo];
+//    }
+}
+
+
+- (void)setEmail:(NSString *)email {
+//    if (![_email isEqualToString:email]) {
+//        [_email release];
+//        _email = [email retain];
+        
+    _email = email;
+        [self saveInfo];
+//    }
+}
+
+- (void)setTel:(NSString *)tel {
+//    if (![_tel isEqualToString:tel]) {
+//        [_tel release];
+//        _tel = [tel retain];
+    _tel = tel;
+        [self saveInfo];
+//    }
+}
+
+- (void)setBirthDate:(NSString *)birthDate {
+//    if (![_birthDate isEqualToString:birthDate]) {
+//        [_birthDate release];
+//        _birthDate = [birthDate retain];
+        
+    _birthDate = birthDate;
+        [self saveInfo];
+//    }
+}
+
+- (void)setCustomInfoArray:(NSMutableArray *)customInfoArray {
+//    if (![customInfoArray isEqual:customInfoArray]) {
+//        [customInfoArray release];
+//        _customInfoArray  = [customInfoArray retain];
+        
+    _customInfoArray = customInfoArray;
+        [self saveInfo];
+//    }
+}
+
+#pragma mark -  Init Methods
+
++ (instancetype)sharedInstance {
+    static dispatch_once_t onceToken;
+    static KMProfileInfo *manager = nil;
+    dispatch_once(&onceToken, ^{
+        NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+        NSData *encodedObject = [defaults objectForKey:KMProfileUnarchiveKey];
+        if (!encodedObject) {
+            manager = [[KMProfileInfo alloc] init];
+            [manager setBaseInfo];
+            [manager saveInfo];
+        } else {
+            manager = [NSKeyedUnarchiver unarchiveObjectWithData:encodedObject];
+        }
+        
+    });
+    return manager;
+}
+
+#pragma mark - Private Methods
+
+- (void)saveInfo {
+    NSData *encodedObject = [NSKeyedArchiver archivedDataWithRootObject:self];
+    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+    [defaults setObject:encodedObject forKey:KMProfileUnarchiveKey];
+    [defaults synchronize];
+}
+
+- (void)setBaseInfo {
+    _fullName = @"";
+    _firstName = @"";
+    _middleName = @"";
+    _lastName = @"";
+    
+    _street1 = @"";
+    _street2 = @"";
+    _city = @"";
+    _state = @"";
+    _zip = @"";
+    _country = @"";
+    
+    _email = @"";
+    _tel = @"";
+    
+    _birthDate = @"";
+    _customInfoArray = [NSMutableArray array];
+}
+
+
+- (void)replaceObjectInCustomInfoArrayAtIndex:(NSInteger)index withObject:(id)object {
+    [self.customInfoArray replaceObjectAtIndex:index withObject:object];
+    [self saveInfo];
+}
+
+- (void)removeObjectFromCustomInfoArrayAtIndex:(NSUInteger)index {
+    [self.customInfoArray removeObjectAtIndex:index];
+    [self saveInfo];
+}
+
+- (void)insertObject:(id)object inCustomInfoArrayAtIndex:(NSInteger)index {
+    [self.customInfoArray insertObject:object atIndex:index];
+    [self saveInfo];
+}
+
+#pragma mark - NSCoding
+
+- (void)encodeWithCoder:(NSCoder *)aCoder {
+    [aCoder encodeObject:self.fullName forKey:KMProfileSaveInfoFullNameKey];
+    [aCoder encodeObject:self.firstName forKey:KMProfileSaveInfoFirstNameKey];
+    [aCoder encodeObject:self.middleName forKey:KMProfileSaveInfoMiddleNameKey];
+    [aCoder encodeObject:self.lastName forKey:KMProfileSaveInfoLastNameKey];
+    
+    [aCoder encodeObject:self.street1 forKey:KMProfileSaveInfoStreet1Key];
+    [aCoder encodeObject:self.street2 forKey:KMProfileSaveInfoStreet2Key];
+    [aCoder encodeObject:self.city forKey:KMProfileSaveInfoCityKey];
+    [aCoder encodeObject:self.state forKey:KMProfileSaveInfoStateKey];
+    [aCoder encodeObject:self.zip forKey:KMProfileSaveInfoZipKey];
+    [aCoder encodeObject:self.country forKey:KMProfileSaveInfoCountryKey];
+    
+    [aCoder encodeObject:self.email forKey:KMProfileSaveInfoEmailKey];
+    [aCoder encodeObject:self.tel forKey:KMProfileSaveInfoTelKey];
+    
+    [aCoder encodeObject:self.birthDate forKey:KMProfileSaveInfoBirthDateKey];
+    [aCoder encodeObject:self.customInfoArray forKey:KMProfileSaveInfoCustomInfoKey];
+}
+
+- (instancetype)initWithCoder:(NSCoder *)aDecoder {
+    if (self = [super init]) {
+        _fullName = [aDecoder decodeObjectForKey:KMProfileSaveInfoFullNameKey] ?:@"";
+        _firstName = [aDecoder decodeObjectForKey:KMProfileSaveInfoFirstNameKey] ?:@"";
+        _middleName = [aDecoder decodeObjectForKey:KMProfileSaveInfoMiddleNameKey] ?:@"";
+        _lastName = [aDecoder decodeObjectForKey:KMProfileSaveInfoLastNameKey] ?:@"";
+        
+        _street1 = [aDecoder decodeObjectForKey:KMProfileSaveInfoStreet1Key] ?:@"";
+        _street2 = [aDecoder decodeObjectForKey:KMProfileSaveInfoStreet2Key] ?:@"";
+        _city = [aDecoder decodeObjectForKey:KMProfileSaveInfoCityKey] ?:@"";
+        _state = [aDecoder decodeObjectForKey:KMProfileSaveInfoStateKey] ?:@"";
+        _zip = [aDecoder decodeObjectForKey:KMProfileSaveInfoZipKey] ?:@"";
+        _country = [aDecoder decodeObjectForKey:KMProfileSaveInfoCountryKey] ?:@"";
+        
+        _email = [aDecoder decodeObjectForKey:KMProfileSaveInfoEmailKey] ?:@"";
+        
+        _tel = [aDecoder decodeObjectForKey:KMProfileSaveInfoTelKey] ?:@"";
+        
+        _birthDate = [aDecoder decodeObjectForKey:KMProfileSaveInfoBirthDateKey] ?:@"";
+        _customInfoArray = [aDecoder decodeObjectForKey:KMProfileSaveInfoCustomInfoKey]?: [NSMutableArray array];
+    }
+    return self;
+}
+
+- (NSString *)description {
+    return [NSString stringWithFormat:@"fullName:%@,firstName:%@,middleName:%@,lastName:%@,street1:%@,street2:%@,city:%@,zip:%@,country:%@,email:%@,tel:%@,birthdate:%@,customInfo:%@",self.fullName,self.firstName,self.middleName,self.lastName,self.street1,self.street2,self.city,self.zip,self.country,self.email,self.tel,self.birthDate,self.customInfoArray];
+}
+
+
+@end
+
+static NSString  *TitleCellIdentifier = @"TitleCell";
+static NSString  *NormalCellIdentifier = @"Normal";
+
+@interface KMProfileInfoWindowController () <NSTableViewDelegate, NSTableViewDataSource, NSTextFieldDelegate>
+
+@property (assign) IBOutlet NSTextField *titleLabel;
+@property (assign) IBOutlet NSTableView *tableView;
+@property (nonatomic, retain) NSMutableArray *tableContents;
+@property (assign) IBOutlet NSButton *backButton;
+@property (assign) IBOutlet NSButton *addButton;
+@property (assign) IBOutlet NSButton *addNewInfoButton;
+@property (assign) IBOutlet NSButton *removeNewInfoButton;
+
+@end
+
+@implementation KMProfileInfoWindowController
+
+- (void)dealloc {
+    
+//    [_tableContents release];
+    [NSDistributedNotificationCenter.defaultCenter removeObserver:self];
+    
+//    [super dealloc];
+}
+
+#pragma mark - Life Cycle
+- (void)windowDidLoad {
+    [super windowDidLoad];
+    
+    [self configuViews];
+    [self fetchDisplayKeys];
+    [self.tableView reloadData];
+    [NSDistributedNotificationCenter.defaultCenter addObserver:self selector:@selector(themeChanged:) name:@"AppleInterfaceThemeChangedNotification" object: nil];
+}
+
+#pragma mark - Private Methods
+
+- (void)configuViews {
+    
+    self.titleLabel.stringValue = NSLocalizedString(@"My Profile", nil);
+
+    //Button Part
+    self.backButton.title = NSLocalizedString(@"Cancel", nil);
+    self.addButton.title = NSLocalizedString(@"Add to Doc", nil);
+    self.addButton.enabled = NO;
+    self.removeNewInfoButton.enabled = NO;
+    //NSMenu Part
+    NSMenuItem *editItem = [self.tableView.menu itemAtIndex:0];
+    NSMenuItem *addItem = [self.tableView.menu itemAtIndex:1];
+    NSMenuItem *deleteItem = [self.tableView.menu itemAtIndex:2];
+    
+    editItem.title = NSLocalizedString(@"Edit", nil);
+    addItem.title = NSLocalizedString(@"Add to Doc", nil);
+    deleteItem.title = NSLocalizedString(@"Delete", nil);
+}
+
+- (void)fetchDisplayKeys {
+    _tableContents = [NSMutableArray array];
+    [_tableContents addObject:NSLocalizedString(@"Name", nil)];
+    [_tableContents addObject:NSLocalizedString(@"Full Name", nil)];
+    [_tableContents addObject:NSLocalizedString(@"First Name", nil)];
+    [_tableContents addObject:NSLocalizedString(@"Middle Name", nil)];
+    [_tableContents addObject:NSLocalizedString(@"Last Name", nil)];
+    
+    [_tableContents addObject:NSLocalizedString(@"Address", nil)];
+    [_tableContents addObject:NSLocalizedString(@"Street 1", nil)];
+    [_tableContents addObject:NSLocalizedString(@"Street 2", nil)];
+    [_tableContents addObject:NSLocalizedString(@"City", nil)];
+    [_tableContents addObject:NSLocalizedString(@"State ", nil)];
+    [_tableContents addObject:NSLocalizedString(@"Zip", nil)];
+    [_tableContents addObject:NSLocalizedString(@"Country", nil)];
+    
+    [_tableContents addObject:NSLocalizedString(@"Contact Information", nil)];
+    [_tableContents addObject:NSLocalizedString(@"Email", nil)];
+    [_tableContents addObject:NSLocalizedString(@"Tel", nil)];
+    
+    [_tableContents addObject:NSLocalizedString(@"Dates", nil)];
+    [_tableContents addObject:NSLocalizedString(@"Date", nil)];
+    [_tableContents addObject:NSLocalizedString(@"Birth Date", nil)];
+    if ([KMProfileInfo sharedInstance].customInfoArray.count > 0) {
+        [_tableContents addObject:NSLocalizedString(@"Custom", nil)];
+        for (NSUInteger i = 0 ; i < [KMProfileInfo sharedInstance].customInfoArray.count; i ++) {
+            NSDictionary *dict = [[KMProfileInfo sharedInstance].customInfoArray objectAtIndex:i];
+            [_tableContents addObject:dict.allKeys.firstObject];
+        }
+    }
+}
+
+//- (void)configuTextField:(KMProfileCellView *)cellView {
+//    NSTextField * textField = cellView.detailtextField;
+//    NSInteger tag = textField.tag;
+//    NSString *placeHoldString = @"";
+//    NSString *nameString = @"";
+//
+//    if (tag == 1) {
+//        placeHoldString = NSLocalizedString(@"Add Full Name", nil);
+//        nameString = [KMProfileInfo sharedInstance].fullName;
+//    } else if (tag == 2) {
+//        placeHoldString = NSLocalizedString(@"Add First Name", nil);
+//        nameString = [KMProfileInfo sharedInstance].firstName;
+//    } else if (tag == 3) {
+//        placeHoldString = NSLocalizedString(@"Add Middle Name", nil);
+//        nameString = [KMProfileInfo sharedInstance].middleName;
+//    } else if (tag == 4) {
+//        placeHoldString = NSLocalizedString(@"Add Last Name", nil);
+//        nameString = [KMProfileInfo sharedInstance].lastName;
+//    } else if (tag == 6) {
+//        placeHoldString = NSLocalizedString(@"Add Street 1", nil);
+//        nameString = [KMProfileInfo sharedInstance].street1;
+//    } else if (tag == 7) {
+//        placeHoldString = NSLocalizedString(@"Add Street 2", nil);
+//        nameString = [KMProfileInfo sharedInstance].street2;
+//    } else if (tag == 8) {
+//
+//        placeHoldString = NSLocalizedString(@"Add City", nil);
+//        nameString = [KMProfileInfo sharedInstance].city;
+//    } else if (tag == 9) {
+//        placeHoldString = NSLocalizedString(@"Add State", nil);
+//        nameString = [KMProfileInfo sharedInstance].state;
+//    } else if (tag == 10) {
+//        placeHoldString = NSLocalizedString(@"Add Zip", nil);
+//        nameString = [KMProfileInfo sharedInstance].zip;
+//    } else if (tag == 11) {
+//        placeHoldString = NSLocalizedString(@"Add Country", nil);
+//        nameString = [KMProfileInfo sharedInstance].country;
+//    } else if (tag == 13) {
+//        placeHoldString = NSLocalizedString(@"Add Email", nil);
+//        nameString = [KMProfileInfo sharedInstance].email;
+//    } else if (tag == 14) {
+//        placeHoldString = NSLocalizedString(@"Add Tel", nil);
+//        nameString = [KMProfileInfo sharedInstance].tel;
+//    } else if (tag == 16) {
+//        placeHoldString = NSLocalizedString(@"Add Date", nil);
+//        NSDate *date = [NSDate date];
+//        NSDateFormatter *formatter = [[[NSDateFormatter alloc] init] autorelease];
+//        [formatter setDateFormat:@"YYYY/MM/dd"];
+//        nameString = [formatter stringFromDate:date];
+//    } else if (tag == 17) {
+//        placeHoldString = NSLocalizedString(@"Add Birth Date", nil);
+//        nameString = [KMProfileInfo sharedInstance].birthDate;
+//    }
+//    textField.stringValue = nameString;
+//    if (nameString.length > 0) {
+//        textField.hidden = NO;
+//        cellView.addButton.hidden = YES;
+//    } else {
+//        cellView.addButton.title = placeHoldString;
+//        textField.placeholderString = placeHoldString;
+//        textField.hidden = YES;
+//        cellView.addButton.tag = tag;
+//        cellView.addButton.target = self;
+//        [cellView.addButton setAction:@selector(addFileName_Add:)];
+//        [cellView.addButton setTitleColor:[NSColor systemBlueColor]];
+//        cellView.addButton.hidden = NO;
+//
+//    }
+//}
+
+#pragma mark - NSTableViewDelegate / NSTableViewDataSources
+
+- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView {
+    return self.tableContents.count;
+}
+
+- (CGFloat)tableView:(NSTableView *)tableView heightOfRow:(NSInteger)row {
+    NSString *addingString = [self.tableContents objectAtIndex:row];
+    NSInteger customIndex = [self.tableContents indexOfObject:NSLocalizedString(@"Custom", nil)];
+    if (([addingString isEqualToString:NSLocalizedString(@"Name", nil)] ||
+         [addingString isEqualToString:NSLocalizedString(@"Address", nil)] ||
+         [addingString isEqualToString:NSLocalizedString(@"Contact Information", nil)] ||
+         [addingString isEqualToString:NSLocalizedString(@"Dates", nil)] ||
+         [addingString isEqualToString:NSLocalizedString(@"Custom", nil)])
+        && row <= customIndex) {
+        return 24.0;
+    } else {
+        return 36.0;
+    }
+}
+
+- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
+    NSString *addingString = [self.tableContents objectAtIndex:row];
+    NSInteger customIndex = [self.tableContents indexOfObject:NSLocalizedString(@"Custom", nil)];
+    NSTableCellView *tableCellView = nil;
+    if (([addingString isEqualToString:NSLocalizedString(@"Name", nil)] ||
+        [addingString isEqualToString:NSLocalizedString(@"Address", nil)] ||
+        [addingString isEqualToString:NSLocalizedString(@"Contact Information", nil)] ||
+        [addingString isEqualToString:NSLocalizedString(@"Dates", nil)] ||
+        [addingString isEqualToString:NSLocalizedString(@"Custom", nil)])
+        && row <= customIndex) {
+        tableCellView = [tableView makeViewWithIdentifier:TitleCellIdentifier owner:tableColumn];
+//        KMProfileTitleCellView *cellView = (KMProfileTitleCellView *)tableCellView;
+//        cellView.textField.stringValue = addingString;
+//        cellView.textField.editable = NO;
+//        cellView.wantsLayer = YES;
+//        if (@available(macOS 10.14, *)) {
+//            if ([KMAppearance isDarkMode]) {
+//                cellView.layer.backgroundColor = [NSColor colorWithRed:73/255.0 green:75/255.0 blue:77/255.0 alpha:1.0].CGColor;
+//            } else {
+//                cellView.layer.backgroundColor = [NSColor colorWithRed:219/255.0 green:219/255.0 blue:219/255.0 alpha:1.0].CGColor;
+//            }
+//        } else {
+//            cellView.layer.backgroundColor = [NSColor colorWithRed:235.0/255.0 green:235.0/255.0 blue:235.0/255.0 alpha:1.0].CGColor;
+//        }
+        
+    } else {
+        tableCellView = [tableView makeViewWithIdentifier:NormalCellIdentifier owner:tableColumn];
+//        KMProfileCellView *cellView = (KMProfileCellView *)tableCellView;
+//        cellView.textField.stringValue = addingString;
+//        if([cellView isKindOfClass:[KMProfileCellView class]]){
+//            cellView.detailtextField.hidden = NO;
+//        }
+//        cellView.textField.textColor = [KMAppearance KMColor_Layout_H0];
+//        if (customIndex > row) {
+//            cellView.detailtextField.tag = row;
+//            [self configuTextField:cellView];
+//            cellView.textField.editable = NO;
+//            cellView.textField.selectable = NO;
+//            if ([addingString isEqualToString:NSLocalizedString(@"Date", nil)]) {
+//                cellView.detailtextField.editable = NO;
+//                cellView.detailtextField.selectable = NO;
+//            }
+//
+//            cellView.detailtextField.delegate = self;
+//        } else {
+//            NSInteger index = row - customIndex - 1;
+//            NSDictionary *dict = [[KMProfileInfo sharedInstance].customInfoArray objectAtIndex:index];
+//            cellView.addButton.hidden = YES;
+//            cellView.detailtextField.stringValue = dict.allValues.firstObject;
+//            cellView.detailtextField.placeholderString = NSLocalizedString(@"Type Value Here", nil);
+//            cellView.textField.placeholderString = NSLocalizedString(@"Type Label Here", nil);
+//            cellView.textField.editable = YES;
+//            cellView.textField.selectable = YES;
+//            cellView.detailtextField.editable = YES;
+//            cellView.detailtextField.selectable = YES;
+//            cellView.textField.delegate = self;
+//            cellView.detailtextField.delegate = self;
+//
+//        }
+    }
+    return tableCellView;
+}
+
+- (BOOL)tableView:(NSTableView *)tableView shouldSelectRow:(NSInteger)row {
+    NSString *addingString = [self.tableContents objectAtIndex:row];
+    NSInteger customIndex = [self.tableContents indexOfObject:NSLocalizedString(@"Custom", nil)];
+    if (([addingString isEqualToString:NSLocalizedString(@"Name", nil)] ||
+         [addingString isEqualToString:NSLocalizedString(@"Address", nil)] ||
+         [addingString isEqualToString:NSLocalizedString(@"Contact Information", nil)] ||
+         [addingString isEqualToString:NSLocalizedString(@"Dates", nil)] ||
+         [addingString isEqualToString:NSLocalizedString(@"Custom", nil)])
+        && row <= customIndex) {
+        return NO;
+    }
+    return YES;
+}
+
+
+
+#pragma mark - NSTextFieldDelegate
+
+- (void)controlTextDidChange:(NSNotification *)obj {
+    
+    NSInteger currentRow = self.tableView.selectedRow;
+    if (currentRow == -1) {
+        return;
+    }
+    NSTextField *textField = (NSTextField *)obj.object;
+//    KMProfileCellView *cellView = [self.tableView viewAtColumn:0 row:currentRow makeIfNecessary:NO];
+    if (currentRow == 1) {
+        [KMProfileInfo sharedInstance].fullName = textField.stringValue;
+    } else if (currentRow == 2) {
+        [KMProfileInfo sharedInstance].firstName = textField.stringValue;
+    } else if (currentRow == 3) {
+        [KMProfileInfo sharedInstance].middleName = textField.stringValue;
+    } else if (currentRow == 4) {
+        [KMProfileInfo sharedInstance].lastName = textField.stringValue;
+    } else if (currentRow == 6) {
+        [KMProfileInfo sharedInstance].street1 = textField.stringValue;
+    } else if (currentRow == 7) {
+        [KMProfileInfo sharedInstance].street2 = textField.stringValue;
+    } else if (currentRow == 8) {
+        [KMProfileInfo sharedInstance].city = textField.stringValue;
+    } else if (currentRow == 9) {
+        [KMProfileInfo sharedInstance].state = textField.stringValue;
+    } else if (currentRow == 10) {
+        [KMProfileInfo sharedInstance].zip = textField.stringValue;
+    } else if (currentRow == 11) {
+        [KMProfileInfo sharedInstance].country = textField.stringValue;
+    } else if (currentRow == 13) {
+        [KMProfileInfo sharedInstance].email = textField.stringValue;
+    } else if (currentRow == 14) {
+        [KMProfileInfo sharedInstance].tel = textField.stringValue;
+    } else if (currentRow == 16) {
+//        [KMProfileInfo sharedInstance].date = textField.stringValue;
+    } else if (currentRow == 17) {
+        [KMProfileInfo sharedInstance].birthDate = textField.stringValue;
+    } else if (currentRow >= 19 ) {
+        NSInteger customIndex = currentRow - 19;
+//        if (cellView) {
+//            NSDictionary *dict = [[KMProfileInfo sharedInstance].customInfoArray objectAtIndex:customIndex];
+//            NSString *originalKey = dict.allKeys.firstObject;
+//            NSString *originalValue = dict.allValues.firstObject;
+//            if ([textField isEqual:cellView.textField]) {
+//                NSDictionary *newDict = @{textField.stringValue : originalValue};
+//                [[KMProfileInfo sharedInstance] replaceObjectInCustomInfoArrayAtIndex:customIndex withObject:newDict];
+//            } else if ([textField isEqual:cellView.detailtextField]){
+//                NSDictionary *newDict = @{originalKey:textField.stringValue};
+//                [[KMProfileInfo sharedInstance] replaceObjectInCustomInfoArrayAtIndex:customIndex withObject:newDict];
+//            }
+//        }
+    }
+    
+//    if (cellView.detailtextField.stringValue.length > 0 ) {
+//        self.addButton.enabled = YES;
+//    } else {
+//        self.addButton.enabled = NO;
+//    }
+}
+
+- (void)controlTextDidBeginEditing:(NSNotification *)obj {
+    NSTextField *textField = obj.object;
+    BOOL isDarkMode = NO;
+    if (@available(macOS 10.14, *)) {
+        if ([[NSApplication sharedApplication].effectiveAppearance isEqual: [NSAppearance appearanceNamed:NSAppearanceNameDarkAqua]]) {
+            isDarkMode =YES;
+        }
+    }
+
+    textField.textColor = [NSColor labelColor];
+}
+
+- (void)controlTextDidEndEditing:(NSNotification *)obj;
+{
+    NSTextField *textField = obj.object;
+    NSInteger tag = textField.tag;
+//    KMProfileCellView *cellView = [self.tableView viewAtColumn:0 row:textField.tag makeIfNecessary:NO];
+
+//    if ([cellView isKindOfClass:[KMProfileCellView class]] && tag > 0) {
+//        NSString *placeHoldString = @"";
+//
+//        if (tag == 1) {
+//            placeHoldString = NSLocalizedString(@"Add Full Name", nil);
+//        } else if (tag == 2) {
+//            placeHoldString = NSLocalizedString(@"Add First Name", nil);
+//        } else if (tag == 3) {
+//            placeHoldString = NSLocalizedString(@"Add Middle Name", nil);
+//        } else if (tag == 4) {
+//            placeHoldString = NSLocalizedString(@"Add Last Name", nil);
+//        } else if (tag == 6) {
+//            placeHoldString = NSLocalizedString(@"Add Street 1", nil);
+//        } else if (tag == 7) {
+//            placeHoldString = NSLocalizedString(@"Add Street 2", nil);
+//        } else if (tag == 8) {
+//            placeHoldString = NSLocalizedString(@"Add City", nil);
+//        } else if (tag == 9) {
+//            placeHoldString = NSLocalizedString(@"Add State", nil);
+//        } else if (tag == 10) {
+//            placeHoldString = NSLocalizedString(@"Add Zip", nil);
+//        } else if (tag == 11) {
+//            placeHoldString = NSLocalizedString(@"Add Country", nil);
+//        } else if (tag == 13) {
+//            placeHoldString = NSLocalizedString(@"Add Email", nil);
+//        } else if (tag == 14) {
+//            placeHoldString = NSLocalizedString(@"Add Tel", nil);
+//        } else if (tag == 16) {
+//            placeHoldString = NSLocalizedString(@"Add Date", nil);
+//        } else if (tag == 17) {
+//            placeHoldString = NSLocalizedString(@"Add Birth Date", nil);
+//        }
+//
+//        if (textField.stringValue.length > 0) {
+//            textField.textColor = [NSColor secondaryLabelColor];
+//            textField.hidden = NO;
+//            cellView.addButton.hidden = YES;
+//        } else {
+////            textField.hidden = YES; //自定义新增,输入Label后,value为空时推出编辑,就无法填写了
+//            textField.placeholderString = @"";
+//            cellView.addButton.hidden = NO;
+//            cellView.addButton.tag = tag;
+//            cellView.addButton.target = self;
+//            [cellView.addButton setAction:@selector(addFileName_Add:)];
+//            cellView.addButton.title = placeHoldString;
+//            [cellView.addButton setTitleColor:[NSColor systemBlueColor]];
+//        }
+//    }
+    
+}
+
+- (void)tableViewSelectionDidChange:(NSNotification *)notification {
+    if (self.tableView.selectedRow == NSNotFound || self.tableView.selectedRow == -1) {
+        return;
+    }
+//    KMProfileCellView *cellView = [self.tableView viewAtColumn:0 row:self.tableView.selectedRow makeIfNecessary:NO];
+//    self.addButton.enabled = cellView.detailtextField.stringValue.length > 0;
+//
+//    for (NSInteger i = 0; i < self.tableView.numberOfRows; i++) {
+//        NSTableCellView *cellView =  [self.tableView viewAtColumn:0 row:i makeIfNecessary:NO];
+//        if ([cellView isKindOfClass:[KMProfileCellView class]]) {
+//            KMProfileCellView *cellView1 = (KMProfileCellView *)cellView;
+//            if (i == self.tableView.selectedRow) {
+//                cellView1.detailtextField.textColor = [NSColor whiteColor];
+//                [cellView1.addButton setTitleColor:[NSColor whiteColor]];
+//            } else {
+//                cellView1.detailtextField.textColor = [NSColor secondaryLabelColor];
+//                [cellView1.addButton setTitleColor:[NSColor systemBlueColor]];
+//            }
+//        }
+//    }
+    NSInteger customIndex = [self.tableContents indexOfObject:NSLocalizedString(@"Custom", nil)];
+    if (self.tableView.selectedRow > customIndex) {
+        self.removeNewInfoButton.enabled = YES;
+    } else {
+        self.removeNewInfoButton.enabled = NO;
+    }
+}
+
+#pragma  mark - Button Action
+
+- (IBAction)buttonClicked_back:(id)sender {
+//    [self dismissSheet:sender];
+}
+
+- (IBAction)buttonClicked_add:(id)sender {
+    NSInteger selectRow =self.tableView.selectedRow;
+    if (selectRow >= 0) {
+        if (self.callBack) {
+//            KMProfileCellView *cellView = [self.tableView viewAtColumn:0 row:self.tableView.selectedRow makeIfNecessary:NO];
+//            self.callBack(cellView.detailtextField.stringValue);
+//            [self dismissSheet:sender];
+        }
+    }
+}
+
+- (IBAction)buttonClicked_addNewInfo:(id)sender {
+    NSDictionary *dict = @{@"":@""};
+    [[KMProfileInfo sharedInstance] insertObject:dict inCustomInfoArrayAtIndex:[KMProfileInfo sharedInstance].customInfoArray.count];
+    [self fetchDisplayKeys];
+    [self.tableView reloadData];
+    if (self.tableView.numberOfRows > 1) {
+        [self.tableView scrollRowToVisible:self.tableView.numberOfRows - 1];
+        NSIndexSet *set = [NSIndexSet indexSetWithIndex:self.tableView.numberOfRows - 1];
+        [self.tableView selectRowIndexes:set byExtendingSelection:NO];
+//        KMProfileCellView *cellView = [self.tableView viewAtColumn:0 row:self.tableView.selectedRow makeIfNecessary:NO];
+//        cellView.addButton.hidden = YES;
+//        [cellView.textField becomeFirstResponder];
+    };
+}
+
+- (IBAction)buttonClicked_RemoveNewInfo:(id)sender
+{
+    NSInteger  editIndex = self.tableView.selectedRow;
+    NSUInteger customIndex = [self.tableContents indexOfObject:NSLocalizedString(@"Custom", nil)];
+    if (editIndex - customIndex - 1 < [KMProfileInfo sharedInstance].customInfoArray.count) {
+        [[KMProfileInfo sharedInstance] removeObjectFromCustomInfoArrayAtIndex:editIndex - customIndex - 1];
+        [self fetchDisplayKeys];
+        [self.tableView reloadData];
+        self.removeNewInfoButton.enabled = NO;
+    }
+}
+
+- (IBAction)addFileName_Add:(NSButton *)sender
+{
+    [self.window makeFirstResponder:nil];
+    NSInteger tag = sender.tag;
+//    KMProfileCellView *cellView = [self.tableView viewAtColumn:0 row:tag makeIfNecessary:NO];
+//    if ([cellView isKindOfClass:[KMProfileCellView class]]) {
+//        cellView.addButton.hidden = YES;
+//        cellView.detailtextField.hidden = NO;
+//        [cellView.detailtextField becomeFirstResponder];
+//    }
+}
+
+#pragma mark - NSMenu Action
+
+- (IBAction)menuItemClicked_Edit:(id)sender {
+//    KMProfileCellView *cellView = [self.tableView viewAtColumn:0 row:self.tableView.clickedRow makeIfNecessary:NO];
+//    NSIndexSet *set = [NSIndexSet indexSetWithIndex:self.tableView.clickedRow];
+//    [self.tableView selectRowIndexes:set byExtendingSelection:NO];
+//    if (cellView.textField.editable) {
+//        if (cellView.textField.stringValue.length == 0) {
+//            [cellView.textField becomeFirstResponder];
+//        }else {
+//            [cellView.detailtextField becomeFirstResponder];
+//        }
+//    } else {
+//        [cellView.detailtextField becomeFirstResponder];
+//    }
+}
+
+- (IBAction)menuItemClicked_Add:(id)sender {
+//     KMProfileCellView *cellView = [self.tableView viewAtColumn:0 row:self.tableView.clickedRow makeIfNecessary:NO];
+//    if (self.callBack) {
+//        self.callBack(cellView.detailtextField.stringValue);
+//        [self dismissSheet:sender];
+//    }
+}
+
+- (IBAction)menuItemClicked_Delete:(id)sender {
+    NSInteger  editIndex = self.tableView.clickedRow;
+    NSInteger customIndex = [self.tableContents indexOfObject:NSLocalizedString(@"Custom", nil)];
+    if (editIndex < customIndex ) {
+        switch (editIndex) {
+            case 1:
+                [KMProfileInfo sharedInstance].fullName = @"";
+                break;
+            case 2:
+                [KMProfileInfo sharedInstance].firstName = @"";
+                break;
+            case 3:
+                [KMProfileInfo sharedInstance].middleName = @"";
+                break;
+            case 4:
+                [KMProfileInfo sharedInstance].lastName = @"";
+                break;
+                
+            case 6:
+                [KMProfileInfo sharedInstance].street1 = @"";
+                break;
+            case 7:
+                [KMProfileInfo sharedInstance].street2 = @"";
+                break;
+            case 8:
+                [KMProfileInfo sharedInstance].city = @"";
+                break;
+            case 9:
+                [KMProfileInfo sharedInstance].state = @"";
+                break;
+            case 10:
+                [KMProfileInfo sharedInstance].zip = @"";
+                break;
+            case 11:
+                [KMProfileInfo sharedInstance].country = @"";
+                break;
+            case 13:
+                [KMProfileInfo sharedInstance].email = @"";
+                break;
+            case 14:
+                [KMProfileInfo sharedInstance].tel = @"";
+                break;
+            case 16:
+//                [KMProfileInfo sharedInstance].date = @"";
+                break;
+            case 17:
+                [KMProfileInfo sharedInstance].birthDate = @"";
+                break;
+            default:
+                break;
+        }
+    } else {
+        [[KMProfileInfo sharedInstance] removeObjectFromCustomInfoArrayAtIndex:editIndex - customIndex - 1];
+    }
+    
+    [self fetchDisplayKeys];
+    [self.tableView reloadData];
+}
+
+- (BOOL)validateMenuItem:(NSMenuItem *)menuItem {
+    
+//    NSTableCellView *cellView = [self.tableView viewAtColumn:0 row:self.tableView.clickedRow makeIfNecessary:NO];
+//    if (menuItem.action == @selector(menuItemClicked_Edit:)) {
+//        if ([cellView isKindOfClass:[KMProfileTitleCellView class]]) {
+//            return NO;
+//        } else {
+//            KMProfileCellView *cellView1 = (KMProfileCellView *)cellView;
+//            if ([cellView1.textField.stringValue isEqualToString:NSLocalizedString(@"Date", nil)]) {
+//                return NO;
+//            }
+//            return YES;
+//        }
+//        
+//    } else if (menuItem.action == @selector(menuItemClicked_Add:)) {
+//        if ([cellView isKindOfClass:[KMProfileTitleCellView class]]) {
+//            return NO;
+//        } else {
+//            KMProfileCellView *cell = (KMProfileCellView *)cellView;
+//            return cell.detailtextField.stringValue.length > 0;
+//        }
+//    } else if (menuItem.action == @selector(menuItemClicked_Delete:)) {
+//        if ([cellView isKindOfClass:[KMProfileTitleCellView class]]) {
+//            return NO;
+//        } else {
+//            KMProfileCellView *cellView1 = (KMProfileCellView *)cellView;
+//            if ([cellView1.textField.stringValue isEqualToString:NSLocalizedString(@"Date", nil)]) {
+//                return NO;
+//            }
+//            return YES;
+//        }
+//    }
+    return NO;
+}
+
+- (void)themeChanged:(NSNotification *)notification {
+    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+        [self updateViewColor];
+    });
+}
+
+- (void)updateViewColor {
+    [self.tableView reloadData];
+}
+
+@end

+ 300 - 0
PDF Office/PDF Master/Class/PDFTools/SelfSign/Window/KMProfileInfoWindowController.xib

@@ -0,0 +1,300 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
+        <capability name="Named colors" minToolsVersion="9.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="KMProfileInfoWindowController" customModule="PDF_Master" customModuleProvider="target">
+            <connections>
+                <outlet property="addButton" destination="Tj7-dF-cXg" id="zcz-NP-Al4"/>
+                <outlet property="addNewInfoButton" destination="KmW-Wb-5U4" id="axV-bJ-832"/>
+                <outlet property="backButton" destination="2Ne-wD-bDF" id="Xbs-f3-Q7i"/>
+                <outlet property="removeNewInfoButton" destination="Sbl-ux-3gS" id="Wr9-gh-D9r"/>
+                <outlet property="tableView" destination="ldR-2V-TXt" id="mGw-v2-bzz"/>
+                <outlet property="titleLabel" destination="HcI-gL-dgj" id="iJm-b9-QYW"/>
+                <outlet property="window" destination="F0z-JX-Cv5" id="gIp-Ho-8D9"/>
+            </connections>
+        </customObject>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="F0z-JX-Cv5">
+            <windowStyleMask key="styleMask" titled="YES" closable="YES" resizable="YES"/>
+            <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
+            <rect key="contentRect" x="196" y="240" width="585" height="460"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="1440" height="875"/>
+            <value key="minSize" type="size" width="350" height="250"/>
+            <value key="maxSize" type="size" width="700" height="460"/>
+            <view key="contentView" misplaced="YES" id="se5-gp-TjO">
+                <rect key="frame" x="0.0" y="0.0" width="585" height="460"/>
+                <autoresizingMask key="autoresizingMask"/>
+                <subviews>
+                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="ld4-iP-eeZ">
+                        <rect key="frame" x="0.0" y="0.0" width="664" height="52"/>
+                        <subviews>
+                            <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="2Ne-wD-bDF">
+                                <rect key="frame" x="502" y="9" width="64" height="32"/>
+                                <buttonCell key="cell" type="push" title="back" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="9lt-zT-GNH">
+                                    <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                    <font key="font" metaFont="system"/>
+                                    <connections>
+                                        <action selector="buttonClicked_back:" target="-2" id="t4i-gz-ehx"/>
+                                    </connections>
+                                </buttonCell>
+                            </button>
+                            <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Tj7-dF-cXg">
+                                <rect key="frame" x="559" y="9" width="96" height="32"/>
+                                <buttonCell key="cell" type="push" title="addToDoc" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="XDJ-oH-X8r">
+                                    <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                    <font key="font" metaFont="system"/>
+                                    <string key="keyEquivalent" base64-UTF8="YES">
+DQ
+</string>
+                                </buttonCell>
+                                <connections>
+                                    <action selector="buttonClicked_add:" target="-2" id="oXc-oV-Vpe"/>
+                                </connections>
+                            </button>
+                        </subviews>
+                        <constraints>
+                            <constraint firstItem="2Ne-wD-bDF" firstAttribute="centerY" secondItem="ld4-iP-eeZ" secondAttribute="centerY" id="L2Q-wZ-7Qn"/>
+                            <constraint firstItem="Tj7-dF-cXg" firstAttribute="centerY" secondItem="ld4-iP-eeZ" secondAttribute="centerY" id="W1a-JM-EXj"/>
+                            <constraint firstItem="Tj7-dF-cXg" firstAttribute="leading" secondItem="2Ne-wD-bDF" secondAttribute="trailing" constant="7" id="XJa-Dw-YJP"/>
+                            <constraint firstAttribute="height" constant="52" id="cVn-Ih-aOn"/>
+                            <constraint firstAttribute="trailing" secondItem="Tj7-dF-cXg" secondAttribute="trailing" constant="16" id="n4E-eh-acP"/>
+                        </constraints>
+                    </customView>
+                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="8IG-xp-hB5">
+                        <rect key="frame" x="40" y="52" width="584" height="22"/>
+                        <subviews>
+                            <button translatesAutoresizingMaskIntoConstraints="NO" id="Sbl-ux-3gS">
+                                <rect key="frame" x="21" y="0.0" width="20" height="22"/>
+                                <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="KMImageNameUXIconToolbarZoomoutNor" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="B7R-YA-mMq">
+                                    <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                    <font key="font" metaFont="system"/>
+                                </buttonCell>
+                                <connections>
+                                    <action selector="buttonClicked_RemoveNewInfo:" target="-2" id="poj-My-gCu"/>
+                                </connections>
+                            </button>
+                            <box horizontalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="ubN-Bj-TQt">
+                                <rect key="frame" x="18" y="0.0" width="5" height="22"/>
+                            </box>
+                            <box horizontalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="YUm-cY-YeD">
+                                <rect key="frame" x="581" y="1" width="5" height="21"/>
+                            </box>
+                            <box horizontalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="hDb-ID-CoI">
+                                <rect key="frame" x="-2" y="1" width="5" height="21"/>
+                            </box>
+                            <box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="9ku-iC-wEd">
+                                <rect key="frame" x="0.0" y="-2" width="584" height="5"/>
+                            </box>
+                            <button translatesAutoresizingMaskIntoConstraints="NO" id="KmW-Wb-5U4">
+                                <rect key="frame" x="0.0" y="0.0" width="20" height="22"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="20" id="wpe-Mn-tqL"/>
+                                </constraints>
+                                <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="KMImageNameUXIconToolbarZoominNor" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="GmD-SX-voJ">
+                                    <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                    <font key="font" metaFont="system"/>
+                                </buttonCell>
+                                <connections>
+                                    <action selector="buttonClicked_addNewInfo:" target="-2" id="vhq-MM-wrg"/>
+                                </connections>
+                            </button>
+                        </subviews>
+                        <constraints>
+                            <constraint firstItem="hDb-ID-CoI" firstAttribute="top" secondItem="8IG-xp-hB5" secondAttribute="top" id="69m-j3-cMG"/>
+                            <constraint firstItem="hDb-ID-CoI" firstAttribute="leading" secondItem="8IG-xp-hB5" secondAttribute="leading" id="9Ot-go-ky1"/>
+                            <constraint firstAttribute="height" constant="22" id="ATZ-PO-Hfj"/>
+                            <constraint firstItem="ubN-Bj-TQt" firstAttribute="leading" secondItem="KmW-Wb-5U4" secondAttribute="trailing" id="BXe-D7-QO6"/>
+                            <constraint firstItem="ubN-Bj-TQt" firstAttribute="top" secondItem="8IG-xp-hB5" secondAttribute="top" id="Ep8-io-x5z"/>
+                            <constraint firstAttribute="bottom" secondItem="KmW-Wb-5U4" secondAttribute="bottom" id="HtU-gx-6a0"/>
+                            <constraint firstAttribute="trailing" secondItem="YUm-cY-YeD" secondAttribute="trailing" id="J0z-wx-1vA"/>
+                            <constraint firstItem="Sbl-ux-3gS" firstAttribute="leading" secondItem="ubN-Bj-TQt" secondAttribute="trailing" id="MRe-vS-Gcr"/>
+                            <constraint firstItem="KmW-Wb-5U4" firstAttribute="leading" secondItem="8IG-xp-hB5" secondAttribute="leading" id="O3A-XZ-mS5"/>
+                            <constraint firstItem="9ku-iC-wEd" firstAttribute="leading" secondItem="8IG-xp-hB5" secondAttribute="leading" id="OPB-D9-AKa"/>
+                            <constraint firstAttribute="bottom" secondItem="9ku-iC-wEd" secondAttribute="bottom" id="X85-VO-swj"/>
+                            <constraint firstAttribute="bottom" secondItem="ubN-Bj-TQt" secondAttribute="bottom" id="XQO-z4-VkY"/>
+                            <constraint firstAttribute="bottom" secondItem="Sbl-ux-3gS" secondAttribute="bottom" id="Xq5-jb-Ovf"/>
+                            <constraint firstItem="YUm-cY-YeD" firstAttribute="top" secondItem="8IG-xp-hB5" secondAttribute="top" id="c6Y-zX-Ix9"/>
+                            <constraint firstItem="KmW-Wb-5U4" firstAttribute="top" secondItem="8IG-xp-hB5" secondAttribute="top" id="eK5-TZ-mXc"/>
+                            <constraint firstAttribute="bottom" secondItem="YUm-cY-YeD" secondAttribute="bottom" constant="1" id="iMB-6e-aDV"/>
+                            <constraint firstAttribute="trailing" secondItem="9ku-iC-wEd" secondAttribute="trailing" id="k0H-bD-87F"/>
+                            <constraint firstAttribute="bottom" secondItem="hDb-ID-CoI" secondAttribute="bottom" constant="1" id="txW-N9-L1f"/>
+                            <constraint firstItem="Sbl-ux-3gS" firstAttribute="top" secondItem="8IG-xp-hB5" secondAttribute="top" id="xxe-ar-qou"/>
+                        </constraints>
+                    </customView>
+                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="HcI-gL-dgj">
+                        <rect key="frame" x="38" y="400" width="37" height="18"/>
+                        <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="YeK-uM-b3g">
+                            <font key="font" size="13" name="PingFangSC-Regular"/>
+                            <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                        </textFieldCell>
+                    </textField>
+                    <scrollView autohidesScrollers="YES" horizontalLineScroll="17" horizontalPageScroll="10" verticalLineScroll="17" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="P2P-jH-JNm">
+                        <rect key="frame" x="40" y="74" width="584" height="325"/>
+                        <clipView key="contentView" id="Txz-Kp-TvA">
+                            <rect key="frame" x="1" y="1" width="582" height="323"/>
+                            <autoresizingMask key="autoresizingMask"/>
+                            <subviews>
+                                <tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnSelection="YES" multipleSelection="NO" autosaveColumns="NO" rowSizeStyle="automatic" viewBased="YES" id="ldR-2V-TXt">
+                                    <rect key="frame" x="0.0" y="0.0" width="582" height="323"/>
+                                    <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                    <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                    <color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
+                                    <tableColumns>
+                                        <tableColumn identifier="TitleCell" width="506" minWidth="40" maxWidth="1000" id="3Ky-VI-wQR">
+                                            <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border">
+                                                <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
+                                                <color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
+                                            </tableHeaderCell>
+                                            <textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" title="Text Cell" id="tMi-bQ-lKm">
+                                                <font key="font" metaFont="system"/>
+                                                <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                                                <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                            </textFieldCell>
+                                            <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
+                                            <prototypeCellViews>
+                                                <tableCellView identifier="Normal" misplaced="YES" id="VL0-rw-bVq" customClass="KMProfileCellView">
+                                                    <rect key="frame" x="10" y="0.0" width="518" height="17"/>
+                                                    <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                                    <subviews>
+                                                        <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ZQO-rE-tFu">
+                                                            <rect key="frame" x="483" y="0.0" width="29" height="16"/>
+                                                            <buttonCell key="cell" type="bevel" title="Add" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="RWe-0p-QXt">
+                                                                <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                                                <font key="font" metaFont="system"/>
+                                                            </buttonCell>
+                                                        </button>
+                                                        <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="jaJ-ef-ZVq" customClass="KMProfileTextField">
+                                                            <rect key="frame" x="6" y="-1" width="171" height="18"/>
+                                                            <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" title="dsfdfsdf" id="ZHq-Kp-fZd">
+                                                                <font key="font" size="13" name="PingFangSC-Regular"/>
+                                                                <color key="textColor" name="KM_242424_ColorDarkChange01"/>
+                                                                <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                            </textFieldCell>
+                                                        </textField>
+                                                        <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="EAb-dY-AtZ" customClass="KMProfileTextField">
+                                                            <rect key="frame" x="173" y="-1" width="339" height="18"/>
+                                                            <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" alignment="right" title="ddddd" id="5VQ-la-WIf">
+                                                                <font key="font" size="13" name="PingFangSC-Regular"/>
+                                                                <color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
+                                                                <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                            </textFieldCell>
+                                                        </textField>
+                                                    </subviews>
+                                                    <constraints>
+                                                        <constraint firstItem="EAb-dY-AtZ" firstAttribute="centerY" secondItem="VL0-rw-bVq" secondAttribute="centerY" id="A0K-4q-s7w"/>
+                                                        <constraint firstItem="jaJ-ef-ZVq" firstAttribute="centerY" secondItem="VL0-rw-bVq" secondAttribute="centerY" id="OdE-Rq-b7d"/>
+                                                        <constraint firstItem="jaJ-ef-ZVq" firstAttribute="leading" secondItem="VL0-rw-bVq" secondAttribute="leading" constant="8" id="YXW-5a-WqG"/>
+                                                        <constraint firstItem="ZQO-rE-tFu" firstAttribute="top" secondItem="VL0-rw-bVq" secondAttribute="top" id="bvf-F1-40d"/>
+                                                        <constraint firstItem="EAb-dY-AtZ" firstAttribute="width" secondItem="jaJ-ef-ZVq" secondAttribute="width" multiplier="2" id="e4b-3E-fIw"/>
+                                                        <constraint firstAttribute="trailing" secondItem="EAb-dY-AtZ" secondAttribute="trailing" constant="8" id="iFY-le-dco"/>
+                                                        <constraint firstAttribute="trailing" secondItem="ZQO-rE-tFu" secondAttribute="trailing" constant="6" id="mdU-p5-hY4"/>
+                                                        <constraint firstAttribute="bottom" secondItem="ZQO-rE-tFu" secondAttribute="bottom" id="sCF-w5-ZY2"/>
+                                                        <constraint firstItem="EAb-dY-AtZ" firstAttribute="leading" secondItem="jaJ-ef-ZVq" secondAttribute="trailing" id="ztg-X6-zhR"/>
+                                                    </constraints>
+                                                    <connections>
+                                                        <outlet property="addButton" destination="ZQO-rE-tFu" id="FA7-Ug-eVA"/>
+                                                        <outlet property="detailtextField" destination="EAb-dY-AtZ" id="h0a-9f-ePm"/>
+                                                        <outlet property="textField" destination="jaJ-ef-ZVq" id="GzH-wx-MQQ"/>
+                                                    </connections>
+                                                </tableCellView>
+                                                <tableCellView identifier="TitleCell" id="FUh-ze-Iiz" customClass="KMProfileTitleCellView">
+                                                    <rect key="frame" x="10" y="17" width="518" height="17"/>
+                                                    <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                                    <subviews>
+                                                        <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="o1d-Zx-TaD">
+                                                            <rect key="frame" x="3" y="1" width="33" height="16"/>
+                                                            <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="pmF-xq-IBN">
+                                                                <font key="font" size="11" name="PingFangSC-Semibold"/>
+                                                                <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                                <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                            </textFieldCell>
+                                                        </textField>
+                                                    </subviews>
+                                                    <constraints>
+                                                        <constraint firstItem="o1d-Zx-TaD" firstAttribute="centerY" secondItem="FUh-ze-Iiz" secondAttribute="centerY" id="A5L-ob-xmD"/>
+                                                        <constraint firstItem="o1d-Zx-TaD" firstAttribute="leading" secondItem="FUh-ze-Iiz" secondAttribute="leading" constant="5" id="mgx-Xf-3yY"/>
+                                                    </constraints>
+                                                    <connections>
+                                                        <outlet property="textField" destination="o1d-Zx-TaD" id="V4X-CZ-Af0"/>
+                                                    </connections>
+                                                </tableCellView>
+                                            </prototypeCellViews>
+                                        </tableColumn>
+                                    </tableColumns>
+                                    <connections>
+                                        <outlet property="dataSource" destination="-2" id="oRu-K9-FU9"/>
+                                        <outlet property="delegate" destination="-2" id="bcN-by-WoW"/>
+                                        <outlet property="menu" destination="Opp-56-iVw" id="5xN-ca-p1A"/>
+                                    </connections>
+                                </tableView>
+                            </subviews>
+                        </clipView>
+                        <scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" controlSize="mini" horizontal="YES" id="bZH-pn-OyO">
+                            <rect key="frame" x="1" y="119" width="223" height="11"/>
+                            <autoresizingMask key="autoresizingMask"/>
+                        </scroller>
+                        <scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" controlSize="mini" horizontal="NO" id="BoA-b4-cU6">
+                            <rect key="frame" x="224" y="17" width="11" height="102"/>
+                            <autoresizingMask key="autoresizingMask"/>
+                        </scroller>
+                    </scrollView>
+                </subviews>
+                <constraints>
+                    <constraint firstAttribute="trailing" secondItem="ld4-iP-eeZ" secondAttribute="trailing" id="48J-S0-tt0"/>
+                    <constraint firstItem="P2P-jH-JNm" firstAttribute="top" secondItem="HcI-gL-dgj" secondAttribute="bottom" constant="1" id="LSd-Ms-fXE"/>
+                    <constraint firstAttribute="trailing" secondItem="8IG-xp-hB5" secondAttribute="trailing" constant="40" id="O0F-0n-sB6"/>
+                    <constraint firstItem="8IG-xp-hB5" firstAttribute="top" secondItem="P2P-jH-JNm" secondAttribute="bottom" id="PHk-Yd-1N8"/>
+                    <constraint firstItem="8IG-xp-hB5" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="40" id="PfW-Kc-ij0"/>
+                    <constraint firstAttribute="bottom" secondItem="ld4-iP-eeZ" secondAttribute="bottom" id="QDV-Xo-b0I"/>
+                    <constraint firstItem="HcI-gL-dgj" firstAttribute="top" secondItem="se5-gp-TjO" secondAttribute="top" constant="18" id="TV2-D6-WP0"/>
+                    <constraint firstItem="ld4-iP-eeZ" firstAttribute="top" secondItem="P2P-jH-JNm" secondAttribute="bottom" constant="22" id="clr-aj-tpw"/>
+                    <constraint firstItem="ld4-iP-eeZ" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" id="hVV-zw-ZdU"/>
+                    <constraint firstItem="HcI-gL-dgj" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="40" id="nnS-ry-PGI"/>
+                    <constraint firstAttribute="trailing" secondItem="P2P-jH-JNm" secondAttribute="trailing" constant="40" id="sq8-jI-WwQ"/>
+                    <constraint firstItem="P2P-jH-JNm" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="40" id="ynA-Xq-bs7"/>
+                </constraints>
+            </view>
+            <connections>
+                <outlet property="delegate" destination="-2" id="0bl-1N-AYu"/>
+            </connections>
+            <point key="canvasLocation" x="-14.5" y="217"/>
+        </window>
+        <menu id="Opp-56-iVw">
+            <items>
+                <menuItem title="edit" id="xoG-X3-O5u">
+                    <modifierMask key="keyEquivalentModifierMask"/>
+                    <connections>
+                        <action selector="menuItemClicked_Edit:" target="-2" id="igO-Vc-q9u"/>
+                    </connections>
+                </menuItem>
+                <menuItem title="add to doc" id="X5K-Vt-LTo">
+                    <modifierMask key="keyEquivalentModifierMask"/>
+                    <connections>
+                        <action selector="menuItemClicked_Add:" target="-2" id="MiN-4D-Rns"/>
+                    </connections>
+                </menuItem>
+                <menuItem title="Delete" id="jib-aN-Xgb">
+                    <modifierMask key="keyEquivalentModifierMask"/>
+                    <connections>
+                        <action selector="menuItemClicked_Delete:" target="-2" id="Do4-Ph-FsE"/>
+                    </connections>
+                </menuItem>
+            </items>
+            <point key="canvasLocation" x="-25.5" y="-127"/>
+        </menu>
+    </objects>
+    <resources>
+        <image name="KMImageNameUXIconToolbarZoominNor" width="20" height="21"/>
+        <image name="KMImageNameUXIconToolbarZoomoutNor" width="20" height="21"/>
+        <namedColor name="KM_242424_ColorDarkChange01">
+            <color red="0.14100000262260437" green="0.14100000262260437" blue="0.14100000262260437" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+        </namedColor>
+    </resources>
+</document>

+ 2 - 0
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift

@@ -2953,6 +2953,8 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
                     self.showPrintWindow()
                 } else if toolbarItem.itemIdentifier == KMToolbarToolProfileIdentifier {
                     Swift.debugPrint("KMToolbarToolProfileIdentifier ...")
+                    let windowC = KMProfileInfoWindowController(windowNibName: "KMProfileInfoWindowController")
+                    self.km_beginSheet(windowC: windowC)
                 } else if toolbarItem.itemIdentifier == KMToolbarViewSettingIdentifier {
                     Swift.debugPrint("KMToolbarViewSettingIdentifier ...")
                 } else if toolbarItem.itemIdentifier == KMToolbarSnapshotIdentifier {

+ 3 - 1
PDF Office/PDF Master/Class/Preference/Controller/KMGeneralPreferences.swift

@@ -312,5 +312,7 @@ extension KMGeneralPreferences {
 }
 
 extension KMGeneralPreferences: KMPreferencePane {
-    
+    func defaultsDidRevert() {
+        
+    }
 }

+ 40 - 29
PDF Office/PDF Master/Class/Preference/Window/KMPreferenceController.swift

@@ -195,36 +195,7 @@ class KMPreferenceController: NSWindowController {
                              contextInfo:NULL];
      }
 
-     - (void)resetCurrentSheetDidEnd:(NSAlert *)alert returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo {
-         if (returnCode == NSAlertFirstButtonReturn) {
-             NSURL *initialUserDefaultsURL = [[NSBundle mainBundle] URLForResource:INITIALUSERDEFAULTS_KEY withExtension:@"plist"];
-             NSArray *resettableKeys = [[[NSDictionary dictionaryWithContentsOfURL:initialUserDefaultsURL] objectForKey:RESETTABLEKEYS_KEY] objectForKey:[currentPane nibName]];
-             [[NSUserDefaultsController sharedUserDefaultsController] revertToInitialValuesForKeys:resettableKeys];
-             if ([currentPane respondsToSelector:@selector(defaultsDidRevert)])
-                 [currentPane defaultsDidRevert];
-             if ([[currentPane title] isEqualToString:@"OCR"]) { //重置OCR后,记录切换值
-                 [[NSUserDefaults standardUserDefaults] setInteger:0 forKey:@"KMStatusPlanPopUpBtnKey"];
-                 [[NSUserDefaults standardUserDefaults] synchronize];
-             }
-         }
-     }
 
-     - (IBAction)resetCurrent:(id)sender {
-         if (currentPane == nil) {
-             NSBeep();
-             return;
-         }
-         NSString *label = [currentPane title];
-         NSAlert *alert = [[NSAlert alloc] init];
-         [alert setMessageText:[NSString stringWithFormat:NSLocalizedString(@"Reset %@ preferences to their original values?", @"Message in alert dialog when pressing Reset All button"), label]];
-         [alert setInformativeText:[NSString stringWithFormat:NSLocalizedString(@"Choosing Reset will restore all settings in this pane to the state they were in when PDF Reader Pro Edition was first installed.", @"Informative text in alert dialog when pressing Reset All button"), label]];
-         [alert addButtonWithTitle:NSLocalizedString(@"Reset", @"Button title")];
-         [alert addButtonWithTitle:NSLocalizedString(@"Cancel", @"Button title")];
-         [alert beginSheetModalForWindow:[self window]
-                           modalDelegate:self
-                          didEndSelector:@selector(resetCurrentSheetDidEnd:returnCode:contextInfo:)
-                             contextInfo:NULL];
-     }
 
      - (IBAction)doGoToNextPage:(id)sender {
          NSUInteger itemIndex = [preferencePanes indexOfObject:currentPane];
@@ -343,6 +314,32 @@ class KMPreferenceController: NSWindowController {
      @end
      */
 
+    @IBAction func resetCurrent(_ sender: AnyObject?) {
+        if (self.currentPane == nil) {
+            return
+        }
+        
+//        NSString *label = [currentPane title];
+//        NSAlert *alert = [[NSAlert alloc] init];
+//        [alert setMessageText:[NSString stringWithFormat:NSLocalizedString(@"Reset %@ preferences to their original values?", @"Message in alert dialog when pressing Reset All button"), label]];
+//        [alert setInformativeText:[NSString stringWithFormat:, label]];
+//        [alert addButtonWithTitle:NSLocalizedString(@"Reset", @"Button title")];
+//        [alert addButtonWithTitle:NSLocalizedString(@"Cancel", @"Button title")];
+//        [alert beginSheetModalForWindow:[self window]
+//                          modalDelegate:self
+////                         didEndSelector:@selector(resetCurrentSheetDidEnd:returnCode:contextInfo:)
+//                            contextInfo:NULL];
+        
+        
+        let label = (self.currentPane as? NSViewController)?.title ?? ""
+        let alert = NSAlert()
+        alert.messageText = String(format: KMLocalizedString("Reset %@ preferences to their original values?", "Message in alert dialog when pressing Reset All button"), label)
+        alert.informativeText = String(format: KMLocalizedString("Choosing Reset will restore all settings in this pane to the state they were in when PDF Reader Pro Edition was first installed.", "Informative text in alert dialog when pressing Reset All button"), label)
+        alert.addButton(withTitle: KMLocalizedString("Reset", "Button title"))
+        alert.addButton(withTitle: KMLocalizedString("Cancel", "Button title"))
+        alert.beginSheetModal(for: self.window!, modalDelegate: self, didEnd: #selector(_resetCurrentSheetDidEnd), contextInfo: nil)
+    }
+
 }
 
 // MARK: - Private Methods
@@ -447,6 +444,20 @@ extension KMPreferenceController {
             }
         }
     }
+    
+    @objc private func _resetCurrentSheetDidEnd(_ alert: NSAlert, _ returnCode: Int, _ contextInfo: Any) {
+//        if (returnCode == NSAlertFirstButtonReturn) {
+//            NSURL *initialUserDefaultsURL = [[NSBundle mainBundle] URLForResource:INITIALUSERDEFAULTS_KEY withExtension:@"plist"];
+//            NSArray *resettableKeys = [[[NSDictionary dictionaryWithContentsOfURL:initialUserDefaultsURL] objectForKey:RESETTABLEKEYS_KEY] objectForKey:[currentPane nibName]];
+//            [[NSUserDefaultsController sharedUserDefaultsController] revertToInitialValuesForKeys:resettableKeys];
+//            if ([currentPane respondsToSelector:@selector(defaultsDidRevert)])
+//                [currentPane defaultsDidRevert];
+//            if ([[currentPane title] isEqualToString:@"OCR"]) { //重置OCR后,记录切换值
+//                [[NSUserDefaults standardUserDefaults] setInteger:0 forKey:@"KMStatusPlanPopUpBtnKey"];
+//                [[NSUserDefaults standardUserDefaults] synchronize];
+//            }
+//        }
+    }
 }
 
 extension KMPreferenceController: NSToolbarDelegate {

+ 2 - 0
PDF Office/PDF Master/PDF_Master-Bridging-Header.h

@@ -57,3 +57,5 @@
 #import "KMConvertURLToPDF.h"
 
 #import "NSImage_SKExtensions.h"
+
+#import "KMProfileInfoWindowController.h"