From 1d308b4b6106126e444c86a1069ad33848097fca Mon Sep 17 00:00:00 2001 From: Ivan Grachev Date: Sat, 19 Jun 2021 19:34:55 +0300 Subject: [PATCH] Display reason on password screen --- .../Screens/Base.lproj/Main.storyboard | 24 ++++++++++++++----- .../Screens/PasswordViewController.swift | 7 +++++- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/Encrypted Ink/Screens/Base.lproj/Main.storyboard b/Encrypted Ink/Screens/Base.lproj/Main.storyboard index 2e4c4b11..1d755bc2 100644 --- a/Encrypted Ink/Screens/Base.lproj/Main.storyboard +++ b/Encrypted Ink/Screens/Base.lproj/Main.storyboard @@ -1,8 +1,8 @@ - + - + @@ -842,7 +842,7 @@ DQ - + @@ -855,11 +855,11 @@ DQ - + - + @@ -872,7 +872,7 @@ DQ - + @@ -1254,14 +1254,25 @@ DQ + + + + + + + + + + + @@ -1269,6 +1280,7 @@ DQ + diff --git a/Encrypted Ink/Screens/PasswordViewController.swift b/Encrypted Ink/Screens/PasswordViewController.swift index 3cf45eb5..e2aa789d 100644 --- a/Encrypted Ink/Screens/PasswordViewController.swift +++ b/Encrypted Ink/Screens/PasswordViewController.swift @@ -21,6 +21,7 @@ class PasswordViewController: NSViewController { private var passwordToRepeat: String? private var completion: ((Bool) -> Void)? + @IBOutlet weak var reasonLabel: NSTextField! @IBOutlet weak var cancelButton: NSButton! @IBOutlet weak var okButton: NSButton! @IBOutlet weak var titleLabel: NSTextField! @@ -31,9 +32,13 @@ class PasswordViewController: NSViewController { } override func viewDidLoad() { - // TODO: display reason if there is some super.viewDidLoad() switchToMode(mode) + if let reason = reason { + reasonLabel.stringValue = "to " + reason.lowercased() + } else { + reasonLabel.stringValue = "" + } } func switchToMode(_ mode: Mode) {