mirror of
https://github.com/XcodesOrg/XcodesApp.git
synced 2026-03-26 09:05:46 +00:00
Rename launch to open
This is the preferred verb when it's user-facing, according to Apple's style guide.
This commit is contained in:
parent
3f76fb9e36
commit
9dc3d21f2e
4 changed files with 11 additions and 11 deletions
|
|
@ -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())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ struct InspectorPane: View {
|
|||
SelectButton(xcode: xcode)
|
||||
}
|
||||
|
||||
LaunchButton(xcode: xcode)
|
||||
OpenButton(xcode: xcode)
|
||||
}
|
||||
} else {
|
||||
InstallButton(xcode: xcode)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue