Marino Faggiana 8 жил өмнө
parent
commit
13a7a69b8b

+ 2 - 0
iOSClient/CCStandardImages.h

@@ -117,6 +117,8 @@
 
 #define image_seleziona                         @"seleziona"
 #define image_saveSelectedFiles                 @"saveSelectedFiles"
+#define image_settingsDebug                     @"settingsDebug"
+#define image_settingsIntroduction              @"settingsIntroduction"
 #define image_settingsMail                      @"settingsMail"
 #define image_settingsManagePhotos              @"settingsManagePhotos"
 #define image_settingsManagePhotosChange        @"settingsManagePhotosChange"

+ 23 - 0
iOSClient/Images.xcassets/settingsDebug.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "settingsDebug.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "settingsDebug@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "settingsDebug@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
iOSClient/Images.xcassets/settingsDebug.imageset/settingsDebug.png


BIN
iOSClient/Images.xcassets/settingsDebug.imageset/settingsDebug@2x.png


BIN
iOSClient/Images.xcassets/settingsDebug.imageset/settingsDebug@3x.png


+ 23 - 0
iOSClient/Images.xcassets/settingsIntroduction.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "settingsIntroducion.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "settingsIntroducion@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "settingsIntroducion@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
iOSClient/Images.xcassets/settingsIntroduction.imageset/settingsIntroducion.png


BIN
iOSClient/Images.xcassets/settingsIntroduction.imageset/settingsIntroducion@2x.png


BIN
iOSClient/Images.xcassets/settingsIntroduction.imageset/settingsIntroducion@3x.png


+ 68 - 1
iOSClient/Settings/CCManageHelp.m

@@ -58,6 +58,7 @@
     [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
     [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
     [row.cellConfig setObject:COLOR_BRAND forKey:@"textLabel.textColor"];
+    [row.cellConfig setObject:[UIImage imageNamed:image_settingsIntroduction] forKey:@"imageView.image"];
     row.action.formSelector = @selector(intro:);
     [section addFormRow:row];
 
@@ -66,9 +67,19 @@
     
     row = [XLFormRowDescriptor formRowDescriptorWithTag:@"activityVerboseDebug" rowType:XLFormRowDescriptorTypeBooleanSwitch title:NSLocalizedString(@"_help_debug_Activity_verbose_", nil)];
     [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
+    [row.cellConfig setObject:[UIImage imageNamed:image_settingsDebug] forKey:@"imageView.image"];
     if ([CCUtility getActivityVerboseDebug]) row.value = @"1";
     else row.value = @"0";
     [section addFormRow:row];
+    
+    row = [XLFormRowDescriptor formRowDescriptorWithTag:@"sendMailDebug" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_help_debug_Activity_mail_", nil)];
+    [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
+    [row.cellConfig setObject:COLOR_BRAND forKey:@"textLabel.textColor"];
+    [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
+    [row.cellConfig setObject:[UIImage imageNamed:image_settingsKeyMail] forKey:@"imageView.image"];
+    row.action.formSelector = @selector(sendMail:);
+    [section addFormRow:row];
+
 
     section = [XLFormSectionDescriptor formSection];
     [form addFormSection:section];
@@ -111,7 +122,11 @@
         }
     }
 }
-    
+
+#pragma --------------------------------------------------------------------------------------------
+#pragma mark === Intro ===
+#pragma --------------------------------------------------------------------------------------------
+
 - (void)intro:(XLFormRowDescriptor *)sender
 {
     [self deselectFormRow:sender];
@@ -119,4 +134,56 @@
     [self.intro showIntroCryptoCloud:0.1];
 }
 
+#pragma --------------------------------------------------------------------------------------------
+#pragma mark === Mail ===
+#pragma --------------------------------------------------------------------------------------------
+
+- (void) mailComposeController:(MFMailComposeViewController *)vc didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
+{
+    switch (result)
+    {
+        case MFMailComposeResultCancelled:
+            [app messageNotification:@"_info_" description:@"_mail_deleted_" visible:YES delay:k_dismissAfterSecond type:TWMessageBarMessageTypeSuccess];
+            break;
+        case MFMailComposeResultSaved:
+            [app messageNotification:@"_info_" description:@"_mail_saved_" visible:YES delay:k_dismissAfterSecond type:TWMessageBarMessageTypeSuccess];
+            break;
+        case MFMailComposeResultSent:
+            [app messageNotification:@"_info_" description:@"_mail_sent_" visible:YES delay:k_dismissAfterSecond type:TWMessageBarMessageTypeSuccess];
+            break;
+        case MFMailComposeResultFailed: {
+            NSString *msg = [NSString stringWithFormat:NSLocalizedString(@"_mail_failure_", nil), [error localizedDescription]];
+            [app messageNotification:@"_error_" description:msg visible:YES delay:k_dismissAfterSecond type:TWMessageBarMessageTypeError];
+        }
+            break;
+        default:
+            break;
+    }
+    
+    // Close the Mail Interface
+    [self dismissViewControllerAnimated:YES completion:NULL];
+}
+
+- (void)sendMail:(XLFormRowDescriptor *)sender
+{
+    // Email Subject
+    NSString *emailTitle = NSLocalizedString(@"_information_req_", nil);
+    // Email Content
+    NSString *messageBody;
+    // Email Recipents
+    NSArray *toRecipents;
+    
+    messageBody = [NSString stringWithFormat:@"\n\n\n%@ Version %@ (%@)", k_brand,[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"], [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]];
+    toRecipents = [NSArray arrayWithObject:k_mailMe];
+    
+    MFMailComposeViewController *mc = [[MFMailComposeViewController alloc] init];
+    mc.mailComposeDelegate = self;
+    [mc setSubject:emailTitle];
+    [mc setMessageBody:messageBody isHTML:NO];
+    [mc setToRecipients:toRecipents];
+    
+    // Present mail view controller on screen
+    [self presentViewController:mc animated:YES completion:NULL];
+}
+
 @end

+ 1 - 0
iOSClient/en.lproj/Localizable.strings

@@ -187,6 +187,7 @@
 "_help_intro_"                  = "Introduction _brand_";
 "_help_debug_section_"          = "Debug";
 "_help_debug_Activity_verbose_" = "Activity verbose debug";
+"_help_debug_Activity_mail_"    = "Send activity debug at Mail";
 
 // Manage Optimizations