From 3039e2dc92d352e9d8bdd6595a644926769d2845 Mon Sep 17 00:00:00 2001 From: Kiooeht Date: Sat, 31 Mar 2012 17:54:49 -0700 Subject: [PATCH] Bug fix: Check group name on rename --- CHANGELOG.mkdn | 1 + pesterchum.py | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.mkdn b/CHANGELOG.mkdn index 8cf3248..d507b0c 100644 --- a/CHANGELOG.mkdn +++ b/CHANGELOG.mkdn @@ -27,6 +27,7 @@ CHANGELOG * Add chums when using manual sorting - Kiooeht [evacipatedBox] * Memo case insensitive for userlist and modes - Kiooeht [evacipatedBox] * Move hidden chums when deleting group - Kiooeht [evacipatedBox] + * Don't allow rename groups with parenthesis - Kiooeht [evacipatedBox] ### 3.41.3 diff --git a/pesterchum.py b/pesterchum.py index 84cb076..d882b81 100644 --- a/pesterchum.py +++ b/pesterchum.py @@ -790,6 +790,13 @@ class chumArea(RightClickTree): (gname, ok) = QtGui.QInputDialog.getText(self, "Rename Group", "Enter a new name for the group:") if ok: gname = unicode(gname) + if re.search("[^A-Za-z0-9_\s]", gname) is not None: + msgbox = QtGui.QMessageBox() + msgbox.setInformativeText("THIS IS NOT A VALID GROUP NAME") + msgbox.setStandardButtons(QtGui.QMessageBox.Ok) + ret = msgbox.exec_() + self.addgroupdialog = None + return currentGroup = self.currentItem() if not currentGroup: return @@ -1896,7 +1903,7 @@ class PesterWindow(MovingWindow): return if re.search("[^A-Za-z0-9_\s]", group) is not None: errormsg = QtGui.QErrorMessage(self) - errormsg.showMessage("THIS IS NOT A VALID CHUMTAG!") + errormsg.showMessage("THIS IS NOT A VALID GROUP NAME") self.addchumdialog = None return if newgroup: