Re: [Q] : search window ?



On 2001.12.22 01:58 Pawel Salek wrote:
> On 2001.12.21 13:19 Emmanuel wrote:
>> There was a feature request to have a window containing all messages 
>> matching a search request, and when you click on one of these messages 
>> you are moved to the actual message of the mailbox.
>> I have an idea to implement that having in mind that I want to reuse 
>> max of code. Namely I just want to mimic the pop3 hack : create a fake 
>> mailbox, fill it with matching messages and then create a BalsaIndex 
>> associated to that mailbox. Then you're almost done (you just have to 
>> manage the click and the selection of the corresponding message in the 
>> actual mailbox, that's easy I think).
> 
> This is simplest, but far from good. Imagine, you mistype your search 
> and end up copying several megabytes of data. I am afraid the right way 
> of doing it should be more sofisticated. What about subclassing 
> LibBalsaMailbox?

Finally here is what I think : the simplest way to handle that is that we 
should make an abstract BalsaIndex class from which we'll derive the 
actual BalsaIndex and another, says BalsaVirtualIndex that will handle our 
case. The base class will contain the UI part and common code in general. 
But the BalsaVirtualIndex will add all the necessary sync with the 
associated mailbox, whereas it won't implement all the message view 
functions (these are only needed in the BalsaIndex class). This way I 
think we don't need to touch the mailbox hierarchy.
The idea for the sync functions between the BalsaVirtualIndex and the 
mailbox would be to hook signals handlers on all modif signals affecting 
the associated mailbox and just update the virtual index accordingly (so 
that if the user remove 100 messages in a mailbox associated with a 
BalsaVirtualIndex, the latter will remove all of these 100 messages that 
it is displaying and so on).
Does that sound feasible and not too intrusive. IMHO this is a view issue 
(if we use the model-view-controller paradigm) so that we should only 
touch the view (here BalsaIndex) part, not the model (here mailbox) to 
keep the separation.
Bye
Manu



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