From: Wido D. <wi...@us...> - 2005-01-31 15:51:30
|
Update of /cvsroot/luma/luma/lib/luma/plugins/addressbook In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3727/lib/luma/plugins/addressbook Modified Files: AddressbookWidget.py Log Message: Disable GUI when doing LDAP operations. Fix for cases when sn is not part of the cn. Index: AddressbookWidget.py =================================================================== RCS file: /cvsroot/luma/luma/lib/luma/plugins/addressbook/AddressbookWidget.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** AddressbookWidget.py 9 Jan 2005 20:12:26 -0000 1.18 --- AddressbookWidget.py 31 Jan 2005 15:51:21 -0000 1.19 *************** *** 219,222 **** --- 219,223 ---- title = None middleName = None + sureNamePosition = None cn = '' *************** *** 225,229 **** tmpList = cn.split(' ') ! sureNamePosition = tmpList.index(sn) # find the given name --- 226,233 ---- tmpList = cn.split(' ') ! if sn in tmpList: ! sureNamePosition = tmpList.index(sn) ! else: ! sureNamePosition = len(tmpList) - 1 # find the given name *************** *** 301,305 **** self.dataObject.deleteAttribute('givenName') else: ! self.dataObject.addAttributeValue('givenName', [givenName]) value = ''.join(tmpList) --- 305,309 ---- self.dataObject.deleteAttribute('givenName') else: ! self.dataObject.addAttributeValue('givenName', [givenName], True) value = ''.join(tmpList) *************** *** 407,410 **** --- 411,416 ---- if not('' == tmpString): self.dataObject.addAttributeValue('cn', [tmpString], True) + if self.dataObject.isAttributeAllowed('gecos'): + self.dataObject.addAttributeValue('gecos', [tmpString], True) else: if not self.dataObject.isAttributeMust('cn'): *************** *** 576,579 **** --- 582,586 ---- def saveEntry(self): + self.setEnabled(False) self.updateValues() *************** *** 582,585 **** --- 589,593 ---- if not bindSuccess: + self.setEnabled(True) dialog = LumaErrorDialog() errorMsg = self.trUtf8("Could not bind to server.<br><br>Reason: ") *************** *** 593,598 **** --- 601,608 ---- if success: + self.setEnabled(True) self.emit(PYSIGNAL("contact_saved"), ()) else: + self.setEnabled(True) dialog = LumaErrorDialog() errorMsg = self.trUtf8("Could not save entry.<br><br>Reason: ") |