← Back to team overview

gtg-contributors team mailing list archive

About my refactorisation

 

Hello dear GTG contributors,

Here's the status of my current big refactorisation :
https://code.edge.launchpad.net/~gtg/gtg/gtg-refactor


I've discoverd that GTK is even worse than what I thought : it's hard to
understand to make basic stuffs and it's nearly impossible to make
more-or-less complicated stuffs. In our case, I wanted to use
gtk.TreeModelFilter to implement workview/tagview/…

It's not possible. TreeModelFilter cannot display a node if the parent is
hidden. Point. This is not in the documentation but it is.

As a consequence, I've started my own FilteredTree which is not related to
gtk but is a View layer above our own Tree.  This filteredTree is given to
the gtk.TreeModel as an argument.

I've also started a FiltersBank who will store all of our filters so that
they are in one place.

There's one main FilteredTree that you can get through the requester. This
main FilteredTree does use the filters applied throught the requester. This
allow plugin writers to easily get the current displayed tree (main View).

For custom views, the plugin writers are able to get their own
FilteredTree and apply on it the filters they want. (this is not finished
yet but in good shape).

I hope this will help plugin writers and make our requester API saner.


Currently, there's only one filter implemented : workview (and it's not
complete. It currently only check if the node if a leaf node or not).

Also, FilteredTree is currently completely suboptimal from a performance
POV. This is not a big deal because I foresee plenty of low-hanging fruit
to improve the speed.



BUGS
****
For whatever reason, when I apply a filter, the treeview is not well
refreshed. I don't undestand really what is happening.
- If you start in normal mode then apply the workview, the workview tasks
are added but others stay. Unapplying workview does nothing.
- If you start in workview the unapply it, nothin happens. If you re-apply
it, nothing happens.

Help on this particular bug would be highly appreciated.



TODO
*****
- implement the filters : workview, tags(which will be a special case),
active, closed, …  : this is trivial to do in FiltersBank.py
- make use of the filters in the browser (closed_pane will be implemented
with a different FileredTree) : this will not be hard.
- make the difference between the main View and custom FilteredTrees. I
know how to do it ;-)
- unit tests for FilteredTree. Any help on this is welcome.


WHAT WILL BREAK
**************
Because requester was heavily changed, the following will break :
- all plugins
- dbuswrapper

Also, what I've intentionnaly broken :
- drag-n-drop (code commented in tasktree.py, need to be adapted)
- multi-parent support (need to be tested once everything else is working)
- tag_count (code commented out in tagtree.py because of change in the
requester)


Any feedback is welcome (specially on my current Treeview refresh bug)


Lionel






Follow ups