marinofaggiana 4 жил өмнө
parent
commit
fd24f0c00a

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

@@ -54,6 +54,15 @@ extension NCCollectionViewCommon {
         let serverUrlHome = NCUtility.shared.getHomeServer(urlBase: appDelegate.urlBase, account: appDelegate.account)
         var isOffline = false
         
+        var titleDelete = NSLocalizedString("_delete_", comment: "")
+        if metadataFolder != nil {
+            let isShare = metadata.permissions.contains(k_permission_shared) && !metadataFolder!.permissions.contains(k_permission_shared)
+            let isMounted = metadata.permissions.contains(k_permission_mounted) && !metadataFolder!.permissions.contains(k_permission_mounted)
+            if isShare || isMounted {
+                titleDelete = NSLocalizedString("_leave_share_", comment: "")
+            }
+        }
+                
         if metadata.directory {
             if let directory = NCManageDatabase.sharedInstance.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", appDelegate.account, serverUrl)) {
                 isOffline = directory.offline
@@ -237,7 +246,7 @@ extension NCCollectionViewCommon {
         //
         actions.append(
             NCMenuAction(
-                title: NSLocalizedString("_delete_", comment: ""),
+                title: titleDelete,
                 icon: CCGraphics.changeThemingColorImage(UIImage(named: "trash"), width: 50, height: 50, color: .red),
                 action: { menuAction in
                     let alertController = UIAlertController(title: "", message: NSLocalizedString("_want_delete_", comment: ""), preferredStyle: .alert)

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

@@ -141,6 +141,8 @@
 "_recent_"                  = "Recent";
 "_view_in_folder_"          = "View in folder";
 "_leave_share_"             = "Leave this share";
+"_delete_file_"             = "Delete file";
+"_delete_folder_"           = "Delete folder";
 
 // App