~antonio-roquentin-deactivatedaccount/gtg/bugfix-1076029

« back to all changes in this revision

Viewing changes to GTG/gtk/browser/browser.py

  • Committer: Izidor Matušov
  • Date: 2013-02-04 07:48:17 UTC
  • mfrom: (1278.1.2 fix-expand-collapse)
  • Revision ID: izidor.matusov@gmail.com-20130204074817-x3r75qvkpmcbk8wp
Fix for #1076909: Collapsing and expanding tasks doesn't work

Show diffs side-by-side

added added

removed removed

Lines of Context:
741
741
            self.quickadd_pane.hide()
742
742
            self.config.set('quick_add', False)
743
743
 
 
744
    def _expand_not_collapsed(self, model, path, iter, colt):
 
745
        """ Expand all not collapsed nodes
 
746
 
 
747
        Workaround around bug in Gtk, see LP #1076909 """
 
748
        # Generate tid from treeview
 
749
        tid_build = []
 
750
        current_iter = iter
 
751
        while current_iter is not None:
 
752
            tid = str(model.get_value(current_iter,0))
 
753
            tid_build.insert(0, tid)
 
754
            current_iter = model.iter_parent(current_iter)
 
755
        tid = str(tuple(tid_build))
 
756
 
 
757
        # expand if the node was not stored as collapsed
 
758
        if tid not in colt:
 
759
            self.vtree_panes['active'].expand_row(path, False)
 
760
 
744
761
    def on_task_expanded(self, sender, tid):
745
762
        colt = self.config.get("collapsed_tasks")
746
763
        if tid in colt:
747
764
            colt.remove(tid)
 
765
        # restore expanded state of subnodes
 
766
        self.vtree_panes['active'].get_model().foreach(
 
767
            self._expand_not_collapsed, colt)
748
768
 
749
769
    def on_task_collapsed(self, sender, tid):
750
770
        colt = self.config.get("collapsed_tasks")