Browse Source

【偏好设置】KMSyncPreferences OC转Swift

tangchao 1 year ago
parent
commit
f271c4d054

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

@@ -2453,6 +2453,12 @@
 		BB65A06B2AF8D8A1003A27A0 /* KMNotesPreferences.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB65A06A2AF8D8A1003A27A0 /* KMNotesPreferences.swift */; };
 		BB65A06C2AF8D8A1003A27A0 /* KMNotesPreferences.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB65A06A2AF8D8A1003A27A0 /* KMNotesPreferences.swift */; };
 		BB65A06D2AF8D8A1003A27A0 /* KMNotesPreferences.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB65A06A2AF8D8A1003A27A0 /* KMNotesPreferences.swift */; };
+		BB65A0742AF8DE4F003A27A0 /* SyncPreferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = BB65A0732AF8DE4F003A27A0 /* SyncPreferences.xib */; };
+		BB65A0752AF8DE4F003A27A0 /* SyncPreferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = BB65A0732AF8DE4F003A27A0 /* SyncPreferences.xib */; };
+		BB65A0762AF8DE4F003A27A0 /* SyncPreferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = BB65A0732AF8DE4F003A27A0 /* SyncPreferences.xib */; };
+		BB65A0782AF8E2F2003A27A0 /* KMSyncPreferences.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB65A0772AF8E2F2003A27A0 /* KMSyncPreferences.swift */; };
+		BB65A0792AF8E2F2003A27A0 /* KMSyncPreferences.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB65A0772AF8E2F2003A27A0 /* KMSyncPreferences.swift */; };
+		BB65A07A2AF8E2F2003A27A0 /* KMSyncPreferences.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB65A0772AF8E2F2003A27A0 /* KMSyncPreferences.swift */; };
 		BB6719E52AD28527003D44D5 /* CPDFLineAnnotation+PDFListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB6719E42AD28527003D44D5 /* CPDFLineAnnotation+PDFListView.swift */; };
 		BB6719E62AD28527003D44D5 /* CPDFLineAnnotation+PDFListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB6719E42AD28527003D44D5 /* CPDFLineAnnotation+PDFListView.swift */; };
 		BB6719E72AD28527003D44D5 /* CPDFLineAnnotation+PDFListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB6719E42AD28527003D44D5 /* CPDFLineAnnotation+PDFListView.swift */; };
