Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
17ee5d6717 | ||
|
|
2295bcdbae | ||
|
|
c9bff50a1a | ||
|
|
1b3d3dd821 | ||
|
|
55dee0f0cd | ||
|
|
45fd2b988f |
@@ -110,7 +110,8 @@ final class PrintSessionViewModel: ObservableObject {
|
|||||||
isPrinting = true
|
isPrinting = true
|
||||||
let task = Task { @MainActor [weak self] in
|
let task = Task { @MainActor [weak self] in
|
||||||
guard let self else { return }
|
guard let self else { return }
|
||||||
defer { self.printTask = nil }
|
// `defer` cannot mutate isolated state under Swift 5.7
|
||||||
|
// (Xcode 14.2 / macOS 12 runner), so clear explicitly (#113).
|
||||||
var printed = 0
|
var printed = 0
|
||||||
for page in result.pages {
|
for page in result.pages {
|
||||||
do {
|
do {
|
||||||
@@ -123,6 +124,7 @@ final class PrintSessionViewModel: ObservableObject {
|
|||||||
+ error.localizedDescription
|
+ error.localizedDescription
|
||||||
)
|
)
|
||||||
isPrinting = false
|
isPrinting = false
|
||||||
|
self.printTask = nil
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -132,6 +134,7 @@ final class PrintSessionViewModel: ObservableObject {
|
|||||||
autoHideAfter: nil
|
autoHideAfter: nil
|
||||||
)
|
)
|
||||||
isPrinting = false
|
isPrinting = false
|
||||||
|
self.printTask = nil
|
||||||
}
|
}
|
||||||
printTask = task
|
printTask = task
|
||||||
}
|
}
|
||||||
@@ -141,7 +144,6 @@ final class PrintSessionViewModel: ObservableObject {
|
|||||||
isPrinting = true
|
isPrinting = true
|
||||||
let task = Task { @MainActor [weak self] in
|
let task = Task { @MainActor [weak self] in
|
||||||
guard let self else { return }
|
guard let self else { return }
|
||||||
defer { self.printTask = nil }
|
|
||||||
do {
|
do {
|
||||||
try await spool(page, index: page.index, pageSize: pageSize)
|
try await spool(page, index: page.index, pageSize: pageSize)
|
||||||
printNotice = Notice(
|
printNotice = Notice(
|
||||||
@@ -156,6 +158,7 @@ final class PrintSessionViewModel: ObservableObject {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
isPrinting = false
|
isPrinting = false
|
||||||
|
self.printTask = nil
|
||||||
}
|
}
|
||||||
printTask = task
|
printTask = task
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,16 +138,20 @@ struct Stage4View: View {
|
|||||||
.textFieldStyle(.roundedBorder)
|
.textFieldStyle(.roundedBorder)
|
||||||
.accessibilityIdentifier("colprofCopyright")
|
.accessibilityIdentifier("colprofCopyright")
|
||||||
|
|
||||||
Toggle("Apply calibration curve", isOn: $model.applyCalibration)
|
// Nested VStack keeps the parent at the Swift 5.7 ViewBuilder
|
||||||
.accessibilityIdentifier("colprofApplyCalibration")
|
// 10-child limit (Xcode 14.2 / macOS 12 CI runner, #111).
|
||||||
|
VStack(alignment: .leading, spacing: 12) {
|
||||||
|
Toggle("Apply calibration curve", isOn: $model.applyCalibration)
|
||||||
|
.accessibilityIdentifier("colprofApplyCalibration")
|
||||||
|
|
||||||
if model.applyCalibration {
|
if model.applyCalibration {
|
||||||
HStack {
|
HStack {
|
||||||
TextField("Calibration .cal file", text: $model.calibrationFile)
|
TextField("Calibration .cal file", text: $model.calibrationFile)
|
||||||
.textFieldStyle(.roundedBorder)
|
.textFieldStyle(.roundedBorder)
|
||||||
.accessibilityIdentifier("colprofCalibrationFile")
|
.accessibilityIdentifier("colprofCalibrationFile")
|
||||||
Button("Browse…") { model.browseForCalibrationFile() }
|
Button("Browse…") { model.browseForCalibrationFile() }
|
||||||
.accessibilityIdentifier("btnBrowseCalibrationFile")
|
.accessibilityIdentifier("btnBrowseCalibrationFile")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,9 @@ final class ProcessRunSupportTests: XCTestCase {
|
|||||||
setRunning: { running.append($0) },
|
setRunning: { running.append($0) },
|
||||||
resetLog: { resets += 1 },
|
resetLog: { resets += 1 },
|
||||||
onLog: { batch in
|
onLog: { batch in
|
||||||
MainActor.assertIsolated()
|
// MainActor.assertIsolated() needs Swift 5.9; the runner is
|
||||||
|
// on Xcode 14.2 (Swift 5.7) (#115).
|
||||||
|
XCTAssertTrue(Thread.isMainThread)
|
||||||
received.append(contentsOf: batch)
|
received.append(contentsOf: batch)
|
||||||
}
|
}
|
||||||
) { onLog in
|
) { onLog in
|
||||||
|
|||||||
Reference in New Issue
Block a user