Ver código fonte

Add isCryptoCloudMode

Marino Faggiana 8 anos atrás
pai
commit
de4053482f

+ 15 - 8
iOSClient/AppDelegate.m

@@ -485,20 +485,27 @@
     NSString *bundleId = [NSBundle mainBundle].bundleIdentifier;
 
     UIApplicationShortcutIcon *shortcutPhotosIcon = [UIApplicationShortcutIcon iconWithTemplateImageName:image_quickActionPhotos];
-    UIApplicationShortcutIcon *shortcutUploadClearIcon = [UIApplicationShortcutIcon iconWithTemplateImageName:image_quickActionUploadClear];
+    UIApplicationShortcutIcon *shortcutUploadIcon = [UIApplicationShortcutIcon iconWithTemplateImageName:image_quickActionUpload];
     UIApplicationShortcutIcon *shortcutUploadEncryptedIcon = [UIApplicationShortcutIcon iconWithTemplateImageName:image_quickActionUploadEncrypted];
     
     UIApplicationShortcutItem *shortcutPhotos = [[UIApplicationShortcutItem alloc] initWithType:[NSString stringWithFormat:@"%@.photos", bundleId] localizedTitle:NSLocalizedString(@"_photo_camera_", nil) localizedSubtitle:nil icon:shortcutPhotosIcon userInfo:nil];
 
-    UIApplicationShortcutItem *shortcutUploadClear = [[UIApplicationShortcutItem alloc] initWithType:[NSString stringWithFormat:@"%@.uploadClear", bundleId] localizedTitle:NSLocalizedString(@"_upload_file_", nil) localizedSubtitle:nil icon:shortcutUploadClearIcon userInfo:nil];
+    UIApplicationShortcutItem *shortcutUpload = [[UIApplicationShortcutItem alloc] initWithType:[NSString stringWithFormat:@"%@.upload", bundleId] localizedTitle:NSLocalizedString(@"_upload_file_", nil) localizedSubtitle:nil icon:shortcutUploadIcon userInfo:nil];
     
     UIApplicationShortcutItem *shortcutUploadEncrypted = [[UIApplicationShortcutItem alloc] initWithType:[NSString stringWithFormat:@"%@.uploadEncrypted", bundleId] localizedTitle:NSLocalizedString(@"_upload_encrypted_file_", nil) localizedSubtitle:nil icon:shortcutUploadEncryptedIcon userInfo:nil];
     
-    // add all items to an array
-    NSArray *items = @[shortcutUploadEncrypted, shortcutUploadClear, shortcutPhotos];
     
-    // add the array to our app
-    [UIApplication sharedApplication].shortcutItems = items;
+    if (app.isCryptoCloudMode) {
+        
+        // add the array to our app
+        [UIApplication sharedApplication].shortcutItems = @[shortcutUploadEncrypted, shortcutUpload, shortcutPhotos];
+
+    } else {
+
+        // add the array to our app
+        [UIApplication sharedApplication].shortcutItems = @[shortcutUpload, shortcutPhotos];
+
+    }
 }
 
 - (void)application:(UIApplication *)application performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem completionHandler:(void (^)(BOOL))completionHandler
@@ -515,10 +522,10 @@
     NSString *bundleId = [NSBundle mainBundle].bundleIdentifier;
     
     NSString *shortcutPhotos = [NSString stringWithFormat:@"%@.photos", bundleId];
-    NSString *shortcutUploadClear = [NSString stringWithFormat:@"%@.uploadClear", bundleId];
+    NSString *shortcutUpload = [NSString stringWithFormat:@"%@.upload", bundleId];
     NSString *shortcutUploadEncrypted = [NSString stringWithFormat:@"%@.uploadEncrypted", bundleId];
         
