Closed Bug 455240 Opened 13 years ago Closed 13 years ago
Address book card preview pane doesn't update for card changes via external interfaces (where notifications exist, e
.g . OS X)
1) Select a card in Thunderbird's Address Book which is in an OS X address book. 2) Go into the OS X address book and update the card. 3) Notice that the card preview pane doesn't update. The problem is the way we're doing the notifications. Should be very simple to fix. At the moment when we call the edit card or edit list dialogs, they are called with a callback which equates to UpdateCardView, which is why this works internally. We have proper methods for doing this, in particular we already have a listener in addressbook.js which listens for some events. We should just drop the edit card/list callbacks and update the card view in the listener in addressbook.js if the card matches the selected card.
This patch means we update the card view pane whenever the changed card matches the one selected, hence we can drop the "manual" callbacks that are used to update the cards.
I'm tempted to suggest that this should be done in nsAbView - it already has to update its internal state for card edits and it should be trivial to check that the card it updated was the single selection and if so poke the UI.
(In reply to comment #2) > I'm tempted to suggest that this should be done in nsAbView - it already has to > update its internal state for card edits and it should be trivial to check that > the card it updated was the single selection and if so poke the UI. How would you be thinking of poking the UI? Not everything that uses nsAbView needs an update, so the only way I can think of is to use a listener/callback combination which is what I'm effectively doing here anyway.
We already have an nsIAbViewListener. For instance, when you change the first/last name pref then the nsAbView calls its onSelectionChanged method.
Better patch, based on Neil's comments, this patch simply notifies the nsIAbViewListener of a selection changed update (when OnItemPropertyChanged is called) and that refreshes the display.
Limit updates to only when the card was/is selected.
Comment on attachment 339063 [details] [diff] [review] The fix v3 This also works when editing the contact from the address book sidebar of course :-)
Attachment #339063 - Flags: review?(neil) → review+
Attachment #339063 - Flags: superreview?(bienvenu) → superreview+
Checked in, changeset id: 360:6fb2a576f786
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.