Don't close the settings window if something failed when renaming
e.g. the VM name already exists
This commit is contained in:
parent
4d103562bd
commit
cb5bc16948
@ -478,6 +478,8 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtGui.QDialog):
|
|||||||
self.tr("Error!"),
|
self.tr("Error!"),
|
||||||
self.tr("ERROR: {}").format(
|
self.tr("ERROR: {}").format(
|
||||||
t_monitor.error_msg))
|
t_monitor.error_msg))
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
def _rename_vm(self, t_monitor, name):
|
def _rename_vm(self, t_monitor, name):
|
||||||
try:
|
try:
|
||||||
@ -492,14 +494,13 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtGui.QDialog):
|
|||||||
t_monitor.set_finished()
|
t_monitor.set_finished()
|
||||||
|
|
||||||
def rename_vm(self):
|
def rename_vm(self):
|
||||||
|
|
||||||
new_vm_name, ok = QtGui.QInputDialog.getText(
|
new_vm_name, ok = QtGui.QInputDialog.getText(
|
||||||
self,
|
self,
|
||||||
self.tr('Rename qube'),
|
self.tr('Rename qube'),
|
||||||
self.tr('New name: (WARNING: all other changes will be discarded)'))
|
self.tr('New name: (WARNING: all other changes will be discarded)'))
|
||||||
|
|
||||||
if ok:
|
if ok:
|
||||||
self._run_in_thread(self._rename_vm, new_vm_name)
|
if self._run_in_thread(self._rename_vm, new_vm_name):
|
||||||
self.done(0)
|
self.done(0)
|
||||||
|
|
||||||
def _remove_vm(self, t_monitor):
|
def _remove_vm(self, t_monitor):
|
||||||
|
Loading…
Reference in New Issue
Block a user