http://bugs.async.com.br/show_bug.cgi?id=3782

           Summary: Add filter on objectlist
           Product: Kiwi
           Version: SVN trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: (unset)
         Component: ObjectList
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]
         QAContact: [EMAIL PROTECTED]
   Estimated Hours: 0.0


Created an attachment (id=4858)
 --> (http://bugs.async.com.br/attachment.cgi?id=4858)
Patch of objectlist.py that implement filtering of model

(sorry for this poor english ;)

The aim is to add a filtering functionality to objectlist such a
filter_model in gtk.

I think there is two ways to achieve this.
1) let the user give a custom model to the objectlist. This is now    possible,
but does not work because the objectlist assert that the 
   model is like a gtk.ListStore which is not the case with the 
   TreeModelFilter. I think it can be easy to patch the objectlist to fix 
   this behavior (I don't know how ?). 

   Does this mean lot of hacking in the objectlist ?

2)  add this behavior in the objectlist itself.

    class ObjectList(...):
       ... 
          def set_filter_func(self,func):...          def refilter(self):...

    This is more user friendly, but I don't think that ObjectList must
    become a mega widget that do everything. Moreover the first solution
    can let other kinds of custom models work.

    Also, I don't know how much hacking it need in the objectlist to work
    correctly.

    I wrote a small patch that implement set_filter_func and refilter,
    but :

        - I don't know why, some time the filter function receive
          'None' object, this happen when user insert row in the objectlist.
          This patch contain a hack to solve that, but it is an ugly hack

        - I don't know well the rest of the objectlist, so perhaps this
          patch can create some unwanted behaviors.

I join a demo.py file and the svn diff objectlist.py of my patch.

I'm quite interested to finish this work, so if you have no time and
want this functionality, give me some advice and I will work on it.


-- 
Configure bugmail: http://bugs.async.com.br/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
_______________________________________________
Kiwi mailing list
[email protected]
http://www.async.com.br/mailman/listinfo/kiwi

Reply via email to