@@ -4475,6 +4481,8 @@
 		BB65A0652AF8C2BE003A27A0 /* SKFontWell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SKFontWell.h; sourceTree = "<group>"; };
 		BB65A0662AF8C2BF003A27A0 /* SKFontWell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SKFontWell.m; sourceTree = "<group>"; };
 		BB65A06A2AF8D8A1003A27A0 /* KMNotesPreferences.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMNotesPreferences.swift; sourceTree = "<group>"; };
+		BB65A0732AF8DE4F003A27A0 /* SyncPreferences.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SyncPreferences.xib; sourceTree = "<group>"; };
+		BB65A0772AF8E2F2003A27A0 /* KMSyncPreferences.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMSyncPreferences.swift; sourceTree = "<group>"; };
 		BB6719E42AD28527003D44D5 /* CPDFLineAnnotation+PDFListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CPDFLineAnnotation+PDFListView.swift"; sourceTree = "<group>"; };
 		BB6719E82AD2A57C003D44D5 /* CPDFLinkAnnotation+PDFListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CPDFLinkAnnotation+PDFListView.swift"; sourceTree = "<group>"; };
 		BB6719F42AD2C949003D44D5 /* CPDFRedactAnnotation+PDFListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CPDFRedactAnnotation+PDFListView.swift"; sourceTree = "<group>"; };
@@ -7132,6 +7140,8 @@
 		BB003012298CA41D002DD1A0 /* Controller */ = {
 			isa = PBXGroup;
 			children = (
+				BB65A0732AF8DE4F003A27A0 /* SyncPreferences.xib */,
+				BB65A0772AF8E2F2003A27A0 /* KMSyncPreferences.swift */,
 				BB65A05C2AF8BF2A003A27A0 /* NotesPreferences.xib */,
 				BB65A06A2AF8D8A1003A27A0 /* KMNotesPreferences.swift */,
 				BB65A04F2AF8B64B003A27A0 /* DisplayPreferences.xib */,
@@ -9345,6 +9355,7 @@
 				BBC348462956A638008D2CD1 /* KMEditBackgroundController.xib in Resources */,
 				BBA2109429ACC10F00E6B346 /* signlist_add.pdf in Resources */,
 				BBFDFAAA2AF389B700E08AA2 /* PasswordWindowController.xib in Resources */,
+				BB65A0742AF8DE4F003A27A0 /* SyncPreferences.xib in Resources */,
 				9F0201992A1F352100C9B673 /* KMAITranslationConfirmWindowController.xib in Resources */,
 				BB89721B294AED6C0045787C /* KMWatermarkAdjectivePreViewBaseController.xib in Resources */,
 				89E4E72F2963FBA2002DBA6F /* KMPropertiesViewPopController.xib in Resources */,
@@ -9797,6 +9808,7 @@
 				AD68783929A60FC0005B5210 /* KMLoginView.xib in Resources */,
 				AD85D1882AEF46DF000F4D28 /* KMHomeNOFileView.xib in Resources */,
 				ADD1B6F52946C07800C3FFF7 /* KMPrintChoosePageSizePosterView.xib in Resources */,
+				BB65A0752AF8DE4F003A27A0 /* SyncPreferences.xib in Resources */,
 				9F1FE3F5293F4F0F00E952CA /* Info.plist in Resources */,
 				BB7648E929ECECBF00931039 /* Color.xcassets in Resources */,
 				BB5F8A1D29BB15AD00365ADB /* KMEmailSubWindowController.xib in Resources */,
@@ -10114,6 +10126,7 @@
 				ADBC375A29CAE95700D93208 /* KMComparativeOutlineSectionCell.xib in Resources */,
 				BB99ACD4292E2AEF0048AFD9 /* KMMergeCollectionViewItem.xib in Resources */,
 				AD1CA4052A06040B0070541F /* KMAnnotationScreenCollectionView.xib in Resources */,
+				BB65A0762AF8DE4F003A27A0 /* SyncPreferences.xib in Resources */,
 				BB7F7BFC29AA469F00A3E4E7 /* KMSigntureViewItem.xib in Resources */,
 				BB65A0522AF8B64B003A27A0 /* DisplayPreferences.xib in Resources */,
 				9F0CB4A429683E2600007028 /* KMPropertiesPanelSizeSubVC.xib in Resources */,
@@ -10245,6 +10258,7 @@
 				BB147029299DC0D100784A6A /* OIDAuthorizationService.m in Sources */,
 				9FF94F1129A7476000B1EF69 /* KMDesignPropertySelector.swift in Sources */,
 				ADBC2D0C299CAA65006280C8 /* KMBaseXibView.swift in Sources */,
+				BB65A0782AF8E2F2003A27A0 /* KMSyncPreferences.swift in Sources */,
 				ADDEEA7E2AD3FB1D00EF675D /* KMImageAccessoryController.swift in Sources */,
 				BB60138C2AD3A94200A76FB2 /* CPDFSignatureAnnotation+PDFListView.swift in Sources */,
 				9F53D54B2AD6696B00CCF9D8 /* ComPDFUIConfig.swift in Sources */,
@@ -11716,6 +11730,7 @@
 				BB6719FA2AD2CC05003D44D5 /* CPDFSignatureWidgetAnnotation+PDFListView.swift in Sources */,
 				BB2EDF71296ECE17003BCF58 /* KMPageEditThumbnailView.swift in Sources */,
 				9FD0FA2A29CD3ED400F2AB0D /* KMRightSideEmptyVC.swift in Sources */,
+				BB65A0792AF8E2F2003A27A0 /* KMSyncPreferences.swift in Sources */,
 				9F78EFC328F7E395001E66F4 /* KMHomeViewController+Action.swift in Sources */,
 				ADE3C1EE29A5AFB100793B13 /* KMRequestServerManager.swift in Sources */,
 				9F1FE50029406E4700E952CA /* CTTabStripModel.m in Sources */,
@@ -12002,6 +12017,7 @@
 				BB14703D299DC0D200784A6A /* OIDErrorUtilities.m in Sources */,
 				BBFE6E772930E53000142C01 /* KMMergePopoverViewController.swift in Sources */,
 				ADF6B8782A48155E0090CB78 /* KMComparativeViewCollectionItem.swift in Sources */,
+				BB65A07A2AF8E2F2003A27A0 /* KMSyncPreferences.swift in Sources */,
 				BB32BF252A5EA05900D11348 /* KMAnalytics.swift in Sources */,
 				ADAFDA1B2AE8DD6600F084BC /* KMAdvertisementTableView.swift in Sources */,
 				89E4E7102963D62C002DBA6F /* KMAnnotationFontWindowController.m in Sources */,

+ 7 - 2
PDF Office/PDF Master/Class/Common/Category/NSObject+KMExtension.swift

@@ -417,6 +417,10 @@ let SKInkNoteDashPatternKey = "SKInkNoteDashPattern"
 let SKInkNoteLineStyleKey = "SKInkNoteLineStyle"
 let SKFreeTextNoteFontColorKey = "SKFreeTextNoteFontColor"
 
+let SKTeXEditorPresetKey = "SKTeXEditorPreset"
+let SKTeXEditorCommandKey = "SKTeXEditorCommand"
+let SKTeXEditorArgumentsKey = "SKTeXEditorArguments"
+
 
 @objcMembers class SKStringConstants: NSObject {
     public static let disableAnimationsKey = SKDisableAnimationsKey
@@ -444,6 +448,7 @@ let SKFreeTextNoteFontColorKey = "SKFreeTextNoteFontColor"
     public static let inkNoteLineStyleKey = SKInkNoteLineStyleKey
     public static let freeTextNoteFontColorKey = SKFreeTextNoteFontColorKey
     
-    
-    
+    public static let teXEditorPresetKey = SKTeXEditorPresetKey
+    public static let teXEditorCommandKey = SKTeXEditorCommandKey
+    public static let teXEditorArgumentsKey = SKTeXEditorArgumentsKey
 }

+ 13 - 0
PDF Office/PDF Master/Class/Common/Category/View/NSMenu+KMExtension.swift

@@ -106,6 +106,19 @@ extension NSMenu {
         self.target = target
         self.tag = tag
     }
+    
+    func setImageAndSize(_ image: NSImage) {
+        var dstSize = NSMakeSize(16.0, 16.0)
+        var srcSize = image.size
+        if (NSEqualSizes(srcSize, dstSize)) {
+            self.image = image
+        } else {
+            let newImage = NSImage.bitmapImage(with: dstSize) { rect in
+                image.draw(in: rect, from: .zero, operation: .copy, fraction: 1.0)
+            }
+            self.image = newImage
+        }
+    }
 }
 
 /*

+ 140 - 0
PDF Office/PDF Master/Class/Preference/Controller/KMSyncPreferences.swift

@@ -0,0 +1,140 @@
+//
+//  KMSyncPreferences.swift
+//  PDF Master
+//
+//  Created by tangchao on 2023/11/6.
+//
+
+import Cocoa
+
+class KMSyncPreferences: NSViewController {
+    
+    /*
+     @interface SKSyncPreferences : NSViewController <SKPreferencePane> {
+         NSArray *texEditorLabels;
+         NSArray *texEditorControls;
+         BOOL customTeXEditor;
+     }
+
+     @property (nonatomic, retain) IBOutlet NSArray *texEditorLabels, *texEditorControls;
+     @property (nonatomic, getter=isCustomTeXEditor) BOOL customTeXEditor;
+
+     + (BOOL)getTeXEditorCommand:(NSString **)command arguments:(NSString **)arguments forPreset:(NSString *)name;
+
+     - (IBAction)changeTeXEditorPreset:(id)sender;
+     */
+    
+    override var nibName: NSNib.Name? {
+        return "SyncPreferences"
+    }
+    
+    override func loadView() {
+        super.loadView()
+        
+        //    SKAutoSizeLabelFields(texEditorLabels, texEditorControls, YES);
+            
+//            NSString *editorPreset = [[NSUserDefaults standardUserDefaults] stringForKey:SKStringConstants.teXEditorPresetKey];
+//            NSInteger i = [TeXEditors count];
+//            NSInteger idx = -1;
+//            NSPopUpButton *texEditorPopUpButton = [texEditorControls objectAtIndex:0];
+//            NSWorkspace *ws = [NSWorkspace sharedWorkspace];
+//
+//            while (i--) {
+//                NSString *name = [[TeXEditors objectAtIndex:i] objectForKey:NAME_KEY];
+//                NSString *path = [ws fullPathForApplication:name];
+//                NSImage *image = path ? [ws iconForFile:path] : [ws iconForFileType:NSFileTypeForHFSTypeCode(kGenericApplicationIcon)];
+//                [texEditorPopUpButton insertItemWithTitle:name atIndex:0];
+//                [[texEditorPopUpButton itemAtIndex:0] setImageAndSize:image];
+//                if ([name isEqualToString:editorPreset])
+//                    idx = i;
+//            }
+//
+//            [self setCustomTeXEditor:idx == -1];
+//
+//            if (idx == -1)
+//                [texEditorPopUpButton selectItem:[texEditorPopUpButton lastItem]];
+//            else
+//                [texEditorPopUpButton selectItemAtIndex:idx];
+    }
+    
+    override var title: String? {
+        set {
+            super.title = newValue
+        }
+        get {
+            return KMLocalizedString("Sync", "Preference pane label")
+        }
+    }
+
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        // Do view setup here.
+    }
+    
+    /*
+     @implementation SKSyncPreferences
+
+     @synthesize texEditorLabels, texEditorControls, customTeXEditor;
+
+     static NSArray *TeXEditors = nil;
+
+     + (void)initialize {
+     //    SKINITIALIZE;
+         
+         NSURL *initialUserDefaultsURL = [[NSBundle mainBundle] URLForResource:INITIALUSERDEFAULTS_KEY withExtension:@"plist"];
+         TeXEditors = [[[NSDictionary dictionaryWithContentsOfURL:initialUserDefaultsURL] objectForKey:TEXEDITORS_KEY] copy];
+     }
+
+     - (void)dealloc {
+     //    SKDESTROY(texEditorLabels);
+     //    SKDESTROY(texEditorControls);
+     //    [super dealloc];
+     }
+
+     #pragma mark Accessors
+
+
+     + (BOOL)getTeXEditorCommand:(NSString **)command arguments:(NSString **)arguments forPreset:(NSString *)name {
+         for (NSDictionary *editor in TeXEditors) {
+             if ([[editor objectForKey:NAME_KEY] isEqualToString:name]) {
+                 if (command) *command = [editor objectForKey:COMMAND_KEY];
+                 if (arguments) *arguments = [editor objectForKey:ARGUMENTS_KEY];
+                 return YES;
+             }
+         }
+         return NO;
+     }
+
+     #pragma mark Hooks
+
+     - (void)defaultsDidRevert {
+         NSString *editorPreset = [[NSUserDefaults standardUserDefaults] stringForKey:SKStringConstants.teXEditorPresetKey];
+         NSPopUpButton *texEditorPopUpButton = [texEditorControls objectAtIndex:0];
+         if ([editorPreset length] == 0) {
+             [texEditorPopUpButton selectItem:[texEditorPopUpButton lastItem]];
+             [self setCustomTeXEditor:YES];
+         } else {
+             [texEditorPopUpButton selectItemWithTitle:editorPreset];
+             [self setCustomTeXEditor:NO];
+         }
+     }
+
+     @end
+     */
+    
+    @IBAction func changeTeXEditorPreset(_ sender: AnyObject?) {
+//        NSUserDefaultsController *sudc = [NSUserDefaultsController sharedUserDefaultsController];
+//        NSInteger idx = [sender indexOfSelectedItem];
+//        if (idx < [sender numberOfItems] - 1) {
+//            NSDictionary *editor = [TeXEditors objectAtIndex:idx];
+//            [[sudc values] setValue:[sender titleOfSelectedItem] forKey:SKStringConstants.teXEditorPresetKey];
+//            [[sudc values] setValue:[editor objectForKey:COMMAND_KEY] forKey:SKStringConstants.teXEditorCommandKey];
+//            [[sudc values] setValue:[editor objectForKey:ARGUMENTS_KEY] forKey:SKStringConstants.teXEditorArgumentsKey];
+//            [self setCustomTeXEditor:NO];
+//        } else {
+//            [[sudc values] setValue:@"" forKey:SKStringConstants.teXEditorPresetKey];
+//            [self setCustomTeXEditor:YES];
+//        }
+    }
+    
+}

