Mercurial > libervia-web
comparison browser_side/dialog.py @ 221:f3898fbb00c3
browser_side: check for duplicate name before adding a new contact group
author | souliane <souliane@mailoo.org> |
---|---|
date | Sat, 21 Sep 2013 20:24:36 +0200 |
parents | 9827cda1a6b0 |
children | f3a5a094c8d6 |
comparison
equal
deleted
inserted
replaced
220:09e4de9df5b7 | 221:f3898fbb00c3 |
---|---|
263 if self.cancel_cb: | 263 if self.cancel_cb: |
264 self.cancel_cb(self) | 264 self.cancel_cb(self) |
265 | 265 |
266 def onGroupInput(self, sender): | 266 def onGroupInput(self, sender): |
267 text = sender.getText() | 267 text = sender.getText() |
268 for index in xrange(0, self.list_box.getItemCount()): | |
269 if text == self.list_box.getValue(index): | |
270 Window.alert("The group '%s' already exists." % text) | |
271 return | |
268 for pattern in FORBIDDEN_PATTERNS_IN_GROUP: | 272 for pattern in FORBIDDEN_PATTERNS_IN_GROUP: |
269 if pattern in text: | 273 if pattern in text: |
270 Window.alert("The pattern '%s' is not allowed in group names." % pattern) | 274 Window.alert("The pattern '%s' is not allowed in group names." % pattern) |
271 return | 275 return |
272 self.list_box.addItem(text) | 276 self.list_box.addItem(text) |