Fixed lack of new vm.icon property handling in Qube Manager

This commit is contained in:
Marta Marczykowska-Górecka 2020-08-06 20:55:28 +02:00
parent 2637d9bb09
commit 3f6f8c5396
No known key found for this signature in database
GPG Key ID: 9A752C30B26FD04B

View File

@ -202,6 +202,8 @@ class VmInfo():
self.label = getattr(self.vm, 'label', None)
self.klass = getattr(self.vm, 'klass', None)
self.icon = getattr(vm, 'icon', 'appvm-black')
self.state = {'power': "", 'outdated': ""}
self.updateable = getattr(vm, 'updateable', False)
self.update(True)
@ -430,13 +432,11 @@ class QubesTableModel(QAbstractTableModel):
if col_name == "Label":
try:
return self.label_pixmap[vm.label]
except KeyError:
icon = QIcon.fromTheme(vm.label.icon)
self.label_pixmap[vm.label] = icon.pixmap(icon_size)
return self.label_pixmap[vm.label]
except exc.QubesDaemonAccessError:
return None
return self.label_pixmap[vm.icon]
except (KeyError, AttributeError):
icon = QIcon.fromTheme(vm.icon)
self.label_pixmap[vm.icon] = icon.pixmap(icon_size)
return self.label_pixmap[vm.icon]
if role == Qt.FontRole:
if col_name == "Template":