Kaynağa Gözat

new view shared

marinofaggiana 5 yıl önce
ebeveyn
işleme
7692f99862

+ 2 - 20
iOSClient/Share/NCShare.swift

@@ -432,7 +432,6 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
     @IBOutlet weak var switchPasswordProtect: UISwitch!
     @IBOutlet weak var labelPasswordProtect: UILabel!
     @IBOutlet weak var fieldPasswordProtect: UITextField!
-    @IBOutlet weak var buttonSendPasswordProtect: UIButton!
 
     @IBOutlet weak var switchSetExpirationDate: UISwitch!
     @IBOutlet weak var labelSetExpirationDate: UILabel!
@@ -441,7 +440,6 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
     @IBOutlet weak var imageNoteToRecipient: UIImageView!
     @IBOutlet weak var labelNoteToRecipient: UILabel!
     @IBOutlet weak var fieldNoteToRecipient: UITextField!
-    @IBOutlet weak var buttonSendNoteToRecipient: UIButton!
 
     @IBOutlet weak var buttonDeleteShareLink: UIButton!
     @IBOutlet weak var labelDeleteShareLink: UILabel!
@@ -515,12 +513,10 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
             switchPasswordProtect.setOn(true, animated: false)
             fieldPasswordProtect.isEnabled = true
             fieldPasswordProtect.text = tableShare!.shareWith
-            buttonSendPasswordProtect.isEnabled = true
         } else {
             switchPasswordProtect.setOn(false, animated: false)
             fieldPasswordProtect.isEnabled = false
             fieldPasswordProtect.text = ""
-            buttonSendPasswordProtect.isEnabled = false
         }
         
         // Set expiration date
@@ -579,7 +575,6 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
         if sender.isOn {
             fieldPasswordProtect.isEnabled = true
             fieldPasswordProtect.text = ""
-            buttonSendPasswordProtect.isEnabled = true
             fieldPasswordProtect.becomeFirstResponder()
         } else {
             let networking = NCShareNetworking.init(account: metadata!.account, activeUrl: appDelegate.activeUrl,  view: self, delegate: self)
@@ -587,21 +582,14 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
         }
     }
     
