Skip to content

Commit 943a72c

Browse files
committed
settings: add button to reset saved USB devices
1 parent 6a020a6 commit 943a72c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Platform/macOS/SettingsView.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ struct ApplicationSettingsView: View {
162162
@AppStorage("NoQuitConfirmation") var isNoQuitConfirmation = false
163163
@AppStorage("NoUsbPrompt") var isNoUsbPrompt = false
164164

165+
@State private var isConfirmResetAutoConnect = false
166+
165167
var body: some View {
166168
Form {
167169
Toggle(isOn: $isKeepRunningAfterLastWindowClosed, label: {
@@ -191,6 +193,14 @@ struct ApplicationSettingsView: View {
191193
Toggle(isOn: $isNoUsbPrompt, label: {
192194
Text("Do not show prompt when USB device is plugged in")
193195
})
196+
Button("Reset auto connect devices…") {
197+
isConfirmResetAutoConnect.toggle()
198+
}.help("Clears all saved USB devices.")
199+
.alert(isPresented: $isConfirmResetAutoConnect) {
200+
Alert(title: Text("Do you wish to reset all saved USB devices?"), primaryButton: .cancel(), secondaryButton: .destructive(Text("Reset")) {
201+
UTMUSBManager.shared.usbDevices.removeAll()
202+
})
203+
}
194204
}
195205
}
196206
}

0 commit comments

Comments
 (0)