* Updated signal handlers to deal with citation tree model and secondary nodes

* Fix for citation selector.

svn: r18171
This commit is contained in:
Tim G L Lyons
2011-09-18 19:49:18 +00:00
parent c474e5e638
commit 21e402fc6f
8 changed files with 48 additions and 23 deletions

View File

@@ -73,18 +73,8 @@ class BaseCitationView(ListView):
# The configuration parameters have been moved to CitationTreeView and
# CitationListView, because they differ for the two different views.
def __init__(self, pdata, dbstate, uistate, title, model, nav_group=0):
signal_map = {
'citation-add' : self.row_add,
'citation-update' : self.row_update,
'citation-delete' : self.row_delete,
'citation-rebuild' : self.object_build,
'source-add' : self.row_add,
'source-update' : self.row_update,
'source-delete' : self.row_delete,
'source-rebuild' : self.object_build,
}
def __init__(self, pdata, dbstate, uistate, title, model, signal_map,
nav_group=0):
ListView.__init__(
self, title, pdata, dbstate, uistate,
@@ -430,7 +420,7 @@ class BaseCitationView(ListView):
"""
Define the default gramplets for the sidebar and bottombar.
"""
return (("Source Filter",),
return (("Citation Filter",),
("Citation Gallery",
"Citation Notes",
"Citation Backlinks"))

View File

@@ -50,9 +50,12 @@ from gen.ggettext import gettext as _
class CitationListView(BaseCitationView):
"""
A list view of citations.
The citation list view only shows the citations (it does not show
sources as separate list entries).
"""
# The data items here have to correspond, in order, to the items in
# src/giu.views/treemodels/citationlistmodel.py
# src/giu.views/treemodels/citationlismodel.py
COL_TITLE_PAGE = 0
COL_ID = 1
COL_DATE = 2
@@ -99,7 +102,16 @@ class CitationListView(BaseCitationView):
QR_CATEGORY = CATEGORY_QR_SOURCE
def __init__(self, pdata, dbstate, uistate, nav_group=0):
signal_map = {
'citation-add' : self.row_add,
'citation-update' : self.row_update,
'citation-delete' : self.row_delete,
'citation-rebuild' : self.object_build,
}
BaseCitationView.__init__(self, pdata, dbstate, uistate,
_('Citation View'), CitationListModel,
signal_map,
nav_group=nav_group)

View File

@@ -98,8 +98,20 @@ class CitationTreeView(BaseCitationView):
def __init__(self, pdata, dbstate, uistate, nav_group=0):
signal_map = {
'citation-add' : self.row_add,
'citation-update' : self.row_update,
'citation-delete' : self.row_delete,
'citation-rebuild' : self.object_build,
'source-add' : self.row_add,
'source-update' : self.row_update,
'source-delete' : self.row_delete,
'source-rebuild' : self.object_build,
}
BaseCitationView.__init__(self, pdata, dbstate, uistate,
_('Citation Tree View'), CitationTreeModel,
signal_map,
nav_group=nav_group)
def type_list(self):