marinofaggiana 4 ani în urmă
părinte
comite
937ead8ef2

+ 0 - 1
iOSClient/Main/CCMain.h

@@ -80,7 +80,6 @@
 - (void)downloadSelectedFilesFolders;
 - (void)moveOpenWindow:(NSArray *)indexPaths;
 
-- (void)minCharTextFieldDidChange:(UITextField *)sender;
 - (void)actionDelete:(NSIndexPath *)indexPath;
 
 @end

+ 2 - 36
iOSClient/Main/CCMain.m

@@ -592,27 +592,6 @@
     return [[NSAttributedString alloc] initWithString:text attributes:attributes];
 }
 
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Text Field =====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)minCharTextFieldDidChange:(UITextField *)sender
-{
-    UIAlertController *alertController = (UIAlertController *)self.presentedViewController;
-    
-    if (alertController)
-    {
-        UITextField *fileName = alertController.textFields.firstObject;
-        UIAlertAction *okAction = alertController.actions.lastObject;
-        okAction.enabled = fileName.text.length > 0;
-    }
-}
-
-- (void)textFieldDidBeginEditing:(UITextField *)textField
-{
-    [CCUtility selectFileNameFrom:textField];
-}
-
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark ===== Graphic Window =====
 #pragma --------------------------------------------------------------------------------------------
@@ -1827,15 +1806,7 @@
 }
 - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
 {
-    NSArray *sections = [sectionDataSource.sectionArrayRow allKeys];
-    NSString *sectionTitle = [sections objectAtIndex:section];
-    
-    if ([sectionTitle isKindOfClass:[NSString class]] && [sectionTitle rangeOfString:@"download"].location != NSNotFound) return 18.f;
-    if ([sectionTitle isKindOfClass:[NSString class]] && [sectionTitle rangeOfString:@"upload"].location != NSNotFound) return 18.f;
-    
-    if ([[CCUtility getGroupBySettings] isEqualToString:@"none"] && [sections count] <= 1) return 0.0f;
-    
-    return 20.f;
+    return 0.0f;
 }
 
 -(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
@@ -1843,7 +1814,7 @@
     float shift;
     UIVisualEffectView *visualEffectView;
     
-    NSString *titleSection;
+    NSString *titleSection = @"";
     
     if (![self indexPathIsValid:[NSIndexPath indexPathForRow:0 inSection:section]])
         return nil;
@@ -1854,11 +1825,6 @@
     if ([[sectionDataSource.sections objectAtIndex:section] isKindOfClass:[NSDate class]])
         titleSection = [CCUtility getTitleSectionDate:[sectionDataSource.sections objectAtIndex:section]];
     
-    if ([titleSection isEqualToString:@"_none_"]) titleSection = @"";
-    else if ([titleSection rangeOfString:@"download"].location != NSNotFound) titleSection = NSLocalizedString(@"_title_section_download_",nil);
-    else if ([titleSection rangeOfString:@"upload"].location != NSNotFound) titleSection = NSLocalizedString(@"_title_section_upload_",nil);
-    else titleSection = NSLocalizedString(titleSection,nil);
-    
     // Format title
     UIVisualEffect *blurEffect;
     blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];

+ 0 - 9
iOSClient/Main/Collection/NCCollectionViewCommon.swift

@@ -188,15 +188,6 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
         }
     }
     
-    // MARK: - Utility
-    
-    @objc func minCharTextFieldDidChange(sender: UITextField) {
-        guard let alertController = self.presentedViewController as? UIAlertController else { return }
-        guard let password = alertController.textFields?.first else { return }
-        guard let ok = alertController.actions.last else { return }
-        ok.isEnabled =  password.text?.count ?? 0 >= 8
-    }
-    
     // MARK: - NotificationCenter
 
     @objc func changeTheming() {

+ 0 - 2
iOSClient/Main/Menu/AppDelegate+Menu.swift

@@ -138,7 +138,6 @@ extension AppDelegate {
                      let alertController = UIAlertController(title: NSLocalizedString("_create_folder_on_", comment: ""), message: nil, preferredStyle: .alert)
                     
                      alertController.addTextField { (textField) in
-                         //[textField addTarget:self action:@selector(minCharTextFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
                          textField.autocapitalizationType = UITextAutocapitalizationType.sentences
                      }
                     
@@ -153,7 +152,6 @@ extension AppDelegate {
                          }
                      })
                     
