diff --git a/tests/uitests/addhardware.py b/tests/uitests/addhardware.py index eb42691f..9ea8222e 100644 --- a/tests/uitests/addhardware.py +++ b/tests/uitests/addhardware.py @@ -487,7 +487,7 @@ class AddHardware(uiutils.UITestCase): # Add sound self._open_addhw_window(details) tab = self._select_hw(addhw, "Sound", "sound-tab") - tab.find("Model:", "combo box").click() + tab.find("Model:", "combo box").click_combo_entry() tab.find("HDA", "menu item").click() finish.click() uiutils.check_in_loop(lambda: details.active) diff --git a/ui/addhardware.ui b/ui/addhardware.ui index 02b0ea01..71321b2d 100644 --- a/ui/addhardware.ui +++ b/ui/addhardware.ui @@ -710,16 +710,6 @@ False 6 6 - - - True - False - - - 1 - 0 - - True @@ -735,6 +725,22 @@ 0 + + + True + False + True + + + True + + + + + 1 + 0 + + sound-tab diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py index 6a91c259..d7188f0b 100644 --- a/virtManager/addhardware.py +++ b/virtManager/addhardware.py @@ -547,13 +547,8 @@ class vmmAddHardware(vmmGObjectUI): @staticmethod def build_sound_combo(vm, combo): - stable_defaults = vm.stable_defaults() - stable_soundmodels = ["ich6", "ich9", "ac97"] - values = [] - for m in DeviceSound.MODELS: - if (stable_defaults and m not in stable_soundmodels): - continue + for m in DeviceSound.get_recommended_models(vm.xmlobj): values.append([m, DeviceSound.pretty_model(m)]) default = DeviceSound.default_model(vm.xmlobj) diff --git a/virtinst/devices/sound.py b/virtinst/devices/sound.py index 8c27f441..768a7446 100644 --- a/virtinst/devices/sound.py +++ b/virtinst/devices/sound.py @@ -21,10 +21,9 @@ class _Codec(XMLBuilder): class DeviceSound(Device): XML_NAME = "sound" - MODELS = ["es1370", "sb16", "pcspk", "ac97", "ich6", "ich9"] - - model = XMLProperty("./@model") - codecs = XMLChildProperty(_Codec) + @staticmethod + def get_recommended_models(_guest): + return ["ich6", "ich9", "ac97"] @staticmethod def pretty_model(model): @@ -34,6 +33,10 @@ class DeviceSound(Device): return ret + model = XMLProperty("./@model") + codecs = XMLChildProperty(_Codec) + + ################## # Default config # ##################