changeset 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 09e4de9df5b7
children 759fd7386e1e
files browser_side/dialog.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/browser_side/dialog.py	Sat Sep 21 15:37:29 2013 +0200
+++ b/browser_side/dialog.py	Sat Sep 21 20:24:36 2013 +0200
@@ -265,6 +265,10 @@
 
     def onGroupInput(self, sender):
         text = sender.getText()
+        for index in xrange(0, self.list_box.getItemCount()):
+            if text == self.list_box.getValue(index):
+                Window.alert("The group '%s' already exists." % text)
+                return
         for pattern in FORBIDDEN_PATTERNS_IN_GROUP:
             if pattern in text:
                 Window.alert("The pattern '%s' is not allowed in group names." % pattern)