mirror of
https://github.com/utmapp/UTM.git
synced 2026-10-12 02:24:01 +00:00
config(qemu): display usb option when usb is not available
This commit is contained in:
@@ -18,12 +18,14 @@ import SwiftUI
|
||||
|
||||
struct VMConfigInputView: View {
|
||||
@Binding var config: UTMQemuConfigurationInput
|
||||
|
||||
let hasUsbSupport: Bool
|
||||
|
||||
var body: some View {
|
||||
VStack {
|
||||
Form {
|
||||
DetailedSection("USB", description: "If enabled, the default input devices will be emulated on the USB bus.") {
|
||||
VMConfigConstantPicker("USB Support", selection: $config.usbBusSupport)
|
||||
.disabled(!hasUsbSupport)
|
||||
}
|
||||
|
||||
#if WITH_USB
|
||||
@@ -99,7 +101,7 @@ struct VMConfigInputView_Previews: PreviewProvider {
|
||||
@State static private var config = UTMQemuConfigurationInput()
|
||||
|
||||
static var previews: some View {
|
||||
VMConfigInputView(config: $config)
|
||||
VMConfigInputView(config: $config, hasUsbSupport: true)
|
||||
#if os(macOS)
|
||||
.scrollable()
|
||||
#endif
|
||||
|
||||
@@ -59,7 +59,7 @@ struct VMSettingsView: View {
|
||||
.labelStyle(.roundRectIcon)
|
||||
})
|
||||
NavigationLink(
|
||||
destination: VMConfigInputView(config: $config.input).navigationTitle("Input"),
|
||||
destination: VMConfigInputView(config: $config.input, hasUsbSupport: config.system.architecture.hasUsbSupport).navigationTitle("Input"),
|
||||
label: {
|
||||
Label("Input", systemImage: "keyboard")
|
||||
.labelStyle(.roundRectIcon)
|
||||
|
||||
@@ -59,7 +59,7 @@ struct VMQEMUSettingsView: View {
|
||||
}
|
||||
}
|
||||
NavigationLink {
|
||||
VMConfigInputView(config: $config.input)
|
||||
VMConfigInputView(config: $config.input, hasUsbSupport: config.system.architecture.hasUsbSupport)
|
||||
.scrollable()
|
||||
.settingsToolbar()
|
||||
} label: {
|
||||
|
||||
Reference in New Issue
Block a user