Przeglądaj źródła

【综合】系统菜单栏重置Form菜单入口补充

tangchao 1 rok temu
rodzic
commit
93492d095e

+ 6 - 22
PDF Office/PDF Master.xcodeproj/xcuserdata/kdanmobile.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -318,8 +318,8 @@
             filePath = "PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+MenuAction.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1127"
-            endingLineNumber = "1127"
+            startingLineNumber = "1131"
+            endingLineNumber = "1131"
             landmarkName = "rotateAllRight(_:)"
             landmarkType = "7">
          </BreakpointContent>
@@ -334,8 +334,8 @@
             filePath = "PDF Master/Class/ChromiumTabs/KMBrowserWindowController.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2306"
-            endingLineNumber = "2306"
+            startingLineNumber = "2312"
+            endingLineNumber = "2312"
             landmarkName = "autoSelectContent(_:)"
             landmarkType = "7">
          </BreakpointContent>
@@ -350,8 +350,8 @@
             filePath = "PDF Master/Class/ChromiumTabs/KMBrowserWindowController.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2035"
-            endingLineNumber = "2035"
+            startingLineNumber = "2041"
+            endingLineNumber = "2041"
             landmarkName = "editWatermark(_:)"
             landmarkType = "7">
          </BreakpointContent>
@@ -388,22 +388,6 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "38C2C48E-EFBB-43D8-A676-1371B12D578A"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+UI.swift"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "144"
-            endingLineNumber = "144"
-            landmarkName = "changeAnnotationModeAction(item:)"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent

+ 9 - 3
PDF Office/PDF Master/Class/ChromiumTabs/KMBrowserWindowController.swift

@@ -838,9 +838,6 @@ extension KMBrowserWindowController {
         KMPrint("selfSignProfile ...")
     }
 
-    @IBAction func resetForm(_ sender: Any?) {
-        KMPrint("resetForm ...")
-    }
     @IBAction func removeAllAnnotation(_ sender: Any?) {
         KMPrint("removeAllAnnotation ...")
     }
@@ -1625,6 +1622,15 @@ extension KMBrowserWindowController: KMSystemPDFMenuProtocol {
             document.mainViewController?.highlightLinks(sender)
         }
     }
+    
+    @IBAction func resetForm(_ sender: Any?) {
+        if (self.canResponseDocumentAction() == false) {
+            return
+        }
+        if let document = self.browser.activeTabContents() as? KMMainDocument, document.isHome == false {
+            document.mainViewController?.resetForm(sender)
+        }
+    }
 }
 
 // MARK: - KMSystemGotoMenuProtocol

+ 2 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+Extension.h

@@ -43,6 +43,8 @@
 - (void)goToPageAtIndex:(NSUInteger)pageIndex point:(NSPoint)point;
 - (NSUInteger)currentPageIndexAndPoint:(NSPoint *)point rotated:(BOOL *)rotated;
 
+- (void)resetFormAnnotation;
+
 @end
 
 @interface CPDFView (KMExtension)

+ 16 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+Extension.m

@@ -533,6 +533,22 @@ CGFloat DEFAULT_SNAPSHOT_HEIGHT = 200.0;
     return [page pageIndex];
 }
 
+- (void)resetFormAnnotation {
+    NSAlert* alert = [[NSAlert alloc] init];
+    [alert setAlertStyle:NSAlertStyleCritical];
+    [alert setMessageText:NSLocalizedString(@"Do you really want to reset the form?", nil)];
+    [alert addButtonWithTitle:NSLocalizedString(@"Yes", nil)];
+    [alert addButtonWithTitle:NSLocalizedString(@"No", nil)];
+    
+    NSModalResponse response = [alert runModal];
+    if (response == NSAlertFirstButtonReturn) {
+        CPDFResetFormAction *action = [[CPDFResetFormAction alloc] init];
+//        action.fieldsIncludedAreCleared = NO;
+        [self performAction:action];
+        [self setNeedsDisplay:YES];
+    }
+}
+
 @end
 
 @implementation CPDFView (KMExtension)

+ 4 - 0
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+MenuAction.swift

@@ -648,6 +648,10 @@ extension KMMainViewController: KMSystemPDFMenuProtocol {
         
         self.listView.setNeedsDisplayForVisiblePages()
     }
+    
+    func resetForm(_ sender: Any?) {
+        self.listView.resetFormAnnotation()
+    }
 }
 
 // MARK: goto Menu

+ 5 - 2
PDF Office/PDF Master/Class/SystemMenu/KMSystemPDFMenu.swift

@@ -23,7 +23,7 @@ import Cocoa
     
     @objc optional func highlightFormFiled(_ sender: Any?)
     @objc optional func highlightLinks(_ sender: Any?)
-    
+    @objc optional func resetForm(_ sender: Any?)
 }
 
 extension KMSystemMenu.PDF {
@@ -43,9 +43,12 @@ extension KMSystemMenu.PDF {
     public static let highlightFormFiledSelector    = NSSelectorFromString("highlightFormFiled:")
     public static let highlightLinksSelector    = NSSelectorFromString("highlightLinks:")
     
+    public static let resetFormSelector    = NSSelectorFromString("resetForm:")
+    
     public static func actions() -> [Selector] {
         return [self.changeDisplayModeSelector, self.toggleDisplayAsBookSelector, self.toggleDisplayPageBreaksSelector, self.changeDisplayBoxSelector,
                 self.toggleAutoScaleSelector, self.doZoomToActualSizeSelector, self.doZoomToFitSelector, self.doZoomInSelector, self.doZoomOutSelector, self.doMarqueeZoomToolSelector,
-                self.highlightFormFiledSelector, self.highlightLinksSelector]
+                self.highlightFormFiledSelector, self.highlightLinksSelector,
+                self.resetFormSelector]
     }
 }