Forráskód Böngészése

add new share view

marinofaggiana 5 éve
szülő
commit
440fae9866

+ 2 - 2
iOSClient/Main/CCMain.m

@@ -1885,8 +1885,8 @@
     NCSharePaging *shareViewController = (NCSharePaging *)shareNavigationController.topViewController;
     
     shareViewController.metadata = metadata;
-    shareViewController.shareLink = [appDelegate.sharesLink objectForKey:metadata.fileID];
-    shareViewController.shareUserAndGroup = [appDelegate.sharesUserAndGroup objectForKey:metadata.fileID];;
+    shareViewController.shareLink = [appDelegate.sharesLink objectForKey:[metadata.serverUrl stringByAppendingString:metadata.fileName]];
+    shareViewController.shareUserAndGroup = [appDelegate.sharesUserAndGroup objectForKey:[metadata.serverUrl stringByAppendingString:metadata.fileName]];;
     
     [shareNavigationController setModalPresentationStyle:UIModalPresentationPageSheet];
     [self presentViewController:shareNavigationController animated:YES completion:nil];

+ 5 - 0
iOSClient/Share/NCShare.swift

@@ -96,6 +96,8 @@ extension NCSharePaging: PagingViewControllerDataSource {
             let viewController = UIStoryboard(name: "NCShare", bundle: nil).instantiateViewController(withIdentifier: "sharing") as! NCShare
             viewController.metadata = metadata!
             viewController.height = height
+            viewController.shareLink = shareLink
+            viewController.shareUserAndGroup = shareUserAndGroup
             return viewController
         default:
             return UIViewController()
@@ -235,7 +237,10 @@ class NCShare: UIViewController, UIGestureRecognizerDelegate {
     var metadata: tableMetadata?
     private let appDelegate = UIApplication.shared.delegate as! AppDelegate
 
+    public var shareLink: String = ""
+    public var shareUserAndGroup: String = ""
     public var height: CGFloat = 0
+    
     private let iconShare: CGFloat = 200
     private var viewMenuShareLink: UIView?
     private var shareLinkMenuView: NCShareLinkMenuView?

+ 11 - 11
iOSClient/Share/NCShareLinkMenuView.xib

@@ -58,7 +58,7 @@
                     </constraints>
                     <nil key="textColor"/>
                     <fontDescription key="fontDescription" type="system" pointSize="13"/>
-                    <textInputTraits key="textInputTraits" textContentType="password"/>
+                    <textInputTraits key="textInputTraits" secureTextEntry="YES" textContentType="password"/>
                 </textField>
                 <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="dB8-1M-WZr">
                     <rect key="frame" x="10" y="195" width="51" height="31"/>
@@ -82,7 +82,7 @@
                     <textInputTraits key="textInputTraits" textContentType="password"/>
                 </textField>
                 <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="file_txt" translatesAutoresizingMaskIntoConstraints="NO" id="F4T-wQ-tBU">
-                    <rect key="frame" x="10" y="278" width="25" height="25"/>
+                    <rect key="frame" x="13" y="278" width="25" height="25"/>
                     <constraints>
                         <constraint firstAttribute="height" constant="25" id="7uC-w2-XPl"/>
                         <constraint firstAttribute="width" constant="25" id="YkI-0i-Hbj"/>
@@ -108,7 +108,7 @@
                     <textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
                 </textView>
                 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="CLA-UL-mYb">
-                    <rect key="frame" x="10" y="378" width="25" height="25"/>
+                    <rect key="frame" x="13" y="378" width="25" height="25"/>
                     <constraints>
                         <constraint firstAttribute="width" constant="25" id="XDw-5r-2dP"/>
                         <constraint firstAttribute="height" constant="25" id="fWP-XF-kQx"/>
@@ -125,7 +125,7 @@
                     <nil key="highlightedColor"/>
                 </label>
                 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="0bK-Kl-hcs">
-                    <rect key="frame" x="10" y="433" width="25" height="25"/>
+                    <rect key="frame" x="13" y="433" width="25" height="25"/>
                     <constraints>
                         <constraint firstAttribute="width" constant="25" id="jn9-Sf-5OM"/>
                         <constraint firstAttribute="height" constant="25" id="wQO-6d-vWV"/>
@@ -147,16 +147,16 @@
                 <constraint firstItem="e1F-PV-32s" firstAttribute="leading" secondItem="HDO-WC-RvJ" secondAttribute="trailing" constant="10" id="0Un-2w-9a3"/>
                 <constraint firstItem="grT-sd-j7q" firstAttribute="centerY" secondItem="F4T-wQ-tBU" secondAttribute="centerY" id="4KH-Py-OgY"/>
                 <constraint firstItem="qll-9F-4DA" firstAttribute="centerY" secondItem="dB8-1M-WZr" secondAttribute="centerY" id="5QL-7q-jdE"/>
-                <constraint firstItem="CLA-UL-mYb" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="10" id="8lb-ki-xfh"/>
-                <constraint firstItem="hvx-5m-jip" firstAttribute="leading" secondItem="F4T-wQ-tBU" secondAttribute="trailing" constant="30" id="AG8-gi-XVa"/>
+                <constraint firstItem="CLA-UL-mYb" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="13" id="8lb-ki-xfh"/>
+                <constraint firstItem="hvx-5m-jip" firstAttribute="leading" secondItem="F4T-wQ-tBU" secondAttribute="trailing" constant="27" id="AG8-gi-XVa"/>
                 <constraint firstItem="0bK-Kl-hcs" firstAttribute="top" secondItem="CLA-UL-mYb" secondAttribute="bottom" constant="30" id="Bka-Hj-Arm"/>
                 <constraint firstAttribute="trailing" secondItem="ymk-0u-ddH" secondAttribute="trailing" constant="10" id="Chd-iQ-EdR"/>
                 <constraint firstItem="sjf-wF-y07" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="10" id="EW6-D3-tml"/>
                 <constraint firstItem="UIn-eq-hkP" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="10" id="FwN-Rj-koX"/>
-                <constraint firstItem="Ff4-JE-zGU" firstAttribute="leading" secondItem="CLA-UL-mYb" secondAttribute="trailing" constant="34" id="Fzp-Qw-dGx"/>
+                <constraint firstItem="Ff4-JE-zGU" firstAttribute="leading" secondItem="CLA-UL-mYb" secondAttribute="trailing" constant="31" id="Fzp-Qw-dGx"/>
                 <constraint firstItem="HDO-WC-RvJ" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="10" id="GTl-Tq-cLY"/>
                 <constraint firstItem="IHP-P8-rm2" firstAttribute="centerY" secondItem="sjf-wF-y07" secondAttribute="centerY" id="HiA-pE-L6l"/>
-                <constraint firstItem="cna-iK-PD7" firstAttribute="leading" secondItem="0bK-Kl-hcs" secondAttribute="trailing" constant="34" id="Hic-qB-F0O"/>
+                <constraint firstItem="cna-iK-PD7" firstAttribute="leading" secondItem="0bK-Kl-hcs" secondAttribute="trailing" constant="31" id="Hic-qB-F0O"/>
                 <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"/>
@@ -171,21 +171,21 @@
                 <constraint firstAttribute="trailing" secondItem="e1F-PV-32s" secondAttribute="trailing" constant="10" id="ZYT-R4-bqo"/>
                 <constraint firstAttribute="trailing" secondItem="IHP-P8-rm2" secondAttribute="trailing" constant="10" id="Zsj-Ja-2wq"/>
                 <constraint firstItem="F4T-wQ-tBU" firstAttribute="top" secondItem="ymk-0u-ddH" secondAttribute="bottom" constant="20" id="aj8-2w-ySe"/>
-                <constraint firstItem="0bK-Kl-hcs" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="10" id="bSd-GG-kS3"/>
+                <constraint firstItem="0bK-Kl-hcs" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="13" id="bSd-GG-kS3"/>
                 <constraint firstItem="qll-9F-4DA" firstAttribute="leading" secondItem="dB8-1M-WZr" secondAttribute="trailing" constant="10" id="ciQ-HO-5Lo"/>
                 <constraint firstItem="HDO-WC-RvJ" firstAttribute="top" secondItem="UIn-eq-hkP" secondAttribute="bottom" constant="20" id="dex-mb-oRg"/>
                 <constraint firstItem="cna-iK-PD7" firstAttribute="centerY" secondItem="0bK-Kl-hcs" secondAttribute="centerY" id="fDj-O7-Xdr"/>
                 <constraint firstItem="KXo-cP-gkc" firstAttribute="leading" secondItem="UIn-eq-hkP" secondAttribute="trailing" constant="10" id="grU-Jx-SqH"/>
                 <constraint firstItem="Ff4-JE-zGU" firstAttribute="centerY" secondItem="CLA-UL-mYb" secondAttribute="centerY" id="htT-Up-zbh"/>
                 <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="F4T-wQ-tBU" secondAttribute="trailing" constant="34" id="kLi-Zi-SmS"/>
+                <constraint firstItem="grT-sd-j7q" firstAttribute="leading" secondItem="F4T-wQ-tBU" secondAttribute="trailing" constant="31" id="kLi-Zi-SmS"/>
                 <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="hvx-5m-jip" secondAttribute="trailing" constant="10" id="pIn-yh-w1o"/>
                 <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="hvx-5m-jip" firstAttribute="top" secondItem="grT-sd-j7q" secondAttribute="bottom" constant="10" id="wuG-4i-FDE"/>
-                <constraint firstItem="F4T-wQ-tBU" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="10" id="x4S-GE-lJ8"/>
+                <constraint firstItem="F4T-wQ-tBU" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="13" id="x4S-GE-lJ8"/>
                 <constraint firstAttribute="trailing" secondItem="HaY-OM-mQh" secondAttribute="trailing" constant="10" id="yvI-xV-T7d"/>
                 <constraint firstItem="UIn-eq-hkP" firstAttribute="top" secondItem="sjf-wF-y07" secondAttribute="bottom" constant="20" id="zex-fG-9ns"/>
             </constraints>