feat: allow quitting finder for power users (closes #1328)

This commit is contained in:
Louis Pontoise committed 2022-04-08 18:01:21 +09:00
1 parent 02590579df
commit 9e46bd8e2c
2 files changed
+4 -1

No files matched your search

+3
View File
@@ -64,6 +64,9 @@ class Preferences {
"hideThumbnails": "false",
]
// system preferences
static var finderShowsQuitMenuItem: Bool { UserDefaults(suiteName: "com.apple.Finder")?.bool(forKey: "QuitMenuItem") ?? false }
// constant values
// not exposed as preferences now but may be in the future, probably through macro preferences
static var windowMaterial: NSVisualEffectView.Material { .dark }
+1 -1
View File
@@ -128,7 +128,7 @@ class Window {
func quitApp() {
// prevent users from quitting Finder
if application.runningApplication.bundleIdentifier == "com.apple.finder" { return }
if application.runningApplication.bundleIdentifier == "com.apple.finder" && !Preferences.finderShowsQuitMenuItem { return }
BackgroundWork.accessibilityCommandsQueue.asyncWithCap { [weak self] in
self?.application.runningApplication.terminate()
}