Merge lp:~daker/dexter-rolodex/dexter into lp:dexter-rolodex

Proposed by Adnane Belmadiaf
Status: Merged
Merged at revision: 270
Proposed branch: lp:~daker/dexter-rolodex/dexter
Merge into: lp:dexter-rolodex
Diff against target: 48 lines (+10/-5)
2 files modified
dexter/app.py (+7/-2)
dexter/backend/utilities.py (+3/-3)
To merge this branch: bzr merge lp:~daker/dexter-rolodex/dexter
Reviewer Review Type Date Requested Status
Postler Devs Pending
Review via email: mp+43330@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'dexter/app.py'
2--- dexter/app.py 2010-12-10 05:30:30 +0000
3+++ dexter/app.py 2010-12-10 10:24:09 +0000
4@@ -388,13 +388,18 @@
5
6 def _on_toolbutton_delete_contact_clicked(self, widget):
7 """remove selected contact when the delete button is clicked"""
8+ selected_contacts = self.get_selected_contacts()
9+ if len(selected_contacts) < 2:
10+ msg = _("Are you sure you want to delete the selected contact?")
11+ else:
12+ msg = _("Are you sure you want to delete the selected contacts?")
13 md = gtk.MessageDialog(None, gtk.DIALOG_DESTROY_WITH_PARENT,
14 gtk.MESSAGE_QUESTION, gtk.BUTTONS_OK_CANCEL,
15- _("Are you sure you want to delete the selected contacts?"))
16+ msg)
17 response = md.run()
18 md.destroy()
19 if response == gtk.RESPONSE_OK:
20- for contact in self.get_selected_contacts():
21+ for contact in selected_contacts :
22 utilities.delete_contact(self.store, contact)
23 self._on_store_changed()
24
25
26=== modified file 'dexter/backend/utilities.py'
27--- dexter/backend/utilities.py 2010-12-10 06:24:59 +0000
28+++ dexter/backend/utilities.py 2010-12-10 10:24:09 +0000
29@@ -181,7 +181,7 @@
30 photo_path = None # TODO: replace with proper
31 print _("couldn't add photo") # error handling and logging
32 if hasattr(card, 'note'):
33- notes.append(card.note.value)
34+ notes.append(card.note.value.strip())
35 for child in card.getChildren():
36 if child.name == u'EMAIL':
37 if hasattr(child, 'value'):
38@@ -279,8 +279,8 @@
39 address_dict["type"] = None
40 addresses.append(address_dict)
41 for anote in contact.notes:
42- if anote.text:
43- note += (anote.text + "\n")
44+ if anote.text and anote.text.strip() != "":
45+ note += (anote.text.strip() + "\n")
46 delete_contact(store, contact)
47 if len(firstnames) > 1 or len(middlenames) > 1 or len(lastnames) > 1 or \
48 len(organizations) > 1 or len(birthdays) > 1:

Subscribers

People subscribed via source and target branches