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
This commit is contained in:
Marta Marczykowska-Górecka 2018-07-13 20:40:17 +02:00
parent 0a44c931da
commit 3f0af4498c
No known key found for this signature in database
GPG Key ID: 9A752C30B26FD04B
3 changed files with 3 additions and 3 deletions

View File

@ -71,7 +71,7 @@ class NewVmDlg(QtGui.QDialog, Ui_NewVMDlg):
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()

View File

@ -263,7 +263,7 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QtGui.QMainWindow):
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()"),

View File

@ -294,7 +294,7 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtGui.QDialog):
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())