From c5abca4099b8e136541031b906248900995f67d7 Mon Sep 17 00:00:00 2001 From: Max Goedjen Date: Fri, 20 Mar 2020 21:14:51 -0700 Subject: [PATCH] Indent. --- Secretive/Views/SetupView.swift | 42 ++++++++++++++++----------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/Secretive/Views/SetupView.swift b/Secretive/Views/SetupView.swift index 7e2600e..7a49e7d 100644 --- a/Secretive/Views/SetupView.swift +++ b/Secretive/Views/SetupView.swift @@ -3,15 +3,15 @@ import SwiftUI import ServiceManagement struct SetupView: View { - + var completion: ((Bool) -> Void)? - + var body: some View { Form { SetupStepView(text: "Secretive needs to install a helper app to sign requests when the main app isn't running. This app is called \"SecretAgent\" and you might see it in Activity Manager from time to time.", - index: 1, - nestedView: nil, - actionText: "Install") { + index: 1, + nestedView: nil, + actionText: "Install") { self.installLaunchAgent() } SetupStepView(text: "You need to add a line to your shell config (.bashrc or .zshrc) telling SSH to talk to SecretAgent when it wants to authenticate. Drag this into your config file.", @@ -22,25 +22,25 @@ struct SetupView: View { } HStack { Spacer() - Button(action: { self.completion?(true) }) { - Text("Finish") - } + Button(action: { self.completion?(true) }) { + Text("Finish") + } .padding() } } } - + } struct SetupStepView: View { - + let text: String let index: Int let nestedView: NestedViewType? @State var completed = false let actionText: String let action: (() -> Bool) - + var body: some View { Section { HStack { @@ -83,9 +83,9 @@ struct SetupStepView: View { } struct SetupStepCommandView: View { - + let text: String - + var body: some View { VStack(alignment: .leading) { Text(text) @@ -104,36 +104,36 @@ struct SetupStepCommandView: View { .cornerRadius(10) .onDrag { return NSItemProvider(item: NSData(data: self.text.data(using: .utf8)!), typeIdentifier: kUTTypeUTF8PlainText as String) - + } } - + func copy() { NSPasteboard.general.declareTypes([.string], owner: nil) NSPasteboard.general.setString(text, forType: .string) } - + } extension SetupView { - + func installLaunchAgent() -> Bool { SMLoginItemSetEnabled("com.maxgoedjen.Secretive.SecretAgent" as CFString, true) } - + func markAsDone() -> Bool { return true } - + } extension SetupView { - + enum Constants { static let socketPath = (NSHomeDirectory().replacingOccurrences(of: "com.maxgoedjen.Secretive.Host", with: "com.maxgoedjen.Secretive.SecretAgent") as NSString).appendingPathComponent("socket.ssh") as String static let socketPrompt = "export SSH_AUTH_SOCK=\(socketPath)" } - + } #if DEBUG