浏览代码

continued

Marino Faggiana 8 年之前
父节点
当前提交
bd086e80dc
共有 2 个文件被更改,包括 34 次插入4 次删除
  1. 30 2
      iOSClient/Create/CCCreateCloud.swift
  2. 4 2
      iOSClient/Main/CCMain.m

+ 30 - 2
iOSClient/Create/CCCreateCloud.swift

@@ -187,10 +187,28 @@ class CreateFormUpload: XLFormViewController {
     convenience init(_ destionationFolder : String?) {
         
         self.init()
-        self.destinationFolder = destionationFolder
+        
+        if destionationFolder == nil || destionationFolder?.isEmpty == true {
+            self.destinationFolder = "/" //NSLocalizedString("_root_", comment: "")
+        } else {
+            self.destinationFolder = destionationFolder
+        }
+    
         self.initializeForm()
     }
     
+    override func viewDidLoad() {
+
+        super.viewDidLoad()
+        
+        let cancelButton : UIBarButtonItem = UIBarButtonItem(title: NSLocalizedString("_cancel_", comment: ""), style: UIBarButtonItemStyle.plain, target: self, action: #selector(cancel))
+        
+        let saveButton : UIBarButtonItem = UIBarButtonItem(title: NSLocalizedString("_save_", comment: ""), style: UIBarButtonItemStyle.plain, target: self, action: #selector(save))
+        
+        self.navigationItem.leftBarButtonItem = cancelButton
+        self.navigationItem.rightBarButtonItem = saveButton
+    }
+    
     func initializeForm() {
         
         let form : XLFormDescriptor = XLFormDescriptor() as XLFormDescriptor
@@ -199,7 +217,7 @@ class CreateFormUpload: XLFormViewController {
         var section : XLFormSectionDescriptor
         var row : XLFormRowDescriptor
 
-        section = XLFormSectionDescriptor.formSection() as XLFormSectionDescriptor
+        section = XLFormSectionDescriptor.formSection(withTitle: "_destination_folder_") as XLFormSectionDescriptor
         form.addFormSection(section)
         
         row = XLFormRowDescriptor(tag: "ButtonDestinationFolder", rowType: XLFormRowDescriptorTypeButton, title: self.destinationFolder)
@@ -209,12 +227,22 @@ class CreateFormUpload: XLFormViewController {
         section = XLFormSectionDescriptor.formSection() as XLFormSectionDescriptor
         form.addFormSection(section)
         
+        section = XLFormSectionDescriptor.formSection() as XLFormSectionDescriptor
+        form.addFormSection(section)
+        
         row = XLFormRowDescriptor(tag: "TextFieldAndTextView", rowType: XLFormRowDescriptorTypeName, title: "File name")
         section.addFormRow(row)
         
         self.form = form
     }
+    
+    func save() {
+        
+    }
 
+    func cancel() {
+        
+    }
 }
 
 

+ 4 - 2
iOSClient/Main/CCMain.m

@@ -638,9 +638,11 @@
 #ifdef DEBUG
     
     CreateFormUpload *form = [[CreateFormUpload alloc] init:_titleMain];
-    //form.destinationFolder = @"x";
+    UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:form];
     
-    [self presentViewController:form animated:YES completion:nil];
+    //navController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
+
+    [self presentViewController:navController animated:YES completion:nil];
 
     return;
 #endif