Added additional check for cloning a VM
An attempt to clone a VM to a name that is already in use will fail more gracefully and with an explicit warning message.
This commit is contained in:
parent
733f00ddf2
commit
ddb70fe8ea
@ -504,7 +504,7 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QtGui.QMainWindow):
|
|||||||
# Check Updates Timer
|
# Check Updates Timer
|
||||||
timer = QtCore.QTimer(self)
|
timer = QtCore.QTimer(self)
|
||||||
timer.timeout.connect(self.check_updates)
|
timer.timeout.connect(self.check_updates)
|
||||||
timer.start(1000 * 30) # 30s
|
timer.start(1000 * 30) # 30s
|
||||||
self.check_updates()
|
self.check_updates()
|
||||||
|
|
||||||
def keyPressEvent(self, event): # pylint: disable=invalid-name
|
def keyPressEvent(self, event): # pylint: disable=invalid-name
|
||||||
@ -852,6 +852,15 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QtGui.QMainWindow):
|
|||||||
if not ok or clone_name == "":
|
if not ok or clone_name == "":
|
||||||
return
|
return
|
||||||
|
|
||||||
|
name_in_use = clone_name in self.qubes_app.domains
|
||||||
|
|
||||||
|
if name_in_use:
|
||||||
|
QtGui.QMessageBox.warning(
|
||||||
|
None, self.tr("Name already in use!"),
|
||||||
|
self.tr("There already exists a qube called '{}'. "
|
||||||
|
"Cloning aborted.").format(clone_name))
|
||||||
|
return
|
||||||
|
|
||||||
self.progress = QtGui.QProgressDialog(
|
self.progress = QtGui.QProgressDialog(
|
||||||
self.tr(
|
self.tr(
|
||||||
"Cloning Qube..."), "", 0, 0)
|
"Cloning Qube..."), "", 0, 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user