Package: luma Version: 2.4-2 Severity: normal Tags: patch Hi,
when trying to use the addressbook plugin in luma 2.4-2, luma throws an unhandled exception: 16:27:48 An unhandled exception occured. This is most likely a bug in the programming of Luma. In order to fix this, send an email with the following text and a detailed description of what you were doing to luma-us...@lists.sourceforge.net. File "/usr/lib/luma/base/utils/gui/LumaEntryBrowser.py", line 339, in listItemClicked self.emit(PYSIGNAL("about_to_change"), ()) File "/usr/lib/luma/plugins/addressbook/AddressbookWidget.py", line 684, in aboutToChange if not self.EDITED: Reason: <type 'exceptions.AttributeError'> 'AddressbookWidget' object has no attribute 'EDITED' that probibits displaying the addressbook details The attached patch makes the addressbook usable (at least for reading - I did not yet dare to change an entry in my directory ;-) Thanks for maintaining luma in Debian Peter -- System Information: Debian Release: squeeze/sid APT prefers testing APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable') Architecture: amd64 (x86_64) Kernel: Linux 2.6.26-2-amd64 (SMP w/2 CPU cores) Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages luma depends on: ii python 2.5.4-4 An interactive high-level object-o ii python-ldap 2.3.10-1 LDAP interface module for Python ii python-qt3 3.18.1-2 Qt3 bindings for Python ii python-support 1.0.6 automated rebuilding support for P luma recommends no packages. luma suggests no packages. -- no debconf information
#! /bin/sh /usr/share/dpatch/dpatch-run ## luma-2.4-addressbook.patch ## DP: make addressbook workable (at least for reading) # From: Peter Marschall <pe...@adpm.de> # Subject: make addressbook workable (at least for reading) --- luma-2.4/lib/luma/plugins/addressbook/AddressbookWidget.py +++ luma-2.4/lib/luma/plugins/addressbook/AddressbookWidget.py @@ -86,6 +86,7 @@ class AddressbookWidget(AddressbookWidge self.DISABLED = 1 self.ENABLE_SAVE = False self.DIALOG_MODE = False + self.setEdited(False); self.addressID = 0 @@ -197,11 +198,13 @@ class AddressbookWidget(AddressbookWidge self.noteEdit.setText(value) if x == 'birthDate': - tmpList = self.dataObject.getAttributeValue(x, 0).split('-') + tmpDate = self.dataObject.getAttributeValue(x, 0).split(' ') + tmpList = tmpDate[0].split('-') self.birthDateEdit.setDate(QDate(int(tmpList[0]), int(tmpList[1]), int(tmpList[2]))) if x == 'anniversary': - tmpList = self.dataObject.getAttributeValue(x, 0).split('-') + tmpDate = self.dataObject.getAttributeValue(x, 0).split(' ') + tmpList = tmpdate[0].split('-') self.birthDateEdit.setDate(QDate(int(tmpList[0]), int(tmpList[1]), int(tmpList[2]))) self.addressID = 0 @@ -210,6 +213,7 @@ class AddressbookWidget(AddressbookWidge # PATCH #self.ENABLE_SAVE = True #self.setSaveButton() + self.setEdited(False); ############################################################################### @@ -270,7 +274,7 @@ class AddressbookWidget(AddressbookWidge if (sureNamePosition-givenNamePosition) > 1: middleName = " ".join(tmpList[givenNamePosition+1 : sureNamePosition]) - + edited = self.EDITED dialog.lastEdit.setText(sn) if not givenName == None: @@ -281,7 +285,10 @@ class AddressbookWidget(AddressbookWidge dialog.titleBox.setCurrentText(title) if not middleName == None: dialog.middleEdit.setText(middleName) - + + if not edited: + self.setEdited(False); + dialog.exec_loop() @@ -394,7 +401,7 @@ class AddressbookWidget(AddressbookWidge # PATCH #self.ENABLE_SAVE = False #self.setSaveButton() - self.EDITED = False + #self.EDITED = False self.setEdited(False) ############################################################################### --- luma-2.4/lib/luma/plugins/addressbook/AddressbookView.py +++ luma-2.4/lib/luma/plugins/addressbook/AddressbookView.py @@ -42,7 +42,7 @@ class AddressbookView(QWidget): self.connect(self.entryList, PYSIGNAL("about_to_change"), self.addressBookWidget.aboutToChange) # PATCH #self.connect(self.entryList, PYSIGNAL("ldap_result"), self.addressBookWidget.initView) - self.connect(self.entryList, PYSIGNAL("about_to_change"), self.addressBookWidget.aboutToChange) + #self.connect(self.entryList, PYSIGNAL("about_to_change"), self.addressBookWidget.aboutToChange) self.connect(self.entryList, PYSIGNAL("ldap_result"), self.addressBookWidget.initView) self.connect(self.entryList, PYSIGNAL("server_changed"), self.addressBookWidget.serverChanged)