Added missing updates() method for some widget
internal, ip, include_in_backups and last_backup
This commit is contained in:
parent
a77cc5172d
commit
c43a47019e
@ -141,6 +141,10 @@ class VmRowInTable(object):
|
||||
self.info_widget.update_vm_state(self.vm)
|
||||
self.template_widget.update()
|
||||
self.netvm_widget.update()
|
||||
self.internal_widget.update()
|
||||
self.ip_widget.update()
|
||||
self.include_in_backups_widget.update()
|
||||
self.last_backup_widget.update()
|
||||
if update_size_on_disk:
|
||||
self.size_widget.update()
|
||||
|
||||
|
@ -317,10 +317,13 @@ class VmInternalItem(QtGui.QTableWidgetItem):
|
||||
self.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled)
|
||||
|
||||
self.vm = vm
|
||||
self.internal = vm.features.get('internal', False)
|
||||
self.update()
|
||||
|
||||
def update(self):
|
||||
self.internal = self.vm.features.get('internal', False)
|
||||
self.setText("Yes" if self.internal else "")
|
||||
|
||||
|
||||
def __lt__(self, other):
|
||||
if self.vm.qid == 0:
|
||||
return True
|
||||
@ -464,6 +467,9 @@ class VmIPItem(QtGui.QTableWidgetItem):
|
||||
self.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled)
|
||||
|
||||
self.vm = vm
|
||||
self.update()
|
||||
|
||||
def update(self):
|
||||
self.ip = getattr(self.vm, 'ip', None)
|
||||
self.setText(self.ip if self.ip is not None else 'n/a')
|
||||
|
||||
@ -481,6 +487,9 @@ class VmIncludeInBackupsItem(QtGui.QTableWidgetItem):
|
||||
self.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled)
|
||||
|
||||
self.vm = vm
|
||||
self.update()
|
||||
|
||||
def update(self):
|
||||
if getattr(self.vm, 'include_in_backups', None):
|
||||
self.setText("Yes")
|
||||
else:
|
||||
@ -502,6 +511,9 @@ class VmLastBackupItem(QtGui.QTableWidgetItem):
|
||||
self.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled)
|
||||
|
||||
self.vm = vm
|
||||
self.update()
|
||||
|
||||
def update(self):
|
||||
self.backup_timestamp = getattr(self.vm, 'backup_timestamp', None)
|
||||
|
||||
if self.backup_timestamp:
|
||||
|
Loading…
Reference in New Issue
Block a user