Upgraded Source and Citation reference Quick Views to work with citations (actually, for citationtreeview, this is a source_or_citation reference, to avoid having to change the way listview calls the pop up menu items).

Also minimal changes to SimpleAccess and SimpleTable to support these references views.

svn: r18447
This commit is contained in:
Tim G L Lyons
2011-11-15 12:08:43 +00:00
parent a73075f881
commit 4a69d45fe6
10 changed files with 61 additions and 8 deletions
+6 -1
View File
@@ -36,7 +36,8 @@ from QuickReports import run_quick_report_by_name, get_quick_report_list
from gen.plug import (CATEGORY_QR_PERSON, CATEGORY_QR_FAMILY,
CATEGORY_QR_EVENT, CATEGORY_QR_SOURCE, CATEGORY_QR_NOTE,
CATEGORY_QR_MISC, CATEGORY_QR_PLACE, CATEGORY_QR_MEDIA,
CATEGORY_QR_REPOSITORY)
CATEGORY_QR_REPOSITORY, CATEGORY_QR_CITATION,
CATEGORY_QR_SOURCE_OR_CITATION)
#------------------------------------------------------------------------
#
@@ -52,6 +53,7 @@ class QuickViewGramplet(Gramplet):
self.connect_signal('Event', self._active_changed)
self.connect_signal('Place', self._active_changed)
self.connect_signal('Source', self._active_changed)
self.connect_signal('Citation', self._active_changed)
self.connect_signal('Repository', self._active_changed)
self.connect_signal('Media', self._active_changed)
self.connect_signal('Note', self._active_changed)
@@ -108,6 +110,7 @@ class QuickViewGramplet(Gramplet):
("Place", _("Place")),
("Repository", _("Repository")),
("Source", _("Source")),
("Citation", _("Citation")),
]:
type_list.add_item(item[0], item[1])
# Add particular lists:
@@ -129,6 +132,8 @@ class QuickViewGramplet(Gramplet):
"Family": CATEGORY_QR_FAMILY,
"Event": CATEGORY_QR_EVENT,
"Source": CATEGORY_QR_SOURCE,
"Citation": CATEGORY_QR_CITATION,
"Source or Citation": CATEGORY_QR_SOURCE_OR_CITATION,
"Place": CATEGORY_QR_PLACE,
"Media": CATEGORY_QR_MEDIA,
"Note": CATEGORY_QR_NOTE,
+5
View File
@@ -41,6 +41,8 @@ def get_ref(db, objclass, handle):
ref = db.get_event_from_handle(handle)
elif objclass == 'Source':
ref = db.get_source_from_handle(handle)
elif objclass == 'Citation':
ref = db.get_citation_from_handle(handle)
elif objclass == 'Place':
ref = db.get_place_from_handle(handle)
elif objclass == 'Note':
@@ -83,6 +85,9 @@ run_person = lambda db, doc, obj: run(db, doc, obj, 'person', _("Person"))
run_family = lambda db, doc, obj: run(db, doc, obj, 'family', _("Family"))
run_event = lambda db, doc, obj: run(db, doc, obj, 'event', _("Event"))
run_source = lambda db, doc, obj: run(db, doc, obj, 'source', _("Source"))
run_citation = lambda db, doc, obj: run(db, doc, obj, 'citation', _("Citation"))
run_source_or_citation = lambda db, doc, obj: run(db, doc, obj,
'source or citation', _("Source or Citation"))
run_place = lambda db, doc, obj: run(db, doc, obj, 'place', _("Place"))
run_media = lambda db, doc, obj: run(db, doc, obj, 'media', _("Media"))
run_note = lambda db, doc, obj: run(db, doc, obj, 'note', _("Note"))
+3
View File
@@ -202,6 +202,9 @@ refitems = [(CATEGORY_QR_PERSON, 'person', _("Person")),
(CATEGORY_QR_PLACE, 'place', _("Place")),
(CATEGORY_QR_MEDIA, 'media', _("Media")),
(CATEGORY_QR_NOTE, 'note', _("Note")),
(CATEGORY_QR_CITATION, 'citation', _("Citation")),
(CATEGORY_QR_SOURCE_OR_CITATION, 'source or citation',
_("Source or Citation"))
]
for (category, item, trans) in refitems:
+2 -2
View File
@@ -46,7 +46,7 @@ import gtk
#
#-------------------------------------------------------------------------
from gui.views.treemodels.citationlistmodel import CitationListModel
from gen.plug import CATEGORY_QR_SOURCE
from gen.plug import CATEGORY_QR_CITATION
import gen.lib
from gui.views.listview import ListView
import Utils
@@ -120,7 +120,7 @@ class CitationListView(ListView):
DEL_MSG = _("Delete the selected citation")
MERGE_MSG = _("Merge the selected citations")
FILTER_TYPE = "Citation"
QR_CATEGORY = CATEGORY_QR_SOURCE
QR_CATEGORY = CATEGORY_QR_CITATION
def __init__(self, pdata, dbstate, uistate, nav_group=0):
+2 -2
View File
@@ -47,7 +47,7 @@ import gtk
#-------------------------------------------------------------------------
from gui.views.listview import LISTTREE
from gui.views.treemodels.citationtreemodel import CitationTreeModel
from gen.plug import CATEGORY_QR_SOURCE
from gen.plug import CATEGORY_QR_SOURCE_OR_CITATION
import gen.lib
from gui.views.listview import ListView
import Utils
@@ -112,7 +112,7 @@ class CitationTreeView(ListView):
DEL_MSG = _("Delete the selected citation or source")
MERGE_MSG = _("Merge the selected citations or selected sources")
FILTER_TYPE = "Citation"
QR_CATEGORY = CATEGORY_QR_SOURCE
QR_CATEGORY = CATEGORY_QR_SOURCE_OR_CITATION
def __init__(self, pdata, dbstate, uistate, nav_group=0):