From 8d7ae00b2a3063384d1ba6ca2f0b8ef85d837eb0 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Thu, 23 Aug 2012 03:57:01 +0200 Subject: [PATCH 1/2] fix HVM presence test --- qubesmanager/create_new_vm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qubesmanager/create_new_vm.py b/qubesmanager/create_new_vm.py index e915612..f284b9a 100644 --- a/qubesmanager/create_new_vm.py +++ b/qubesmanager/create_new_vm.py @@ -56,7 +56,7 @@ class NewVmDlg (QDialog, Ui_NewVMDlg): # Instead we lock for writing in the actual worker thread try: - from qubes.qubes import QubesHVM + from qubes.qubes import QubesHVm except ImportError: pass else: From d0eb5a2fd5c57779a44eda1fe6fb278b2e54349f Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Thu, 23 Aug 2012 03:57:19 +0200 Subject: [PATCH 2/2] validate VM name also at GUI level (#656) --- qubesmanager/create_new_vm.py | 1 + qubesmanager/settings.py | 1 + 2 files changed, 2 insertions(+) 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()