diff --git a/qubesmanager/create_new_vm.py b/qubesmanager/create_new_vm.py index f284b9a..f69a953 100644 --- a/qubesmanager/create_new_vm.py +++ b/qubesmanager/create_new_vm.py @@ -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() diff --git a/qubesmanager/settings.py b/qubesmanager/settings.py index 622ba91..66e7186 100755 --- a/qubesmanager/settings.py +++ b/qubesmanager/settings.py @@ -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()