瀏覽代碼

new login

Marino Faggiana 8 年之前
父節點
當前提交
a6b0a35b3d

+ 0 - 1
iOSClient/Login/CCLogin.h

@@ -30,7 +30,6 @@
 @protocol CCLoginDelegate <NSObject>
 
 - (void) loginSuccess:(NSInteger)loginType;
-@optional - (void) loginCancel:(NSInteger)loginType;
 
 @end
 

+ 0 - 3
iOSClient/Login/CCLogin.m

@@ -274,9 +274,6 @@
 
 - (IBAction)handleAnnulla:(id)sender
 {
-    if ([self.delegate respondsToSelector:@selector(loginCancel:)])
-        [self.delegate loginCancel:_loginType];
-    
     [self dismissViewControllerAnimated:YES completion:nil];
 }
 

+ 1 - 1
iOSClient/Main/CCMain.h

@@ -62,7 +62,7 @@
 #import "CCPatenteGuida.h"
 #import "JSAlertView.h"
 
-@interface CCMain : UITableViewController <UITableViewDataSource, UITableViewDelegate, UIActionSheetDelegate, UIGestureRecognizerDelegate, UIDocumentInteractionControllerDelegate, UIViewControllerPreviewingDelegate, CCMoveDelegate, CTAssetsPickerControllerDelegate, BKPasscodeViewControllerDelegate, UISplitViewControllerDelegate, UIPopoverControllerDelegate, CCNetworkingDelegate, CCShareOCDelegate, CCAccountWebDelegate, CCBancomatDelegate, CCCartaDiCreditoDelegate, CCCartaIdentitaDelegate, CCContoCorrenteDelegate, CCNoteDelegate, CCPassaportoDelegate, CCPatenteGuidaDelegate, CCPeekPopDelegate, UIDocumentMenuDelegate, UIDocumentPickerDelegate, UISearchResultsUpdating, UISearchControllerDelegate, UISearchBarDelegate, UIScrollViewDelegate>
+@interface CCMain : UITableViewController <UITableViewDataSource, UITableViewDelegate, UIActionSheetDelegate, UIGestureRecognizerDelegate, UIDocumentInteractionControllerDelegate, UIViewControllerPreviewingDelegate, CCMoveDelegate, CTAssetsPickerControllerDelegate, BKPasscodeViewControllerDelegate, UISplitViewControllerDelegate, UIPopoverControllerDelegate, CCNetworkingDelegate, CCShareOCDelegate, CCAccountWebDelegate, CCBancomatDelegate, CCCartaDiCreditoDelegate, CCCartaIdentitaDelegate, CCContoCorrenteDelegate, CCNoteDelegate, CCPassaportoDelegate, CCPatenteGuidaDelegate, CCPeekPopDelegate, UIDocumentMenuDelegate, UIDocumentPickerDelegate, UISearchResultsUpdating, UISearchControllerDelegate, UISearchBarDelegate, UIScrollViewDelegate, CCLoginDelegate>
 
 @property BOOL isFolderEncrypted;
 

+ 1 - 0
iOSClient/Main/CCMain.m

@@ -1011,6 +1011,7 @@
 - (void)changePasswordAccount
 {
     CCLogin *loginVC = [[UIStoryboard storyboardWithName:@"CCLogin" bundle:nil] instantiateViewControllerWithIdentifier:@"CCLoginNextcloud"];
+    loginVC.delegate = self;
     loginVC.loginType = loginModifyPasswordUser;
     
     [self presentViewController:loginVC animated:YES completion:nil];

+ 3 - 2
iOSClient/Main/CCSplit.m

@@ -134,7 +134,7 @@
 #pragma mark ===== newAccount =====
 #pragma --------------------------------------------------------------------------------------------
 
-- (void) loginSuccess:(NSInteger)loginType
+- (void)loginSuccess:(NSInteger)loginType
 {
     [[NSNotificationCenter defaultCenter] postNotificationName:@"initializeMain" object:nil];
 }
@@ -144,8 +144,9 @@
     if ([app.activeAccount length] == 0) {
     
         CCLogin *loginVC = [[UIStoryboard storyboardWithName:@"CCLogin" bundle:nil] instantiateViewControllerWithIdentifier:@"CCLoginNextcloud"];
+        loginVC.delegate = self;
         loginVC.loginType = loginAddForced;
-    
+        
         [self presentViewController:loginVC animated:YES completion:nil];
     }
 }

+ 6 - 7
iOSClient/Settings/CCManageAccount.m

@@ -124,14 +124,10 @@
 #pragma mark === Delegate Login ===
 #pragma --------------------------------------------------------------------------------------------
 
-- (void) loginSuccess:(NSInteger)loginType
+- (void)loginSuccess:(NSInteger)loginType
 {
-    
-}
-
-- (void) loginCancel:(NSInteger)loginType
-{
-    
+    if (loginType == loginAddForced)
+        [[NSNotificationCenter defaultCenter] postNotificationName:@"initializeMain" object:nil];
 }
 
 #pragma --------------------------------------------------------------------------------------------
@@ -146,6 +142,7 @@
     [[CCNetworking sharedNetworking] settingSessionsDownload:YES upload:YES taskStatus:k_taskStatusCancel activeAccount:app.activeAccount activeUser:app.activeUser activeUrl:app.activeUrl];
     
     CCLogin *loginVC = [[UIStoryboard storyboardWithName:@"CCLogin" bundle:nil] instantiateViewControllerWithIdentifier:@"CCLoginNextcloud"];
+    loginVC.delegate = self;
     loginVC.loginType = loginAdd;
     
     [self presentViewController:loginVC animated:YES completion:nil];
@@ -154,6 +151,7 @@
 - (void)addAccountFoced
 {
     CCLogin *loginVC = [[UIStoryboard storyboardWithName:@"CCLogin" bundle:nil] instantiateViewControllerWithIdentifier:@"CCLoginNextcloud"];
+    loginVC.delegate = self;
     loginVC.loginType = loginAddForced;
     
     dispatch_async(dispatch_get_main_queue(), ^ {
@@ -175,6 +173,7 @@
     if ([app.typeCloud isEqualToString:typeCloudNextcloud] || [app.typeCloud isEqualToString:typeCloudOwnCloud]) {
         
         CCLogin *loginVC = [[UIStoryboard storyboardWithName:@"CCLogin" bundle:nil] instantiateViewControllerWithIdentifier: @"CCLoginNextcloud"];
+        loginVC.delegate = self;
         loginVC.loginType = loginModifyPasswordUser;
         
         [self presentViewController:loginVC animated:YES completion:nil];