Skip to content

Commit

Permalink
Fixed VM name validation in GUI tools (Create VM, Settings, Manager)
Browse files Browse the repository at this point in the history
VM name validation in various places in Manager did not allow a
perfectly legal '_' character.

references QubesOS/qubes-issues#2422
  • Loading branch information
marmarta committed Jul 13, 2018
1 parent 0a44c93 commit 3f0af44
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion qubesmanager/create_new_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion qubesmanager/qube_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()"),
Expand Down
2 changes: 1 addition & 1 deletion qubesmanager/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 3f0af44

Please sign in to comment.