Browse Source

new settings for : preferred provider

Marino Faggiana 6 years ago
parent
commit
be3fc5a63f

+ 1 - 1
iOSClient/AppDelegate.h

@@ -128,7 +128,7 @@
 @property (nonatomic, strong) NSUserDefaults *ncUserDefaults;
 
 // Login View
-- (void)openLoginView:(id)delegate loginType:(NSInteger)loginType;
+- (void)openLoginView:(id)delegate loginType:(NSInteger)loginType selector:(NSInteger)selector;
 
 // Setting Active Account
 - (void)settingActiveAccount:(NSString *)activeAccount activeUrl:(NSString *)activeUrl activeUser:(NSString *)activeUser activeUserID:(NSString *)activeUserID activePassword:(NSString *)activePassword;

+ 1 - 1
iOSClient/AppDelegate.m

@@ -321,7 +321,7 @@
 #pragma mark ===== Login =====
 #pragma --------------------------------------------------------------------------------------------
 
-- (void)openLoginView:(id)delegate loginType:(NSInteger)loginType
+- (void)openLoginView:(id)delegate loginType:(NSInteger)loginType selector:(NSInteger)selector
 {
     BOOL loginWeb = NO;
     

+ 4 - 4
iOSClient/Brand/Intro/CCIntro.m

@@ -55,22 +55,22 @@
 
 - (void)introWillFinish:(EAIntroView *)introView wasSkipped:(BOOL)wasSkipped
 {
-    [self.delegate introFinishSelector:0];
+    [self.delegate introFinishSelector:k_intro_login];
 }
 
 - (void)introDidFinish:(EAIntroView *)introView wasSkipped:(BOOL)wasSkipped
 {
-    [self.delegate introFinishSelector:0];
+    [self.delegate introFinishSelector:k_intro_login];
 }
 
 - (void)login:(id)sender
 {
-    [self.delegate introFinishSelector:0];
+    [self.delegate introFinishSelector:k_intro_login];
 }
 
 - (void)signUp:(id)sender
 {
-    [self.delegate introFinishSelector:0];
+    [self.delegate introFinishSelector:k_intro_signup];
 }
 
 - (void)show

+ 5 - 0
iOSClient/CCGlobal.h

@@ -78,6 +78,11 @@
 // Name Default DB
 #define k_databaseDefault                               @"nextcloud.realm"
 
+// Intro selector
+#define k_intro_nothing                                 0
+#define k_intro_login                                   1
+#define k_intro_signup                                  2
+
 // Login
 #define k_login_Add                                     0
 #define k_login_Add_Forced                              1

+ 9 - 9
iOSClient/Main/CCMain.m

@@ -1441,7 +1441,7 @@
     } else {
         // Unauthorized
         if (errorCode == kOCErrorServerUnauthorized)
-            [appDelegate openLoginView:self loginType:k_login_Modify_Password];
+            [appDelegate openLoginView:self loginType:k_login_Modify_Password selector:k_intro_login];
     }
 }
 
