Re: [RFC] : search window



On 2002.01.11 09:54 Emmanuel wrote:
> here is the ideas I want to discuss on the list to implement the 
> search window.
> First here are the goals I want to achieve for these windows :
> 	- you can open different search windows for one mailbox
> 	- the search window has the same features as the normal index : 
> ie user will be able to delete/transfer... messages in it.
> 	- the search windows must be updated upon mailbox changes 
> (deletion of messages, new messages...)
> 
> So the biggest problem is synchronization : imagine that you have 
> opened a mailbox. You open also a searc window on it. You look into 
> the search window and see a Spam mail (that's a rather usual example 
> ;-), you destroy it from within the search window. All other "views" 
> (ie the index and also other search windows you could have opened on 
> this mailbox) of the mailbox and the mailbox itself must be updated.

This is achieved by connecting signal handlers to 
LibBalsaMailbox::message-delete signal. I.e. each of the view/indexes 
installs a signal handler and this signal handler will be called every 
time a message(s) is(are) deleted from the mailbox. The only thing to 
remember is to uninstall the signal handler when the view/index is 
destroyed, otherwise LibBalsaMailbox would try to call a signal handler 
with possibly invalid data.

/pawel

> 	 	So what I propose is just to add a controller object 
> BalsaIndexCtl that will do the job of synchronizing model and views 
> (ie mailbox and indexes/search windows), and to just implement the 
> search window as a window with a BalsaIndex in it. We'll also have to 
> change also a bit the BalsaIndex object : strip out all the code that 
> changes the mailbox directly, and replace it with a code that tells 
> the controller that the user want to change the model. This 
> controller will handle these requests, dispatch them to all views so 
> that they update their content, then issue the command to the mailbox 
> to keep in sync with views. That should also be possible the other 
> way : if new messages are put in a mailbox, the controller must be 
> aware of it and tell all views to refresh.
-- 
Pawel Salek (pawsa@theochem.kth.se) http://www.theochem.kth.se/~pawsa/
Theoretical Chemistry Division, KTH



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]