i18n: simplify vmmAddHardware.controller_pretty_desc

Shortcut the specific cases, avoiding string puzzles; keep using
vmmAddHardware.controller_pretty_type() otherwise.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
This commit is contained in:
Pino Toscano 2020-07-13 10:25:42 +02:00 committed by Cole Robinson
parent 838c8524d2
commit 42463cde9c
1 changed files with 6 additions and 6 deletions

View File

@ -481,13 +481,13 @@ class vmmAddHardware(vmmGObjectUI):
@staticmethod
def controller_pretty_desc(dev):
ret = vmmAddHardware.controller_pretty_type(dev.type)
if dev.type == "scsi":
if dev.type == DeviceController.TYPE_SCSI:
if dev.model == "virtio-scsi":
ret = "Virtio " + ret
if dev.type == "pci" and dev.model == "pcie-root":
ret = _("PCIe")
return ret
return _("VirtIO SCSI")
if dev.type == DeviceController.TYPE_PCI:
if dev.model == "pcie-root":
return _("PCIe")
return vmmAddHardware.controller_pretty_type(dev.type)
@staticmethod
def disk_old_recommended_buses(guest):