Ver Fonte

added _copy_path_

marinofaggiana há 3 anos atrás
pai
commit
5a1996b83f

+ 1 - 0
iOSClient/NCGlobal.swift

@@ -180,6 +180,7 @@ class NCGlobal: NSObject {
     
     // Error
     //
+    @objc let errorNoError: Int                     = 0
     @objc let errorRequestExplicityCancelled: Int   = 15
     @objc let errorNotModified: Int                 = 304
     @objc let errorBadRequest: Int                  = 400

+ 15 - 0
iOSClient/Share/NCSharePaging.swift

@@ -340,6 +340,13 @@ class NCShareHeaderView: UIView {
     private let appDelegate = UIApplication.shared.delegate as! AppDelegate
     var ocId = ""
 
+    override func awakeFromNib() {
+        super.awakeFromNib()
+        
+        let longGesture = UILongPressGestureRecognizer(target: self, action: #selector(self.longTap))
+        path.addGestureRecognizer(longGesture)
+    }
+    
     @IBAction func touchUpInsideFavorite(_ sender: UIButton) {
         if let metadata = NCManageDatabase.shared.getMetadataFromOcId(ocId) {
             NCNetworking.shared.favoriteMetadata(metadata) { (errorCode, errorDescription) in
@@ -355,4 +362,12 @@ class NCShareHeaderView: UIView {
             }
         }
     }
+    
+    @objc func longTap(sender : UIGestureRecognizer) {
+        
+        let board = UIPasteboard.general
+        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)
+    }
 }

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

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