+ 149 - 0
PDF Office/PDF Master/Class/Preference/Controller/SyncPreferences.xib

@@ -0,0 +1,149 @@
+<?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">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="KMSyncPreferences" customModule="PDF_Master" customModuleProvider="target">
+            <connections>
+                <outlet property="texEditorControls" destination="45" id="54"/>
+                <outlet property="texEditorLabels" destination="40" id="53"/>
+                <outlet property="view" destination="1" id="31"/>
+            </connections>
+        </customObject>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application"/>
+        <customView id="1">
+            <rect key="frame" x="0.0" y="0.0" width="428" height="213"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
+            <subviews>
+                <button toolTip="Select this to check for external file changes. Use at your own risk." fixedFrame="YES" imageHugsTitle="YES" translatesAutoresizingMaskIntoConstraints="NO" id="2">
+                    <rect key="frame" x="18" y="177" width="392" height="18"/>
+                    <autoresizingMask key="autoresizingMask" widthSizable="YES"/>
+                    <buttonCell key="cell" type="check" title="Check for file changes" bezelStyle="regularSquare" imagePosition="leading" alignment="left" inset="2" id="23">
+                        <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
+                        <font key="font" metaFont="system"/>
+                    </buttonCell>
+                    <connections>
+                        <binding destination="27" name="value" keyPath="values.SKAutoCheckFileUpdate" id="28"/>
+                    </connections>
+                </button>
+                <box verticalHuggingPriority="750" fixedFrame="YES" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="3">
+                    <rect key="frame" x="12" y="132" width="404" height="5"/>
+                    <autoresizingMask key="autoresizingMask" widthSizable="YES"/>
+                </box>
+                <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="4">
+                    <rect key="frame" x="34" y="51" width="73" height="17"/>
+                    <autoresizingMask key="autoresizingMask"/>
+                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Command:" id="22">
+                        <font key="font" metaFont="system"/>
+                        <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                        <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                    </textFieldCell>
+                </textField>
+                <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="5">
+                    <rect key="frame" x="17" y="107" width="394" height="17"/>
+                    <autoresizingMask key="autoresizingMask" widthSizable="YES"/>
+                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="PDF-TeX Sync support:" id="21">
+                        <font key="font" metaFont="system"/>
+                        <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                        <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                    </textFieldCell>
+                </textField>
+                <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="6">
+                    <rect key="frame" x="29" y="22" width="78" height="17"/>
+                    <autoresizingMask key="autoresizingMask"/>
+                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Arguments:" id="20">
+                        <font key="font" metaFont="system"/>
+                        <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                        <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                    </textFieldCell>
+                </textField>
+                <textField toolTip="Enter the arguments for the command. Use %file to indicate the file to open and %line for the line number" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="7">
+                    <rect key="frame" x="112" y="20" width="296" height="22"/>
+                    <autoresizingMask key="autoresizingMask" widthSizable="YES"/>
+                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="19">
+                        <font key="font" metaFont="system"/>
+                        <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                    </textFieldCell>
+                    <connections>
+                        <accessibilityConnection property="title" destination="6" id="24"/>
+                        <binding destination="27" name="value" keyPath="values.SKTeXEditorArguments" id="30"/>
+                    </connections>
+                </textField>
+                <popUpButton toolTip="Choose settings for a preset TeX editor, or use custom settings" verticalHuggingPriority="750" fixedFrame="YES" imageHugsTitle="YES" translatesAutoresizingMaskIntoConstraints="NO" id="8">
+                    <rect key="frame" x="109" y="75" width="302" height="26"/>
+                    <autoresizingMask key="autoresizingMask" widthSizable="YES"/>
+                    <popUpButtonCell key="cell" type="push" title="Custom" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" inset="2" arrowPosition="arrowAtCenter" preferredEdge="maxY" selectedItem="17" id="15">
+                        <behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
+                        <font key="font" metaFont="system"/>
+                        <menu key="menu" id="16">
+                            <items>
+                                <menuItem isSeparatorItem="YES" id="18">
+                                    <modifierMask key="keyEquivalentModifierMask" command="YES"/>
+                                </menuItem>
+                                <menuItem title="Custom" state="on" id="17"/>
+                            </items>
+                        </menu>
+                    </popUpButtonCell>
+                    <connections>
+                        <accessibilityConnection property="link" destination="9" id="38"/>
+                        <accessibilityConnection property="title" destination="10" id="25"/>
+                        <action selector="changeTeXEditorPreset:" target="-2" id="58"/>
+                    </connections>
+                </popUpButton>
+                <textField toolTip="Enter the command to call your favorite TeX editor" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="9">
+                    <rect key="frame" x="112" y="49" width="296" height="22"/>
+                    <autoresizingMask key="autoresizingMask" widthSizable="YES"/>
+                    <textFieldCell key="cell" lineBreakMode="truncatingMiddle" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="14">
+                        <font key="font" metaFont="system"/>
+                        <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                    </textFieldCell>
+                    <connections>
+                        <accessibilityConnection property="link" destination="7" id="39"/>
+                        <accessibilityConnection property="title" destination="4" id="26"/>
+                        <binding destination="27" name="value" keyPath="values.SKTeXEditorCommand" id="29"/>
+                    </connections>
+                </textField>
+                <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="10">
+                    <rect key="frame" x="60" y="81" width="47" height="17"/>
+                    <autoresizingMask key="autoresizingMask"/>
+                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Preset:" id="13">
+                        <font key="font" metaFont="system"/>
+                        <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                        <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                    </textFieldCell>
+                </textField>
+                <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" preferredMaxLayoutWidth="390" translatesAutoresizingMaskIntoConstraints="NO" id="11">
+                    <rect key="frame" x="17" y="143" width="394" height="28"/>
+                    <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
+                    <textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" title="Do not select this when using a script or program that will force a revert." id="12">
+                        <font key="font" metaFont="smallSystem"/>
+                        <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                        <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                    </textFieldCell>
+                </textField>
+            </subviews>
+            <point key="canvasLocation" x="-3" y="154"/>
+        </customView>
+        <userDefaultsController representsSharedInstance="YES" id="27"/>
+        <customObject id="40" userLabel="Labels" customClass="SKIBArray">
+            <connections>
+                <outlet property="object1" destination="10" id="49"/>
+                <outlet property="object2" destination="4" id="43"/>
+                <outlet property="object3" destination="6" id="44"/>
+            </connections>
+        </customObject>
+        <customObject id="45" userLabel="Controls" customClass="SKIBArray">
+            <connections>
+                <outlet property="object1" destination="8" id="50"/>
+                <outlet property="object2" destination="9" id="51"/>
+                <outlet property="object3" destination="7" id="52"/>
+            </connections>
+        </customObject>
+    </objects>
+</document>

+ 1 - 1
PDF Office/PDF Master/Class/Preference/Window/SKPreferenceController.m

@@ -95,7 +95,7 @@ static SKPreferenceController *sharedPrefenceController = nil;
                 [[SKGeneralPreferences alloc] init],
                 [[KMDisplayPreferences alloc] init],
                 [[KMNotesPreferences alloc] init],
-//                [[[SKSyncPreferences alloc] init] autorelease],
+                [[KMSyncPreferences alloc] init],
                                
 //                [[[DropboxPreferences alloc] init] autorelease],
 //                [[[KMOCRPreferences alloc] init] autorelease], nil];  //恢复OCR架上版本样式

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

@@ -59,3 +59,4 @@
 #import "KMColorPickerViewController.h"
 
 #import "KMConvertURLToPDF.h"
+#import "NSImage_SKExtensions.h"

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

@@ -42,3 +42,4 @@
 #import "KMColorPickerViewController.h"
 
 #import "KMConvertURLToPDF.h"
+#import "NSImage_SKExtensions.h"

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

@@ -59,3 +59,4 @@
 
 #import "SKFontWell.h"
 #import "SKLineWell.h"
+#import "NSImage_SKExtensions.h"