mirror of
https://github.com/utmapp/UTM.git
synced 2026-10-12 02:24:01 +00:00
settings: add button to reset saved USB devices
This commit is contained in:
@@ -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()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user