GNOME Bugzilla – Bug 333858
Multiple categories dialog are popped up in the same contact editor
Last modified: 2013-09-13 01:00:10 UTC
Please describe the problem: In the same contact editor, can pop up more than one categories dialog. And all the dialogs popped up would reset categorie list entry in contact editor. Steps to reproduce: 1. Launch evolution 2. File->New->Contact, open contact editor. 3. Click "Categories" button, then pop up a categories dialog. 4. Click "Categories" button again, then pop up another categories dialog. Actual results: All the dialogs can reset the corresponding categories list entry in contact editor. Expected results: Just one dialog is popped up. when one exists, others shouldn't be popped up. Does this happen every time? Yes. Other information:
Created attachment 60888 [details] [review] patch Make only one categories dialog is popped up at the same contact editor.
Using a static global is not a good idea, as this will be shared between all the contact editor instances. Open contact editor and click on categories. Open one more contact editor dialog and click on categories, you wouldn't get a new categories dialog. I hope you understood the problem. The best way would have been to put ctegories_dialog into Contact editor struct, but that cant be done as we can't break the ABI. Check if you can do it in some other way.
What about add this pointer on dialog to EContactPrivate structure? It could work, what do you mean?
Not EContactPrivate (By the name I assume it is part of e-contact), but to the dialog's private or so
Srinivasa, you have right that there is usually created an editor window for each contact, but I don't think it could be placed in a dialog private structure, because new editor dialog is usually called on contact, so I think that if we store this in dialog private, then we need a list of all active dialogs and loop trough them to find out that our, with actual contact. And it is not what we want to do, am I right? BTW, look on e-minicard.c, there is also used same dialog, and it's stored inside minicard itself.
Milan, I dont understand. I haven't read the code, but you should have a instance in representation in the priv struct of the contact dialog. I dont see you why you have to maintain a loop of dialogs. It should be just one.
Created attachment 89007 [details] [review] proposed patch for evolution; as srag said on IRC, I placed into EContactEditor pointer on actual categories dialog.
+ e_categories_dialog_set_categories ( E_CATEGORIES_DIALOG(editor->categories_dialog), categories); Is this really required? Im just wondering why cant you just raise the dialog? Looks fine other wise.
(In reply to comment #8) > + e_categories_dialog_set_categories ( > E_CATEGORIES_DIALOG(editor->categories_dialog), categories); > Is this really required? Im just wondering why cant you just raise the dialog? > > Looks fine other wise. > I added it there because I want to have behavior of that button always same: after user click on "Categories" button, then the value in dialog is always consistent with value in categories entry (and is also based on that value). Does it make sense?
No. Assume, I check 4-5 entries and I click categories again, it presents the same window but clears every thing. Ideally it should show what was there. Ill fix it and commit it.
Reworked patch committed.