From 3f0af4498c17bbabcae64e837e1313c8c4fc001b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marta=20Marczykowska-G=C3=B3recka?= Date: Fri, 13 Jul 2018 20:40:17 +0200 Subject: [PATCH] Fixed VM name validation in GUI tools (Create VM, Settings, Manager) VM name validation in various places in Manager did not allow a perfectly legal '_' character. references QubesOS/qubes-issues#2422 --- qubesmanager/create_new_vm.py | 2 +- qubesmanager/qube_manager.py | 2 +- qubesmanager/settings.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/qubesmanager/create_new_vm.py b/qubesmanager/create_new_vm.py index 97bba22b..6e7fa52f 100644 --- a/qubesmanager/create_new_vm.py +++ b/qubesmanager/create_new_vm.py @@ -71,7 +71,7 @@ def __init__(self, qtapp, app, parent=None): allow_internal=False, allow_default=True, allow_none=True) self.name.setValidator(QtGui.QRegExpValidator( - QtCore.QRegExp("[a-zA-Z0-9-]*", QtCore.Qt.CaseInsensitive), None)) + QtCore.QRegExp("[a-zA-Z0-9_-]*", QtCore.Qt.CaseInsensitive), None)) self.name.selectAll() self.name.setFocus() diff --git a/qubesmanager/qube_manager.py b/qubesmanager/qube_manager.py index 6cec676b..7d8931c4 100644 --- a/qubesmanager/qube_manager.py +++ b/qubesmanager/qube_manager.py @@ -263,7 +263,7 @@ def __init__(self, qt_app, qubes_app, parent=None): self.searchbox = SearchBox() self.searchbox.setValidator(QtGui.QRegExpValidator( - QtCore.QRegExp("[a-zA-Z0-9-]*", QtCore.Qt.CaseInsensitive), None)) + QtCore.QRegExp("[a-zA-Z0-9_-]*", QtCore.Qt.CaseInsensitive), None)) self.searchContainer.addWidget(self.searchbox) self.connect(self.table, QtCore.SIGNAL("itemSelectionChanged()"), diff --git a/qubesmanager/settings.py b/qubesmanager/settings.py index f71611e0..9de9baa0 100755 --- a/qubesmanager/settings.py +++ b/qubesmanager/settings.py @@ -294,7 +294,7 @@ def __init_basic_tab__(self): self.vmname.setText(self.vm.name) self.vmname.setValidator( QtGui.QRegExpValidator( - QtCore.QRegExp("[a-zA-Z0-9-]*", + QtCore.QRegExp("[a-zA-Z0-9_-]*", QtCore.Qt.CaseInsensitive), None)) self.vmname.setEnabled(False) self.rename_vm_button.setEnabled(not self.vm.is_running())