Files
shotdeck/Sources/ShotdeckCore/Model/ShotdeckError.swift
Claude Fable 5 3fb9b504f4 feat(capture): choose what to capture — area, window, browser page or screen
Capture is now a decision, not a hidden setting. The popover shows a four-way scope control with the target named under it (800 x 600 on Display 1, the frontmost window, the front browser window, the whole display), and the window header carries the same choice beside the verbs. Picking Window or Browser hides Redline, dims the screen, names the app under the pointer and highlights its window; a click captures exactly that window, Escape cancels, and the desktop highlights the whole screen. New Session is one click: the current captures stay in their own folder, a fresh session opens, and the area picker comes straight up with the saved area pre-selected — Return keeps it, a drag replaces it. Settings is consolidated into one door (the popover gear, plus Cmd-,): what to capture, saved area, shortcut, ask-on-new-session, sending, session age limit, and a new Updates group with automatic install (on by default; installs only when nothing is unsent). The footer filler and the extra-actions menu are gone.
2026-11-01 11:47:58 +04:00

46 lines
2.0 KiB
Swift

import Foundation
public enum ShotdeckError: Error, LocalizedError, Sendable {
case screenRecordingNotGranted
case noRegionRemembered
case displayNoLongerConnected(displayID: UInt32)
case captureFailed(underlying: String)
case spoolWriteFailed(path: String, underlying: String)
case manifestCorrupt(path: String)
case pdfCompositionFailed(reason: String)
case airDropUnavailable
case noCommentedReturns
case oneDriveFolderUnavailable(path: String)
case noFrontWindow
case noBrowserWindow
public var errorDescription: String? {
switch self {
case .screenRecordingNotGranted:
return "Screen Recording is turned off. Grant it in System Settings to capture."
case .noRegionRemembered:
return "No capture region is set. Choose 'Re-select area' from the Redline menu."
case .displayNoLongerConnected:
return "The display used for capture is no longer connected."
case .captureFailed(let underlying):
return "The screenshot could not be taken. \(underlying)"
case .spoolWriteFailed(_, let underlying):
return "The screenshot could not be saved. \(underlying)"
case .manifestCorrupt:
return "This session's file is damaged and cannot be opened."
case .pdfCompositionFailed(let reason):
return "The PDF could not be built. \(reason)"
case .airDropUnavailable:
return "AirDrop is not available right now."
case .noCommentedReturns:
return "None of the returned PDFs have comments on them."
case .oneDriveFolderUnavailable(let path):
return "Your OneDrive folder is not available: \(path). Check that OneDrive is signed in, or choose another folder in Settings."
case .noFrontWindow:
return "There is no front window to capture. Click the window you want first, or choose Area."
case .noBrowserWindow:
return "No browser window is open. Open the page you want, or choose Window or Area."
}
}
}