소스 검색

Add menu Crypto Cloud

Marino Faggiana 8 년 전
부모
커밋
4b099b14d2

+ 3 - 0
iOSClient/Login/CCSecurityOptions.h

@@ -39,4 +39,7 @@
 @end
 
 @protocol CCSecurityOptionsDelegate <NSObject>
+
+- (void)closeSecurityOptions;
+
 @end

+ 3 - 1
iOSClient/Login/CCSecurityOptions.m

@@ -123,7 +123,9 @@
         [CCUtility setHint:(NSString *)rowHint.value];
     else
         [CCUtility setHint:@""];
-     
+    
+    [self.delegate closeSecurityOptions];
+    
     [self dismissViewControllerAnimated:YES completion:nil];
 }
 

+ 2 - 1
iOSClient/Settings/CCManageCryptoCloud.h

@@ -24,9 +24,10 @@
 #import "XLFormViewController.h"
 #import "XLForm.h"
 #import "BKPasscodeViewController.h"
+#import "CCSecurityOptions.h"
 #import <MessageUI/MessageUI.h>
 
-@interface CCManageCryptoCloud : XLFormViewController <BKPasscodeViewControllerDelegate, MFMailComposeViewControllerDelegate>
+@interface CCManageCryptoCloud : XLFormViewController <BKPasscodeViewControllerDelegate, MFMailComposeViewControllerDelegate, CCSecurityOptionsDelegate>
 
 @property (nonatomic) NSUInteger failedAttempts;
 @property (strong, nonatomic) NSDate *lockUntilDate;

+ 37 - 4
iOSClient/Settings/CCManageCryptoCloud.m

@@ -50,7 +50,7 @@
     [form addFormSection:section];
     
     // Activation Crypto Cloud Mode
-    row = [XLFormRowDescriptor formRowDescriptorWithTag:@"activate_cryptocloud" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_activation_crypto_cloud_", nil)];
+    row = [XLFormRowDescriptor formRowDescriptorWithTag:@"activatecryptocloud" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_activation_crypto_cloud_", nil)];
     [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
     [row.cellConfig setObject:[UIImage imageNamed:image_settingsCryptoCloud] forKey:@"imageView.image"];
     row.action.formSelector = @selector(activateCryptoCloud:);
@@ -77,7 +77,7 @@
     
     // Color
     [CCAspect aspectNavigationControllerBar:self.navigationController.navigationBar hidden:NO];
-    [CCAspect aspectTabBar:self.tabBarController.tabBar hidden:NO];    
+    [CCAspect aspectTabBar:self.tabBarController.tabBar hidden:NO];
 }
 
 // Apparirà
@@ -88,6 +88,8 @@
     // Color
     [CCAspect aspectNavigationControllerBar:self.navigationController.navigationBar hidden:NO];
     [CCAspect aspectTabBar:self.tabBarController.tabBar hidden:NO];
+    
+    [self reloadForm];
 }
 
 - (void)activateCryptoCloud:(XLFormRowDescriptor *)sender
@@ -115,6 +117,21 @@
     
 }
 
+- (void)closeSecurityOptions
+{
+    UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"_OK_", nil) message:@"Attivazione avvenuta correttamente, ora potrai usufruire di tutte le funzionalità aggiuntive. Ti ricordiamo che i file cifrati possono essere decifrati sono sui dispositivi iOS" delegate:nil cancelButtonTitle:nil otherButtonTitles:NSLocalizedString(@"_ok_", nil), nil];
+    [alertView show];
+}
+
+- (void)activateSecurityOptions
+{
+    CCSecurityOptions *securityOptionsVC = [[CCSecurityOptions alloc] initWithDelegate:self];
+    UINavigationController *securityOptionsNC = [[UINavigationController alloc] initWithRootViewController:securityOptionsVC];
+    
+    [securityOptionsNC setModalPresentationStyle:UIModalPresentationFormSheet];
+    [self presentViewController:securityOptionsNC animated:YES completion:nil];
+}
+
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark == BKPasscodeViewController ==
 #pragma --------------------------------------------------------------------------------------------
@@ -147,8 +164,9 @@
                         // reload
                         [[NSNotificationCenter defaultCenter] postNotificationName:@"initializeMain" object:nil];
                         
-                        UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"_OK_", nil) message:@"Attivazione avvenuta correttamente, ora potrai usufruire di tutte le funzionalità aggiuntive. Ti ricordiamo che i file cifrati possono essere decifrati sono sui dispositivi iOS" delegate:nil cancelButtonTitle:nil otherButtonTitles:NSLocalizedString(@"_ok_", nil), nil];
-                        [alertView show];
+                        // Request : Send Passcode email
+                        [self performSelector:@selector(activateSecurityOptions) withObject:nil afterDelay:0.1];
+
                     }
                 } else {
                 
@@ -229,4 +247,19 @@
     [self dismissViewControllerAnimated:YES completion:nil];
 }
 
+#pragma --------------------------------------------------------------------------------------------
+#pragma mark === Reload Form ===
+#pragma --------------------------------------------------------------------------------------------
+
+- (void)reloadForm
+{
+    XLFormRowDescriptor *rowActivateCryptoCloud = [self.form formRowWithTag:@"activatecryptocloud"];
+    
+    if (app.isCryptoCloudMode)
+        rowActivateCryptoCloud.hidden = @(YES);
+        
+    [self.tableView reloadData];
+}
+
+
 @end