ソースを参照

【自动保存】功能补充

tangchao 1 年間 前
コミット
512431ea5d

+ 8 - 1
PDF Office/PDF Master/Class/AutoSave/Tools/AutoSaveManager.swift

@@ -9,7 +9,9 @@ import Cocoa
 
 public let KAutoSaveTimeValueChangedNoti = "KAutoSaveTimeValueChangedNoti"
 
-class AutoSaveManager: NSObject {
+@objcMembers class AutoSaveManager: NSObject {
+    public static let kTimeValueChangedNotificationName = Notification.Name(KAutoSaveTimeValueChangedNoti)
+    
     //APP是否允许进行自动缓存
     var autoSaveEnabled = false {
         didSet {
@@ -53,6 +55,11 @@ class AutoSaveManager: NSObject {
         }
     }
     // 所有打开的文件信息汇总
+    var opendPaths: NSMutableArray? {
+        get {
+            return self._opendPaths
+        }
+    }
     private var _opendPaths: NSMutableArray?
     
     static let manager: AutoSaveManager = {

+ 20 - 0
PDF Office/PDF Master/Class/Common/OC/AutoSave/AutoSaveFileItem.h

@@ -0,0 +1,20 @@
+//
+//  AutoSaveFileItem.h
+//  PDF Reader Pro Edition
+//
+//  Created by Niehaoyu on 2023/08/15.
+//
+
+#import <Cocoa/Cocoa.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface AutoSaveFileItem : NSCollectionViewItem
+
+@property (nonatomic, copy) NSString *filePath;
+
+@property (nonatomic, copy) void(^stateHandle)(void);
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 82 - 0
PDF Office/PDF Master/Class/Common/OC/AutoSave/AutoSaveFileItem.m

@@ -0,0 +1,82 @@
+//
+//  AutoSaveFileItem.m
+//  PDF Reader Pro Edition
+//
+//  Created by Niehaoyu on 2023/08/15.
+//
+
+#import "AutoSaveFileItem.h"
+#import <PDF_Reader_Pro-Swift.h>
+
+@interface AutoSaveFileItem ()
+
+@property (assign) IBOutlet NSView *contendView;
+
+@property (assign) IBOutlet NSTextField *pathLbl;
+@property (assign) IBOutlet NSTextField *dateLbl;
+
+@property (assign) IBOutlet NSButton *checkBtn;
+
+@property (assign) IBOutlet NSView *headerLineView1;
+@property (assign) IBOutlet NSView *headerLineView2;
+@property (assign) IBOutlet NSView *headerLineView3;
+
+@end
+
+@implementation AutoSaveFileItem
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do view setup here.
+    
+    
+    self.headerLineView1.wantsLayer = self.headerLineView2.wantsLayer = self.headerLineView3.wantsLayer = YES;
+
+    
+    
+}
+
+- (void)setFilePath:(NSString *)filePath {
+    _filePath = filePath;
+    
+    NSDictionary *attrib = [[NSFileManager defaultManager] attributesOfItemAtPath:_filePath error:nil];
+    
+    NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init];
+    [dateFormatter setDateFormat:@"yyyy/MM/dd HH:mm"];
+    
+    self.pathLbl.stringValue = _filePath.lastPathComponent?:@"";
+    self.dateLbl.stringValue = [dateFormatter stringFromDate:[attrib objectForKey:NSFileModificationDate]]?:@"";
+    
+    if ([[AutoSaveManager manager].opendPaths containsObject:_filePath]) {
+        self.checkBtn.state = NSControlStateValueOn;
+    } else {
+        self.checkBtn.state = NSControlStateValueOff;
+    }
+    
+    if ([KMAppearance isDarkMode]) {
+        self.headerLineView1.layer.backgroundColor = self.headerLineView2.layer.backgroundColor = self.headerLineView3.layer.backgroundColor = [NSColor colorWithRed:62/255. green:62/255. blue:62/255. alpha:1.].CGColor;
+    } else {
+        self.headerLineView1.layer.backgroundColor = self.headerLineView2.layer.backgroundColor = self.headerLineView3.layer.backgroundColor = [NSColor colorWithRed:218/255. green:219/255. blue:222/255. alpha:1.].CGColor;
+    }
+    
+    self.pathLbl.toolTip = _filePath.lastPathComponent?:@"";
+}
+
+#pragma mark - IBAction
+- (IBAction)checkBtnAction:(NSButton *)sender {
+    if (self.checkBtn.state == NSControlStateValueOn) {
+        if (![[AutoSaveManager manager].opendPaths containsObject:self.filePath]) {
+            [[AutoSaveManager manager].opendPaths addObject:self.filePath];
+        }
+    } else {
+        if ([[AutoSaveManager manager].opendPaths containsObject:self.filePath]) {
+            [[AutoSaveManager manager].opendPaths removeObject:self.filePath];
+        }
+    }
+    if (self.stateHandle) {
+        self.stateHandle();
+    }
+    self.filePath = self.filePath;
+}
+
+@end

+ 126 - 0
PDF Office/PDF Master/Class/Common/OC/AutoSave/AutoSaveFileItem.xib

@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21701"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="AutoSaveFileItem">
+            <connections>
+                <outlet property="checkBtn" destination="v1Y-Bn-0Lp" id="wmq-sW-0Lx"/>
+                <outlet property="contendView" destination="Fun-BM-aH3" id="b12-g3-wdw"/>
+                <outlet property="dateLbl" destination="SQZ-ow-8Yh" id="Xwj-sy-vum"/>
+                <outlet property="headerLineView1" destination="Z2M-is-fSk" id="NKE-fT-pUI"/>
+                <outlet property="headerLineView2" destination="Whq-Lz-GLU" id="l2U-ds-a8u"/>
+                <outlet property="headerLineView3" destination="gVD-jG-7XA" id="pTm-dR-uG3"/>
+                <outlet property="pathLbl" destination="tfJ-C8-1BQ" id="QtW-nL-rRP"/>
+                <outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
+            </connections>
+        </customObject>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <customView id="Hz6-mo-xeY">
+            <rect key="frame" x="0.0" y="0.0" width="560" height="32"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <subviews>
+                <customView translatesAutoresizingMaskIntoConstraints="NO" id="Fun-BM-aH3">
+                    <rect key="frame" x="0.0" y="0.0" width="560" height="32"/>
+                    <subviews>
+                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="f6M-HT-rjf">
+                            <rect key="frame" x="0.0" y="0.0" width="328" height="32"/>
+                            <subviews>
+                                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="tfJ-C8-1BQ">
+                                    <rect key="frame" x="14" y="8" width="96" height="16"/>
+                                    <textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="jnw-hd-xp9">
+                                        <font key="font" usesAppearanceFont="YES"/>
+                                        <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                    </textFieldCell>
+                                </textField>
+                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="Z2M-is-fSk">
+                                    <rect key="frame" x="327" y="0.0" width="1" height="32"/>
+                                    <constraints>
+                                        <constraint firstAttribute="width" constant="1" id="LGJ-uM-RhO"/>
+                                    </constraints>
+                                </customView>
+                            </subviews>
+                            <constraints>
+                                <constraint firstAttribute="trailing" secondItem="Z2M-is-fSk" secondAttribute="trailing" id="F1f-4V-Xlm"/>
+                                <constraint firstItem="Z2M-is-fSk" firstAttribute="top" secondItem="f6M-HT-rjf" secondAttribute="top" id="QEI-6A-c9k"/>
+                                <constraint firstItem="Z2M-is-fSk" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="tfJ-C8-1BQ" secondAttribute="trailing" constant="10" id="RcW-xa-haN"/>
+                                <constraint firstItem="tfJ-C8-1BQ" firstAttribute="centerY" secondItem="f6M-HT-rjf" secondAttribute="centerY" id="iXt-KC-zTm"/>
+                                <constraint firstItem="tfJ-C8-1BQ" firstAttribute="leading" secondItem="f6M-HT-rjf" secondAttribute="leading" constant="16" id="kgm-Bu-yed"/>
+                                <constraint firstAttribute="bottom" secondItem="Z2M-is-fSk" secondAttribute="bottom" id="yPQ-SZ-7kF"/>
+                            </constraints>
+                        </customView>
+                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="lHL-BS-Em8">
+                            <rect key="frame" x="328" y="0.0" width="184" height="32"/>
+                            <subviews>
+                                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="SQZ-ow-8Yh">
+                                    <rect key="frame" x="14" y="8" width="96" height="16"/>
+                                    <textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="gMB-L8-Af3">
+                                        <font key="font" usesAppearanceFont="YES"/>
+                                        <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                    </textFieldCell>
+                                </textField>
+                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="Whq-Lz-GLU">
+                                    <rect key="frame" x="183" y="0.0" width="1" height="32"/>
+                                    <constraints>
+                                        <constraint firstAttribute="width" constant="1" id="R8m-od-s4V"/>
+                                    </constraints>
+                                </customView>
+                            </subviews>
+                            <constraints>
+                                <constraint firstAttribute="bottom" secondItem="Whq-Lz-GLU" secondAttribute="bottom" id="0qc-pB-OCR"/>
+                                <constraint firstAttribute="trailing" secondItem="Whq-Lz-GLU" secondAttribute="trailing" id="H2O-nn-Jt1"/>
+                                <constraint firstItem="SQZ-ow-8Yh" firstAttribute="centerY" secondItem="lHL-BS-Em8" secondAttribute="centerY" id="K1x-1X-Rjl"/>
+                                <constraint firstItem="Whq-Lz-GLU" firstAttribute="top" secondItem="lHL-BS-Em8" secondAttribute="top" id="aKj-4i-crw"/>
+                                <constraint firstItem="SQZ-ow-8Yh" firstAttribute="leading" secondItem="lHL-BS-Em8" secondAttribute="leading" constant="16" id="fn3-GD-jNb"/>
+                            </constraints>
+                        </customView>
+                        <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="v1Y-Bn-0Lp">
+                            <rect key="frame" x="528" y="7" width="18" height="18"/>
+                            <buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" inset="2" id="LNq-44-uDO">
+                                <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
+                                <font key="font" metaFont="system"/>
+                            </buttonCell>
+                            <connections>
+                                <action selector="checkBtnAction:" target="-2" id="OhZ-Rd-rA1"/>
+                            </connections>
+                        </button>
+                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="gVD-jG-7XA">
+                            <rect key="frame" x="0.0" y="0.0" width="560" height="1"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="1" id="V7A-XD-qYY"/>
+                            </constraints>
+                        </customView>
+                    </subviews>
+                    <constraints>
+                        <constraint firstAttribute="bottom" secondItem="lHL-BS-Em8" secondAttribute="bottom" id="05T-v2-sjq"/>
+                        <constraint firstAttribute="bottom" secondItem="gVD-jG-7XA" secondAttribute="bottom" id="5eS-eG-S0m"/>
+                        <constraint firstItem="f6M-HT-rjf" firstAttribute="top" secondItem="Fun-BM-aH3" secondAttribute="top" id="9Jq-Uj-RML"/>
+                        <constraint firstAttribute="bottom" secondItem="f6M-HT-rjf" secondAttribute="bottom" id="Hw3-xz-HD8"/>
+                        <constraint firstItem="lHL-BS-Em8" firstAttribute="top" secondItem="Fun-BM-aH3" secondAttribute="top" id="JNS-lX-rQW"/>
+                        <constraint firstItem="lHL-BS-Em8" firstAttribute="width" secondItem="Fun-BM-aH3" secondAttribute="width" multiplier="184:560" id="NDj-4b-acx"/>
+                        <constraint firstAttribute="trailing" secondItem="gVD-jG-7XA" secondAttribute="trailing" id="T9N-zK-cbB"/>
+                        <constraint firstItem="gVD-jG-7XA" firstAttribute="leading" secondItem="Fun-BM-aH3" secondAttribute="leading" id="Wqu-xZ-SZI"/>
+                        <constraint firstAttribute="trailing" secondItem="v1Y-Bn-0Lp" secondAttribute="trailing" constant="16" id="jyY-tf-KQT"/>
+                        <constraint firstItem="v1Y-Bn-0Lp" firstAttribute="centerY" secondItem="Fun-BM-aH3" secondAttribute="centerY" id="lCc-MW-ZsL"/>
+                        <constraint firstItem="f6M-HT-rjf" firstAttribute="width" secondItem="Fun-BM-aH3" secondAttribute="width" multiplier="328:560" id="qK5-0a-y6n"/>
+                        <constraint firstItem="f6M-HT-rjf" firstAttribute="leading" secondItem="Fun-BM-aH3" secondAttribute="leading" id="z3c-54-OXB"/>
+                        <constraint firstItem="lHL-BS-Em8" firstAttribute="leading" secondItem="f6M-HT-rjf" secondAttribute="trailing" id="zrG-WY-7LH"/>
+                    </constraints>
+                </customView>
+            </subviews>
+            <constraints>
+                <constraint firstAttribute="trailing" secondItem="Fun-BM-aH3" secondAttribute="trailing" id="0Tp-8n-qRQ"/>
+                <constraint firstItem="Fun-BM-aH3" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="Geh-mv-Klg"/>
+                <constraint firstAttribute="bottom" secondItem="Fun-BM-aH3" secondAttribute="bottom" id="USj-A2-pjR"/>
+                <constraint firstItem="Fun-BM-aH3" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" id="bnQ-Kn-WQl"/>
+            </constraints>
+            <point key="canvasLocation" x="83" y="114"/>
+        </customView>
+    </objects>
+</document>

+ 20 - 0
PDF Office/PDF Master/Class/Common/OC/AutoSave/AutoSavePopController.h

@@ -0,0 +1,20 @@
+//
+//  AutoSavePopController.h
+//  PDF Reader Pro Edition
+//
+//  Created by Niehaoyu on 2023/08/14.
+//
+
+#import <Cocoa/Cocoa.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface AutoSavePopController : NSWindowController
+
+@property (nonatomic, copy) void(^cancelHandle)(AutoSavePopController *windowController);
+
+@property (nonatomic, copy) void(^confirmHandle)(AutoSavePopController *windowController);
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 187 - 0
PDF Office/PDF Master/Class/Common/OC/AutoSave/AutoSavePopController.m

@@ -0,0 +1,187 @@
+//
+//  AutoSavePopController.m
+//  PDF Reader Pro Edition
+//
+//  Created by Niehaoyu on 2023/08/14.
+//
+
+#import "AutoSavePopController.h"
+#import "AutoSaveFileItem.h"
+#import <PDF_Reader_Pro-Swift.h>
+
+@interface AutoSavePopController ()<
+NSTableViewDelegate,
+NSTableViewDataSource,
+NSCollectionViewDelegate,
+NSCollectionViewDataSource>
+
+
+@property (assign) IBOutlet NSTextField *titleLbl;
+
+@property (assign) IBOutlet NSView *tableBGView;
+
+@property (assign) IBOutlet NSView *headerView;
+@property (assign) IBOutlet NSTextField *headerNameLbl;
+@property (assign) IBOutlet NSTextField *headerDateLbl;
+@property (assign) IBOutlet NSView *headerLineView1;
+@property (assign) IBOutlet NSView *headerLineView2;
+@property (assign) IBOutlet NSButton *headerCheckBtn;
+
+@property (assign) IBOutlet NSCollectionView *collectionView;
+
+
+@property (assign) IBOutlet NSButton *cancelBtn;
+
+@property (assign) IBOutlet NSButton *saveAsBtn;
+@end
+
+@implementation AutoSavePopController
+
+- (void)dealloc {
+    
+    [NSDistributedNotificationCenter.defaultCenter removeObserver:self];
+#if DEBUG
+    NSLog(@"## %@ Dealloc", self.className);
+#endif
+}
+
+- (id)init {
+    if (self = [super initWithWindowNibName:@"AutoSavePopController"]) {
+        
+    }
+    return self;
+}
+
+- (void)windowDidLoad {
+    [super windowDidLoad];
+    
+    // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
+    
+    self.titleLbl.stringValue = NSLocalizedString(@"Document cache records will be cleared if you choose 'Cancel'", nil);
+    self.headerNameLbl.stringValue = NSLocalizedString(@"File Name", nil);
+    self.headerDateLbl.stringValue = NSLocalizedString(@"Autosave Time", nil);
+    self.cancelBtn.title = NSLocalizedString(@"Cancel", nil);
+    self.saveAsBtn.title = NSLocalizedString(@"Save as", nil);
+    
+    self.tableBGView.wantsLayer = YES;
+    self.tableBGView.layer.cornerRadius = 5.;
+    self.tableBGView.layer.masksToBounds = YES;
+    self.tableBGView.layer.borderWidth = 0.5;
+    
+    self.headerView.wantsLayer = YES;
+    self.headerLineView1.wantsLayer = self.headerLineView2.wantsLayer = YES;
+
+    self.collectionView.delegate = self;
+    self.collectionView.dataSource = self;
+    [self.collectionView registerClass:[AutoSaveFileItem class] forItemWithIdentifier:@"autoSaveFileItem"];
+    
+    
+    
+    [self refreshSaveBtnState];
+    
+    [self updateViewColor];
+    [NSDistributedNotificationCenter.defaultCenter addObserver:self selector:@selector(themeChanged:) name:@"AppleInterfaceThemeChangedNotification" object: nil];
+}
+
+- (void)updateViewColor {
+    self.tableBGView.layer.backgroundColor = [NSColor colorWithRed:246/255. green:246/255. blue:246/255. alpha:1.].CGColor;
+    
+    if ([KMAppearance isDarkMode]) {
+        self.tableBGView.layer.borderColor = [NSColor colorWithRed:66/255. green:67/255. blue:69/255. alpha:1.].CGColor;
+        self.headerView.layer.backgroundColor = [NSColor colorWithRed:54/255. green:54/255. blue:54/255. alpha:1.].CGColor;
+        self.headerLineView1.layer.backgroundColor = [NSColor colorWithRed:62/255. green:62/255. blue:62/255. alpha:1.].CGColor;
+        self.headerLineView2.layer.backgroundColor = [NSColor colorWithRed:62/255. green:62/255. blue:62/255. alpha:1.].CGColor;
+    } else {
+        self.tableBGView.layer.borderColor = [NSColor colorWithRed:218/255. green:219/255. blue:222/255. alpha:1.].CGColor;
+        self.headerView.layer.backgroundColor = [NSColor colorWithRed:228/255. green:228/255. blue:228/255. alpha:1.].CGColor;
+        self.headerLineView1.layer.backgroundColor = [NSColor colorWithRed:218/255. green:219/255. blue:222/255. alpha:1.].CGColor;
+        self.headerLineView2.layer.backgroundColor = [NSColor colorWithRed:218/255. green:219/255. blue:222/255. alpha:1.].CGColor;
+    }
+
+    [self.collectionView reloadData];
+}
+
+- (void)refreshSaveBtnState {
+    self.headerCheckBtn.state = NSControlStateValueOff;
+//    [AutoSaveManager manager].opend
+    if ([AutoSaveManager manager].opendPaths.count > 0) {
+        self.saveAsBtn.enabled = YES;
+        if ([AutoSaveManager manager].opendPaths.count == [AutoSaveManager manager].autoSavePaths.count) {
+            self.headerCheckBtn.state = NSControlStateValueOn;
+        }
+    } else {
+        self.saveAsBtn.enabled = NO;
+    }
+}
+
+#pragma mark - IBAction
+- (IBAction)headerCheckBtnAction:(NSButton *)sender {
+    if (self.headerCheckBtn.state == NSControlStateValueOn) {
+        [[AutoSaveManager manager].opendPaths removeAllObjects];
+        [[AutoSaveManager manager].opendPaths addObjectsFromArray:[AutoSaveManager manager].autoSavePaths];
+    } else {
+        [[AutoSaveManager manager].opendPaths removeAllObjects];
+    }
+    [self.collectionView reloadData];
+    [self refreshSaveBtnState];
+}
+
+- (IBAction)cancelAction:(NSButton *)sender {
+    if (self.cancelHandle) {
+        self.cancelHandle(self);
+    }
+}
+
+- (IBAction)saveAsAction:(NSButton *)sender {
+    if (self.confirmHandle) {
+        self.confirmHandle(self);
+    }
+}
+
+#pragma mark - NSTableViewDelegate & NSTableView
+- (NSInteger)collectionView:(NSCollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
+    return [AutoSaveManager manager].autoSavePaths.count;
+}
+
+- (NSCollectionViewItem *)collectionView:(NSCollectionView *)collectionView itemForRepresentedObjectAtIndexPath:(NSIndexPath *)indexPath {
+    AutoSaveFileItem *item = [collectionView makeItemWithIdentifier:@"autoSaveFileItem" forIndexPath:indexPath];
+    
+    if ((NSInteger)[AutoSaveManager manager].autoSavePaths.count > indexPath.item) {
+        item.filePath = [[AutoSaveManager manager].autoSavePaths objectAtIndex:indexPath.item];
+    }
+    __weak typeof(self) weakSelf = self;
+    item.stateHandle = ^{
+        [weakSelf refreshSaveBtnState];
+    };
+    
+    return item;
+}
+
+- (NSSize)collectionView:(NSCollectionView *)collectionView layout:(NSCollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
+    return CGSizeMake(CGRectGetWidth(self.collectionView.frame), 32);
+}
+
+- (CGSize)collectionView:(NSCollectionView *)collectionView layout:(NSCollectionViewLayout *)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section {
+    return CGSizeMake(CGRectGetWidth(self.collectionView.frame), 0);
+}
+
+- (NSEdgeInsets)collectionView:(NSCollectionView *)collectionView layout:(NSCollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section {
+    return NSEdgeInsetsMake(0, 0, 0, 0);
+}
+
+- (CGFloat)collectionView:(NSCollectionView *)collectionView layout:(NSCollectionViewLayout *)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section {
+    return 0.01;
+}
+
+- (CGFloat)collectionView:(NSCollectionView *)collectionView layout:(NSCollectionViewLayout *)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section {
+    return 0.01;
+}
+
+#pragma mark - DarkMode
+- (void)themeChanged:(NSNotification *)notification {
+    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+        [self updateViewColor];
+    });
+}
+
+@end

+ 215 - 0
PDF Office/PDF Master/Class/Common/OC/AutoSave/AutoSavePopController.xib

@@ -0,0 +1,215 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21701"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="AutoSavePopController">
+            <connections>
+                <outlet property="cancelBtn" destination="WsC-2g-7BJ" id="eEm-wh-3x1"/>
+                <outlet property="collectionView" destination="BKU-2F-WfH" id="ZZV-K8-inU"/>
+                <outlet property="headerCheckBtn" destination="7mq-rP-JVV" id="ljL-L8-MoS"/>
+                <outlet property="headerDateLbl" destination="amj-oC-zlc" id="dtw-Se-Wt4"/>
+                <outlet property="headerLineView1" destination="Im9-9V-nBI" id="k7p-6E-4Il"/>
+                <outlet property="headerLineView2" destination="uUP-qw-229" id="Vff-fo-Cmb"/>
+                <outlet property="headerNameLbl" destination="P5u-cM-soL" id="jra-ZI-EQi"/>
+                <outlet property="headerView" destination="1Hh-eS-bTq" id="0zd-g9-DAx"/>
+                <outlet property="saveAsBtn" destination="WTc-ea-CBJ" id="1xX-dl-2bH"/>
+                <outlet property="tableBGView" destination="KBj-VH-O6S" id="5Jx-Vd-RdK"/>
+                <outlet property="titleLbl" destination="l8h-g8-ot2" id="wdB-Qb-ZpK"/>
+                <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" closable="YES" miniaturizable="YES" resizable="YES"/>
+            <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
+            <rect key="contentRect" x="196" y="240" width="600" height="418"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="1920" height="1055"/>
+            <view key="contentView" id="se5-gp-TjO">
+                <rect key="frame" x="0.0" y="0.0" width="600" height="418"/>
+                <autoresizingMask key="autoresizingMask"/>
+                <subviews>
+                    <view translatesAutoresizingMaskIntoConstraints="NO" id="zpo-K2-USx">
+                        <rect key="frame" x="0.0" y="0.0" width="600" height="418"/>
+                        <subviews>
+                            <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="WsC-2g-7BJ">
+                                <rect key="frame" x="436" y="13" width="76" height="32"/>
+                                <buttonCell key="cell" type="push" title="Cancel" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Vp4-wT-z8Q">
+                                    <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                    <font key="font" metaFont="system"/>
+                                    <string key="keyEquivalent" base64-UTF8="YES">
+Gw
+</string>
+                                </buttonCell>
+                                <connections>
+                                    <action selector="cancelAction:" target="-2" id="uqV-tR-hOL"/>
+                                </connections>
+                            </button>
+                            <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="WTc-ea-CBJ">
+                                <rect key="frame" x="506" y="13" width="81" height="32"/>
+                                <buttonCell key="cell" type="push" title="Save as" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="94h-Oj-eeE">
+                                    <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="saveAsAction:" target="-2" id="5CI-iI-Aqq"/>
+                                </connections>
+                            </button>
+                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="KBj-VH-O6S">
+                                <rect key="frame" x="20" y="60" width="560" height="320"/>
+                                <subviews>
+                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="1Hh-eS-bTq">
+                                        <rect key="frame" x="0.0" y="288" width="560" height="32"/>
+                                        <subviews>
+                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="w2l-WH-0b7">
+                                                <rect key="frame" x="0.0" y="0.0" width="328" height="32"/>
+                                                <subviews>
+                                                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="P5u-cM-soL">
+                                                        <rect key="frame" x="14" y="8" width="71" height="16"/>
+                                                        <textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Files Name" id="HY0-Bm-UgW">
+                                                            <font key="font" metaFont="system"/>
+                                                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                                                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                        </textFieldCell>
+                                                    </textField>
+                                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="Im9-9V-nBI">
+                                                        <rect key="frame" x="327" y="0.0" width="1" height="32"/>
+                                                        <constraints>
+                                                            <constraint firstAttribute="width" constant="1" id="cXa-Xl-Txa"/>
+                                                        </constraints>
+                                                    </customView>
+                                                </subviews>
+                                                <constraints>
+                                                    <constraint firstItem="Im9-9V-nBI" firstAttribute="top" secondItem="w2l-WH-0b7" secondAttribute="top" id="03d-QV-qtF"/>
+                                                    <constraint firstAttribute="bottom" secondItem="Im9-9V-nBI" secondAttribute="bottom" id="70S-a4-rSS"/>
+                                                    <constraint firstItem="P5u-cM-soL" firstAttribute="leading" secondItem="w2l-WH-0b7" secondAttribute="leading" constant="16" id="HUq-me-hSR"/>
+                                                    <constraint firstItem="P5u-cM-soL" firstAttribute="centerY" secondItem="w2l-WH-0b7" secondAttribute="centerY" id="VJA-jX-x5S"/>
+                                                    <constraint firstAttribute="trailing" secondItem="Im9-9V-nBI" secondAttribute="trailing" id="Wij-aO-ewi"/>
+                                                </constraints>
+                                            </customView>
+                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="Prf-HL-0rP">
+                                                <rect key="frame" x="328" y="0.0" width="184" height="32"/>
+                                                <subviews>
+                                                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="amj-oC-zlc">
+                                                        <rect key="frame" x="14" y="8" width="146" height="16"/>
+                                                        <textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Automatic Backup Date" id="ODg-MW-eIN">
+                                                            <font key="font" usesAppearanceFont="YES"/>
+                                                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                                                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                        </textFieldCell>
+                                                    </textField>
+                                                    <customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="uUP-qw-229">
+                                                        <rect key="frame" x="182" y="0.0" width="1" height="32"/>
+                                                        <autoresizingMask key="autoresizingMask" flexibleMinX="YES" heightSizable="YES"/>
+                                                    </customView>
+                                                </subviews>
+                                                <constraints>
+                                                    <constraint firstItem="amj-oC-zlc" firstAttribute="leading" secondItem="Prf-HL-0rP" secondAttribute="leading" constant="16" id="gFB-8j-0oh"/>
+                                                    <constraint firstItem="amj-oC-zlc" firstAttribute="centerY" secondItem="Prf-HL-0rP" secondAttribute="centerY" id="z4h-N7-0Fg"/>
+                                                </constraints>
+                                            </customView>
+                                            <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7mq-rP-JVV">
+                                                <rect key="frame" x="527" y="7" width="18" height="18"/>
+                                                <buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" inset="2" id="dDt-Du-W4h">
+                                                    <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
+                                                    <font key="font" metaFont="system"/>
+                                                </buttonCell>
+                                                <connections>
+                                                    <action selector="headerCheckBtnAction:" target="-2" id="VZg-O1-8Tb"/>
+                                                </connections>
+                                            </button>
+                                        </subviews>
+                                        <constraints>
+                                            <constraint firstAttribute="bottom" secondItem="Prf-HL-0rP" secondAttribute="bottom" id="CJp-Ma-7XP"/>
+                                            <constraint firstAttribute="trailing" secondItem="7mq-rP-JVV" secondAttribute="trailing" constant="17" id="Hjm-yW-o4T"/>
+                                            <constraint firstItem="7mq-rP-JVV" firstAttribute="centerY" secondItem="1Hh-eS-bTq" secondAttribute="centerY" id="MGp-7v-fxT"/>
+                                            <constraint firstAttribute="bottom" secondItem="w2l-WH-0b7" secondAttribute="bottom" id="ObQ-RV-CVD"/>
+                                            <constraint firstItem="Prf-HL-0rP" firstAttribute="top" secondItem="1Hh-eS-bTq" secondAttribute="top" id="cTD-HI-p42"/>
+                                            <constraint firstItem="Prf-HL-0rP" firstAttribute="leading" secondItem="w2l-WH-0b7" secondAttribute="trailing" id="co5-mv-4w9"/>
+                                            <constraint firstItem="w2l-WH-0b7" firstAttribute="leading" secondItem="1Hh-eS-bTq" secondAttribute="leading" id="dkX-ab-mmt"/>
+                                            <constraint firstItem="Prf-HL-0rP" firstAttribute="width" secondItem="1Hh-eS-bTq" secondAttribute="width" multiplier="184:560" id="fpB-Yd-eQg"/>
+                                            <constraint firstItem="w2l-WH-0b7" firstAttribute="top" secondItem="1Hh-eS-bTq" secondAttribute="top" id="jhy-Rs-xXB"/>
+                                            <constraint firstAttribute="height" constant="32" id="tfJ-X0-0hz"/>
+                                            <constraint firstItem="w2l-WH-0b7" firstAttribute="width" secondItem="1Hh-eS-bTq" secondAttribute="width" multiplier="328:560" id="xUs-Es-qPW"/>
+                                        </constraints>
+                                    </customView>
+                                    <scrollView wantsLayer="YES" autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="KNM-aC-wVf">
+                                        <rect key="frame" x="0.0" y="0.0" width="560" height="288"/>
+                                        <clipView key="contentView" id="LQo-ei-zLi">
+                                            <rect key="frame" x="1" y="1" width="558" height="286"/>
+                                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                            <subviews>
+                                                <collectionView id="BKU-2F-WfH">
+                                                    <rect key="frame" x="0.0" y="0.0" width="558" height="158"/>
+                                                    <autoresizingMask key="autoresizingMask" widthSizable="YES"/>
+                                                    <collectionViewFlowLayout key="collectionViewLayout" minimumInteritemSpacing="10" minimumLineSpacing="10" id="F8P-u5-5WO">
+                                                        <size key="itemSize" width="50" height="50"/>
+                                                    </collectionViewFlowLayout>
+                                                    <color key="primaryBackgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                </collectionView>
+                                            </subviews>
+                                        </clipView>
+                                        <scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="ly0-LG-HJQ">
+                                            <rect key="frame" x="1" y="144" width="233" height="15"/>
+                                            <autoresizingMask key="autoresizingMask"/>
+                                        </scroller>
+                                        <scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="F0W-gV-dxx">
+                                            <rect key="frame" x="234" y="1" width="15" height="143"/>
+                                            <autoresizingMask key="autoresizingMask"/>
+                                        </scroller>
+                                    </scrollView>
+                                </subviews>
+                                <constraints>
+                                    <constraint firstAttribute="trailing" secondItem="1Hh-eS-bTq" secondAttribute="trailing" id="3bw-fy-wWI"/>
+                                    <constraint firstItem="1Hh-eS-bTq" firstAttribute="top" secondItem="KBj-VH-O6S" secondAttribute="top" id="8Qm-n2-hBn"/>
+                                    <constraint firstAttribute="trailing" secondItem="KNM-aC-wVf" secondAttribute="trailing" id="d7P-vT-Alc"/>
+                                    <constraint firstItem="KNM-aC-wVf" firstAttribute="top" secondItem="1Hh-eS-bTq" secondAttribute="bottom" id="kDk-Md-Fb7"/>
+                                    <constraint firstItem="1Hh-eS-bTq" firstAttribute="leading" secondItem="KBj-VH-O6S" secondAttribute="leading" id="lX1-WV-6aP"/>
+                                    <constraint firstItem="KNM-aC-wVf" firstAttribute="leading" secondItem="KBj-VH-O6S" secondAttribute="leading" id="uqr-qJ-sN5"/>
+                                    <constraint firstAttribute="bottom" secondItem="KNM-aC-wVf" secondAttribute="bottom" id="wsA-CG-wmU"/>
+                                </constraints>
+                            </customView>
+                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="l8h-g8-ot2">
+                                <rect key="frame" x="18" y="394" width="345" height="16"/>
+                                <textFieldCell key="cell" lineBreakMode="clipping" title="Canceling it clears the accidentally stable cache records" id="bgr-rD-iEn">
+                                    <font key="font" metaFont="system"/>
+                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                </textFieldCell>
+                            </textField>
+                        </subviews>
+                        <constraints>
+                            <constraint firstItem="KBj-VH-O6S" firstAttribute="top" secondItem="zpo-K2-USx" secondAttribute="top" constant="38" id="0N1-nN-KJl"/>
+                            <constraint firstAttribute="bottom" secondItem="WsC-2g-7BJ" secondAttribute="bottom" constant="20" id="9Fd-Fh-LHs"/>
+                            <constraint firstAttribute="trailing" secondItem="WTc-ea-CBJ" secondAttribute="trailing" constant="20" id="IAi-Ip-rwZ"/>
+                            <constraint firstItem="KBj-VH-O6S" firstAttribute="leading" secondItem="zpo-K2-USx" secondAttribute="leading" constant="20" id="LFQ-Ki-VuH"/>
+                            <constraint firstItem="WTc-ea-CBJ" firstAttribute="leading" secondItem="WsC-2g-7BJ" secondAttribute="trailing" constant="8" id="MvG-NE-I34"/>
+                            <constraint firstAttribute="bottom" secondItem="WTc-ea-CBJ" secondAttribute="bottom" constant="20" id="OJa-5K-W0j"/>
+                            <constraint firstItem="l8h-g8-ot2" firstAttribute="top" secondItem="zpo-K2-USx" secondAttribute="top" constant="8" id="Ryu-c5-QA8"/>
+                            <constraint firstAttribute="trailing" secondItem="KBj-VH-O6S" secondAttribute="trailing" constant="20" id="Xze-cC-pWg"/>
+                            <constraint firstItem="l8h-g8-ot2" firstAttribute="leading" secondItem="zpo-K2-USx" secondAttribute="leading" constant="20" id="fal-uh-rBZ"/>
+                            <constraint firstAttribute="bottom" secondItem="KBj-VH-O6S" secondAttribute="bottom" constant="60" id="o55-7j-Q0o"/>
+                        </constraints>
+                    </view>
+                </subviews>
+                <constraints>
+                    <constraint firstItem="zpo-K2-USx" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" id="bIg-9g-5RM"/>
+                    <constraint firstAttribute="trailing" secondItem="zpo-K2-USx" secondAttribute="trailing" id="ek7-eH-TaG"/>
+                    <constraint firstAttribute="bottom" secondItem="zpo-K2-USx" secondAttribute="bottom" id="hqX-SE-aQE"/>
+                    <constraint firstItem="zpo-K2-USx" firstAttribute="top" secondItem="se5-gp-TjO" secondAttribute="top" id="uWp-1h-cQM"/>
+                </constraints>
+            </view>
+            <connections>
+                <outlet property="delegate" destination="-2" id="0bl-1N-AYu"/>
+            </connections>
+            <point key="canvasLocation" x="87" y="-178"/>
+        </window>
+    </objects>
+</document>

+ 195 - 65
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController.swift

@@ -126,7 +126,7 @@ let LOCKED_KEY  = "locked"
     
     var cropSettingWindowController: KMCropSettingWindowController!
     var currentWindowController: NSWindowController!
-//    var interactionMode: SKInteractionMode = .SKNormalMode
+    //    var interactionMode: SKInteractionMode = .SKNormalMode
     var savedNormalSetup: NSMutableDictionary = NSMutableDictionary()
     
     //数字签名
@@ -324,15 +324,15 @@ let LOCKED_KEY  = "locked"
     override func viewWillAppear() {
         super.viewWillAppear()
         
-        self.reStartAutoSaveTimer()
+        //        self.reStartAutoSaveTimer()
         //是否弹出登录窗口
 //        self.needShowRegisterView()
     }
     override func viewWillDisappear() {
         super.viewWillDisappear()
         
-//        KMPreferenceManager.shared.setPageNumber(self.listView.currentPageIndex, forKey: self.listView.document.documentURL.path)
-        self.pauseAutoSaveTimer()
+        //        KMPreferenceManager.shared.setPageNumber(self.listView.currentPageIndex, forKey: self.listView.document.documentURL.path)
+        //        self.pauseAutoSaveTimer()
         self.removeEventMonitor()
     }
     
@@ -406,10 +406,10 @@ let LOCKED_KEY  = "locked"
         tipCurrentPageBox.moveCallback = { [unowned self] mouseEntered, mouseBox in
             if mouseEntered {
                 self.pageNumberDisplayView.hover = true
-//                self.updatePageIndicatoreType()
+                //                self.updatePageIndicatoreType()
             } else {
                 self.pageNumberDisplayView.hover = false
-//                self.updatePageIndicatoreType()
+                //                self.updatePageIndicatoreType()
             }
         }
 
@@ -430,12 +430,16 @@ let LOCKED_KEY  = "locked"
         NotificationCenter.default.addObserver(self, selector: #selector(willShowFullScreenNotification), name: NSWindow.willShowFullScreenNotification, object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(didShowFullScreenNotification), name: NSWindow.didShowFullScreenNotification, object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(didAddContentViewNotification), name: NSWindow.didAddContentViewNotification, object: nil)
+        NotificationCenter.default.addObserver(self, selector: #selector(addAutoSaveEvent), name: AutoSaveManager.kTimeValueChangedNotificationName, object: nil)
         
         self.autoSaveTimeStartOrStopIfNeed()
+        Task {
+            self.addAutoSaveEvent()
+        }
         
         self.toolbarController.selectItem(KMDocumentAnnotationToolbarItemIdentifier)
         self.closeRightPane()
-
+        
         self.addKeyEventMonitor()
         
         self.addAdsBannerView()
@@ -445,7 +449,7 @@ let LOCKED_KEY  = "locked"
         KMResourceDownloadManager.manager.checkDocumentAIVersion()
 #endif
     }
-       
+    
     //MARK: - KMToolbarViewControllerDelegate
     
     //MARK: - PDFListView
@@ -466,7 +470,7 @@ let LOCKED_KEY  = "locked"
         self.rightSideViewController.view.frame = CGRect(x: 0, y: 0, width: self.rightView.frame.width, height: self.rightView.frame.size.height)
         self.rightSideViewController.view.autoresizingMask = [.height,.width]
         self.rightSideViewController.listView = self.listView
-//        self.rightSideViewController.view.isHidden = true
+        //        self.rightSideViewController.view.isHidden = true
         self.rightSideViewController.isHidden = true
         self.rightSideViewController.delegate = self
         self.rightView.addSubview(self.rightSideViewController.view)
@@ -550,38 +554,38 @@ let LOCKED_KEY  = "locked"
     }
     
     func checkShouldAutoOpenLeftVC() {
-//        if (KMPreferenceManager.shared.leftSideNeedCloseWhenOpenFile()) {
-//            return
-//        }
-//        if (KMPreferenceManager.shared.leftSideDisplayType == .showOutlineIfHas) {
-//            let outlineRoot = self.listView.document.outlineRoot()
-//            let hasOutline = (outlineRoot != nil && outlineRoot!.numberOfChildren > 0)
-//            if (hasOutline == false) {
-//                return
-//            }
-//
-//            DispatchQueue.main.asyncAfter(deadline: .now() + 0.15) {
-//                self.leftSideViewController.refreshMethodType(methodType: .Outline)
-//            }
-//            return
-//        }
-//        DispatchQueue.main.asyncAfter(deadline: .now() + 0.15) {
-//            let selectedIndex = UserDefaults.standard.integer(forKey: "KMBOTASelectedIndexKey")
-//            let thumai = KMLeftMethodMode()
-//            if selectedIndex == 0 {
-//                thumai.methodType = .Thumbnail
-//            } else if selectedIndex == 1 {
-//                thumai.methodType = .Outline
-//            } else if selectedIndex == 2 {
-//                thumai.methodType = .BookMark
-//            } else if selectedIndex == 3 {
-//                thumai.methodType = .Annotation
-//            } else if selectedIndex == 4 {
-//                thumai.methodType = .Search
-//            }
-//
-//            self.leftSideViewController.refreshMethodType(methodType: thumai.methodType)
-//        }
+        //        if (KMPreferenceManager.shared.leftSideNeedCloseWhenOpenFile()) {
+        //            return
+        //        }
+        //        if (KMPreferenceManager.shared.leftSideDisplayType == .showOutlineIfHas) {
+        //            let outlineRoot = self.listView.document.outlineRoot()
+        //            let hasOutline = (outlineRoot != nil && outlineRoot!.numberOfChildren > 0)
+        //            if (hasOutline == false) {
+        //                return
+        //            }
+        //
+        //            DispatchQueue.main.asyncAfter(deadline: .now() + 0.15) {
+        //                self.leftSideViewController.refreshMethodType(methodType: .Outline)
+        //            }
+        //            return
+        //        }
+        //        DispatchQueue.main.asyncAfter(deadline: .now() + 0.15) {
+        //            let selectedIndex = UserDefaults.standard.integer(forKey: "KMBOTASelectedIndexKey")
+        //            let thumai = KMLeftMethodMode()
+        //            if selectedIndex == 0 {
+        //                thumai.methodType = .Thumbnail
+        //            } else if selectedIndex == 1 {
+        //                thumai.methodType = .Outline
+        //            } else if selectedIndex == 2 {
+        //                thumai.methodType = .BookMark
+        //            } else if selectedIndex == 3 {
+        //                thumai.methodType = .Annotation
+        //            } else if selectedIndex == 4 {
+        //                thumai.methodType = .Search
+        //            }
+        //
+        //            self.leftSideViewController.refreshMethodType(methodType: thumai.methodType)
+        //        }
         if KMPreference.shared.showLeftSideBar == false {
             return
         }
@@ -1415,16 +1419,16 @@ let LOCKED_KEY  = "locked"
 //            self?.view.window?.endSheet((self?.currentWindowController.window)!)
 //            self?.currentWindowController = nil
 //        }
-//        
+//
 //        windowController.resultCallback = { [weak self] result in
 //            let windowController_secure = self?.currentWindowController as! KMSecureEncryptWindowController
 //            self?.view.window?.endSheet((self?.currentWindowController.window)!)
 //            self?.currentWindowController = nil
-//            
+//
 //            self?._secureOptions = windowController_secure.options
 //            self?.needSave = true
 //            self?.recordIsPDFDocumentEdited(type: .setPassword)
-//            
+//
 //            if (result) {
 //                self?.showSecureSuccessTip()
 //                self?.recordSaveWatermarkFlag(type: .setPassword)
@@ -1434,7 +1438,7 @@ let LOCKED_KEY  = "locked"
 //                alert.runModal()
 //            }
 //        }
-//        
+//
 //        self.view.window?.beginSheet(windowController.window!)
         
         let controller = KMSecurityWindowController(windowNibName: "KMSecurityWindowController")
@@ -1591,6 +1595,131 @@ let LOCKED_KEY  = "locked"
         }
     }
     
