Browse Source

add print

marinofaggiana 4 năm trước cách đây
mục cha
commit
67f170a70d
1 tập tin đã thay đổi với 8 bổ sung0 xóa
  1. 8 0
      iOSClient/Main/NCFunctionCenter.swift

+ 8 - 0
iOSClient/Main/NCFunctionCenter.swift

@@ -536,6 +536,10 @@ import NCCommunication
             self.openDownload(metadata: metadata, selector: NCGlobal.shared.selectorOpenIn)
         }
         
+        let print = UIAction(title: NSLocalizedString("_print_", comment: ""), image: UIImage(systemName: "printer") ) { action in
+            self.openDownload(metadata: metadata, selector: NCGlobal.shared.selectorPrint)
+        }
+        
         let openQuickLook = UIAction(title: NSLocalizedString("_open_quicklook_", comment: ""), image: UIImage(systemName: "eye")) { action in
             self.openDownload(metadata: metadata, selector: NCGlobal.shared.selectorLoadFileQuickLook)
         }
@@ -581,6 +585,10 @@ import NCCommunication
             children.insert(save, at: 2)
         }
         
+        if metadata.typeFile == NCGlobal.shared.metadataTypeFileImage || metadata.contentType == "application/pdf" {
+            children.insert(print, at: 2)
+        }
+        
         if enableViewInFolder {
             children.insert(viewInFolder, at: 5)
         }