Browse Source

【批量操作】- 优化

jiajie 1 year ago
parent
commit
d4f047cca7

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

@@ -39,10 +39,12 @@ class KMBatchOperateSplitViewController: NSSplitViewController{
         self.rightPropertiesViewController?.switchToOperateType(operateType: operateType, files: files)
     }
     func switchToOperateType(_ operateType: KMBatchOperationType) {
+        self.rightPropertiesViewController?.files = self.leftFileListViewController?.files ?? []
         self.leftFileListViewController!.switchToOperateType(operateType)
         self.rightPropertiesViewController!.switchToOperateType(operateType: operateType)
     }
     func switchToConvertType(_ convertType: KMConvertWithPDFType) {
+        self.rightPropertiesViewController?.files = self.leftFileListViewController?.files ?? []
         self.leftFileListViewController!.reloadConvertInterface(withType: convertType)
         self.rightPropertiesViewController!.switchToConvertType(convertType)
     }

+ 2 - 6
PDF Office/PDF Master/Class/PDFTools/AddPassword/VC/KMBatchOperateAddPasswordViewController.swift

@@ -181,12 +181,8 @@ class KMBatchOperateAddPasswordViewController: KMBatchOperateBaseViewController,
         encryptButtonEnabled()
     }
     @objc func batchFilesCountNotification(notification: Notification) {
-        let arr: Array? = notification.object as? [Any]
-        if arr?.count ?? 0 > 0{
-            self.haveFiles = true
-        }else {
-            self.haveFiles = false
-        }
+        let arr: Array? = notification.object as? [KMBatchOperateFile]
+        self.files? = arr ?? []
         encryptButtonEnabled()
     }
     @objc func themeChanged(notification: Notification) {

+ 7 - 1
PDF Office/PDF Master/Class/PDFTools/RemoveWatermark/VC/KMBatchOperateRemoveWatermarkViewController.swift

@@ -103,7 +103,13 @@ class KMBatchOperateRemoveWatermarkViewController: KMBatchOperateBaseViewControl
         }
     }
     @objc func batchFilesCountNotification(notification: Notification) {
-        var _: Array? = notification.object as? [Any]
+        let arr: Array? = notification.object as? [KMBatchOperateFile]
+        self.files? = arr ?? []
+        if self.files?.count ?? 0 > 0{
+            self.haveFiles = true
+        } else {
+            self.haveFiles = false
+        }
         updateBtnStatus()
     }
     @objc func themeChanged(notification: Notification) {

+ 1 - 1
PDF Office/PDF Master/Class/PDFTools/Watermark/Controller/KMBatchOperateAddWatermarkViewController.swift

@@ -209,7 +209,7 @@ class KMBatchOperateAddWatermarkViewController: KMBatchOperateBaseViewController
     }
     
     //button Actions,切换水印类型
-    @IBAction func funcbuttonClicked_SwitchWaterMarkType(_ sender: NSButton) {
+    @IBAction func buttonClicked_SwitchWaterMarkType(_ sender: NSButton) {
         if (self.isBackground) {
             self.currentBackgroundType = KMBackgroundType(rawValue: sender.tag) ?? .color
         } else {