Răsfoiți Sursa

print option

marinofaggiana 4 ani în urmă
părinte
comite
444c1435c3

+ 0 - 0
iOSClient/Images.xcassets/print.imageset/Contents.json → iOSClient/Images.xcassets/printer.imageset/Contents.json


+ 0 - 0
iOSClient/Images.xcassets/print.imageset/print.svg → iOSClient/Images.xcassets/printer.imageset/print.svg


+ 1 - 1
iOSClient/Menu/NCCollectionViewCommon+Menu.swift

@@ -172,7 +172,7 @@ extension NCCollectionViewCommon {
             actions.append(
             actions.append(
                 NCMenuAction(
                 NCMenuAction(
                     title: NSLocalizedString("_print_", comment: ""),
                     title: NSLocalizedString("_print_", comment: ""),
-                    icon: UIImage(named: "print")!.image(color: NCBrandColor.shared.icon, size: 50),
+                    icon: NCCollectionCommon.shared.loadImage(named: "printer"),
                     action: { menuAction in
                     action: { menuAction in
                         if CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView) {
                         if CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView) {
                             NCCollectionCommon.shared.printDocument(metadata: metadata)
                             NCCollectionCommon.shared.printDocument(metadata: metadata)

+ 19 - 0
iOSClient/Menu/NCViewer+Menu.swift

@@ -118,6 +118,25 @@ extension NCViewer {
             )
             )
         }
         }
         
         
+        //
+        // PRINT
+        //
+        if metadata.typeFile == NCGlobal.shared.metadataTypeFileImage {
+            actions.append(
+                NCMenuAction(
+                    title: NSLocalizedString("_print_", comment: ""),
+                    icon: NCCollectionCommon.shared.loadImage(named: "printer"),
+                    action: { menuAction in
+                        if CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView) {
+                            NCCollectionCommon.shared.printDocument(metadata: metadata)
+                        } else {
+                            NCOperationQueue.shared.download(metadata: metadata, selector: NCGlobal.shared.selectorPrint)
+                        }
+                    }
+                )
+            )
+        }
+        
         //
         //
         // SAVE IMAGE / VIDEO
         // SAVE IMAGE / VIDEO
         //
         //