Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/spec/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ Defines:

## Status Menu

- The status menu must expose New Capture, Settings, and Quit.
- The status menu must expose New Capture, Open Screenshots Folder, Check for Updates, Settings,
and Quit.
- Open Screenshots Folder must open the configured output directory, creating it first when needed.
- Check for Updates must invoke the same Sparkle-backed update check flow as the About section.
- The status menu must not expose Cancel Capture. Capture cancellation is handled in-session by
`Esc` and secondary click in both live and Frozen modes.
- The status menu must not expose Permissions as a separate menu item. Permission status and
Expand Down
30 changes: 30 additions & 0 deletions native/macos-host/Sources/RsnapNativeHostKit/NativeHostApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,27 @@ public final class NativeHostApplicationController: NSObject, NSApplicationDeleg
settingsWindowController.present()
}

@objc
private func openScreenshotsFolder(_ sender: Any?) {
let outputDirectory = settingsStore.settings.outputDirectory
do {
try FileManager.default.createDirectory(
at: outputDirectory,
withIntermediateDirectories: true)
NSWorkspace.shared.open(outputDirectory)
NativeHostTelemetry.lifecycleEvent("native_host.output_directory_opened")
} catch {
NativeHostTelemetry.lifecycleWarning(
"native_host.output_directory_open_failed",
detail: "reason=create_or_open_failed")
}
}

@objc
private func checkForUpdates(_ sender: Any?) {
softwareUpdater.checkForUpdates(sender)
}

private func scheduleLaunchPermissionOnboardingIfNeeded() {
DispatchQueue.main.async { [weak self] in
_ = self?.presentPermissionRecoveryIfNeeded(
Expand Down Expand Up @@ -523,6 +544,15 @@ public final class NativeHostApplicationController: NSObject, NSApplicationDeleg
keyEquivalent: ""
)
menu.addItem(.separator())
menu.addItem(
withTitle: "Open Screenshots Folder",
action: #selector(openScreenshotsFolder(_:)),
keyEquivalent: "")
menu.addItem(
withTitle: "Check for Updates…",
action: #selector(checkForUpdates(_:)),
keyEquivalent: "")
menu.addItem(.separator())
menu.addItem(
withTitle: "Settings…", action: #selector(openSettings(_:)), keyEquivalent: ",")
menu.addItem(.separator())
Expand Down
Loading