Browse Source

add comments capabilities status

marinofaggiana 4 years ago
parent
commit
db00ceda6d

+ 51 - 7
iOSClient/Diagnostics/NCCapabilitiesViewController.storyboard

@@ -21,7 +21,7 @@
                                 <rect key="frame" x="0.0" y="88" width="414" height="774"/>
                                 <subviews>
                                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Sms-Ez-fLO" userLabel="View Capabilities">
-                                        <rect key="frame" x="5" y="5" width="404" height="500"/>
+                                        <rect key="frame" x="5" y="5" width="404" height="550"/>
                                         <subviews>
                                             <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="jdW-oZ-cH8" userLabel="FileSharing">
                                                 <rect key="frame" x="0.0" y="0.0" width="404" height="50"/>
@@ -368,7 +368,7 @@
                                                     <constraint firstItem="Tq3-cS-wup" firstAttribute="centerY" secondItem="LTt-2C-rPb" secondAttribute="centerY" id="xlI-tP-AMe"/>
                                                 </constraints>
                                             </view>
-                                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="2Pp-Kb-YMc" userLabel="OnlyOffice">
+                                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="2Pp-Kb-YMc" userLabel="User Status">
                                                 <rect key="frame" x="0.0" y="450" width="404" height="50"/>
                                                 <subviews>
                                                     <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="userStatusAway" translatesAutoresizingMaskIntoConstraints="NO" id="Nxp-H1-Pob">
@@ -406,15 +406,56 @@
                                                     <constraint firstItem="5Sj-5h-jgb" firstAttribute="centerY" secondItem="2Pp-Kb-YMc" secondAttribute="centerY" id="peY-Iv-kLA"/>
                                                 </constraints>
                                             </view>
+                                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="S24-Wc-fps" userLabel="Comments">
+                                                <rect key="frame" x="0.0" y="498" width="404" height="50"/>
+                                                <subviews>
+                                                    <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="comments" translatesAutoresizingMaskIntoConstraints="NO" id="cYf-px-izj">
+                                                        <rect key="frame" x="0.0" y="10" width="30" height="30"/>
+                                                        <constraints>
+                                                            <constraint firstAttribute="width" constant="30" id="gdA-CQ-Wu0"/>
+                                                            <constraint firstAttribute="height" constant="30" id="xGI-Zv-SQC"/>
+                                                        </constraints>
+                                                    </imageView>
+                                                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Comments" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="AEw-vE-bsf">
+                                                        <rect key="frame" x="40" y="16" width="74.5" height="18"/>
+                                                        <fontDescription key="fontDescription" type="system" pointSize="15"/>
+                                                        <nil key="textColor"/>
+                                                        <nil key="highlightedColor"/>
+                                                    </label>
+                                                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Available" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="lVT-MG-7kN">
+                                                        <rect key="frame" x="279" y="12.5" width="120" height="25"/>
+                                                        <constraints>
+                                                            <constraint firstAttribute="width" constant="120" id="TPY-VV-LmQ"/>
+                                                            <constraint firstAttribute="height" constant="25" id="WwT-hU-yOT"/>
+                                                        </constraints>
+                                                        <fontDescription key="fontDescription" type="system" pointSize="12"/>
+                                                        <nil key="textColor"/>
+                                                        <nil key="highlightedColor"/>
+                                                    </label>
+                                                </subviews>
+                                                <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="height" constant="50" id="3iW-tC-sQm"/>
+                                                    <constraint firstItem="AEw-vE-bsf" firstAttribute="leading" secondItem="cYf-px-izj" secondAttribute="trailing" constant="10" id="6bS-1j-tEi"/>
+                                                    <constraint firstItem="lVT-MG-7kN" firstAttribute="centerY" secondItem="S24-Wc-fps" secondAttribute="centerY" id="6zR-QZ-UEn"/>
+                                                    <constraint firstItem="cYf-px-izj" firstAttribute="leading" secondItem="S24-Wc-fps" secondAttribute="leading" id="Ahj-Nc-bRa"/>
+                                                    <constraint firstItem="cYf-px-izj" firstAttribute="centerY" secondItem="S24-Wc-fps" secondAttribute="centerY" id="BO8-tt-rX5"/>
+                                                    <constraint firstItem="AEw-vE-bsf" firstAttribute="centerY" secondItem="S24-Wc-fps" secondAttribute="centerY" id="ete-pJ-l2X"/>
+                                                    <constraint firstAttribute="trailing" secondItem="lVT-MG-7kN" secondAttribute="trailing" constant="5" id="zCZ-du-XT5"/>
+                                                </constraints>
+                                            </view>
                                         </subviews>
                                         <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                                         <constraints>
                                             <constraint firstItem="lGp-bh-Ysz" firstAttribute="leading" secondItem="Sms-Ez-fLO" secondAttribute="leading" id="0qE-PV-O2f"/>
                                             <constraint firstAttribute="trailing" secondItem="8nf-zJ-Qas" secondAttribute="trailing" id="0vv-HQ-Qqx"/>