+    // MARK: - 定时保存
+    
+    func addAutoSaveEvent() {
+        if (self.autoSaveTimer != nil) {
+            self.autoSaveTimer?.invalidate()
+            self.autoSaveTimer = nil
+        }
+        
+        if self.document != nil {
+            self.autoSaveTimer = Timer.scheduledTimer(withTimeInterval: AutoSaveManager.manager.timeInterval * 60, repeats: true, block: { [weak self] timer in
+                self?.autoSaveTimerAction(timer)
+            })
+        }
+        self.checkAutoSaveInfo()
+    }
+    
+    func checkAutoSaveInfo() {
+        guard let cnt = AutoSaveManager.manager.autoSavePaths?.count, cnt > 0 else {
+            return
+        }
+        if AutoSaveManager.manager.autoSaveAlertShow {
+            return
+        }
+        
+        AutoSaveManager.manager.autoSaveDidEndAction = false
+        AutoSaveManager.manager.autoSaveAlertShow = true
+        
+        let blockSaveWindow = AutoSavePopController()
+        blockSaveWindow.cancelHandle = { [weak self] windowController in
+            AutoSaveManager.manager.autoSaveDidEndAction = true
+            AutoSaveManager.manager.clearCache()
+            self?.km_quick_endSheet()
+        }
+        
+        blockSaveWindow.confirmHandle = { [weak self] windowController in
+            self?.km_quick_endSheet()
+            self?.saveAutoSaveInfo()
+        }
+        self.km_beginSheet(windowC: blockSaveWindow)
+    }
+    
+    func saveAutoSaveInfo() {
+        let openPanel = NSOpenPanel()
+        openPanel.canChooseDirectories = true
+        openPanel.canChooseFiles = false
+        openPanel.allowsMultipleSelection = false
+        let win = NSApp.keyWindow != nil ? NSApp.keyWindow : self.view.window
+        openPanel.beginSheetModal(for: win!) { result in
+            if (result == .OK)  {
+                let folderPath = openPanel.url?.path ?? openPanel.url?.absoluteString
+                for path in AutoSaveManager.manager.opendPaths ?? [] {
+                    let _path = path as? String
+                    var newPath = "\(folderPath ?? "")/\(_path?.lastPathComponent ?? "")"
+                    newPath = self.getValidFilePath(newPath)
+                    do {
+                        try FileManager.default.moveItem(atPath: _path ?? "", toPath: newPath)
+                    } catch {
+                        NSWorkspace.shared.activateFileViewerSelecting([URL(fileURLWithPath: newPath)])
+                    }
+                }
+                AutoSaveManager.manager.clearCache()
+            }
+            AutoSaveManager.manager.autoSaveDidEndAction = true
+        }
+    }
+    
+    func autoSaveTimerAction(_ timer: Timer) {
+        if (self.document == nil || self.listView?.document?.documentURL.path == nil) {
+            return
+        }
+        if AutoSaveManager.manager.autoSaveDidEndAction == false {
+            //防止提示弹窗出现后,未进行任何操作又进入自动保存的机制
+            return
+        }
+        
+        if let data = self.document?.isLocked, data {
+            return
+        }
+        
+        if AutoSaveManager.manager.autoSaveEnabled == false {
+            return
+        }
+        
+        let documentArray = NSDocumentController.shared.documents
+        var didFileEdit = false
+        for doc in documentArray {
+            if doc.fileURL?.path == self.document?.documentURL.path {
+                didFileEdit = doc.isDocumentEdited
+                break
+            }
+        }
+        if (didFileEdit == false) {
+            return
+        }
+        
+        AutoSaveManager.manager.isSaving = true
+        let savePath = AutoSaveManager.manager.autoSaveWithPath(self.listView?.document?.documentURL.path ?? "")
+        if (!self.document!.isLocked) {
+            self.document?.write(to: URL(fileURLWithPath: savePath))
+        }
+        DispatchQueue.main.asyncAfter(deadline: .now() + 1.5) {
+            AutoSaveManager.manager.isSaving = false
+        }
+    }
+    
+    func removeAutoSaveInfo() {
+        if self.autoSaveTimer != nil {
+            self.autoSaveTimer?.invalidate()
+            self.autoSaveTimer = nil
+        }
+        
+        if AutoSaveManager.manager.autoSaveDidEndAction == false {
+            //防止提示弹窗出现后,未进行任何操作又进入自动保存的机制
+            return
+        }
+        if AutoSaveManager.manager.autoSaveEnabled == false {
+            return
+        }
+        
+        if self.document == nil || self.listView?.document?.documentURL.path == nil {
+            return
+        }
+        AutoSaveManager.manager.removeAutoSavePath(self.listView?.document?.documentURL.path ?? "")
+    }
+    
     // MARK: -
     // MARK: 选择 PDFDisplay 模式
     @objc public func selectDisplay(display: KMPDFDisplayType, viewSettingIsReload: Bool = true) {
@@ -1670,26 +1799,26 @@ let LOCKED_KEY  = "locked"
     // MARK: - 自动保存
     
     internal func autoSaveTimeStartOrStopIfNeed() {
-        if (KMPreferenceManager.shared.autoSave == false) {
-            self.stopAutoSaveTimer()
-            return
-        }
-        
-        self.startAutoSaveTimer(KMPreferenceManager.shared.autoSaveTimeInterval)
-        if (self.myDocument == nil) {
-            self.stopAutoSaveTimer()
-            return
-        }
-        
-        let browser = self.browserWindowController?.browser
-        guard let activeDocument = browser?.activeTabContents() else {
-            return
-        }
-        
-        if (self.myDocument!.isEqual(to: activeDocument) == false)  {
-            self.pauseAutoSaveTimer()
-            return
-        }
+//        if (KMPreferenceManager.shared.autoSave == false) {
+//            self.stopAutoSaveTimer()
+//            return
+//        }
+//
+//        self.startAutoSaveTimer(KMPreferenceManager.shared.autoSaveTimeInterval)
+//        if (self.myDocument == nil) {
+//            self.stopAutoSaveTimer()
+//            return
+//        }
+//
+//        let browser = self.browserWindowController?.browser
+//        guard let activeDocument = browser?.activeTabContents() else {
+//            return
+//        }
+//
+//        if (self.myDocument!.isEqual(to: activeDocument) == false)  {
+//            self.pauseAutoSaveTimer()
+//            return
+//        }
     }
     
     private func startAutoSaveTimer(_ interval: TimeInterval) {
@@ -1916,6 +2045,7 @@ let LOCKED_KEY  = "locked"
         if (self.listView.spellingTag() > 0) {
             NSSpellChecker.shared.closeSpellDocument(withTag: self.listView.spellingTag())
         }
+        self.removeAutoSaveInfo()
     }
     
     public func clearSecureOptions() {

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

@@ -104,3 +104,5 @@
 #import "SKBookmarkSheetController.h"
 #import "SKBookmarkController.h"
 #import "SKBookmark.h"
+
+#import "AutoSavePopController.h"

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

@@ -100,3 +100,5 @@
 #import "SKBookmarkSheetController.h"
 #import "SKBookmarkController.h"
 #import "SKBookmark.h"
+
+#import "AutoSavePopController.h"

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

@@ -100,3 +100,5 @@
 #import "SKBookmarkSheetController.h"
 #import "SKBookmarkController.h"
 #import "SKBookmark.h"
+
+#import "AutoSavePopController.h"

+ 44 - 0
PDF Office/PDF Reader Pro.xcodeproj/project.pbxproj

@@ -4604,6 +4604,18 @@
 		BBD7FE072A1323F500F96075 /* KMCustomTableRowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 899E0B082919244500B13D34 /* KMCustomTableRowView.swift */; };
 		BBD7FE082A13241C00F96075 /* KMOutlineEditViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89DB5DA7291B8DE70029624F /* KMOutlineEditViewController.swift */; };
 		BBD7FE092A13241E00F96075 /* KMOutlineEditViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89DB5DA7291B8DE70029624F /* KMOutlineEditViewController.swift */; };
