diff --git a/Xcodes/Backend/AppState.swift b/Xcodes/Backend/AppState.swift index 48a8c1c..4410fe3 100644 --- a/Xcodes/Backend/AppState.swift +++ b/Xcodes/Backend/AppState.swift @@ -237,7 +237,7 @@ class AppState: ObservableObject { ) } - func launch(id: Xcode.ID) { + func open(id: Xcode.ID) { guard let installedXcode = Current.files.installedXcodes(Path.root/"Applications").first(where: { $0.version == id }) else { return } NSWorkspace.shared.openApplication(at: installedXcode.path.url, configuration: .init()) } diff --git a/Xcodes/Backend/XcodeCommands.swift b/Xcodes/Backend/XcodeCommands.swift index c8fd256..df00299 100644 --- a/Xcodes/Backend/XcodeCommands.swift +++ b/Xcodes/Backend/XcodeCommands.swift @@ -14,7 +14,7 @@ struct XcodeCommands: Commands { Divider() SelectCommand() - LaunchCommand() + OpenCommand() RevealCommand() CopyPathCommand() } @@ -66,19 +66,19 @@ struct SelectButton: View { } } -struct LaunchButton: View { +struct OpenButton: View { @EnvironmentObject var appState: AppState let xcode: Xcode? var body: some View { - Button(action: launch) { - Text("Launch") + Button(action: open) { + Text("Open") } } - private func launch() { + private func open() { guard let xcode = xcode else { return } - appState.launch(id: xcode.id) + appState.open(id: xcode.id) } } @@ -138,12 +138,12 @@ struct SelectCommand: View { } } -struct LaunchCommand: View { +struct OpenCommand: View { @EnvironmentObject var appState: AppState @FocusedValue(\.selectedXcode) private var selectedXcode: SelectedXcode? var body: some View { - LaunchButton(xcode: selectedXcode.unwrapped) + OpenButton(xcode: selectedXcode.unwrapped) .keyboardShortcut(KeyboardShortcut(.downArrow, modifiers: .command)) .disabled(selectedXcode.unwrapped?.installed != true) } diff --git a/Xcodes/Frontend/XcodeList/InspectorPane.swift b/Xcodes/Frontend/XcodeList/InspectorPane.swift index 5e51b07..144d734 100644 --- a/Xcodes/Frontend/XcodeList/InspectorPane.swift +++ b/Xcodes/Frontend/XcodeList/InspectorPane.swift @@ -36,7 +36,7 @@ struct InspectorPane: View { SelectButton(xcode: xcode) } - LaunchButton(xcode: xcode) + OpenButton(xcode: xcode) } } else { InstallButton(xcode: xcode) diff --git a/Xcodes/Frontend/XcodeList/XcodeListView.swift b/Xcodes/Frontend/XcodeList/XcodeListView.swift index 2492b73..74d1897 100644 --- a/Xcodes/Frontend/XcodeList/XcodeListView.swift +++ b/Xcodes/Frontend/XcodeList/XcodeListView.swift @@ -76,7 +76,7 @@ struct XcodeListView: View { if xcode.installed { SelectButton(xcode: xcode) - LaunchButton(xcode: xcode) + OpenButton(xcode: xcode) RevealButton(xcode: xcode) CopyPathButton(xcode: xcode) }