validate VM name also at GUI level (#656)

This commit is contained in:
Marek Marczykowski 2012-08-23 03:57:19 +02:00
parent 8d7ae00b2a
commit d0eb5a2fd5
2 changed files with 2 additions and 0 deletions

View File

@ -83,6 +83,7 @@ class NewVmDlg (QDialog, Ui_NewVMDlg):
self.template_name.insertItem(i, vm.name)
self.template_name.setCurrentIndex(default_index)
self.vmname.setValidator(QRegExpValidator(QRegExp("[a-zA-Z0-9-]*", Qt.CaseInsensitive), None))
self.vmname.selectAll()
self.vmname.setFocus()

View File

@ -189,6 +189,7 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog):
def __init_basic_tab__(self):
self.vmname.setText(self.vm.name)
self.vmname.setValidator(QRegExpValidator(QRegExp("[a-zA-Z0-9-]*", Qt.CaseInsensitive), None))
#self.qvm_collection.lock_db_for_reading()
#self.qvm_collection.load()