@@ -1487,7 +1487,7 @@
         
         // Unauthorized
         if (errorCode == kOCErrorServerUnauthorized) {
-            [appDelegate openLoginView:self loginType:k_login_Modify_Password];
+            [appDelegate openLoginView:self loginType:k_login_Modify_Password selector:k_intro_login];
             
         } else {
             [self tableViewReloadData];
@@ -1744,7 +1744,7 @@
         
         // Unauthorized
         if (errorCode == kOCErrorServerUnauthorized)
-            [appDelegate openLoginView:self loginType:k_login_Modify_Password];
+            [appDelegate openLoginView:self loginType:k_login_Modify_Password selector:k_intro_login];
         else
             [appDelegate messageNotification:@"_error_" description:message visible:YES delay:k_dismissAfterSecond type:TWMessageBarMessageTypeError errorCode:errorCode];
         
@@ -1779,7 +1779,7 @@
 {
     // Unauthorized
     if (errorCode == kOCErrorServerUnauthorized)
-        [appDelegate openLoginView:self loginType:k_login_Modify_Password];
+        [appDelegate openLoginView:self loginType:k_login_Modify_Password selector:k_intro_login];
     
     [_queueSelector removeObject:metadataNet.selector];
     
@@ -2114,7 +2114,7 @@
         
         // Unauthorized
         if (errorCode == kOCErrorServerUnauthorized)
-            [appDelegate openLoginView:self loginType:k_login_Modify_Password];
+            [appDelegate openLoginView:self loginType:k_login_Modify_Password selector:k_intro_login];
         else
             [appDelegate messageNotification:@"_create_folder_" description:message visible:YES delay:k_dismissAfterSecond type:TWMessageBarMessageTypeError errorCode:errorCode];
         
@@ -2386,7 +2386,7 @@
     
     // Unauthorized
     if (errorCode == kOCErrorServerUnauthorized)
-        [appDelegate openLoginView:self loginType:k_login_Modify_Password];
+        [appDelegate openLoginView:self loginType:k_login_Modify_Password selector:k_intro_login];
     else
         [appDelegate messageNotification:@"_share_" description:message visible:YES delay:k_dismissAfterSecond type:TWMessageBarMessageTypeError errorCode:errorCode];
 
@@ -2492,7 +2492,7 @@
     
     // Unauthorized
     if (errorCode == kOCErrorServerUnauthorized)
-        [appDelegate openLoginView:self loginType:k_login_Modify_Password];
+        [appDelegate openLoginView:self loginType:k_login_Modify_Password selector:k_intro_login];
     else
         [appDelegate messageNotification:@"_error_" description:message visible:YES delay:k_dismissAfterSecond type:TWMessageBarMessageTypeError errorCode:errorCode];
 }
@@ -2611,7 +2611,7 @@
     } else {
         
         if (errorCode == kOCErrorServerUnauthorized)
-            [appDelegate openLoginView:self loginType:k_login_Modify_Password];
+            [appDelegate openLoginView:self loginType:k_login_Modify_Password selector:k_intro_login];
         
         NSLog(@"[LOG] Setting Favorite failure error %d, %@", (int)errorCode, message);
     }
@@ -2865,7 +2865,7 @@
     [appDelegate.netQueue cancelAllOperations];
     
     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.3 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
-        [appDelegate openLoginView:self loginType:k_login_Add];
+        [appDelegate openLoginView:self loginType:k_login_Add selector:k_intro_login];
     });
 }
 

+ 1 - 1
iOSClient/Main/CCMore.swift

@@ -361,7 +361,7 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource, CCLo
                 let manageAccount = CCManageAccount()
                 manageAccount.delete(self.appDelegate.activeAccount)
                 
-                self.appDelegate.openLoginView(self, loginType: Int(k_login_Add_Forced))
+                self.appDelegate.openLoginView(self, loginType: Int(k_login_Add_Forced), selector: Int(k_intro_login))
             }
             
             let actionNo = UIAlertAction(title: NSLocalizedString("_no_delete_", comment: ""), style: .default) { (action:UIAlertAction) in

+ 1 - 12
iOSClient/Main/CCSplit.m

@@ -154,6 +154,7 @@
     [CCUtility setIntro:YES];
     
     // check account
+    
     [self performSelector:@selector(newAccount) withObject:nil afterDelay:0.1];
 }
 
@@ -176,18 +177,6 @@
     appDelegate.activeLoginWeb = nil;
 }
 
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== newAccount =====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)newAccount
-{
-    if (appDelegate.activeAccount.length == 0) {
-    
-        [appDelegate openLoginView:self loginType:k_login_Add_Forced];
-    }
-}
-
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark ===== Split View Controller =====
 #pragma --------------------------------------------------------------------------------------------

+ 3 - 3
iOSClient/Settings/CCManageAccount.m

@@ -232,13 +232,13 @@
     [appDelegate.netQueue cancelAllOperations];
     
     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.3 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
-        [appDelegate openLoginView:self loginType:k_login_Add];
+        [appDelegate openLoginView:self loginType:k_login_Add selector:k_intro_login];
     });
 }
 
 - (void)addAccountForced
 {
-    [appDelegate openLoginView:self loginType:k_login_Add_Forced];
+    [appDelegate openLoginView:self loginType:k_login_Add_Forced selector:k_intro_login];
 }
 
 #pragma --------------------------------------------------------------------------------------------
@@ -259,7 +259,7 @@
     [appDelegate.netQueue cancelAllOperations];
     
     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.3 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
-        [appDelegate openLoginView:self loginType:k_login_Modify_Password];
+        [appDelegate openLoginView:self loginType:k_login_Modify_Password selector:k_intro_login];
     });
 }