-                     //okAction.enabled = NO;
                      alertController.addAction(cancelAction)
                      alertController.addAction(okAction)
 

+ 2 - 8
iOSClient/Main/Menu/CCMain+Menu.swift

@@ -177,9 +177,6 @@ extension CCMain {
 
                             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)
@@ -192,7 +189,7 @@ extension CCMain {
                                     }
                                 }
                             })
-                            okAction.isEnabled = false
+
                             alertController.addAction(cancelAction)
                             alertController.addAction(okAction)
 
@@ -338,9 +335,6 @@ extension CCMain {
 
                         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)
@@ -349,7 +343,7 @@ extension CCMain {
                             let fileNameNew = alertController.textFields![0].text
                             NCNetworking.shared.renameMetadata(metadata, fileNameNew: fileNameNew!, urlBase: appDelegate.urlBase, viewController: self) { (errorCode, errorDescription) in }
                         })
-                        okAction.isEnabled = false
+                        
                         alertController.addAction(cancelAction)
                         alertController.addAction(okAction)
 

+ 1 - 9
iOSClient/Share/NCShare.swift

@@ -171,14 +171,13 @@ class NCShare: UIViewController, UIGestureRecognizerDelegate, NCShareLinkCellDel
             let alertController = UIAlertController(title: NSLocalizedString("_enforce_password_protection_", comment: ""), message: "", preferredStyle: .alert)
             alertController.addTextField { (textField) in
                 textField.isSecureTextEntry = true
-                textField.addTarget(self, action: #selector(self.minCharTextFieldDidChange(sender:)), for: UIControl.Event.editingChanged)
             }
             alertController.addAction(UIAlertAction(title: NSLocalizedString("_cancel_", comment: ""), style: .default) { (action:UIAlertAction) in })
             let okAction = UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default) { (action:UIAlertAction) in
                 let password = alertController.textFields?.first?.text
                 self.networking?.createShareLink(password: password ?? "")
             }
-            okAction.isEnabled = false
+            
             alertController.addAction(okAction)
             
             self.present(alertController, animated: true, completion:nil)
@@ -189,13 +188,6 @@ class NCShare: UIViewController, UIGestureRecognizerDelegate, NCShareLinkCellDel
         }
     }
     
-    @objc func minCharTextFieldDidChange(sender: UITextField) {
-        guard let alertController = self.presentedViewController as? UIAlertController else { return }
-        guard let password = alertController.textFields?.first else { return }
-        guard let ok = alertController.actions.last else { return }
-        ok.isEnabled =  password.text?.count ?? 0 >= 8
-    }
-    
     @objc func tapLinkMenuViewWindow(gesture: UITapGestureRecognizer) {
         shareLinkMenuView?.unLoad()
         shareLinkMenuView = nil

+ 0 - 8
iOSClient/Transfers/CCTransfers.m

@@ -450,14 +450,6 @@
 
 - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
 {
-    //NSString *titleSection;
-    
-    //if ([[_sectionDataSource.sections objectAtIndex:section] isKindOfClass:[NSString class]])
-    //    titleSection = [_sectionDataSource.sections objectAtIndex:section];
-    
-    //if ([titleSection rangeOfString:@"upload"].location != NSNotFound && [titleSection rangeOfString:@"wwan"].location != NSNotFound && titleSection != nil) return 18.0f;
-    //else return 0.0f;
-    
     return 18.0f;
 }