Publish VCC Plus OSS source distribution for 3.6.2 build 60
This commit is contained in:
commit
c652a5276d
1192 files changed
+272368
No files matched your search
@@ -0,0 +1,37 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
import SwiftUI
|
||||
|
||||
extension MachineModel {
|
||||
var basicReferenceDialect: BASICReferenceDialect? {
|
||||
switch usageProfile {
|
||||
case .diskBasic: return .disk
|
||||
case .hardDriveBasic: return .rgbdos
|
||||
case .cocoSDC: return .sdcdos
|
||||
default: return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct BASICReferenceHost: View {
|
||||
let result: Result<BASICReferenceModel, Error>
|
||||
@ObservedObject var machine: MachineModel
|
||||
let showManualTopic: (BASICReferenceEntry) -> Void
|
||||
@Environment(\.openWindow) private var openWindow
|
||||
var body: some View {
|
||||
switch result {
|
||||
case .success(let reference):
|
||||
BASICReferenceView(model: reference, activeDialect: machine.basicReferenceDialect) { entry in
|
||||
showManualTopic(entry)
|
||||
openWindow(id: "manual-library")
|
||||
} openExample: { example in
|
||||
openWindow(id: "basic-example", value: example.id)
|
||||
}
|
||||
case .failure(let error):
|
||||
ContentUnavailableView {
|
||||
Label("BASIC Reference Unavailable", systemImage: "book.closed")
|
||||
} description: {
|
||||
Text("The bundled reference could not be read. \(error.localizedDescription)")
|
||||
}.frame(minWidth: 580, minHeight: 400)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user