Bläddra i källkod

【2025】【Protect】数字签名,选择工具时应该先弹提示弹窗修复

lizhe 1 månad sedan
förälder
incheckning
48d15428f2

+ 20 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/KMMainViewController.swift

@@ -733,6 +733,8 @@ struct KMNMWCFlags {
                 //数字签名
                 listView.annotationType = .digitalSign
                 listView.toolMode = .CDigitalSignToolMode
+                
+                self.enterDigitalSignature()
             }
             
             
@@ -1533,6 +1535,24 @@ struct KMNMWCFlags {
         signaturestateVC.reloadData()
     }
     
+    func enterDigitalSignature() {
+        if UserDefaults.standard.object(forKey: "kDigitalSignature") != nil {
+            return
+        }
+        let alert = NSAlert()
+        alert.alertStyle = .informational
+        alert.messageText = KMLocalizedString("Using your mouse, click and drag to draw the area where you would like the signature to appear. Once you finish dragging out the desired area, you will be taken to the next step of the signing process. ")
+        alert.addButton(withTitle: KMLocalizedString("OK"))
+        alert.showsSuppressionButton = true
+        let response = alert.runModal()
+        if response.rawValue == 1000 {
+            if alert.suppressionButton?.state == .on {
+                UserDefaults.standard.set("YES", forKey: "kDigitalSignature")
+                UserDefaults.standard.synchronize()
+            }
+        }
+    }
+    
     
     // MARK: - 显示合并窗口
     public func showMergeWindow(url: URL? = nil, _ password: String?) {