mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
details: Show pretty video model in device list
And show pretty model name everywhere
This commit is contained in:
@@ -3171,7 +3171,8 @@ class vmmDetails(vmmGObjectUI):
|
||||
self.widget("video-ram").set_text(ramlabel)
|
||||
self.widget("video-heads").set_text(heads and heads or "-")
|
||||
|
||||
self.set_combo_label("video-model", model)
|
||||
self.set_combo_label("video-model", model,
|
||||
label=vid.pretty_model(model))
|
||||
|
||||
def refresh_watchdog_page(self):
|
||||
watch = self.get_hw_selection(HW_LIST_COL_DEVICE)
|
||||
@@ -3465,7 +3466,9 @@ class vmmDetails(vmmGObjectUI):
|
||||
|
||||
# Populate video devices
|
||||
for vid in self.vm.get_video_devices():
|
||||
update_hwlist(HW_LIST_TYPE_VIDEO, vid, _("Video"), "video-display")
|
||||
update_hwlist(HW_LIST_TYPE_VIDEO, vid,
|
||||
_("Video %s") % vid.pretty_model(vid.model_type),
|
||||
"video-display")
|
||||
|
||||
# Populate watchdog devices
|
||||
for watch in self.vm.get_watchdog_devices():
|
||||
|
||||
@@ -133,11 +133,11 @@ def check_default_pool_active(topwin, conn):
|
||||
# Hardware model list building (for details, addhw) #
|
||||
#####################################################
|
||||
def build_video_combo(vm, video_dev, no_default=None):
|
||||
video_dev_model = gtk.ListStore(str)
|
||||
video_dev_model = gtk.ListStore(str, str)
|
||||
video_dev.set_model(video_dev_model)
|
||||
text = gtk.CellRendererText()
|
||||
video_dev.pack_start(text, True)
|
||||
video_dev.add_attribute(text, 'text', 0)
|
||||
video_dev.add_attribute(text, 'text', 1)
|
||||
video_dev_model.set_sort_column_id(0, gtk.SORT_ASCENDING)
|
||||
|
||||
populate_video_combo(vm, video_dev, no_default)
|
||||
@@ -159,7 +159,7 @@ def populate_video_combo(vm, video_dev, no_default=None):
|
||||
|
||||
if m == tmpdev.MODEL_DEFAULT and no_default:
|
||||
continue
|
||||
video_dev_model.append([m])
|
||||
video_dev_model.append([m, tmpdev.pretty_model(m)])
|
||||
|
||||
if len(video_dev_model) > 0:
|
||||
video_dev.set_active(0)
|
||||
|
||||
Reference in New Issue
Block a user