-    if ([shortcutItem.type isEqualToString:shortcutUploadClear] && self.activeAccount) {
+    if ([shortcutItem.type isEqualToString:shortcutUpload] && self.activeAccount) {
         
         dispatch_async(dispatch_get_main_queue(), ^{
             

+ 1 - 1
iOSClient/CCImages.h

@@ -57,7 +57,7 @@
 #define image_MenuOrdinamentoAscendente         @"MenuOrdinamentoAscendenteNextcloud"
 #define image_moveSelectedFiles                 @"moveSelectedFilesNextcloud"
 #define image_quickActionPhotos                 @"quickActionPhotosNextcloud"
-#define image_quickActionUploadClear            @"quickActionUploadClearNextcloud"
+#define image_quickActionUpload                 @"quickActionUploadNextcloud"
 #define image_quickActionUploadEncrypted        @"quickActionUploadEncryptedNextcloud"
 #define image_quickActionUploadOffline          @"quickActionUploadOfflineNextcloud"
 #define image_seleziona                         @"selezionaNextcloud"

+ 1 - 1
iOSClient/Main/CCMain.m

@@ -1000,7 +1000,7 @@
 }
 
 #pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Change Password only Nextcloud ownCloud =====
+#pragma mark ===== Change Password =====
 #pragma --------------------------------------------------------------------------------------------
 
 - (void)changePasswordAccount

+ 3 - 3
iOSClient/Nextcloud.xcassets/quickActionUploadClearNextcloud.imageset/Contents.json → iOSClient/Nextcloud.xcassets/quickActionUploadNextcloud.imageset/Contents.json

@@ -2,17 +2,17 @@
   "images" : [
     {
       "idiom" : "universal",
-      "filename" : "quickActionUploadClearNextcloud.png",
+      "filename" : "quickActionUploadNextcloud.png",
       "scale" : "1x"
     },
     {
       "idiom" : "universal",
-      "filename" : "quickActionUploadClearNextcloud@2x.png",
+      "filename" : "quickActionUploadNextcloud@2x.png",
       "scale" : "2x"
     },
     {
       "idiom" : "universal",
-      "filename" : "quickActionUploadClearNextcloud@3x.png",
+      "filename" : "quickActionUploadNextcloud@3x.png",
       "scale" : "3x"
     }
   ],

+ 0 - 0
iOSClient/Nextcloud.xcassets/quickActionUploadClearNextcloud.imageset/quickActionUploadClearNextcloud.png → iOSClient/Nextcloud.xcassets/quickActionUploadNextcloud.imageset/quickActionUploadNextcloud.png


+ 0 - 0
iOSClient/Nextcloud.xcassets/quickActionUploadClearNextcloud.imageset/quickActionUploadClearNextcloud@2x.png → iOSClient/Nextcloud.xcassets/quickActionUploadNextcloud.imageset/quickActionUploadNextcloud@2x.png


+ 0 - 0
iOSClient/Nextcloud.xcassets/quickActionUploadClearNextcloud.imageset/quickActionUploadClearNextcloud@3x.png → iOSClient/Nextcloud.xcassets/quickActionUploadNextcloud.imageset/quickActionUploadNextcloud@3x.png


+ 19 - 13
iOSClient/Settings/CCManageCameraUpload.m

@@ -86,13 +86,16 @@
     [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
     [section addFormRow:row];
 
-    row = [XLFormRowDescriptor formRowDescriptorWithTag:@"camerauploadcryptatedphoto" rowType:XLFormRowDescriptorTypeBooleanSwitch title:NSLocalizedString(@"_upload_encry_camup_", nil)];
-    row.hidden = [NSString stringWithFormat:@"$%@==0", @"cameraupload"];
-    if ([CCCoreData getCameraUploadCryptatedPhotoActiveAccount:app.activeAccount] == YES) row.value = @1;
-    else row.value = @0;
-    [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
-    [section addFormRow:row];
-
+    if (app.isCryptoCloudMode) {
+        
+        row = [XLFormRowDescriptor formRowDescriptorWithTag:@"camerauploadcryptatedphoto" rowType:XLFormRowDescriptorTypeBooleanSwitch title:NSLocalizedString(@"_upload_encry_camup_", nil)];
+        row.hidden = [NSString stringWithFormat:@"$%@==0", @"cameraupload"];
+        if ([CCCoreData getCameraUploadCryptatedPhotoActiveAccount:app.activeAccount] == YES) row.value = @1;
+        else row.value = @0;
+        [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
+        [section addFormRow:row];
+    }
+    
     row = [XLFormRowDescriptor formRowDescriptorWithTag:@"camerauploadwwanphoto" rowType:XLFormRowDescriptorTypeBooleanSwitch title:NSLocalizedString(@"_wifi_only_", nil)];
     row.hidden = [NSString stringWithFormat:@"$%@==0", @"cameraupload"];
     if ([CCCoreData getCameraUploadWWanPhotoActiveAccount:app.activeAccount] == YES) row.value = @1;
@@ -112,12 +115,15 @@
     [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
     [section addFormRow:row];
     
-    row = [XLFormRowDescriptor formRowDescriptorWithTag:@"camerauploadcryptatedvideo" rowType:XLFormRowDescriptorTypeBooleanSwitch title:NSLocalizedString(@"_upload_encry_camup_", nil)];
-    row.hidden = [NSString stringWithFormat:@"$%@==0", @"cameraupload"];
-    if ([CCCoreData getCameraUploadCryptatedVideoActiveAccount:app.activeAccount] == YES) row.value = @1;
-    else row.value = @0;
-    [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
-    [section addFormRow:row];
+    if (app.isCryptoCloudMode) {
+        
+        row = [XLFormRowDescriptor formRowDescriptorWithTag:@"camerauploadcryptatedvideo" rowType:XLFormRowDescriptorTypeBooleanSwitch title:NSLocalizedString(@"_upload_encry_camup_", nil)];
+        row.hidden = [NSString stringWithFormat:@"$%@==0", @"cameraupload"];
+        if ([CCCoreData getCameraUploadCryptatedVideoActiveAccount:app.activeAccount] == YES) row.value = @1;
+        else row.value = @0;
+        [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
+        [section addFormRow:row];
+    }
     
     row = [XLFormRowDescriptor formRowDescriptorWithTag:@"camerauploadwwanvideo" rowType:XLFormRowDescriptorTypeBooleanSwitch title:NSLocalizedString(@"_wifi_only_", nil)];
     row.hidden = [NSString stringWithFormat:@"$%@==0", @"cameraupload"];

+ 11 - 10
iOSClient/Settings/CCSettings.m

@@ -78,22 +78,23 @@
     [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
     [section addFormRow:row];
 
-    // Send aes-256 password via mail
-    row = [XLFormRowDescriptor formRowDescriptorWithTag:@"sendmailencryptpass" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_encryptpass_by_email_", nil)];
-    [row.cellConfig setObject:@(NSTextAlignmentCenter) forKey:@"textLabel.textAlignment"];
-    [row.cellConfig setObject:COLOR_ENCRYPTED 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(checkEncryptPass:);
-    [section addFormRow:row];
-    
+    if (app.isCryptoCloudMode) {
+        
+        // Send aes-256 password via mail
+        row = [XLFormRowDescriptor formRowDescriptorWithTag:@"sendmailencryptpass" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_encryptpass_by_email_", nil)];
+        [row.cellConfig setObject:@(NSTextAlignmentCenter) forKey:@"textLabel.textAlignment"];
+        [row.cellConfig setObject:COLOR_ENCRYPTED 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(checkEncryptPass:);
+        [section addFormRow:row];
+    }
     
     // Section : data Cloud
     
     section = [XLFormSectionDescriptor formSectionWithTitle:@"Cloud account"];
     [form addFormSection:section];
     
-    
     // version
     row = [XLFormRowDescriptor formRowDescriptorWithTag:@"versionserver" rowType:XLFormRowDescriptorTypeInfo title:NSLocalizedString(@"_version_server_", nil)];
     [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];