+		BBD8EE902B8EC86900EB05FE /* AutoSavePopController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BBD8EE8B2B8EC86900EB05FE /* AutoSavePopController.xib */; };
+		BBD8EE912B8EC86900EB05FE /* AutoSavePopController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BBD8EE8B2B8EC86900EB05FE /* AutoSavePopController.xib */; };
+		BBD8EE922B8EC86900EB05FE /* AutoSavePopController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BBD8EE8B2B8EC86900EB05FE /* AutoSavePopController.xib */; };
+		BBD8EE932B8EC86A00EB05FE /* AutoSaveFileItem.m in Sources */ = {isa = PBXBuildFile; fileRef = BBD8EE8C2B8EC86900EB05FE /* AutoSaveFileItem.m */; };
+		BBD8EE942B8EC86A00EB05FE /* AutoSaveFileItem.m in Sources */ = {isa = PBXBuildFile; fileRef = BBD8EE8C2B8EC86900EB05FE /* AutoSaveFileItem.m */; };
+		BBD8EE952B8EC86A00EB05FE /* AutoSaveFileItem.m in Sources */ = {isa = PBXBuildFile; fileRef = BBD8EE8C2B8EC86900EB05FE /* AutoSaveFileItem.m */; };
+		BBD8EE962B8EC86A00EB05FE /* AutoSavePopController.m in Sources */ = {isa = PBXBuildFile; fileRef = BBD8EE8D2B8EC86900EB05FE /* AutoSavePopController.m */; };
+		BBD8EE972B8EC86A00EB05FE /* AutoSavePopController.m in Sources */ = {isa = PBXBuildFile; fileRef = BBD8EE8D2B8EC86900EB05FE /* AutoSavePopController.m */; };
+		BBD8EE982B8EC86A00EB05FE /* AutoSavePopController.m in Sources */ = {isa = PBXBuildFile; fileRef = BBD8EE8D2B8EC86900EB05FE /* AutoSavePopController.m */; };
+		BBD8EE992B8EC86A00EB05FE /* AutoSaveFileItem.xib in Resources */ = {isa = PBXBuildFile; fileRef = BBD8EE8F2B8EC86900EB05FE /* AutoSaveFileItem.xib */; };
+		BBD8EE9A2B8EC86A00EB05FE /* AutoSaveFileItem.xib in Resources */ = {isa = PBXBuildFile; fileRef = BBD8EE8F2B8EC86900EB05FE /* AutoSaveFileItem.xib */; };
+		BBD8EE9B2B8EC86A00EB05FE /* AutoSaveFileItem.xib in Resources */ = {isa = PBXBuildFile; fileRef = BBD8EE8F2B8EC86900EB05FE /* AutoSaveFileItem.xib */; };
 		BBD9222B2B50D50A00DB9585 /* iRate.m in Sources */ = {isa = PBXBuildFile; fileRef = BBD922292B50D50900DB9585 /* iRate.m */; };
 		BBD9222C2B50D50A00DB9585 /* iRate.m in Sources */ = {isa = PBXBuildFile; fileRef = BBD922292B50D50900DB9585 /* iRate.m */; };
 		BBD9222D2B50D50A00DB9585 /* iRate.m in Sources */ = {isa = PBXBuildFile; fileRef = BBD922292B50D50900DB9585 /* iRate.m */; };