-    @IBAction func buttonSendPasswordProtect(sender: UIButton) {
+    @IBAction func fieldPasswordProtectDidEndOnExit(textField: UITextField) {
         
-        fieldPasswordProtect.endEditing(true)
-
         guard let tableShare = self.tableShare else { return }
-        if fieldPasswordProtect.text == nil || fieldPasswordProtect.text == "" { return }
         
         let networking = NCShareNetworking.init(account: metadata!.account, activeUrl: appDelegate.activeUrl,  view: self, delegate: self)
         networking.updateShare(idRemoteShared: tableShare.idRemoteShared, password: fieldPasswordProtect.text, permission: 0, note: nil, expirationTime: nil, hideDownload: tableShare.hideDownload)
     }
     
-    @IBAction func fieldPasswordProtectDidEndOnExit(textField: UITextField) {
-        buttonSendPasswordProtect(sender: UIButton())
-    }
-    
     // Set expiration date
     @IBAction func switchSetExpirationDate(sender: UISwitch) {
         
@@ -624,9 +612,7 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
     }
     
     // Note to recipient
-    @IBAction func buttonSendNoteToRecipient(sender: UIButton) {
-        
-        fieldNoteToRecipient.endEditing(true)
+    @IBAction func fieldNoteToRecipientDidEndOnExit(textField: UITextField) {
 
         guard let tableShare = self.tableShare else { return }
         if fieldNoteToRecipient.text == nil { return }
@@ -635,10 +621,6 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
         networking.updateShare(idRemoteShared: tableShare.idRemoteShared, password: nil, permission: 0, note: fieldNoteToRecipient.text, expirationTime: nil, hideDownload: tableShare.hideDownload)
     }
     
-    @IBAction func fieldNoteToRecipientDidEndOnExit(textField: UITextField) {
-        buttonSendNoteToRecipient(sender: UIButton())
-    }
-    
     // Delete share link
     @IBAction func buttonDeleteShareLink(sender: UIButton) {
         

+ 6 - 35
iOSClient/Share/NCShareLinkMenuView.xib

@@ -60,19 +60,8 @@
                     <nil key="textColor"/>
                     <nil key="highlightedColor"/>
                 </label>
-                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="SzO-tO-ghG" userLabel="Button Send Password Protect">
-                    <rect key="frame" x="285" y="115" width="25" height="25"/>
-                    <constraints>
-                        <constraint firstAttribute="width" constant="25" id="aMX-i0-PEo"/>
-                        <constraint firstAttribute="height" constant="25" id="qlO-39-F5h"/>
-                    </constraints>
-                    <state key="normal" image="arrowRight"/>
-                    <connections>
-                        <action selector="buttonSendPasswordProtectWithSender:" destination="iN0-l3-epB" eventType="touchUpInside" id="LXR-OO-e8e"/>
-                    </connections>
-                </button>
                 <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="e1F-PV-32s">
-                    <rect key="frame" x="69" y="145" width="241" height="30"/>
+                    <rect key="frame" x="70" y="145" width="240" height="30"/>
                     <constraints>
                         <constraint firstAttribute="height" constant="30" id="tTv-8w-kxm"/>
                     </constraints>
@@ -99,7 +88,7 @@
                     <nil key="highlightedColor"/>
                 </label>
                 <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="ymk-0u-ddH">
-                    <rect key="frame" x="69" y="228" width="241" height="30"/>
+                    <rect key="frame" x="70" y="228" width="240" height="30"/>
                     <constraints>
                         <constraint firstAttribute="height" constant="30" id="G4f-LN-v7k"/>
                     </constraints>
@@ -126,19 +115,8 @@
                     <nil key="textColor"/>
                     <nil key="highlightedColor"/>
                 </label>
-                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="AXE-ta-uC8">
-                    <rect key="frame" x="285" y="278" width="25" height="25"/>
-                    <constraints>
-                        <constraint firstAttribute="height" constant="25" id="WjG-39-aup"/>
-                        <constraint firstAttribute="width" constant="25" id="zKE-Fg-nWa"/>
-                    </constraints>
-                    <state key="normal" image="arrowRight"/>
-                    <connections>
-                        <action selector="buttonSendNoteToRecipientWithSender:" destination="iN0-l3-epB" eventType="touchUpInside" id="hxy-ND-ZKC"/>
-                    </connections>
-                </button>
                 <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="FyH-3p-EdC">
-                    <rect key="frame" x="69" y="308" width="241" height="30"/>
+                    <rect key="frame" x="70" y="308" width="240" height="30"/>
                     <nil key="textColor"/>
                     <fontDescription key="fontDescription" type="system" pointSize="14"/>
                     <textInputTraits key="textInputTraits"/>
@@ -199,12 +177,10 @@
             </subviews>
             <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
             <constraints>
-                <constraint firstItem="e1F-PV-32s" firstAttribute="leading" secondItem="HDO-WC-RvJ" secondAttribute="trailing" constant="10" id="0Un-2w-9a3"/>
                 <constraint firstItem="Ff4-JE-zGU" firstAttribute="centerY" secondItem="hr8-Qe-xD0" secondAttribute="centerY" id="0WP-PE-HTp"/>
                 <constraint firstItem="IHP-P8-rm2" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="70" id="2RV-rL-sYG"/>
                 <constraint firstItem="HaY-OM-mQh" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="70" id="4CZ-Mo-lOP"/>
                 <constraint firstItem="grT-sd-j7q" firstAttribute="centerY" secondItem="F4T-wQ-tBU" secondAttribute="centerY" id="4KH-Py-OgY"/>
-                <constraint firstItem="AXE-ta-uC8" firstAttribute="centerY" secondItem="F4T-wQ-tBU" secondAttribute="centerY" id="53F-eV-3Jo"/>
                 <constraint firstItem="qll-9F-4DA" firstAttribute="centerY" secondItem="dB8-1M-WZr" secondAttribute="centerY" id="5QL-7q-jdE"/>
                 <constraint firstItem="FyH-3p-EdC" firstAttribute="top" secondItem="grT-sd-j7q" secondAttribute="bottom" constant="10" id="7al-MO-ezA"/>
                 <constraint firstItem="CLA-UL-mYb" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="13" id="8lb-ki-xfh"/>
@@ -217,19 +193,18 @@
                 <constraint firstItem="IHP-P8-rm2" firstAttribute="centerY" secondItem="sjf-wF-y07" secondAttribute="centerY" id="HiA-pE-L6l"/>
                 <constraint firstItem="6SU-Ak-Q7m" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="13" id="Hqf-wy-u3S"/>
                 <constraint firstAttribute="trailing" secondItem="e1F-PV-32s" secondAttribute="trailing" constant="10" id="ImT-sr-UAr"/>
-                <constraint firstAttribute="trailing" secondItem="AXE-ta-uC8" secondAttribute="trailing" constant="10" id="J2I-36-ULj"/>
                 <constraint firstAttribute="trailing" secondItem="0bK-Kl-hcs" secondAttribute="trailing" constant="20" id="Jy3-Qb-ucs"/>
                 <constraint firstAttribute="trailing" secondItem="cna-iK-PD7" secondAttribute="trailing" constant="10" id="LEz-3F-g5Q"/>
-                <constraint firstItem="ymk-0u-ddH" firstAttribute="leading" secondItem="dB8-1M-WZr" secondAttribute="trailing" constant="10" id="Nka-wr-Yvi"/>
                 <constraint firstAttribute="trailing" secondItem="grT-sd-j7q" secondAttribute="trailing" constant="5" id="Nyn-RD-jTz"/>
                 <constraint firstItem="6SU-Ak-Q7m" firstAttribute="top" secondItem="CLA-UL-mYb" secondAttribute="bottom" constant="20" id="OU0-vG-YTq"/>
                 <constraint firstAttribute="trailing" secondItem="FyH-3p-EdC" secondAttribute="trailing" constant="10" id="RhU-wl-afT"/>
                 <constraint firstItem="KXo-cP-gkc" firstAttribute="centerY" secondItem="UIn-eq-hkP" secondAttribute="centerY" id="Snt-zf-mcs"/>
                 <constraint firstItem="sjf-wF-y07" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="10" id="TFC-63-muN"/>
                 <constraint firstItem="dB8-1M-WZr" firstAttribute="top" secondItem="e1F-PV-32s" secondAttribute="bottom" constant="20" id="TIV-5L-Cza"/>
-                <constraint firstItem="SzO-tO-ghG" firstAttribute="centerY" secondItem="HaY-OM-mQh" secondAttribute="centerY" id="UFI-zx-3Hs"/>
+                <constraint firstItem="FyH-3p-EdC" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="70" id="TXe-jF-DdS"/>
                 <constraint firstItem="dB8-1M-WZr" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="10" id="Ua2-93-05m"/>
                 <constraint firstItem="HaY-OM-mQh" firstAttribute="centerY" secondItem="HDO-WC-RvJ" secondAttribute="centerY" id="UcN-gf-Prv"/>
+                <constraint firstItem="e1F-PV-32s" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="70" id="YCZ-Z6-1Ty"/>
                 <constraint firstItem="CLA-UL-mYb" firstAttribute="centerY" secondItem="hr8-Qe-xD0" secondAttribute="centerY" id="Zoj-Ro-jFv"/>
                 <constraint firstAttribute="trailing" secondItem="IHP-P8-rm2" secondAttribute="trailing" constant="10" id="Zsj-Ja-2wq"/>
                 <constraint firstItem="cna-iK-PD7" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="70" id="aZc-3Q-liP"/>
@@ -238,15 +213,14 @@
                 <constraint firstItem="HDO-WC-RvJ" firstAttribute="top" secondItem="UIn-eq-hkP" secondAttribute="bottom" constant="20" id="dex-mb-oRg"/>
                 <constraint firstItem="hr8-Qe-xD0" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="13" id="elF-be-kqS"/>
                 <constraint firstItem="cna-iK-PD7" firstAttribute="centerY" secondItem="0bK-Kl-hcs" secondAttribute="centerY" id="fDj-O7-Xdr"/>
-                <constraint firstItem="FyH-3p-EdC" firstAttribute="leading" secondItem="F4T-wQ-tBU" secondAttribute="trailing" constant="31" id="iRw-AV-HkK"/>
                 <constraint firstItem="hr8-Qe-xD0" firstAttribute="top" secondItem="FyH-3p-EdC" secondAttribute="bottom" constant="20" id="itX-To-Hbm"/>
                 <constraint firstItem="ymk-0u-ddH" firstAttribute="top" secondItem="qll-9F-4DA" secondAttribute="bottom" constant="10" id="k4G-Yb-xBy"/>
                 <constraint firstItem="grT-sd-j7q" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="70" id="lRX-gv-77N"/>
                 <constraint firstAttribute="trailing" secondItem="Ff4-JE-zGU" secondAttribute="trailing" constant="10" id="ljN-WF-OVS"/>
                 <constraint firstItem="e1F-PV-32s" firstAttribute="top" secondItem="HaY-OM-mQh" secondAttribute="bottom" constant="10" id="m5R-ms-HZh"/>
-                <constraint firstAttribute="trailing" secondItem="SzO-tO-ghG" secondAttribute="trailing" constant="10" id="mh2-EL-jLh"/>
                 <constraint firstAttribute="trailing" secondItem="CLA-UL-mYb" secondAttribute="trailing" constant="20" id="oEb-Su-Nu5"/>
                 <constraint firstItem="qll-9F-4DA" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="70" id="qEq-8J-iTD"/>
+                <constraint firstItem="ymk-0u-ddH" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="70" id="qrv-wQ-p6E"/>
                 <constraint firstAttribute="trailing" secondItem="KXo-cP-gkc" secondAttribute="trailing" constant="10" id="uDa-6r-K84"/>
                 <constraint firstAttribute="trailing" secondItem="qll-9F-4DA" secondAttribute="trailing" constant="10" id="vaT-9Q-m84"/>
                 <constraint firstItem="F4T-wQ-tBU" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="13" id="x4S-GE-lJ8"/>
@@ -257,8 +231,6 @@
             <connections>
                 <outlet property="buttonAddAnotherLink" destination="0bK-Kl-hcs" id="XMo-Cp-y6f"/>
                 <outlet property="buttonDeleteShareLink" destination="CLA-UL-mYb" id="LVP-Vh-RHb"/>
-                <outlet property="buttonSendNoteToRecipient" destination="AXE-ta-uC8" id="hAe-F8-ybi"/>
-                <outlet property="buttonSendPasswordProtect" destination="SzO-tO-ghG" id="bgm-IF-zmu"/>
                 <outlet property="fieldNoteToRecipient" destination="FyH-3p-EdC" id="EBz-iA-1tq"/>
                 <outlet property="fieldPasswordProtect" destination="e1F-PV-32s" id="c1Y-0f-UYD"/>
                 <outlet property="fieldSetExpirationDate" destination="ymk-0u-ddH" id="W6o-xf-Zj2"/>
@@ -282,7 +254,6 @@
     </objects>
     <resources>
         <image name="add" width="25" height="25"/>
-        <image name="arrowRight" width="329" height="329"/>
         <image name="file_txt" width="300" height="300"/>
         <image name="trash" width="300" height="300"/>
     </resources>