ソースを参照

editor file txt

Marino Faggiana 7 年 前
コミット
db800cc62d
3 ファイル変更36 行追加5 行削除
  1. 1 2
      iOSClient/Main/CCMain.m
  2. 15 3
      iOSClient/Text/NCText.storyboard
  3. 20 0
      iOSClient/Text/NCText.swift

+ 1 - 2
iOSClient/Main/CCMain.m

@@ -920,14 +920,13 @@
         case k_returnCreateFileText: {
             
             // remove file Untitled.txt
-            [[NSFileManager defaultManager] removeItemAtPath:[NSString stringWithFormat:@"%@/%@", app.directoryUser, NSLocalizedString(@"_untitled_txt_", nil)] error:nil];
+            //[[NSFileManager defaultManager] removeItemAtPath:[NSString stringWithFormat:@"%@/%@", app.directoryUser, NSLocalizedString(@"_untitled_txt_", nil)] error:nil];
             
             UINavigationController* navigationController = [[UIStoryboard storyboardWithName:@"NCText" bundle:nil] instantiateViewControllerWithIdentifier:@"NCText"];
             
             NCText *viewController = (NCText *)navigationController.topViewController;
             
             viewController.delegate = self;
-            viewController.fileName = NSLocalizedString(@"_untitled_txt_", nil);
             viewController.serverUrl = _serverUrl;
             viewController.titleMain = _titleMain;
             

+ 15 - 3
iOSClient/Text/NCText.storyboard

@@ -38,11 +38,23 @@
                     </view>
                     <toolbarItems>
                         <barButtonItem style="plain" systemItem="flexibleSpace" id="7D3-Jp-G8Q"/>
-                        <barButtonItem image="actionSheetDelete" id="40X-Vo-Hy2"/>
+                        <barButtonItem image="actionSheetDelete" id="40X-Vo-Hy2">
+                            <connections>
+                                <action selector="deleteButtonTapped:" destination="oRF-nm-GrS" id="U2y-hT-dOQ"/>
+                            </connections>
+                        </barButtonItem>
                         <barButtonItem width="25" style="plain" systemItem="fixedSpace" id="l83-dY-K62"/>
-                        <barButtonItem image="actionSheetShare" id="6og-yq-pNL"/>
+                        <barButtonItem image="actionSheetShare" id="6og-yq-pNL">
+                            <connections>
+                                <action selector="shareButtonTapped:" destination="oRF-nm-GrS" id="qaW-VY-Ziw"/>
+                            </connections>
+                        </barButtonItem>
                         <barButtonItem width="25" style="plain" systemItem="fixedSpace" id="Mgf-az-QKC"/>
-                        <barButtonItem image="actionSheetOpenIn" id="2Kw-LQ-ehq"/>
+                        <barButtonItem image="actionSheetOpenIn" id="2Kw-LQ-ehq">
+                            <connections>
+                                <action selector="openInButtonTapped:" destination="oRF-nm-GrS" id="74a-js-ncE"/>
+                            </connections>
+                        </barButtonItem>
                     </toolbarItems>
                     <navigationItem key="navigationItem" id="LYL-SD-Ayv">
                         <barButtonItem key="leftBarButtonItem" title="Item" id="brk-EO-iNZ">

+ 20 - 0
iOSClient/Text/NCText.swift

@@ -54,6 +54,14 @@ class NCText: UIViewController, UITextViewDelegate {
             if loadText == nil {
                 loadText = ""
             }
+        } else {
+            self.fileName =  NSLocalizedString("_untitled_txt_", comment: "")
+            openInButton.tintColor = UIColor.clear
+            openInButton = nil
+            shareButton.tintColor = UIColor.clear
+            shareButton = nil
+            deleteButton.tintColor = UIColor.clear
+            deleteButton = nil
         }
     }
     
@@ -93,4 +101,16 @@ class NCText: UIViewController, UITextViewDelegate {
             self.delegate?.present(navigationController, animated: true, completion: nil)
         })
     }
+    
+    @IBAction func openInButtonTapped(_ sender: AnyObject) {
+        
+    }
+    
+    @IBAction func shareButtonTapped(_ sender: AnyObject) {
+        
+    }
+    
+    @IBAction func deleteButtonTapped(_ sender: AnyObject) {
+        
+    }
 }