@@ -6927,6 +6939,12 @@
 		BBD6D4A62B881F0A00369F7D /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = "<group>"; };
 		BBD6D4A92B881F2B00369F7D /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Main.strings"; sourceTree = "<group>"; };
 		BBD6D4AB2B881F3200369F7D /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Main.strings"; sourceTree = "<group>"; };
+		BBD8EE8A2B8EC86900EB05FE /* AutoSavePopController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AutoSavePopController.h; sourceTree = "<group>"; };
+		BBD8EE8B2B8EC86900EB05FE /* AutoSavePopController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = AutoSavePopController.xib; sourceTree = "<group>"; };
+		BBD8EE8C2B8EC86900EB05FE /* AutoSaveFileItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AutoSaveFileItem.m; sourceTree = "<group>"; };
+		BBD8EE8D2B8EC86900EB05FE /* AutoSavePopController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AutoSavePopController.m; sourceTree = "<group>"; };
+		BBD8EE8E2B8EC86900EB05FE /* AutoSaveFileItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AutoSaveFileItem.h; sourceTree = "<group>"; };
+		BBD8EE8F2B8EC86900EB05FE /* AutoSaveFileItem.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = AutoSaveFileItem.xib; sourceTree = "<group>"; };
 		BBD922292B50D50900DB9585 /* iRate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = iRate.m; sourceTree = "<group>"; };
 		BBD9222A2B50D50A00DB9585 /* iRate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iRate.h; sourceTree = "<group>"; };
 		BBD9222E2B50D60000DB9585 /* KMRateWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMRateWindowController.swift; sourceTree = "<group>"; };
@@ -11472,6 +11490,7 @@
 		BB5F8A0329BB04EF00365ADB /* OC */ = {
 			isa = PBXGroup;
 			children = (
+				BBD8EE892B8EC86900EB05FE /* AutoSave */,
 				BBBBB49C2B6F743700C7205E /* AttachmentEmailer */,
 				BBBBB4962B6F70B100C7205E /* Common */,
 				BBBAED082B57D52D00266BD3 /* KMTransitionController */,
@@ -12502,6 +12521,19 @@
 			path = Model;
 			sourceTree = "<group>";
 		};
+		BBD8EE892B8EC86900EB05FE /* AutoSave */ = {
+			isa = PBXGroup;
+			children = (
+				BBD8EE8A2B8EC86900EB05FE /* AutoSavePopController.h */,
+				BBD8EE8B2B8EC86900EB05FE /* AutoSavePopController.xib */,
+				BBD8EE8C2B8EC86900EB05FE /* AutoSaveFileItem.m */,
+				BBD8EE8D2B8EC86900EB05FE /* AutoSavePopController.m */,
+				BBD8EE8E2B8EC86900EB05FE /* AutoSaveFileItem.h */,
+				BBD8EE8F2B8EC86900EB05FE /* AutoSaveFileItem.xib */,
+			);
+			path = AutoSave;
+			sourceTree = "<group>";
+		};
 		BBD922282B50D43800DB9585 /* Rate */ = {
 			isa = PBXGroup;
 			children = (
@@ -13572,6 +13604,7 @@
 				ADF9ED3329A850D200C4A943 /* KMAccountInfoView.xib in Resources */,
 				BB46CF482AFB7E5C00281EDF /* InitialUserDefaults.plist in Resources */,
 				ADD5AE592A64DD2600C14249 /* KMPurchaseAlertView.xib in Resources */,
+				BBD8EE902B8EC86900EB05FE /* AutoSavePopController.xib in Resources */,
 				BB7F7C0029AA586800A3E4E7 /* signAdd.png in Resources */,
 				AD58F4052B14954B00299EE0 /* KMCompareTextHeaderView.xib in Resources */,
 				BBBE208F2B2164CD00509C4E /* KMPDFEditWindowController.xib in Resources */,
@@ -13591,6 +13624,7 @@
 				BBD9223A2B50D6D600DB9585 /* rate_pic_pro.pdf in Resources */,
 				ADBC376129CC637900D93208 /* KMReadModelView.xib in Resources */,
 				ADDF83832B391A5D00A81A4E /* DSignatureSaveTypeViewController.xib in Resources */,
+				BBD8EE992B8EC86A00EB05FE /* AutoSaveFileItem.xib in Resources */,
 				AD1D480B2AFB18DA007AC1F0 /* KMCompressWIndowControllerNew.xib in Resources */,
 				9F1F82DD292F84D60092C4B4 /* KMHomeInsertActionViewController.xib in Resources */,
 				9F78EFBE28F7C1CC001E66F4 /* KMHomeViewController.xib in Resources */,
@@ -13986,6 +14020,7 @@
 				BBADCF592AF3C7B3004ECE0C /* KMBatchOperateAddWatermarkViewController.xib in Resources */,
 				BBC3481029558DC1008D2CD1 /* KMBackgroundController.xib in Resources */,
 				BB1B0AF02B4FC6E900889528 /* KMFunctionGuideNameItemView.xib in Resources */,
+				BBD8EE9A2B8EC86A00EB05FE /* AutoSaveFileItem.xib in Resources */,
 				BB10FAEA2AFE03CD00F18D65 /* KMPDFEditPageRangeWindowController.xib in Resources */,
 				BB1B0AE12B4FC6E900889528 /* KMOpenFileGuidePanel.xib in Resources */,
 				BBAFC84E298519F700D0648E /* KMSavePanelAccessoryController.xib in Resources */,
@@ -14098,6 +14133,7 @@
 				BBEC00DD295C39FD00A26C98 /* KMBatesPropertyInfoController.xib in Resources */,
 				BBA8B7B4293635D80097D183 /* KMPasswordInputWindow.xib in Resources */,
 				BBBAECF92B57672C00266BD3 /* TransitionSheet.xib in Resources */,
+				BBD8EE912B8EC86900EB05FE /* AutoSavePopController.xib in Resources */,
 				9F78EFBF28F7C1CC001E66F4 /* KMHomeViewController.xib in Resources */,
 				9FDCD8122B6C904900E22166 /* KMFormListMenuPopWindowController.xib in Resources */,
 				BBB376A52B10A7FD009539CC /* a_4b.png in Resources */,
@@ -14594,6 +14630,7 @@
 				899700ED28F3E4D3009AF911 /* MainWindowController.xib in Resources */,
 				BB65A0422AF8863F003A27A0 /* GeneralPreferences.xib in Resources */,
 				AD1D48152AFB1912007AC1F0 /* KMCompressView.xib in Resources */,
+				BBD8EE922B8EC86900EB05FE /* AutoSavePopController.xib in Resources */,
 				AD88109C29A78AEC00178CA1 /* KMVerificationCodeView.xib in Resources */,
 				89E4E7872967BF5A002DBA6F /* KMCustomizeStampViewController.xib in Resources */,
 				BBBE20912B2164CD00509C4E /* KMPDFEditWindowController.xib in Resources */,
@@ -14613,6 +14650,7 @@
 				AD58F41C2B1DAC1500299EE0 /* KMPrintSettingView.xib in Resources */,
 				BB1EC8032967B26700EC0BC3 /* KMPDFEditViewController.xib in Resources */,
 				ADDF83852B391A5D00A81A4E /* DSignatureSaveTypeViewController.xib in Resources */,
+				BBD8EE9B2B8EC86A00EB05FE /* AutoSaveFileItem.xib in Resources */,
 				BBD1F781296F9BE000343885 /* KMPageEditSettingBaseWindowController.xib in Resources */,
 				BB5DF1EE2959C5CB0025CDA1 /* KMHeaderFooterPreviewController.xib in Resources */,
 				ADBC2D17299CCD10006280C8 /* KMTextfieldButton.xib in Resources */,
@@ -15333,6 +15371,7 @@
 				ADDF836B2B391A5C00A81A4E /* DSignatureSaveTypeViewController.swift in Sources */,
 				9F0CB50D2986564500007028 /* KMDesignToken+BorderLeft.swift in Sources */,
 				9FBC489B2996500300CA39D7 /* KMDocumentController.swift in Sources */,
+				BBD8EE962B8EC86A00EB05FE /* AutoSavePopController.m in Sources */,
 				BB2F9AAF2AFCAE1F00F9DD93 /* KMProfileTitleCellView.swift in Sources */,
 				BBC348332955A118008D2CD1 /* KMCreateBackgroundController.swift in Sources */,
 				AD58F41F2B1DC29100299EE0 /* KMPrintViewModel.swift in Sources */,
@@ -15608,6 +15647,7 @@
 				BB88E45829404752002B3655 /* KMPDFConvert.swift in Sources */,
 				9F1FE4CC29406E4700E952CA /* CTTabContentsController.m in Sources */,
 				BB146FF0299DC0D100784A6A /* GTLRUploadParameters.m in Sources */,
+				BBD8EE932B8EC86A00EB05FE /* AutoSaveFileItem.m in Sources */,
 				AD3AAD232B0B6F9E00DE5FE7 /* KMCompareContentView.swift in Sources */,
 				AD88108329A719D400178CA1 /* KMRegisterView.swift in Sources */,
 				9FD0D2B32AD5265A00DA3FF8 /* CPDFListAnnotationNoteWindowController.swift in Sources */,
@@ -16443,6 +16483,7 @@
 				9F1FE4D629406E4700E952CA /* NSPasteboard+Utils.m in Sources */,
 				BB147015299DC0D100784A6A /* OIDAuthState.m in Sources */,
 				BB3AAB9129878CE000992A5A /* KMWatermarkAdjectivePropertyMainController.swift in Sources */,
+				BBD8EE972B8EC86A00EB05FE /* AutoSavePopController.m in Sources */,
 				BB147039299DC0D200784A6A /* OIDAuthorizationResponse.m in Sources */,
 				BB67EE182B54FFEF00573BF0 /* ASIDataCompressor.m in Sources */,
 				9F1FE4B229406E4700E952CA /* CTTabWindowController.m in Sources */,
@@ -16715,6 +16756,7 @@
 				9F0CB5162986566D00007028 /* KMDesignToken+BorderRadiusTopLeft.swift in Sources */,
 				AD867F8729D94F5100F00440 /* KMBOTAOutlineView.swift in Sources */,
 				ADAFDA292AE8DE1B00F084BC /* KMAdvertisementModelTransition.swift in Sources */,
+				BBD8EE942B8EC86A00EB05FE /* AutoSaveFileItem.m in Sources */,
 				9F0CB536298656F900007028 /* KMDesignToken+BorderWidthLeft.swift in Sources */,
 				BBA8B7AB2935DC120097D183 /* KMRemovePasswordResultTipView.swift in Sources */,
 				BBC8A7652B05C93900FA9377 /* KMThumbnailTableView.swift in Sources */,
@@ -17282,6 +17324,7 @@
 				BBF811E22B07178F0074874F /* KMExtractImageWindowController.swift in Sources */,
 				BBEFD01A2AF9BD24003FABD8 /* KMDataVersionManager.swift in Sources */,
 				BBF38A64294F53FD0086D025 /* KMWatermarkFileView.swift in Sources */,
+				BBD8EE982B8EC86A00EB05FE /* AutoSavePopController.m in Sources */,
 				899700F828F4051B009AF911 /* KMAnnotationViewController.swift in Sources */,
 				BBDA8A6F2A31F9A6006A2C4E /* KMDesignStepperView.swift in Sources */,
 				BBAFC83E2985194800D0648E /* KMPDFEditAppendWindow.m in Sources */,
@@ -17314,6 +17357,7 @@
 				BBF811F32B0763930074874F /* PDFConvertObject.swift in Sources */,
 				BBC8DC722B57854800270C98 /* KMSecondaryPDFView.swift in Sources */,
 				BB897230294B08DE0045787C /* KMWatermarkViewController.swift in Sources */,
+				BBD8EE952B8EC86A00EB05FE /* AutoSaveFileItem.m in Sources */,
 				ADE86AE82B0AF50B00414DFA /* KMCompareCoveringSettingWindowController.swift in Sources */,
 				BB8B17342907B63D001C5EA5 /* CipherTextView.swift in Sources */,
 				ADBC375229CAE27900D93208 /* KMComparativeOutlineRowView.swift in Sources */,

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

@@ -499,5 +499,37 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "97355821-9929-4F22-9E18-787CA2C2B2FA"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "PDF Master/Class/PDFWindowController/ViewController/KMMainViewController.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1608"
+            endingLineNumber = "1608"
+            landmarkName = "addAutoSaveEvent()"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "838E1538-ABF3-49FF-963A-26F032E93ACA"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "PDF Master/Class/PDFWindowController/ViewController/KMMainViewController.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1665"
+            endingLineNumber = "1665"
+            landmarkName = "autoSaveTimerAction(_:)"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>