Add warn image to locking view if there is an error

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-08-01 15:32:07 +08:00 committed by Matthieu Gallien
parent 4348869684
commit 19c9c199a6
2 changed files with 12 additions and 0 deletions

View file

@ -21,6 +21,7 @@ class LockViewController: NSViewController {
@IBOutlet weak var descriptionLabel: NSTextField!
@IBOutlet weak var closeButton: NSButton!
@IBOutlet weak var loadingIndicator: NSProgressIndicator!
@IBOutlet weak var warnImage: NSImageView!
public override var nibName: NSNib.Name? {
return NSNib.Name(self.className)
@ -66,6 +67,7 @@ class LockViewController: NSViewController {
private func stopIndicatingLoading() {
loadingIndicator.stopAnimation(self)
loadingIndicator.isHidden = true
warnImage.isHidden = false
}
private func presentError(_ error: String) {

View file

@ -15,6 +15,7 @@
<outlet property="fileNameLabel" destination="LDe-7m-hvL" id="AzB-UH-ndO"/>
<outlet property="loadingIndicator" destination="UWQ-uR-PJA" id="Swv-It-LT9"/>
<outlet property="view" destination="MSC-7J-Z1I" id="6cA-xC-NDA"/>
<outlet property="warnImage" destination="zlo-mM-ZNd" id="5gS-Ab-nDE"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
@ -29,6 +30,10 @@
<constraint firstAttribute="width" secondItem="UWQ-uR-PJA" secondAttribute="height" multiplier="1:1" id="Tcq-dQ-mHX"/>
</constraints>
</progressIndicator>
<imageView hidden="YES" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="zlo-mM-ZNd">
<rect key="frame" x="10" y="25" width="32" height="38"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyUpOrDown" image="exclamationmark.circle.fill" catalog="system" id="Yym-fE-Cdh"/>
</imageView>
<imageView horizontalHuggingPriority="1000" verticalHuggingPriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="KlP-OW-SKo">
<rect key="frame" x="52" y="16.5" width="48" height="55"/>
<constraints>
@ -90,19 +95,23 @@
</subviews>
<constraints>
<constraint firstItem="KlP-OW-SKo" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="MSC-7J-Z1I" secondAttribute="leading" constant="10" id="42d-pC-0Lq"/>
<constraint firstItem="zlo-mM-ZNd" firstAttribute="bottom" secondItem="UWQ-uR-PJA" secondAttribute="bottom" id="4kj-Yy-erm"/>
<constraint firstItem="UWQ-uR-PJA" firstAttribute="top" relation="greaterThanOrEqual" secondItem="MSC-7J-Z1I" secondAttribute="top" constant="10" id="86t-6h-ezO"/>
<constraint firstItem="dpJ-oy-su9" firstAttribute="leading" secondItem="KlP-OW-SKo" secondAttribute="trailing" constant="10" id="CkI-Rn-Ens"/>
<constraint firstItem="7qN-mr-hAh" firstAttribute="leading" secondItem="dpJ-oy-su9" secondAttribute="trailing" constant="10" id="D0y-zd-Mkx"/>
<constraint firstItem="UWQ-uR-PJA" firstAttribute="leading" secondItem="MSC-7J-Z1I" secondAttribute="leading" constant="10" id="DOR-jC-JYh"/>
<constraint firstItem="dpJ-oy-su9" firstAttribute="top" relation="greaterThanOrEqual" secondItem="MSC-7J-Z1I" secondAttribute="top" constant="10" id="EnF-gg-RXe"/>
<constraint firstItem="UWQ-uR-PJA" firstAttribute="centerY" secondItem="MSC-7J-Z1I" secondAttribute="centerY" id="GAc-W2-Bue"/>
<constraint firstItem="zlo-mM-ZNd" firstAttribute="trailing" secondItem="UWQ-uR-PJA" secondAttribute="trailing" id="Hn0-5r-n4p"/>
<constraint firstItem="KlP-OW-SKo" firstAttribute="top" relation="greaterThanOrEqual" secondItem="MSC-7J-Z1I" secondAttribute="top" constant="10" id="JEs-Z1-i2x"/>
<constraint firstItem="KlP-OW-SKo" firstAttribute="leading" secondItem="UWQ-uR-PJA" secondAttribute="trailing" constant="10" id="YHI-Z6-DqR"/>
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="KlP-OW-SKo" secondAttribute="bottom" constant="10" id="g7d-i6-GFB"/>
<constraint firstAttribute="trailing" secondItem="7qN-mr-hAh" secondAttribute="trailing" constant="10" id="jyt-D2-tiy"/>
<constraint firstItem="zlo-mM-ZNd" firstAttribute="leading" secondItem="UWQ-uR-PJA" secondAttribute="leading" id="ljA-uc-fNi"/>
<constraint firstItem="7qN-mr-hAh" firstAttribute="centerY" secondItem="MSC-7J-Z1I" secondAttribute="centerY" id="tuo-AL-2Xr"/>
<constraint firstItem="KlP-OW-SKo" firstAttribute="centerY" secondItem="MSC-7J-Z1I" secondAttribute="centerY" id="upa-4o-uiG"/>
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="dpJ-oy-su9" secondAttribute="bottom" constant="10" id="xOO-EK-GWO"/>
<constraint firstItem="zlo-mM-ZNd" firstAttribute="top" secondItem="UWQ-uR-PJA" secondAttribute="top" id="xeA-Ec-B32"/>
<constraint firstItem="dpJ-oy-su9" firstAttribute="centerY" secondItem="MSC-7J-Z1I" secondAttribute="centerY" id="yKD-Bd-jC9"/>
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="UWQ-uR-PJA" secondAttribute="bottom" constant="10" id="zgg-6J-3Zy"/>
</constraints>
@ -111,6 +120,7 @@
</objects>
<resources>
<image name="doc" catalog="system" width="14" height="16"/>
<image name="exclamationmark.circle.fill" catalog="system" width="15" height="15"/>
<image name="xmark.circle.fill" catalog="system" width="20" height="20"/>
</resources>
</document>