-                                            <constraint firstAttribute="height" constant="500" id="6nU-Cb-MzH"/>
+                                            <constraint firstAttribute="height" constant="550" id="6nU-Cb-MzH"/>
                                             <constraint firstItem="mSC-JU-xuk" firstAttribute="leading" secondItem="Sms-Ez-fLO" secondAttribute="leading" id="9Nq-du-3ah"/>
+                                            <constraint firstItem="S24-Wc-fps" firstAttribute="leading" secondItem="Sms-Ez-fLO" secondAttribute="leading" id="Aad-cm-E1T"/>
+                                            <constraint firstAttribute="trailing" secondItem="S24-Wc-fps" secondAttribute="trailing" id="Ajf-er-GBr"/>
                                             <constraint firstItem="ZNB-jF-9zg" firstAttribute="leading" secondItem="Sms-Ez-fLO" secondAttribute="leading" id="GdE-lt-vZC"/>
                                             <constraint firstAttribute="trailing" secondItem="nVq-4i-FNy" secondAttribute="trailing" id="HSG-Ia-fYc"/>
+                                            <constraint firstItem="S24-Wc-fps" firstAttribute="top" secondItem="2Pp-Kb-YMc" secondAttribute="bottom" constant="-2" id="ML8-GT-9hb"/>
                                             <constraint firstAttribute="trailing" secondItem="2Pp-Kb-YMc" secondAttribute="trailing" id="NG8-Nu-ic6"/>
                                             <constraint firstItem="LTt-2C-rPb" firstAttribute="top" secondItem="dhs-06-3RT" secondAttribute="bottom" id="Nm6-NH-AC9"/>
                                             <constraint firstItem="UPC-L1-VKj" firstAttribute="leading" secondItem="Sms-Ez-fLO" secondAttribute="leading" id="QcN-sd-pHM"/>
@@ -443,7 +484,7 @@
                                         </constraints>
                                     </view>
                                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ogC-ph-Xdr" userLabel="View Link">
-                                        <rect key="frame" x="5" y="520" width="404" height="90"/>
+                                        <rect key="frame" x="5" y="550" width="404" height="90"/>
                                         <subviews>
                                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Home server" textAlignment="natural" lineBreakMode="characterWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PD5-8h-ZLm">
                                                 <rect key="frame" x="40" y="0.0" width="359" height="40"/>
@@ -494,7 +535,7 @@
                                         </constraints>
                                     </view>
                                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="OO4-N7-9vp" userLabel="View JSON">
-                                        <rect key="frame" x="0.0" y="600" width="414" height="40.5"/>
+                                        <rect key="frame" x="0.0" y="650" width="414" height="40.5"/>
                                         <subviews>
                                             <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" scrollEnabled="NO" editable="NO" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="RIO-6X-GG1">
                                                 <rect key="frame" x="5" y="5" width="404" height="30.5"/>
@@ -513,8 +554,8 @@
                                     </view>
                                 </subviews>
                                 <constraints>
-                                    <constraint firstItem="ogC-ph-Xdr" firstAttribute="top" secondItem="hTE-ys-qsF" secondAttribute="top" constant="520" id="9yP-Qs-EjJ"/>
-                                    <constraint firstItem="OO4-N7-9vp" firstAttribute="top" secondItem="hTE-ys-qsF" secondAttribute="top" constant="600" id="A9O-TK-Vz6" userLabel="View JSON.top = top + 550"/>
+                                    <constraint firstItem="ogC-ph-Xdr" firstAttribute="top" secondItem="hTE-ys-qsF" secondAttribute="top" constant="550" id="9yP-Qs-EjJ"/>
+                                    <constraint firstItem="OO4-N7-9vp" firstAttribute="top" secondItem="hTE-ys-qsF" secondAttribute="top" constant="650" id="A9O-TK-Vz6" userLabel="View JSON.top = top + 550"/>
                                     <constraint firstAttribute="trailing" secondItem="ogC-ph-Xdr" secondAttribute="trailing" constant="5" id="JLe-vC-Oyq"/>
                                     <constraint firstAttribute="bottom" secondItem="OO4-N7-9vp" secondAttribute="bottom" id="MpX-OZ-MDh"/>
                                     <constraint firstItem="OO4-N7-9vp" firstAttribute="width" secondItem="hTE-ys-qsF" secondAttribute="width" id="PWW-C3-Qcw"/>
@@ -544,6 +585,7 @@
                         <outlet property="homeServer" destination="PD5-8h-ZLm" id="Hge-8o-YY1"/>
                         <outlet property="imageActivity" destination="tl5-S1-p9X" id="pT5-X7-R2q"/>
                         <outlet property="imageCollabora" destination="GXZ-Rj-WCE" id="cOv-xH-ZKC"/>
