Fix errors when some domain fails to start

This commit is contained in:
donoban 2018-11-25 19:15:56 +01:00
parent 6fdf16278e
commit 4deaedd1e0
No known key found for this signature in database
GPG Key ID: 141310D8E3ED08A5

View File

@ -514,12 +514,17 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QtGui.QMainWindow):
pass
def on_domain_added(self, _submitter, _event, vm, **_kwargs):
domain = self.qubes_app.domains[vm]
row_no = 0
self.table.setSortingEnabled(False)
row_no = self.table.rowCount()
self.table.setRowCount(row_no + 1)
vm_row = VmRowInTable(domain, row_no, self.table)
self.vms_in_table[domain.qid] = vm_row
try:
domain = self.qubes_app.domains[vm]
row_no = self.table.rowCount()
self.table.setRowCount(row_no + 1)
vm_row = VmRowInTable(domain, row_no, self.table)
self.vms_in_table[domain.qid] = vm_row
except (exc.QubesException, KeyError):
if row_no != 0:
self.table.removeRow(row_no)
self.table.setSortingEnabled(True)
self.showhide_vms()