marinofaggiana 5 år sedan
förälder
incheckning
64f53b6a4c
1 ändrade filer med 23 tillägg och 25 borttagningar
  1. 23 25
      iOSClient/Main/Menu/CCMain+Menu.swift

+ 23 - 25
iOSClient/Main/Menu/CCMain+Menu.swift

@@ -411,37 +411,35 @@ extension CCMain {
                 )
             }
 
-            if(metadata.typeFile != k_metadataTypeFile_imagemeter) {
-                actions.append(
-                    NCMenuAction(
-                        title: NSLocalizedString("_rename_", comment: ""),
-                        icon: CCGraphics.changeThemingColorImage(UIImage(named: "rename"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
-                        action: { menuAction in
-                            let alertController = UIAlertController(title: NSLocalizedString("_rename_", comment: ""), message: nil, preferredStyle: .alert)
+            actions.append(
+                NCMenuAction(
+                    title: NSLocalizedString("_rename_", comment: ""),
+                    icon: CCGraphics.changeThemingColorImage(UIImage(named: "rename"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
+                    action: { menuAction in
+                        let alertController = UIAlertController(title: NSLocalizedString("_rename_", comment: ""), message: nil, preferredStyle: .alert)
 
-                            alertController.addTextField { (textField) in
-                                textField.text = metadata.fileNameView
-                                textField.delegate = self as? UITextFieldDelegate
-                                textField.addTarget(self, action: #selector(self.minCharTextFieldDidChange(_:)
-                                    ), for: UIControl.Event.editingChanged)
-                            }
+                        alertController.addTextField { (textField) in
+                            textField.text = metadata.fileNameView
+                            textField.delegate = self as? UITextFieldDelegate
+                            textField.addTarget(self, action: #selector(self.minCharTextFieldDidChange(_:)
+                                ), for: UIControl.Event.editingChanged)
+                        }
 
-                            let cancelAction = UIAlertAction(title: NSLocalizedString("_cancel_", comment: ""), style: .cancel, handler: nil)
+                        let cancelAction = UIAlertAction(title: NSLocalizedString("_cancel_", comment: ""), style: .cancel, handler: nil)
 
-                            let okAction = UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default, handler: { action in
-                                    let fileName = alertController.textFields![0].text
-                                    self.perform(#selector(self.renameFile(_:)), on: .main, with: [metadata, fileName!], waitUntilDone: false)
+                        let okAction = UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default, handler: { action in
+                                let fileName = alertController.textFields![0].text
+                                self.perform(#selector(self.renameFile(_:)), on: .main, with: [metadata, fileName!], waitUntilDone: false)
 
-                                })
-                            okAction.isEnabled = false
-                            alertController.addAction(cancelAction)
-                            alertController.addAction(okAction)
+                            })
+                        okAction.isEnabled = false
+                        alertController.addAction(cancelAction)
+                        alertController.addAction(okAction)
 
-                            self.present(alertController, animated: true, completion: nil)
-                        }
-                    )
+                        self.present(alertController, animated: true, completion: nil)
+                    }
                 )
-            }
+            )
             
             if (!metadataFolder.e2eEncrypted) {
                 actions.append(