+                        <outlet property="imageComments" destination="cYf-px-izj" id="lU6-Vu-AKk"/>
                         <outlet property="imageDeletedFiles" destination="8Zc-9W-n27" id="XYP-JN-JFc"/>
                         <outlet property="imageEndToEndEncryption" destination="S7m-5Z-ktw" id="0Pv-Yt-YJB"/>
                         <outlet property="imageExternalSite" destination="JWO-C0-32L" id="JKi-n1-5IQ"/>
@@ -554,6 +596,7 @@
                         <outlet property="imageUserStatus" destination="Nxp-H1-Pob" id="LQg-7M-CNd"/>
                         <outlet property="statusActivity" destination="dyb-1O-dIA" id="BfC-ZI-Wcr"/>
                         <outlet property="statusCollabora" destination="30w-oC-gZl" id="wnj-OE-UQZ"/>
+                        <outlet property="statusComments" destination="lVT-MG-7kN" id="7tn-cz-EhW"/>
                         <outlet property="statusDeletedFiles" destination="8hg-qK-qvz" id="xtt-gI-H0a"/>
                         <outlet property="statusEndToEndEncryption" destination="M82-8U-M4Q" id="S9e-h3-GpF"/>
                         <outlet property="statusExternalSite" destination="ivv-te-kaP" id="qzS-eo-Dq3"/>
@@ -591,6 +634,7 @@
     <resources>
         <image name="activity" width="512" height="512"/>
         <image name="collabora" width="425" height="425"/>
+        <image name="comments" width="425" height="425"/>
         <image name="dav" width="425" height="425"/>
         <image name="delete" width="425" height="425"/>
         <image name="externalsites" width="425" height="425"/>

+ 16 - 0
iOSClient/Diagnostics/NCCapabilitiesViewController.swift

@@ -49,6 +49,9 @@ class NCCapabilitiesViewController: UIViewController, UIDocumentInteractionContr
     @IBOutlet weak var imageUserStatus: UIImageView!
     @IBOutlet weak var statusUserStatus: UILabel!
     
+    @IBOutlet weak var imageComments: UIImageView!
+    @IBOutlet weak var statusComments: UILabel!
+    
     @IBOutlet weak var imageText: UIImageView!
     @IBOutlet weak var statusText: UILabel!
     
@@ -132,6 +135,11 @@ class NCCapabilitiesViewController: UIViewController, UIDocumentInteractionContr
         statusUserStatus.layer.borderColor = NCBrandColor.sharedInstance.textView.cgColor
         statusUserStatus.layer.backgroundColor = NCBrandColor.sharedInstance.graySoft.withAlphaComponent(0.3).cgColor
         
+        statusComments.layer.cornerRadius = 12.5
+        statusComments.layer.borderWidth = 0.5
+        statusComments.layer.borderColor = NCBrandColor.sharedInstance.textView.cgColor
+        statusComments.layer.backgroundColor = NCBrandColor.sharedInstance.graySoft.withAlphaComponent(0.3).cgColor
+        
         imageFileSharing.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "share"), width: 100, height: 100, color: .gray)
         imageExternalSite.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "externalsites"), width: 100, height: 100, color: .gray)
         imageEndToEndEncryption.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "lock"), width: 100, height: 100, color: .gray)        
@@ -142,6 +150,7 @@ class NCCapabilitiesViewController: UIViewController, UIDocumentInteractionContr
         imageCollabora.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "collabora"), width: 100, height: 100, color: .gray)
         imageOnlyOffice.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "onlyoffice"), width: 100, height: 100, color: .gray)
         imageUserStatus.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "userStatusAway"), width: 100, height: 100, color: .gray)
+        imageComments.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "comments"), width: 100, height: 100, color: .gray)
 
         guard let account = NCManageDatabase.sharedInstance.getAccountActive() else { return }
         self.account = account.account
@@ -303,6 +312,13 @@ class NCCapabilitiesViewController: UIViewController, UIDocumentInteractionContr
             statusUserStatus.text = NSLocalizedString("_not_available_", comment: "")
         }
         
+        let comments = NCManageDatabase.sharedInstance.getCapabilitiesServerBool(account: account, elements: NCElementsJSON.shared.capabilitiesFilesComments, exists: false)
+        if comments {
+            statusComments.text = "✓ " + NSLocalizedString("_available_", comment: "")
+        } else {
+            statusComments.text = NSLocalizedString("_not_available_", comment: "")
+        }
+        
         print("end.")
     }
 }

+ 15 - 0
iOSClient/Images.xcassets/comments.imageset/Contents.json

@@ -0,0 +1,15 @@
+{
+  "images" : [
+    {
+      "filename" : "comments.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  },
+  "properties" : {
+    "preserves-vector-representation" : true
+  }
+}

BIN
iOSClient/Images.xcassets/comments.imageset/comments.pdf