Renable enter to expand nodes on the treeviews

svn: r14005
This commit is contained in:
Benny Malengier
2010-01-09 16:16:52 +00:00
parent 08c8edb43d
commit 0ec49507ed
3 changed files with 80 additions and 9 deletions

View File

@@ -47,7 +47,7 @@ _LOG = logging.getLogger(".gui.personview")
#-------------------------------------------------------------------------
import gen.lib
from gui.views.navigationview import NAVIGATION_PERSON
from gui.views.listview import ListView
from gui.views.listview import ListView, LISTTREE
from gui.views.treemodels import PeopleModel
import Utils
from BasicUtils import name_displayer
@@ -121,7 +121,13 @@ class PersonView(ListView):
}
config.connect("interface.filter", self.filter_toggle)
def type_list(self):
"""
set the listtype, this governs eg keybinding
"""
return LISTTREE
def column_ord_setfunc(self, clist):
self.dbstate.db.set_person_column_order(clist)

View File

@@ -28,6 +28,7 @@ Place Tree View
# Gramps modules
#
#-------------------------------------------------------------------------
from gui.views.listview import LISTTREE
from gui.views.placebaseview import PlaceBaseView
from gui.views.treemodels import PlaceTreeModel
import gen.lib
@@ -55,6 +56,12 @@ class PlaceTreeView(PlaceBaseView):
PlaceBaseView.__init__(self, dbstate, uistate,
_('Tree'), PlaceTreeModel)
def type_list(self):
"""
set the listtype, this governs eg keybinding
"""
return LISTTREE
def get_viewtype_stock(self):
"""
Override the default icon. Set for hierarchical view.
@@ -67,9 +74,9 @@ class PlaceTreeView(PlaceBaseView):
"""
PlaceBaseView.define_actions(self)
self._add_action('OpenBranch', None, _("Expand Rows"),
self._add_action('OpenBranch', None, _("Expand this Entire Group"),
callback=self.open_branch)
self._add_action('CloseBranch', None, _("Collapse Rows"),
self._add_action('CloseBranch', None, _("Collapse this Entire Group"),
callback=self.close_branch)
self._add_action('OpenAllNodes', None, _("Expand all Nodes"),
callback=self.open_all_nodes)