Better dialog creation

This commit is contained in:
donoban 2020-12-12 00:19:30 +01:00
parent 81d95f3de9
commit 4343691b92
No known key found for this signature in database
GPG Key ID: 141310D8E3ED08A5

View File

@ -825,15 +825,12 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QMainWindow):
try: try:
info.vm.template = template info.vm.template = template
except exc.QubesValueError as ex: except exc.QubesValueError as ex:
errors.append((info.name, ex)) errors.append((info.name, str(ex)))
for error in errors: for error in errors:
info_dialog = QMessageBox(self) QMessageBox.warning(self, "{0} template change failed!"
info_dialog.setWindowTitle(self.tr("Error!")) .format(error[0]), error[1])
info_dialog.setText(
self.tr("Template change failed for '{0}':<br>{1}"
).format(error[0], error[1]))
info_dialog.show()
def change_network(self, netvm_name): def change_network(self, netvm_name):
selected_vms = self.get_selected_vms() selected_vms = self.get_selected_vms()
@ -874,15 +871,11 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QMainWindow):
try: try:
info.vm.netvm = netvm_name info.vm.netvm = netvm_name
except exc.QubesValueError as ex: except exc.QubesValueError as ex:
errors.append((info.name, ex)) errors.append((info.name, str(ex)))
for error in errors: for error in errors:
info_dialog = QMessageBox(self) QMessageBox.warning(self, "{0} network change failed!"
info_dialog.setWindowTitle(self.tr("Error!")) .format(error[0]), error[1])
info_dialog.setText(
self.tr("Network change failed for '{0'}:<br>{1]"
).format(error[0], error[1]))
info_dialog.show()
def __init_context_menu(self): def __init_context_menu(self):