Add a "no shares" label if there are no shares available in share view
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Sat, 6 Apr 2024 17:09:13 +0000 (01:09 +0800)
committerClaudio Cambra <claudio.cambra@nextcloud.com>
Wed, 17 Apr 2024 08:39:05 +0000 (16:39 +0800)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/ShareTableViewDataSource.swift
shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/ShareViewController.swift
shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/ShareViewController.xib

index cf8087bc46724abda6b2c64477da190bf12bc24c..1200499ab5ec00f5793458dcef5b4a4191921e18 100644 (file)
@@ -32,7 +32,7 @@ class ShareTableViewDataSource: NSObject, NSTableViewDataSource, NSTableViewDele
     private(set) var kit: NextcloudKit?
     private(set) var itemURL: URL?
     private(set) var itemServerRelativePath: String?
-    private var shares: [NKShare] = [] {
+    private(set) var shares: [NKShare] = [] {
         didSet { Task { @MainActor in sharesTableView?.reloadData() } }
     }
     private var account: NextcloudAccount? {
index 17016dcc440523052d0533d5f680968c24e50047..55955f143984d15839844c443302f8fcc687a9d2 100644 (file)
@@ -27,6 +27,7 @@ class ShareViewController: NSViewController, ShareViewDataSourceUIDelegate {
     @IBOutlet weak var loadingIndicator: NSProgressIndicator!
     @IBOutlet weak var errorMessageStackView: NSStackView!
     @IBOutlet weak var errorTextLabel: NSTextField!
+    @IBOutlet weak var noSharesLabel: NSTextField!
 
     public override var nibName: NSNib.Name? {
         return NSNib.Name(self.className)
@@ -143,6 +144,7 @@ class ShareViewController: NSViewController, ShareViewDataSourceUIDelegate {
     }
 
     func fetchFinished() {
+        noSharesLabel.isHidden = !shareDataSource.shares.isEmpty
         loadingEffectView.isHidden = true
         loadingIndicator.stopAnimation(self)
     }
index a797c5e9b1d313bd5848fe13760ec3dafa39ab0b..7a61de7033656723906aa6c58fd942c3618b10f9 100644 (file)
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22689"/>
         <capability name="Image references" minToolsVersion="12.0"/>
         <capability name="Named colors" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
@@ -19,6 +19,7 @@
                 <outlet property="fileNameLabel" destination="slV-H6-zJ3" id="DPp-sN-Yff"/>
                 <outlet property="loadingEffectView" destination="1ud-mC-gQV" id="HMT-Sb-Axl"/>
                 <outlet property="loadingIndicator" destination="acb-Yu-Zpm" id="9Jf-dE-7LE"/>
+                <outlet property="noSharesLabel" destination="K3D-6U-Cbr" id="zDP-E4-9bg"/>
                 <outlet property="optionsView" destination="EXb-m8-yzj" id="uAb-lv-EZ4"/>
                 <outlet property="splitView" destination="91w-SP-6sl" id="20T-gQ-SPY"/>
                 <outlet property="tableView" destination="vb0-a6-eeH" id="KQo-eg-dba"/>
         <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
         <customObject id="-3" userLabel="Application" customClass="NSObject"/>
         <view translatesAutoresizingMaskIntoConstraints="NO" id="Jw6-da-U8j">
-            <rect key="frame" x="0.0" y="0.0" width="500" height="825"/>
+            <rect key="frame" x="0.0" y="0.0" width="500" height="829"/>
             <subviews>
                 <splitView arrangesAllSubviews="NO" dividerStyle="thin" translatesAutoresizingMaskIntoConstraints="NO" id="91w-SP-6sl">
-                    <rect key="frame" x="10" y="10" width="480" height="805"/>
+                    <rect key="frame" x="10" y="10" width="480" height="809"/>
                     <subviews>
                         <stackView distribution="fill" orientation="vertical" alignment="leading" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="wGI-UV-bB3">
                             <rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
@@ -49,7 +50,7 @@
                                         <stackView distribution="fill" orientation="vertical" alignment="leading" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="oSY-fV-uws">
                                             <rect key="frame" x="51" y="0.0" width="375" height="43"/>
                                             <subviews>
-                                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="slV-H6-zJ3">
+                                                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="slV-H6-zJ3">
                                                     <rect key="frame" x="-2" y="24" width="78" height="19"/>
                                                     <textFieldCell key="cell" lineBreakMode="clipping" title="File name" id="Uuo-1j-to8">
                                                         <font key="font" metaFont="systemBold" size="16"/>
@@ -57,7 +58,7 @@
                                                         <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                                     </textFieldCell>
                                                 </textField>
-                                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="gX0-nE-MrU">
+                                                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="gX0-nE-MrU">
                                                     <rect key="frame" x="-2" y="0.0" width="146" height="16"/>
                                                     <textFieldCell key="cell" lineBreakMode="clipping" title="File size ยท Last modified" id="1GC-Gr-x29">
                                                         <font key="font" usesAppearanceFont="YES"/>
                                     <rect key="frame" x="0.0" y="308" width="480" height="40"/>
                                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                                     <subviews>
-                                        <textField focusRingType="none" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="770-HW-oC7">
-                                            <rect key="frame" x="0.0" y="0.0" width="405" height="40"/>
+                                        <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="770-HW-oC7">
+                                            <rect key="frame" x="0.0" y="0.0" width="411" height="40"/>
                                             <textFieldCell key="cell" selectable="YES" borderStyle="border" alignment="left" title="A long error message that provides detail about why some operations with the shares failed" drawsBackground="YES" id="Jvl-L9-x8K">
                                                 <font key="font" metaFont="systemSemibold" size="13"/>
                                                 <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
                                             </textFieldCell>
                                         </textField>
                                         <button translatesAutoresizingMaskIntoConstraints="NO" id="qfq-F1-w0b">
-                                            <rect key="frame" x="410" y="-4" width="73" height="47"/>
+                                            <rect key="frame" x="416" y="-4" width="67" height="47"/>
                                             <buttonCell key="cell" type="bevel" title="Dismiss" bezelStyle="regularSquare" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="dLP-yX-dyk">
                                                 <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                                 <font key="font" metaFont="system"/>
                                     </customSpacing>
                                 </stackView>
                                 <scrollView autohidesScrollers="YES" horizontalLineScroll="17" horizontalPageScroll="10" verticalLineScroll="17" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZzY-1Z-3xa">
-                                    <rect key="frame" x="0.0" y="4" width="480" height="300"/>
+                                    <rect key="frame" x="0.0" y="0.0" width="480" height="300"/>
                                     <clipView key="contentView" drawsBackground="NO" id="Ixg-th-Nw0">
                                         <rect key="frame" x="1" y="1" width="478" height="298"/>
                                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                         <constraint firstAttribute="height" constant="300" id="FAW-Ws-zy7"/>
                                     </constraints>
                                     <scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="hQs-hA-bDq">
-                                        <rect key="frame" x="1" y="283" width="478" height="16"/>
+                                        <rect key="frame" x="1" y="284" width="478" height="15"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                     </scroller>
                                     <scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="ryi-jk-XFM">
                             </customSpacing>
                         </stackView>
                         <view translatesAutoresizingMaskIntoConstraints="NO" id="EXb-m8-yzj" customClass="ShareOptionsView" customModule="FileProviderUIExt" customModuleProvider="target">
-                            <rect key="frame" x="0.0" y="481" width="480" height="324"/>
+                            <rect key="frame" x="0.0" y="481" width="480" height="328"/>
                             <subviews>
                                 <stackView distribution="fill" orientation="vertical" alignment="leading" spacing="5" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="T4D-9c-PyA">
                                     <rect key="frame" x="10" y="10" width="460" height="308"/>
                                     <subviews>
-                                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" verticalCompressionResistancePriority="749" translatesAutoresizingMaskIntoConstraints="NO" id="AWy-Qo-wHH">
+                                        <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" verticalCompressionResistancePriority="749" translatesAutoresizingMaskIntoConstraints="NO" id="AWy-Qo-wHH">
                                             <rect key="frame" x="-2" y="292" width="464" height="16"/>
                                             <textFieldCell key="cell" lineBreakMode="clipping" alignment="center" title="Share options" id="fzf-0v-uHo">
                                                 <font key="font" metaFont="systemBold"/>
                                                 <action selector="shareTypePickerAction:" target="EXb-m8-yzj" id="LN7-TC-RvV"/>
                                             </connections>
                                         </popUpButton>
-                                        <textField focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="f8k-Ae-oQc">
+                                        <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="f8k-Ae-oQc">
                                             <rect key="frame" x="0.0" y="240" width="460" height="22"/>
                                             <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" placeholderString="Share recipient" bezelStyle="round" id="Ahi-gU-lmO">
                                                 <font key="font" metaFont="system"/>
                                                 <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                             </textFieldCell>
                                         </textField>
-                                        <textField focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="CXW-ZO-B2f">
+                                        <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="CXW-ZO-B2f">
                                             <rect key="frame" x="0.0" y="213" width="460" height="22"/>
                                             <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" placeholderString="Share label" bezelStyle="round" id="ZsJ-zc-mFT">
                                                 <font key="font" metaFont="system"/>
                                                 <action selector="passwordCheckboxAction:" target="EXb-m8-yzj" id="QMn-RM-jdf"/>
                                             </connections>
                                         </button>
-                                        <secureTextField focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="pkv-9L-nhv">
+                                        <secureTextField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="pkv-9L-nhv">
                                             <rect key="frame" x="0.0" y="123" width="460" height="22"/>
                                             <secureTextFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" placeholderString="Enter a new password" usesSingleLineMode="YES" bezelStyle="round" id="hcA-we-oYG">
                                                 <font key="font" metaFont="system"/>
                                             <rect key="frame" x="0.0" y="73" width="463" height="28"/>
                                             <datePickerCell key="cell" borderStyle="bezel" alignment="left" useCurrentDate="YES" id="EHU-Gu-Dfh">
                                                 <font key="font" metaFont="system"/>
-                                                <date key="date" timeIntervalSinceReferenceDate="731325563.59052801">
-                                                    <!--2024-03-05 09:59:23 +0000-->
+                                                <date key="date" timeIntervalSinceReferenceDate="734115148.45631897">
+                                                    <!--2024-04-06 16:52:28 +0000-->
                                                 </date>
                                                 <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
                                                 <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
                                                 <action selector="noteForRecipientCheckboxAction:" target="EXb-m8-yzj" id="j7a-Tc-uiu"/>
                                             </connections>
                                         </button>
-                                        <textField focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="io6-Kg-fLl">
+                                        <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="io6-Kg-fLl">
                                             <rect key="frame" x="0.0" y="25" width="460" height="22"/>
                                             <textFieldCell key="cell" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" placeholderString="Note for the recipient" bezelStyle="round" id="z5W-BH-NnM">
                                                 <font key="font" metaFont="system"/>
                         <real value="250"/>
                     </holdingPriorities>
                 </splitView>
+                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="K3D-6U-Cbr">
+                    <rect key="frame" x="8" y="474" width="484" height="31"/>
+                    <textFieldCell key="cell" lineBreakMode="clipping" alignment="center" title="No shares" id="byC-34-Vtu">
+                        <font key="font" textStyle="largeTitle" name=".SFNS-Regular"/>
+                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                    </textFieldCell>
+                </textField>
                 <visualEffectView blendingMode="withinWindow" material="HUDWindow" state="followsWindowActiveState" translatesAutoresizingMaskIntoConstraints="NO" id="1ud-mC-gQV">
                     <rect key="frame" x="10" y="339" width="480" height="300"/>
                     <subviews>
                 <constraint firstItem="1ud-mC-gQV" firstAttribute="height" secondItem="ZzY-1Z-3xa" secondAttribute="height" id="dfF-9z-iG9"/>
                 <constraint firstItem="91w-SP-6sl" firstAttribute="leading" secondItem="Jw6-da-U8j" secondAttribute="leading" constant="10" id="elm-Nc-tc0"/>
                 <constraint firstItem="1ud-mC-gQV" firstAttribute="leading" secondItem="ZzY-1Z-3xa" secondAttribute="leading" id="kSz-tV-EFM"/>
+                <constraint firstItem="K3D-6U-Cbr" firstAttribute="leading" secondItem="ZzY-1Z-3xa" secondAttribute="leading" id="lut-va-B3T"/>
+                <constraint firstItem="K3D-6U-Cbr" firstAttribute="trailing" secondItem="ZzY-1Z-3xa" secondAttribute="trailing" id="vRC-IM-ovt"/>
+                <constraint firstItem="K3D-6U-Cbr" firstAttribute="centerY" secondItem="ZzY-1Z-3xa" secondAttribute="centerY" id="wFD-ph-Bsp"/>
             </constraints>
             <point key="canvasLocation" x="-270" y="79"/>
         </view>