瀏覽代碼

clear code

marinofaggiana 5 年之前
父節點
當前提交
ef7544c162
共有 1 個文件被更改,包括 26 次插入24 次删除
  1. 26 24
      iOSClient/Main/Menu/CCMain+Menu.swift

+ 26 - 24
iOSClient/Main/Menu/CCMain+Menu.swift

@@ -411,36 +411,38 @@ extension CCMain {
                 )
             }
 
-            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)
+            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)
 
-                        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(
                     NCMenuAction(