Browse Source

Replace Manage Photo

Marino Faggiana 8 years ago
parent
commit
85b98a52cc
3 changed files with 27 additions and 11 deletions
  1. 26 0
      iOSClient/Main/CCMain.m
  2. 0 11
      iOSClient/Settings/CCSettings.m
  3. 1 0
      iOSClient/en.lproj/Localizable.strings

+ 26 - 0
iOSClient/Main/CCMain.m

@@ -4225,6 +4225,32 @@
                                     }];
         }
         
+        if (!([_metadata.fileName isEqualToString:cameraUploadFolderName] == YES && [_localServerUrl isEqualToString:cameraUploadFolderPath] == YES) && _metadata.cryptated == NO) {
+            
+            [actionSheet addButtonWithTitle:NSLocalizedString(@"_folder_automatic_upload_", nil)
+                                      image:[UIImage imageNamed:image_folderphotocamera]
+                            backgroundColor:[UIColor whiteColor]
+                                     height: 50.0
+                                       type:AHKActionSheetButtonTypeDefault
+                                    handler:^(AHKActionSheet *as) {
+                                        
+                                        // close swipe
+                                        [self setEditing:NO animated:YES];
+                                        
+                                        // Settings new folder Automatatic upload
+                                        NSString *oldPath = [CCCoreData getCameraUploadFolderPathActiveAccount:app.activeAccount activeUrl:app.activeUrl typeCloud:app.typeCloud];
+                                        
+                                        [CCCoreData setCameraUploadFolderName:_metadata.fileName activeAccount:app.activeAccount];
+                                        [CCCoreData setCameraUploadFolderPath:_localServerUrl activeUrl:app.activeUrl typeCloud:app.typeCloud activeAccount:app.activeAccount];
+                                        
+                                        [CCCoreData clearDateReadDirectory:oldPath activeAccount:app.activeAccount];
+                                        
+                                        if (app.activeAccount && app.activeUrl && app.activePhotosCameraUpload)
+                                            [app.activePhotosCameraUpload reloadDatasourceForced];
+                                        
+                                        [self readFolderWithForced:YES];
+                                    }];
+        }
         
         if (!lockDirectory) {
         

+ 0 - 11
iOSClient/Settings/CCSettings.m

@@ -137,17 +137,6 @@
     row.action.formSegueIdentifier = @"CCManageCameraUploadSegue";
     [section addFormRow:row];
 
-    // Section : Photos
-    
-    section = [XLFormSectionDescriptor formSectionWithTitle:NSLocalizedString(@"_photo_camera_", nil)];
-    [form addFormSection:section];
-    
-    row = [XLFormRowDescriptor formRowDescriptorWithTag:@"managephotos" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_photo_camera_", nil)];
-    [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
-    [row.cellConfig setObject:[UIImage imageNamed:image_settingsManagePhotos] forKey:@"imageView.image"];
-    row.action.formSegueIdentifier = @"CCManagePhotosSegue";
-    [section addFormRow:row];
-
     // Section : Optimizations
     
     section = [XLFormSectionDescriptor formSectionWithTitle:NSLocalizedString(@"_optimizations_", nil)];

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

@@ -368,6 +368,7 @@
 "_file_saved_cameraroll_"       = "File saved to Photo Album";
 "_directory_on_top_yes_"        = "✓ Folders on top";
 "_directory_on_top_no_"         = "Folders on top";
+"_folder_automatic_upload_"     = "Folder for Automatic upload";
 
 "audio"                         = "AUDIO";
 "compress"                      = "COMPRESS";