marinofaggiana 5 years ago
parent
commit
a149c0e9f9

+ 1 - 1
iOSClient/Main/CCMain.m

@@ -1619,7 +1619,7 @@
 }
 
 // DELEGATE : Select
-- (void)dismissSelectWithServerUrl:(NSString *)serverUrl metadata:(tableMetadata *)metadata type:(NSString *)type buttonType:(NSString *)buttonType
+- (void)dismissSelectWithServerUrl:(NSString *)serverUrl metadata:(tableMetadata *)metadata type:(NSString *)type buttonType:(NSString *)buttonType overwrite:(BOOL)overwrite
 {
     if (serverUrl == nil) {
         [[NCMainCommon sharedInstance] reloadDatasourceWithServerUrl:self.serverUrl ocId:nil action:k_action_NULL];

+ 1 - 1
iOSClient/Main/Create cloud/NCCreateFormUploadAssets.swift

@@ -315,7 +315,7 @@ class NCCreateFormUploadAssets: XLFormViewController, NCSelectDelegate, PhotoEdi
     
     // MARK: - Action
     
-    func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, buttonType: String) {
+    func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, buttonType: String, overwrite: Bool) {
         
         if serverUrl != nil {
             

+ 1 - 1
iOSClient/Main/Create cloud/NCCreateFormUploadDocuments.swift

@@ -210,7 +210,7 @@ class NCCreateFormUploadDocuments: XLFormViewController, NCSelectDelegate, UICol
     
     // MARK: - Action
     
-    func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, buttonType: String) {
+    func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, buttonType: String, overwrite: Bool) {
         
         guard let serverUrl = serverUrl else {
             return

+ 1 - 1
iOSClient/Main/Create cloud/NCCreateFormUploadFileText.swift

@@ -148,7 +148,7 @@ class NCCreateFormUploadFileText: XLFormViewController, NCSelectDelegate {
     
     // MARK: - Action
     
-    func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, buttonType: String) {
+    func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, buttonType: String, overwrite: Bool) {
         
         if serverUrl != nil {
             

+ 1 - 1
iOSClient/Main/Create cloud/NCCreateFormUploadScanDocument.swift

@@ -368,7 +368,7 @@ class NCCreateFormUploadScanDocument: XLFormViewController, NCSelectDelegate {
     
     // MARK: - Action
     
-    func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, buttonType: String) {
+    func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, buttonType: String, overwrite: Bool) {
         
         if serverUrl != nil {
             

+ 1 - 1
iOSClient/Main/Create cloud/NCCreateFormUploadVoiceNote.swift

@@ -194,7 +194,7 @@ class NCCreateFormUploadVoiceNote: XLFormViewController, NCSelectDelegate, AVAud
     
     // MARK: - Action
     
-    func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, buttonType: String) {
+    func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, buttonType: String, overwrite: Bool) {
         
         if serverUrl != nil {
             

+ 1 - 1
iOSClient/Media/NCMedia.swift

@@ -360,7 +360,7 @@ class NCMedia: UIViewController, DropdownMenuDelegate, DZNEmptyDataSetSource, DZ
         
     }
     
-    func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, buttonType: String) {
+    func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, buttonType: String, overwrite: Bool) {
         
         let oldStartDirectoryMediaTabView = NCManageDatabase.sharedInstance.getAccountStartDirectoryMediaTabView(CCUtility.getHomeServerUrlActiveUrl(appDelegate.activeUrl))
         

+ 10 - 10
iOSClient/Select/NCSelect.storyboard

@@ -67,18 +67,18 @@
                                         </connections>
                                     </button>
                                     <view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bvU-cp-GX3">
-                                        <rect key="frame" x="137" y="15" width="60" height="40"/>
+                                        <rect key="frame" x="127" y="5" width="70" height="40"/>
                                         <subviews>
                                             <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="obN-5M-keH">
-                                                <rect key="frame" x="12.5" y="7.5" width="37" height="25"/>
+                                                <rect key="frame" x="17.5" y="5" width="37" height="20"/>
                                                 <constraints>
-                                                    <constraint firstAttribute="height" constant="25" id="c71-Rx-wA7"/>
+                                                    <constraint firstAttribute="height" constant="20" id="c71-Rx-wA7"/>
                                                     <constraint firstAttribute="width" constant="35" id="eQO-iB-kxo"/>
                                                 </constraints>
                                             </switch>
                                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Overwrite" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SQc-p3-dhj">
-                                                <rect key="frame" x="6.5" y="28" width="47" height="12"/>
-                                                <fontDescription key="fontDescription" type="system" pointSize="10"/>
+                                                <rect key="frame" x="5.5" y="34" width="59" height="16"/>
+                                                <fontDescription key="fontDescription" type="system" pointSize="13"/>
                                                 <nil key="textColor"/>
                                                 <nil key="highlightedColor"/>
                                             </label>
@@ -86,23 +86,23 @@
                                         <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                         <constraints>
                                             <constraint firstItem="SQc-p3-dhj" firstAttribute="centerX" secondItem="bvU-cp-GX3" secondAttribute="centerX" id="2tb-50-fVx"/>
-                                            <constraint firstAttribute="width" constant="60" id="Cb4-30-Orh"/>
-                                            <constraint firstItem="obN-5M-keH" firstAttribute="centerX" secondItem="bvU-cp-GX3" secondAttribute="centerX" id="FRm-bs-i20"/>
-                                            <constraint firstItem="obN-5M-keH" firstAttribute="centerY" secondItem="bvU-cp-GX3" secondAttribute="centerY" id="JCK-J5-6WH"/>
-                                            <constraint firstAttribute="bottom" secondItem="SQc-p3-dhj" secondAttribute="bottom" id="OSr-G4-QAG"/>
+                                            <constraint firstAttribute="width" constant="70" id="Cb4-30-Orh"/>
+                                            <constraint firstAttribute="bottom" secondItem="SQc-p3-dhj" secondAttribute="bottom" constant="-10" id="OSr-G4-QAG"/>
+                                            <constraint firstItem="obN-5M-keH" firstAttribute="top" secondItem="bvU-cp-GX3" secondAttribute="top" constant="5" id="TjV-mN-FS2"/>
+                                            <constraint firstItem="obN-5M-keH" firstAttribute="centerX" secondItem="bvU-cp-GX3" secondAttribute="centerX" id="Tlh-4S-fnU"/>
                                             <constraint firstAttribute="height" constant="40" id="idi-T7-L9J"/>
                                         </constraints>
                                     </view>
                                 </subviews>
                                 <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
                                 <constraints>
-                                    <constraint firstItem="bvU-cp-GX3" firstAttribute="centerY" secondItem="un8-Xf-9Fb" secondAttribute="centerY" id="5zm-fz-w7y"/>
                                     <constraint firstItem="kze-s7-kTI" firstAttribute="centerY" secondItem="un8-Xf-9Fb" secondAttribute="centerY" id="899-zh-WyZ"/>
                                     <constraint firstItem="kze-s7-kTI" firstAttribute="leading" secondItem="bvU-cp-GX3" secondAttribute="trailing" constant="10" id="KP4-eN-Eg7"/>
                                     <constraint firstAttribute="trailing" secondItem="gUK-Yw-aVP" secondAttribute="trailing" constant="18" id="OEt-Jd-Y4n"/>
                                     <constraint firstAttribute="height" constant="70" id="TsU-bO-Yu0"/>
                                     <constraint firstItem="gUK-Yw-aVP" firstAttribute="leading" secondItem="kze-s7-kTI" secondAttribute="trailing" constant="10" id="YEP-mX-zEQ"/>
                                     <constraint firstItem="gUK-Yw-aVP" firstAttribute="centerY" secondItem="un8-Xf-9Fb" secondAttribute="centerY" id="he9-pn-vUn"/>
+                                    <constraint firstItem="bvU-cp-GX3" firstAttribute="top" secondItem="un8-Xf-9Fb" secondAttribute="top" constant="5" id="neE-bw-XB6"/>
                                     <constraint firstItem="QFB-w0-4Kc" firstAttribute="leading" secondItem="un8-Xf-9Fb" secondAttribute="leading" constant="10" id="pcs-Y5-Jp6"/>
                                     <constraint firstItem="QFB-w0-4Kc" firstAttribute="centerY" secondItem="un8-Xf-9Fb" secondAttribute="centerY" id="pzi-K5-nNo"/>
                                 </constraints>

+ 11 - 7
iOSClient/Select/NCSelect.swift

@@ -24,7 +24,7 @@
 import Foundation
 
 @objc protocol NCSelectDelegate {
-    @objc func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, buttonType: String)
+    @objc func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, buttonType: String, overwrite: Bool)
 }
 
 class NCSelect: UIViewController, UIGestureRecognizerDelegate, NCListCellDelegate, NCGridCellDelegate, NCSectionHeaderMenuDelegate, DropdownMenuDelegate, DZNEmptyDataSetSource, DZNEmptyDataSetDelegate, BKPasscodeViewControllerDelegate {
@@ -38,7 +38,7 @@ class NCSelect: UIViewController, UIGestureRecognizerDelegate, NCListCellDelegat
     @IBOutlet fileprivate weak var buttonDone: UIButton!
     @IBOutlet fileprivate weak var buttonDone1: UIButton!
     
-    @IBOutlet fileprivate weak var overwrite: UISwitch!
+    @IBOutlet fileprivate weak var overwriteSwitch: UISwitch!
     @IBOutlet fileprivate weak var overwriteLabel: UILabel!
 
     // ------ external settings ------------------------------------
@@ -68,7 +68,7 @@ class NCSelect: UIViewController, UIGestureRecognizerDelegate, NCListCellDelegat
     private var isEditMode = false
     private var networkInProgress = false
     private var selectocId = [String]()
-    
+    private var overwrite = false
     private var sectionDatasource = CCSectionDataSourceMetadata()
     
     private var typeLayout = ""
@@ -285,17 +285,17 @@ class NCSelect: UIViewController, UIGestureRecognizerDelegate, NCListCellDelegat
     // MARK: ACTION
     
     @IBAction func actionCancel(_ sender: Any) {
-        delegate?.dismissSelect(serverUrl: nil, metadata: nil, type: type, buttonType: "cancel")
+        delegate?.dismissSelect(serverUrl: nil, metadata: nil, type: type, buttonType: "cancel", overwrite: overwrite)
         self.dismiss(animated: true, completion: nil)
     }
     
     @IBAction func actionDone(_ sender: Any) {
-        delegate?.dismissSelect(serverUrl: serverUrl, metadata: metadataFolder, type: type, buttonType: "done")
+        delegate?.dismissSelect(serverUrl: serverUrl, metadata: metadataFolder, type: type, buttonType: "done", overwrite: overwrite)
         self.dismiss(animated: true, completion: nil)
     }
     
     @IBAction func actionDone1(_ sender: Any) {
-        delegate?.dismissSelect(serverUrl: serverUrl, metadata: metadataFolder, type: type, buttonType: "done1")
+        delegate?.dismissSelect(serverUrl: serverUrl, metadata: metadataFolder, type: type, buttonType: "done1", overwrite: overwrite)
         self.dismiss(animated: true, completion: nil)
     }
     
@@ -323,6 +323,10 @@ class NCSelect: UIViewController, UIGestureRecognizerDelegate, NCListCellDelegat
         self.present(alertController, animated: true, completion:nil)
     }
     
+    @IBAction func valueChangedSwitchOverwrite(_ sender: Any) {
+        
+    }
+    
     // MARK: TAP EVENT
     
     func tapSwitchHeader(sender: Any) {
@@ -593,7 +597,7 @@ extension NCSelect: UICollectionViewDelegate {
             
         } else {
             
-            delegate?.dismissSelect(serverUrl: serverUrl, metadata: metadata, type: type, buttonType: "select")
+            delegate?.dismissSelect(serverUrl: serverUrl, metadata: metadata, type: type, buttonType: "select", overwrite: overwrite)
             self.dismiss(animated: true, completion: nil)
         }
     }

+ 1 - 1
iOSClient/Settings/CCManageAutoUpload.m

@@ -450,7 +450,7 @@
     return sectionName;
 }
 
-- (void)dismissSelectWithServerUrl:(NSString *)serverUrl metadata:(tableMetadata *)metadata type:(NSString *)type buttonType:(NSString *)buttonType
+- (void)dismissSelectWithServerUrl:(NSString *)serverUrl metadata:(tableMetadata *)metadata type:(NSString *)type buttonType:(NSString *)buttonType overwrite:(BOOL)overwrite
 {
     if (serverUrl != nil) {
         

+ 1 - 1
iOSClient/UploadFromOtherUpp/CCUploadFromOtherUpp.m

@@ -139,7 +139,7 @@
 #pragma mark == IBAction ==
 #pragma --------------------------------------------------------------------------------------------
 
-- (void)dismissSelectWithServerUrl:(NSString *)serverUrl metadata:(tableMetadata *)metadata type:(NSString *)type buttonType:(NSString *)buttonType
+- (void)dismissSelectWithServerUrl:(NSString *)serverUrl metadata:(tableMetadata *)metadata type:(NSString *)type buttonType:(NSString *)buttonType overwrite:(BOOL)overwrite
 {
     if (serverUrl) {
         serverUrlLocal = serverUrl;

+ 1 - 1
iOSClient/Viewer/NCViewerRichdocument.swift

@@ -200,7 +200,7 @@ class NCViewerRichdocument: WKWebView, WKNavigationDelegate, WKScriptMessageHand
     
     //MARK: -
     
-    func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, buttonType: String) {
+    func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, buttonType: String, overwrite: Bool) {
         
         if serverUrl != nil && metadata != nil {