After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 333858 - Multiple categories dialog are popped up in the same contact editor
Multiple categories dialog are popped up in the same contact editor
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Contacts
2.12.x
Other All
: Normal normal
: ---
Assigned To: evolution-addressbook-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2006-03-08 06:55 UTC by Xiurong Simon Zheng
Modified: 2013-09-13 01:00 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
patch (3.64 KB, patch)
2006-03-08 07:02 UTC, Xiurong Simon Zheng
needs-work Details | Review
proposed patch (2.53 KB, patch)
2007-05-29 14:42 UTC, Milan Crha
committed Details | Review

Description Xiurong Simon Zheng 2006-03-08 06:55:24 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:
Comment 1 Xiurong Simon Zheng 2006-03-08 07:02:12 UTC
Created attachment 60888 [details] [review]
patch

Make only one categories dialog is popped up at the same contact editor.
Comment 2 Devashish Sharma 2006-03-10 05:29:17 UTC
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.
Comment 3 Milan Crha 2007-05-15 13:43:16 UTC
What about add this pointer on dialog to EContactPrivate structure? It could work, what do you mean?
Comment 4 Srinivasa Ragavan 2007-05-28 10:53:39 UTC
Not EContactPrivate (By the name I assume it is part of e-contact), but to the dialog's private or so
Comment 5 Milan Crha 2007-05-28 16:26:26 UTC
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.
Comment 6 Srinivasa Ragavan 2007-05-28 17:44:30 UTC
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.
Comment 7 Milan Crha 2007-05-29 14:42:07 UTC
Created attachment 89007 [details] [review]
proposed patch

for evolution;

as srag said on IRC, I placed into EContactEditor pointer on actual categories dialog.
Comment 8 Srinivasa Ragavan 2007-05-29 18:14:24 UTC
+		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.
Comment 9 Milan Crha 2007-05-30 05:51:08 UTC
(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?
Comment 10 Srinivasa Ragavan 2007-05-30 08:11:30 UTC
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.
Comment 11 Srinivasa Ragavan 2007-05-30 08:17:10 UTC
Reworked patch committed.