From 0bc18b79b87b31c658b7eeabd41cd382a5d3ebfa Mon Sep 17 00:00:00 2001 From: maxsoch Date: Mon, 6 Jul 2026 22:09:26 +0200 Subject: [PATCH] make the Upgrade All confirmation dialog optional, on by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New "Ask for confirmation before Upgrade All" checkbox; when disabled, Upgrade All runs immediately. Auto-upgrade is unaffected either way — it never prompts. Co-Authored-By: Claude Fable 5 --- BrewBar/BrewBarApp.swift | 4 +++- BrewBar/SettingsWindowController.swift | 13 +++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/BrewBar/BrewBarApp.swift b/BrewBar/BrewBarApp.swift index e228628..df5552f 100644 --- a/BrewBar/BrewBarApp.swift +++ b/BrewBar/BrewBarApp.swift @@ -210,7 +210,9 @@ class AppDelegate: NSObject, NSApplicationDelegate { } @objc func upgradeAll() { - guard confirmUpgrade() else { return } + if Settings.confirmBeforeUpgradeAll { + guard confirmUpgrade() else { return } + } statusMenuItem.title = "Upgrading..." diff --git a/BrewBar/SettingsWindowController.swift b/BrewBar/SettingsWindowController.swift index a959879..eb216d8 100644 --- a/BrewBar/SettingsWindowController.swift +++ b/BrewBar/SettingsWindowController.swift @@ -21,6 +21,7 @@ class SettingsWindowController: NSWindowController { var autoUpgradeCasksCheckbox: NSButton! var notifyCheckbox: NSButton! var showCountCheckbox: NSButton! + var confirmCheckbox: NSButton! convenience init(appDelegate: AppDelegate) { let window = NSWindow( @@ -123,6 +124,12 @@ class SettingsWindowController: NSWindowController { action: #selector(toggleShowCount(_:)) ) + confirmCheckbox = NSButton( + checkboxWithTitle: "Ask for confirmation before Upgrade All", + target: self, + action: #selector(toggleConfirm(_:)) + ) + let stack = NSStackView(views: [ frequencyRow, customRow, @@ -134,6 +141,7 @@ class SettingsWindowController: NSWindowController { separator(), notifyCheckbox, showCountCheckbox, + confirmCheckbox, launchAtLoginCheckbox, ]) stack.orientation = .vertical @@ -174,6 +182,7 @@ class SettingsWindowController: NSWindowController { autoUpgradeCasksCheckbox.state = Settings.autoUpgradeCasks ? .on : .off notifyCheckbox.state = Settings.notifyOnNewUpdates ? .on : .off showCountCheckbox.state = Settings.showCountInMenuBar ? .on : .off + confirmCheckbox.state = Settings.confirmBeforeUpgradeAll ? .on : .off } func separator() -> NSBox { @@ -239,6 +248,10 @@ class SettingsWindowController: NSWindowController { appDelegate?.updateMenuBarCount() // reflect immediately, no refetch needed } + @objc func toggleConfirm(_ sender: NSButton) { + Settings.confirmBeforeUpgradeAll = sender.state == .on + } + @objc func toggleLaunchAtLogin(_ sender: NSButton) { do { if sender.state == .on {