Browse Source

【批量】- 移除密码

jiajie 1 year ago
parent
commit
12c00757f7

+ 6 - 1
PDF Office/PDF Master/Class/Batch/WindowController/KMBatchOperateLeftViewController.swift

@@ -286,8 +286,9 @@ class KMBatchOperateLeftViewController: NSViewController,NSTableViewDelegate,NST
             let filePath = lockFilePathArr![lockFileIndex] as! String
             let com = PasswordWindowController(windowNibName: "PasswordWindowController")
             com.fileURL = URL(fileURLWithPath: filePath)
-            NSWindow.currentWindow().km_beginSheet(windowC: com)
+            self.km_beginSheet(windowC: com)
             com.closeCallBack = { password in
+                self.closePwd()
                 if !password.isEmpty {
                     let file = KMBatchOperateFile(filePath: filePath, type: self.type!)
                     file.password = password
@@ -305,6 +306,10 @@ class KMBatchOperateLeftViewController: NSViewController,NSTableViewDelegate,NST
             }
         }
     }
+    func closePwd() {
+        self.km_endSheet()
+    }
+    
     func chooseFileFromCamera() {
         self.progressInt = 0
         let vc = KMDeviceBrowserWindowController()

+ 2 - 2
PDF Office/PDF Master/Class/Batch/WindowController/PasswordWindowController.swift

@@ -98,7 +98,7 @@ protocol PasswordWindowDelegate: AnyObject {
         if (self.closeCallBack != nil) {
             closeCallBack!(password ?? "")
         }
-        NSWindow.currentWindow().endSheet(self.window!)
-        self.window?.orderOut(self)
+//        NSWindow.currentWindow().endSheet(self.window!)
+//        self.window?.orderOut(self)
     }
 }