Marino Faggiana 8 gadi atpakaļ
vecāks
revīzija
f78c6bbd11
2 mainītis faili ar 24 papildinājumiem un 11 dzēšanām
  1. 12 6
      iOSClient/Create/CCCreateCloud.swift
  2. 12 5
      iOSClient/Main/CCMain.m

+ 12 - 6
iOSClient/Create/CCCreateCloud.swift

@@ -182,13 +182,12 @@ class CreateMenuAdd: NSObject {
 
 class CreateFormUpload: XLFormViewController {
     
-    required init(coder aDecoder: NSCoder) {
-        super.init(coder: aDecoder)
-        self.initializeForm()
-    }
+    var destinationFolder : String?
     
-    override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
-        super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
+    convenience init(_ destionationFolder : String?) {
+        
+        self.init()
+        self.destinationFolder = destionationFolder
         self.initializeForm()
     }
     
@@ -203,6 +202,13 @@ class CreateFormUpload: XLFormViewController {
         section = XLFormSectionDescriptor.formSection() as XLFormSectionDescriptor
         form.addFormSection(section)
         
+        row = XLFormRowDescriptor(tag: "ButtonDestinationFolder", rowType: XLFormRowDescriptorTypeButton, title: self.destinationFolder)
+        row.cellConfig.setObject(UIImage(named: image_settingsManagePhotos)!, forKey: "imageView.image" as NSCopying)
+        section.addFormRow(row)
+        
+        section = XLFormSectionDescriptor.formSection() as XLFormSectionDescriptor
+        form.addFormSection(section)
+        
         row = XLFormRowDescriptor(tag: "TextFieldAndTextView", rowType: XLFormRowDescriptorTypeName, title: "File name")
         section.addFormRow(row)
         

+ 12 - 5
iOSClient/Main/CCMain.m

@@ -634,6 +634,17 @@
 
 - (void)openAssetsPickerController
 {
+    
+#ifdef DEBUG
+    
+    CreateFormUpload *form = [[CreateFormUpload alloc] init:_titleMain];
+    //form.destinationFolder = @"x";
+    
+    [self presentViewController:form animated:YES completion:nil];
+
+    return;
+#endif
+    
     CTAssetSelectionLabel *assetSelectionLabel = [CTAssetSelectionLabel appearance];
     assetSelectionLabel.borderWidth = 1.0;
     assetSelectionLabel.borderColor = COLOR_BRAND;
@@ -697,11 +708,7 @@
 {
     [picker dismissViewControllerAnimated:YES completion:^{
         
-        CreateFormUpload *menuAdd = [[CreateFormUpload alloc] init];
-        
-        [self presentViewController:menuAdd animated:YES completion:nil];
-        
-        //[self uploadFileAsset:assets serverUrl:_localServerUrl cryptated:_isPickerCriptate session:upload_session];
+        [self uploadFileAsset:assets serverUrl:_localServerUrl cryptated:_isPickerCriptate session:upload_session];
     }];
 }