From d6f9ab955be4680001f125ff445f3d15531eb8ad Mon Sep 17 00:00:00 2001 From: osy <50960678+osy@users.noreply.github.com> Date: Sun, 10 Aug 2025 16:38:45 -0700 Subject: [PATCH] settings: add button to reset saved USB devices --- Platform/macOS/SettingsView.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Platform/macOS/SettingsView.swift b/Platform/macOS/SettingsView.swift index 99c2a5c5..fdde75a2 100644 --- a/Platform/macOS/SettingsView.swift +++ b/Platform/macOS/SettingsView.swift @@ -162,6 +162,8 @@ struct ApplicationSettingsView: View { @AppStorage("NoQuitConfirmation") var isNoQuitConfirmation = false @AppStorage("NoUsbPrompt") var isNoUsbPrompt = false + @State private var isConfirmResetAutoConnect = false + var body: some View { Form { Toggle(isOn: $isKeepRunningAfterLastWindowClosed, label: { @@ -191,6 +193,14 @@ struct ApplicationSettingsView: View { Toggle(isOn: $isNoUsbPrompt, label: { Text("Do not show prompt when USB device is plugged in") }) + Button("Reset auto connect devices…") { + isConfirmResetAutoConnect.toggle() + }.help("Clears all saved USB devices.") + .alert(isPresented: $isConfirmResetAutoConnect) { + Alert(title: Text("Do you wish to reset all saved USB devices?"), primaryButton: .cancel(), secondaryButton: .destructive(Text("Reset")) { + UTMUSBManager.shared.usbDevices.removeAll() + }) + } } } }