Added change network confirmation

This commit is contained in:
donoban 2020-11-18 12:27:59 +01:00
parent 3e5893e6cf
commit 54d523de6c
No known key found for this signature in database
GPG Key ID: 141310D8E3ED08A5

View File

@ -814,6 +814,17 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QMainWindow):
info.vm.template = template
def change_network(self, netvm_name):
selected_vms = self.get_selected_vms()
reply = QMessageBox.question(
self, self.tr("Network Change Confirmation"),
self.tr("Do you want to change '{0}'<br>"
"to Network <b>'{1}'</b>?").format(
', '.join(vm.name for vm in selected_vms), netvm_name),
QMessageBox.Yes | QMessageBox.Cancel)
if reply != QMessageBox.Yes:
return
try:
check_power = any(info.state['power'] == 'Running' for info
in self.get_selected_vms())