Browse Source

In context menu added the "Copy path"

marinofaggiana 3 years ago
parent
commit
785f24e945

+ 12 - 0
iOSClient/Images.xcassets/doc.on.clipboard.imageset/Contents.json

@@ -0,0 +1,12 @@
+{
+  "images" : [
+    {
+      "filename" : "doc.on.clipboard.svg",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 1 - 0
iOSClient/Images.xcassets/doc.on.clipboard.imageset/doc.on.clipboard.svg

@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M15 23C13.9 23 13 22.11 13 21V12C13 10.9 13.9 10 15 10H19L23 14V21C23 22.11 22.11 23 21 23H15M15 21H21V14.83L18.17 12H15V21M19 3C20.1 3 21 3.9 21 5V9.17L19.83 8H19V5H17V7H7V5H5V19H11V21H5C3.9 21 3 20.1 3 19V5C3 3.9 3.9 3 5 3H9.18C9.6 1.84 10.7 1 12 1C13.3 1 14.4 1.84 14.82 3H19M12 3C11.45 3 11 3.45 11 4C11 4.55 11.45 5 12 5C12.55 5 13 4.55 13 4C13 3.45 12.55 3 12 3Z" /></svg>

+ 8 - 2
iOSClient/Main/NCFunctionCenter.swift

@@ -636,6 +636,12 @@ import Queuer
             self.copyPasteboard()
             self.copyPasteboard()
         }
         }
         
         
+        let copyPath = UIAction(title: NSLocalizedString("_copy_path_", comment: ""), image: UIImage(systemName: "doc.on.clipboard")) { action in
+            let board = UIPasteboard.general
+            board.string = NCUtilityFileSystem.shared.getPath(metadata: metadata)
+            NCContentPresenter.shared.messageNotification("", description: "_copied_path_", delay: NCGlobal.shared.dismissAfterSecond, type: NCContentPresenter.messageType.info, errorCode: NCGlobal.shared.errorNoError, forced: false)
+        }
+        
         let detail = UIAction(title: NSLocalizedString("_details_", comment: ""), image: UIImage(systemName: "info")) { action in
         let detail = UIAction(title: NSLocalizedString("_details_", comment: ""), image: UIImage(systemName: "info")) { action in
             self.openShare(ViewController: viewController, metadata: metadata, indexPage: 0)
             self.openShare(ViewController: viewController, metadata: metadata, indexPage: 0)
         }
         }
@@ -761,13 +767,13 @@ import Queuer
         
         
         if metadata.directory {
         if metadata.directory {
             
             
-            let submenu = UIMenu(title: "", options: .displayInline, children: [favorite, offline, rename, moveCopy, delete])
+            let submenu = UIMenu(title: "", options: .displayInline, children: [favorite, offline, rename, moveCopy, copyPath, delete])
             return UIMenu(title: "", children: [detail, submenu])
             return UIMenu(title: "", children: [detail, submenu])
         }
         }
         
         
         // FILE
         // FILE
         
         
-        var children: [UIMenuElement] = [favorite, offline, openIn, rename, moveCopy, copy, delete]
+        var children: [UIMenuElement] = [favorite, offline, openIn, rename, moveCopy, copy, copyPath, delete]
 
 
         if (metadata.contentType != "image/svg+xml") && (metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue || metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue) {
         if (metadata.contentType != "image/svg+xml") && (metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue || metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue) {
             children.insert(save, at: 2)
             children.insert(save, at: 2)

+ 1 - 1
iOSClient/Networking/NCAutoUpload.swift

@@ -136,7 +136,7 @@ class NCAutoUpload: NSObject, CLLocationManagerDelegate {
     @objc func autoUploadFullPhotos(viewController: UIViewController?, log: String) {
     @objc func autoUploadFullPhotos(viewController: UIViewController?, log: String) {
         NCAskAuthorization.shared.askAuthorizationPhotoLibrary(viewController: appDelegate.window?.rootViewController) { (hasPermission) in
         NCAskAuthorization.shared.askAuthorizationPhotoLibrary(viewController: appDelegate.window?.rootViewController) { (hasPermission) in
             if hasPermission {
             if hasPermission {
-                NCContentPresenter.shared.messageNotification("_attention_", description: "_create_full_upload_", delay: NCGlobal.shared.dismissAfterSecondLong, type: .info, errorCode: 0, forced: true)
+                NCContentPresenter.shared.messageNotification("_attention_", description: "_create_full_upload_", delay: NCGlobal.shared.dismissAfterSecondLong, type: .info, errorCode: NCGlobal.shared.errorNoError, forced: true)
                 NCUtility.shared.startActivityIndicator(backgroundView: nil, blurEffect: true)
                 NCUtility.shared.startActivityIndicator(backgroundView: nil, blurEffect: true)
                 self.uploadAssetsNewAndFull(viewController: viewController, selector: NCGlobal.shared.selectorUploadAutoUploadAll, log: log) { (items) in
                 self.uploadAssetsNewAndFull(viewController: viewController, selector: NCGlobal.shared.selectorUploadAutoUploadAll, log: log) { (items) in
                     NCUtility.shared.stopActivityIndicator()
                     NCUtility.shared.stopActivityIndicator()

+ 7 - 2
iOSClient/Share/NCShareHeaderView.xib

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="18122" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="19162" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
     <device id="retina4_0" orientation="portrait" appearance="light"/>
     <device id="retina4_0" orientation="portrait" appearance="light"/>
     <dependencies>
     <dependencies>
         <deployment identifier="iOS"/>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="18093"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19144"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     </dependencies>
     <objects>
     <objects>
@@ -68,6 +68,11 @@
             <point key="canvasLocation" x="38" y="253"/>
             <point key="canvasLocation" x="38" y="253"/>
         </view>
         </view>
     </objects>
     </objects>
+    <designables>
+        <designable name="n1G-pn-D8s">
+            <size key="intrinsicContentSize" width="37.5" height="18"/>
+        </designable>
+    </designables>
     <resources>
     <resources>
         <image name="favorite" width="300" height="300"/>
         <image name="favorite" width="300" height="300"/>
     </resources>
     </resources>

+ 1 - 1
iOSClient/Share/NCSharePaging.swift

@@ -368,6 +368,6 @@ class NCShareHeaderView: UIView {
         let board = UIPasteboard.general
         let board = UIPasteboard.general
         board.string = path.text
         board.string = path.text
         
         
-        NCContentPresenter.shared.messageNotification("_copy_", description: "_copy_path_", delay: NCGlobal.shared.dismissAfterSecond, type: NCContentPresenter.messageType.info, errorCode: NCGlobal.shared.errorNoError, forced: false)
+        NCContentPresenter.shared.messageNotification("", description: "_copied_path_", delay: NCGlobal.shared.dismissAfterSecond, type: NCContentPresenter.messageType.info, errorCode: NCGlobal.shared.errorNoError, forced: false)
     }
     }
 }
 }

+ 2 - 1
iOSClient/Supporting Files/en.lproj/Localizable.strings

@@ -815,4 +815,5 @@
 "_error_something_wrong_"   = "Something went wrong";
 "_error_something_wrong_"   = "Something went wrong";
 "_resolution_"              = "Resolution";
 "_resolution_"              = "Resolution";
 "_try_download_full_resolution_"            = "For more detail try to download the image in full resolution";
 "_try_download_full_resolution_"            = "For more detail try to download the image in full resolution";
-"_copy_path_"               = "Copied path";
+"_copied_path_"             = "Copied path";
+"_copy_path_"               = "Copy path";