Add new bottombar gramplets
svn: r16613
This commit is contained in:
parent
150d13bca6
commit
f5fd46d518
@ -254,6 +254,7 @@ src/plugins/export/ExportXml.py
|
||||
# plugins/gramplet directory
|
||||
src/plugins/gramplet/AgeOnDateGramplet.py
|
||||
src/plugins/gramplet/AgeStats.py
|
||||
src/plugins/gramplet/Attributes.py
|
||||
src/plugins/gramplet/AttributesGramplet.py
|
||||
src/plugins/gramplet/bottombar.gpr.py
|
||||
src/plugins/gramplet/CalendarGramplet.py
|
||||
@ -262,13 +263,14 @@ src/plugins/gramplet/FanChartGramplet.py
|
||||
src/plugins/gramplet/FaqGramplet.py
|
||||
src/plugins/gramplet/GivenNameGramplet.py
|
||||
src/plugins/gramplet/gramplet.gpr.py
|
||||
src/plugins/gramplet/Notes.py
|
||||
src/plugins/gramplet/PedigreeGramplet.py
|
||||
src/plugins/gramplet/PersonAttributes.py
|
||||
src/plugins/gramplet/PersonDetails.py
|
||||
src/plugins/gramplet/PersonResidence.py
|
||||
src/plugins/gramplet/QuickViewGramplet.py
|
||||
src/plugins/gramplet/RelativeGramplet.py
|
||||
src/plugins/gramplet/SessionLogGramplet.py
|
||||
src/plugins/gramplet/Sources.py
|
||||
src/plugins/gramplet/StatsGramplet.py
|
||||
src/plugins/gramplet/SurnameCloudGramplet.py
|
||||
src/plugins/gramplet/ToDoGramplet.py
|
||||
|
@ -294,7 +294,7 @@ src/plugins/tool/phpgedview.glade
|
||||
src/plugins/gramplet/DeepConnections.py
|
||||
src/plugins/gramplet/HeadlineNewsGramplet.py
|
||||
src/plugins/gramplet/NoteGramplet.py
|
||||
src/plugins/gramplet/PersonGallery.py
|
||||
src/plugins/gramplet/Gallery.py
|
||||
src/plugins/gramplet/PluginManagerGramplet.py
|
||||
src/plugins/gramplet/PythonGramplet.py
|
||||
|
||||
|
@ -25,9 +25,9 @@ from gen.plug import Gramplet
|
||||
from gen.ggettext import gettext as _
|
||||
import gtk
|
||||
|
||||
class PersonAttributes(Gramplet):
|
||||
class Attributes(Gramplet):
|
||||
"""
|
||||
Displays the attributes of a person.
|
||||
Displays the attributes of an object.
|
||||
"""
|
||||
def init(self):
|
||||
self.gui.WIDGET = self.build_gui()
|
||||
@ -48,22 +48,13 @@ class PersonAttributes(Gramplet):
|
||||
self.model = ListModel(top, titles, event_func=self.display_report)
|
||||
return top
|
||||
|
||||
def db_changed(self):
|
||||
self.dbstate.db.connect('person-update', self.update)
|
||||
self.update()
|
||||
|
||||
def active_changed(self, handle):
|
||||
self.update()
|
||||
|
||||
def main(self): # return false finishes
|
||||
active_handle = self.get_active('Person')
|
||||
active_person = self.dbstate.db.get_person_from_handle(active_handle)
|
||||
|
||||
self.model.clear()
|
||||
if active_person:
|
||||
for attr in active_person.get_attribute_list():
|
||||
self.model.add((attr.get_type(), attr.get_value()))
|
||||
|
||||
def display_attributes(self, obj):
|
||||
"""
|
||||
Display the attributes of an object.
|
||||
"""
|
||||
for attr in obj.get_attribute_list():
|
||||
self.model.add((attr.get_type(), attr.get_value()))
|
||||
|
||||
def display_report(self, treeview):
|
||||
"""
|
||||
Display the quick report for matching attribute key.
|
||||
@ -75,3 +66,74 @@ class PersonAttributes(Gramplet):
|
||||
self.uistate,
|
||||
'attribute_match',
|
||||
key)
|
||||
|
||||
class PersonAttributes(Attributes):
|
||||
"""
|
||||
Displays the attributes of a person.
|
||||
"""
|
||||
def db_changed(self):
|
||||
self.dbstate.db.connect('person-update', self.update)
|
||||
self.update()
|
||||
|
||||
def active_changed(self, handle):
|
||||
self.update()
|
||||
|
||||
def main(self):
|
||||
active_handle = self.get_active('Person')
|
||||
active = self.dbstate.db.get_person_from_handle(active_handle)
|
||||
|
||||
self.model.clear()
|
||||
if active:
|
||||
self.display_attributes(active)
|
||||
|
||||
class EventAttributes(Attributes):
|
||||
"""
|
||||
Displays the attributes of an event.
|
||||
"""
|
||||
def db_changed(self):
|
||||
self.dbstate.db.connect('event-update', self.update)
|
||||
self.connect_signal('Event', self.update)
|
||||
self.update()
|
||||
|
||||
def main(self):
|
||||
active_handle = self.get_active('Event')
|
||||
active = self.dbstate.db.get_event_from_handle(active_handle)
|
||||
|
||||
self.model.clear()
|
||||
if active:
|
||||
self.display_attributes(active)
|
||||
|
||||
class FamilyAttributes(Attributes):
|
||||
"""
|
||||
Displays the attributes of an event.
|
||||
"""
|
||||
def db_changed(self):
|
||||
self.dbstate.db.connect('family-update', self.update)
|
||||
self.connect_signal('Family', self.update)
|
||||
self.update()
|
||||
|
||||
def main(self):
|
||||
active_handle = self.get_active('Family')
|
||||
active = self.dbstate.db.get_family_from_handle(active_handle)
|
||||
|
||||
self.model.clear()
|
||||
if active:
|
||||
self.display_attributes(active)
|
||||
|
||||
class MediaAttributes(Attributes):
|
||||
"""
|
||||
Displays the attributes of a media object.
|
||||
"""
|
||||
def db_changed(self):
|
||||
self.dbstate.db.connect('media-update', self.update)
|
||||
self.connect_signal('Media', self.update)
|
||||
self.update()
|
||||
|
||||
def main(self):
|
||||
active_handle = self.get_active('Media')
|
||||
active = self.dbstate.db.get_object_from_handle(active_handle)
|
||||
|
||||
self.model.clear()
|
||||
if active:
|
||||
self.display_attributes(active)
|
||||
|
@ -24,9 +24,9 @@ from gen.plug import Gramplet
|
||||
import Utils
|
||||
import gtk
|
||||
|
||||
class PersonGallery(Gramplet):
|
||||
class Gallery(Gramplet):
|
||||
"""
|
||||
Displays details for a person.
|
||||
Displays a gallery of media objects.
|
||||
"""
|
||||
def init(self):
|
||||
self.gui.WIDGET = self.build_gui()
|
||||
@ -44,21 +44,6 @@ class PersonGallery(Gramplet):
|
||||
self.top = gtk.HBox(False, 3)
|
||||
return self.top
|
||||
|
||||
def db_changed(self):
|
||||
self.dbstate.db.connect('person-update', self.update)
|
||||
self.update()
|
||||
|
||||
def active_changed(self, handle):
|
||||
self.update()
|
||||
|
||||
def main(self): # return false finishes
|
||||
active_handle = self.get_active('Person')
|
||||
active_person = self.dbstate.db.get_person_from_handle(active_handle)
|
||||
|
||||
self.clear_images()
|
||||
if active_person:
|
||||
self.load_person_images(active_person)
|
||||
|
||||
def clear_images(self):
|
||||
"""
|
||||
Remove all images from the Gramplet.
|
||||
@ -67,11 +52,11 @@ class PersonGallery(Gramplet):
|
||||
self.top.remove(image)
|
||||
self.image_list = []
|
||||
|
||||
def load_person_images(self, person):
|
||||
def load_images(self, obj):
|
||||
"""
|
||||
Load the primary image into the main form if it exists.
|
||||
"""
|
||||
media_list = person.get_media_list()
|
||||
media_list = obj.get_media_list()
|
||||
for photo in media_list:
|
||||
object_handle = photo.get_reference_handle()
|
||||
obj = self.dbstate.db.get_object_from_handle(object_handle)
|
||||
@ -124,3 +109,74 @@ class PersonGallery(Gramplet):
|
||||
return i
|
||||
except:
|
||||
return None
|
||||
|
||||
class PersonGallery(Gallery):
|
||||
"""
|
||||
Displays a gallery of media objects for a person.
|
||||
"""
|
||||
def db_changed(self):
|
||||
self.dbstate.db.connect('person-update', self.update)
|
||||
self.update()
|
||||
|
||||
def active_changed(self, handle):
|
||||
self.update()
|
||||
|
||||
def main(self):
|
||||
active_handle = self.get_active('Person')
|
||||
active = self.dbstate.db.get_person_from_handle(active_handle)
|
||||
|
||||
self.clear_images()
|
||||
if active:
|
||||
self.load_images(active)
|
||||
|
||||
class EventGallery(Gallery):
|
||||
"""
|
||||
Displays a gallery of media objects for an event.
|
||||
"""
|
||||
def db_changed(self):
|
||||
self.dbstate.db.connect('event-update', self.update)
|
||||
self.connect_signal('Event', self.update)
|
||||
self.update()
|
||||
|
||||
def main(self):
|
||||
active_handle = self.get_active('Event')
|
||||
active = self.dbstate.db.get_event_from_handle(active_handle)
|
||||
|
||||
self.clear_images()
|
||||
if active:
|
||||
self.load_images(active)
|
||||
|
||||
class PlaceGallery(Gallery):
|
||||
"""
|
||||
Displays a gallery of media objects for a place.
|
||||
"""
|
||||
def db_changed(self):
|
||||
self.dbstate.db.connect('place-update', self.update)
|
||||
self.connect_signal('Place', self.update)
|
||||
self.update()
|
||||
|
||||
def main(self):
|
||||
active_handle = self.get_active('Place')
|
||||
active = self.dbstate.db.get_place_from_handle(active_handle)
|
||||
|
||||
self.clear_images()
|
||||
if active:
|
||||
self.load_images(active)
|
||||
|
||||
class SourceGallery(Gallery):
|
||||
"""
|
||||
Displays a gallery of media objects for a source.
|
||||
"""
|
||||
def db_changed(self):
|
||||
self.dbstate.db.connect('event-update', self.update)
|
||||
self.connect_signal('Source', self.update)
|
||||
self.update()
|
||||
|
||||
def main(self):
|
||||
active_handle = self.get_active('Source')
|
||||
active = self.dbstate.db.get_source_from_handle(active_handle)
|
||||
|
||||
self.clear_images()
|
||||
if active:
|
||||
self.load_images(active)
|
||||
|
@ -8,24 +8,26 @@ pkgdatadir = $(datadir)/@PACKAGE@/plugins/gramplet
|
||||
pkgdata_PYTHON = \
|
||||
AgeOnDateGramplet.py \
|
||||
AgeStats.py \
|
||||
Attributes.py \
|
||||
AttributesGramplet.py \
|
||||
bottombar.gpr.py \
|
||||
CalendarGramplet.py \
|
||||
DescendGramplet.py \
|
||||
FanChartGramplet.py \
|
||||
FaqGramplet.py \
|
||||
Filter.py \
|
||||
Filter.py \
|
||||
Gallery.py \
|
||||
GivenNameGramplet.py \
|
||||
gramplet.gpr.py \
|
||||
Notes.py \
|
||||
PedigreeGramplet.py \
|
||||
PersonAttributes.py \
|
||||
PersonDetails.py \
|
||||
PersonGallery.py \
|
||||
PersonResidence.py \
|
||||
PluginManagerGramplet.py\
|
||||
QuickViewGramplet.py \
|
||||
RelativeGramplet.py \
|
||||
SessionLogGramplet.py \
|
||||
Sources.py \
|
||||
StatsGramplet.py \
|
||||
SurnameCloudGramplet.py \
|
||||
ToDoGramplet.py \
|
||||
|
218
src/plugins/gramplet/Notes.py
Normal file
218
src/plugins/gramplet/Notes.py
Normal file
@ -0,0 +1,218 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2011 Nick Hall
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
from gen.plug import Gramplet
|
||||
from gui.widgets.styledtexteditor import StyledTextEditor
|
||||
from gui.widgets import SimpleButton
|
||||
from gen.lib import StyledText
|
||||
from gen.ggettext import gettext as _
|
||||
import gtk
|
||||
|
||||
class Notes(Gramplet):
|
||||
"""
|
||||
Displays the notes for an object.
|
||||
"""
|
||||
def init(self):
|
||||
self.gui.WIDGET = self.build_gui()
|
||||
self.gui.get_container_widget().remove(self.gui.textview)
|
||||
self.gui.get_container_widget().add_with_viewport(self.gui.WIDGET)
|
||||
self.gui.WIDGET.show()
|
||||
|
||||
def build_gui(self):
|
||||
"""
|
||||
Build the GUI interface.
|
||||
"""
|
||||
top = gtk.VBox(False)
|
||||
|
||||
hbox = gtk.HBox()
|
||||
self.left = SimpleButton(gtk.STOCK_GO_BACK, self.left_clicked)
|
||||
hbox.pack_start(self.left, False, False)
|
||||
self.right = SimpleButton(gtk.STOCK_GO_FORWARD, self.right_clicked)
|
||||
hbox.pack_start(self.right, False, False)
|
||||
self.page = gtk.Label()
|
||||
hbox.pack_end(self.page, False, False, 10)
|
||||
|
||||
scrolledwindow = gtk.ScrolledWindow()
|
||||
scrolledwindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
|
||||
self.texteditor = StyledTextEditor()
|
||||
self.texteditor.set_editable(False)
|
||||
self.texteditor.set_wrap_mode(gtk.WRAP_WORD)
|
||||
scrolledwindow.add(self.texteditor)
|
||||
|
||||
top.pack_start(hbox, False, False)
|
||||
top.pack_start(scrolledwindow, True, True)
|
||||
top.show_all()
|
||||
return top
|
||||
|
||||
def get_notes(self, obj):
|
||||
"""
|
||||
Get the note list for the current object.
|
||||
"""
|
||||
self.left.set_sensitive(False)
|
||||
self.right.set_sensitive(False)
|
||||
self.texteditor.set_text(StyledText())
|
||||
self.note_list = obj.get_note_list()
|
||||
self.page.set_text('')
|
||||
if len(self.note_list) > 0:
|
||||
if len(self.note_list) > 1:
|
||||
self.right.set_sensitive(True)
|
||||
self.current = 0
|
||||
self.display_note()
|
||||
|
||||
def display_note(self):
|
||||
"""
|
||||
Display the current note.
|
||||
"""
|
||||
note_handle = self.note_list[self.current]
|
||||
note = self.dbstate.db.get_note_from_handle(note_handle)
|
||||
self.texteditor.set_text(note.get_styledtext())
|
||||
self.page.set_text(_('%d of %d') % (self.current + 1,
|
||||
len(self.note_list)))
|
||||
|
||||
def left_clicked(self, button):
|
||||
"""
|
||||
Display the previous note.
|
||||
"""
|
||||
if self.current > 0:
|
||||
self.current -= 1
|
||||
self.right.set_sensitive(True)
|
||||
if self.current == 0:
|
||||
self.left.set_sensitive(False)
|
||||
self.display_note()
|
||||
|
||||
def right_clicked(self, button):
|
||||
"""
|
||||
Display the next note.
|
||||
"""
|
||||
if self.current < len(self.note_list) - 1:
|
||||
self.current += 1
|
||||
self.left.set_sensitive(True)
|
||||
if self.current == len(self.note_list) - 1:
|
||||
self.right.set_sensitive(False)
|
||||
self.display_note()
|
||||
|
||||
class PersonNotes(Notes):
|
||||
"""
|
||||
Displays the notes for a person.
|
||||
"""
|
||||
def db_changed(self):
|
||||
self.dbstate.db.connect('person-update', self.update)
|
||||
self.update()
|
||||
|
||||
def active_changed(self, handle):
|
||||
self.update()
|
||||
|
||||
def main(self):
|
||||
active_handle = self.get_active('Person')
|
||||
active = self.dbstate.db.get_person_from_handle(active_handle)
|
||||
if active:
|
||||
self.get_notes(active)
|
||||
|
||||
class EventNotes(Notes):
|
||||
"""
|
||||
Displays the notes for an event.
|
||||
"""
|
||||
def db_changed(self):
|
||||
self.dbstate.db.connect('event-update', self.update)
|
||||
self.connect_signal('Event', self.update)
|
||||
self.update()
|
||||
|
||||
def main(self):
|
||||
active_handle = self.get_active('Event')
|
||||
active = self.dbstate.db.get_event_from_handle(active_handle)
|
||||
if active:
|
||||
self.get_notes(active)
|
||||
|
||||
class FamilyNotes(Notes):
|
||||
"""
|
||||
Displays the notes for a family.
|
||||
"""
|
||||
def db_changed(self):
|
||||
self.dbstate.db.connect('family-update', self.update)
|
||||
self.connect_signal('Family', self.update)
|
||||
self.update()
|
||||
|
||||
def main(self):
|
||||
active_handle = self.get_active('Family')
|
||||
active = self.dbstate.db.get_family_from_handle(active_handle)
|
||||
if active:
|
||||
self.get_notes(active)
|
||||
|
||||
class PlaceNotes(Notes):
|
||||
"""
|
||||
Displays the notes for a place.
|
||||
"""
|
||||
def db_changed(self):
|
||||
self.dbstate.db.connect('place-update', self.update)
|
||||
self.connect_signal('Place', self.update)
|
||||
self.update()
|
||||
|
||||
def main(self):
|
||||
active_handle = self.get_active('Place')
|
||||
active = self.dbstate.db.get_place_from_handle(active_handle)
|
||||
if active:
|
||||
self.get_notes(active)
|
||||
|
||||
class SourceNotes(Notes):
|
||||
"""
|
||||
Displays the notes for a source.
|
||||
"""
|
||||
def db_changed(self):
|
||||
self.dbstate.db.connect('source-update', self.update)
|
||||
self.connect_signal('Source', self.update)
|
||||
self.update()
|
||||
|
||||
def main(self):
|
||||
active_handle = self.get_active('Source')
|
||||
active = self.dbstate.db.get_source_from_handle(active_handle)
|
||||
if active:
|
||||
self.get_notes(active)
|
||||
|
||||
class RepositoryNotes(Notes):
|
||||
"""
|
||||
Displays the notes for a repository.
|
||||
"""
|
||||
def db_changed(self):
|
||||
self.dbstate.db.connect('repository-update', self.update)
|
||||
self.connect_signal('Repository', self.update)
|
||||
self.update()
|
||||
|
||||
def main(self):
|
||||
active_handle = self.get_active('Repository')
|
||||
active = self.dbstate.db.get_repository_from_handle(active_handle)
|
||||
if active:
|
||||
self.get_notes(active)
|
||||
|
||||
class MediaNotes(Notes):
|
||||
"""
|
||||
Displays the notes for a media object.
|
||||
"""
|
||||
def db_changed(self):
|
||||
self.dbstate.db.connect('media-update', self.update)
|
||||
self.connect_signal('Media', self.update)
|
||||
self.update()
|
||||
|
||||
def main(self):
|
||||
active_handle = self.get_active('Media')
|
||||
active = self.dbstate.db.get_object_from_handle(active_handle)
|
||||
if active:
|
||||
self.get_notes(active)
|
||||
|
@ -25,6 +25,7 @@ from ListModel import ListModel, NOSORT
|
||||
from gen.plug import Gramplet
|
||||
from gen.ggettext import gettext as _
|
||||
import DateHandler
|
||||
import Errors
|
||||
import gtk
|
||||
|
||||
class PersonResidence(Gramplet):
|
||||
|
181
src/plugins/gramplet/Sources.py
Normal file
181
src/plugins/gramplet/Sources.py
Normal file
@ -0,0 +1,181 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2011 Nick Hall
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
from gui.editors import EditSource
|
||||
from ListModel import ListModel, NOSORT
|
||||
from gen.plug import Gramplet
|
||||
from gen.ggettext import gettext as _
|
||||
import Errors
|
||||
import gtk
|
||||
|
||||
class Sources(Gramplet):
|
||||
"""
|
||||
Displays the sources for an object.
|
||||
"""
|
||||
def init(self):
|
||||
self.gui.WIDGET = self.build_gui()
|
||||
self.gui.get_container_widget().remove(self.gui.textview)
|
||||
self.gui.get_container_widget().add_with_viewport(self.gui.WIDGET)
|
||||
self.gui.WIDGET.show()
|
||||
|
||||
def build_gui(self):
|
||||
"""
|
||||
Build the GUI interface.
|
||||
"""
|
||||
tip = _('Double-click on a row to edit the selected source.')
|
||||
self.set_tooltip(tip)
|
||||
top = gtk.TreeView()
|
||||
titles = [('', NOSORT, 50,),
|
||||
(_('Source'), 1, 200),
|
||||
(_('Reference'), 2, 300),
|
||||
(_('Author'), 3, 100)]
|
||||
self.model = ListModel(top, titles, event_func=self.edit_source)
|
||||
return top
|
||||
|
||||
def display_sources(self, obj):
|
||||
"""
|
||||
Display the sources for the active object.
|
||||
"""
|
||||
for source_ref in obj.get_source_references():
|
||||
self.add_source_ref(source_ref)
|
||||
|
||||
def add_source_ref(self, source_ref):
|
||||
"""
|
||||
Add a source reference to the model.
|
||||
"""
|
||||
page = source_ref.get_page()
|
||||
source = self.dbstate.db.get_source_from_handle(source_ref.ref)
|
||||
title = source.get_title()
|
||||
author = source.get_author()
|
||||
self.model.add((source_ref.ref, title, page, author))
|
||||
|
||||
def edit_source(self, treeview):
|
||||
"""
|
||||
Edit the selected source.
|
||||
"""
|
||||
model, iter_ = treeview.get_selection().get_selected()
|
||||
if iter_:
|
||||
handle = model.get_value(iter_, 0)
|
||||
try:
|
||||
source = self.dbstate.db.get_source_from_handle(handle)
|
||||
EditSource(self.dbstate, self.uistate, [], source)
|
||||
except Errors.WindowActiveError:
|
||||
pass
|
||||
|
||||
class PersonSources(Sources):
|
||||
"""
|
||||
Displays the sources for a person.
|
||||
"""
|
||||
def db_changed(self):
|
||||
self.dbstate.db.connect('person-update', self.update)
|
||||
self.update()
|
||||
|
||||
def active_changed(self, handle):
|
||||
self.update()
|
||||
|
||||
def main(self):
|
||||
active_handle = self.get_active('Person')
|
||||
active = self.dbstate.db.get_person_from_handle(active_handle)
|
||||
|
||||
self.model.clear()
|
||||
if active:
|
||||
self.display_sources(active)
|
||||
|
||||
class EventSources(Sources):
|
||||
"""
|
||||
Displays the sources for an event.
|
||||
"""
|
||||
def db_changed(self):
|
||||
self.dbstate.db.connect('event-update', self.update)
|
||||
self.connect_signal('Event', self.update)
|
||||
self.update()
|
||||
|
||||
def active_changed(self, handle):
|
||||
self.update()
|
||||
|
||||
def main(self):
|
||||
active_handle = self.get_active('Event')
|
||||
active = self.dbstate.db.get_event_from_handle(active_handle)
|
||||
|
||||
self.model.clear()
|
||||
if active:
|
||||
self.display_sources(active)
|
||||
|
||||
class FamilySources(Sources):
|
||||
"""
|
||||
Displays the sources for a family.
|
||||
"""
|
||||
def db_changed(self):
|
||||
self.dbstate.db.connect('family-update', self.update)
|
||||
self.connect_signal('Family', self.update)
|
||||
self.update()
|
||||
|
||||
def active_changed(self, handle):
|
||||
self.update()
|
||||
|
||||
def main(self):
|
||||
active_handle = self.get_active('Family')
|
||||
active = self.dbstate.db.get_family_from_handle(active_handle)
|
||||
|
||||
self.model.clear()
|
||||
if active:
|
||||
self.display_sources(active)
|
||||
|
||||
class PlaceSources(Sources):
|
||||
"""
|
||||
Displays the sources for a place.
|
||||
"""
|
||||
def db_changed(self):
|
||||
self.dbstate.db.connect('place-update', self.update)
|
||||
self.connect_signal('Place', self.update)
|
||||
self.update()
|
||||
|
||||
def active_changed(self, handle):
|
||||
self.update()
|
||||
|
||||
def main(self):
|
||||
active_handle = self.get_active('Place')
|
||||
active = self.dbstate.db.get_place_from_handle(active_handle)
|
||||
|
||||
self.model.clear()
|
||||
if active:
|
||||
self.display_sources(active)
|
||||
|
||||
class MediaSources(Sources):
|
||||
"""
|
||||
Displays the sources for a media object.
|
||||
"""
|
||||
def db_changed(self):
|
||||
self.dbstate.db.connect('media-update', self.update)
|
||||
self.connect_signal('Media', self.update)
|
||||
self.update()
|
||||
|
||||
def active_changed(self, handle):
|
||||
self.update()
|
||||
|
||||
def main(self):
|
||||
active_handle = self.get_active('Media')
|
||||
active = self.dbstate.db.get_object_from_handle(active_handle)
|
||||
|
||||
self.model.clear()
|
||||
if active:
|
||||
self.display_sources(active)
|
||||
|
@ -38,19 +38,6 @@ register(GRAMPLET,
|
||||
gramplet_title=_("Details"),
|
||||
)
|
||||
|
||||
register(GRAMPLET,
|
||||
id="Person Gallery Gramplet",
|
||||
name=_("Person Gallery Gramplet"),
|
||||
description = _("Gramplet showing media objects for a person"),
|
||||
version="1.0.0",
|
||||
gramps_target_version="3.3",
|
||||
status = STABLE,
|
||||
fname="PersonGallery.py",
|
||||
height=200,
|
||||
gramplet = 'PersonGallery',
|
||||
gramplet_title=_("Gallery"),
|
||||
)
|
||||
|
||||
register(GRAMPLET,
|
||||
id="Person Residence Gramplet",
|
||||
name=_("Person Residence Gramplet"),
|
||||
@ -64,6 +51,58 @@ register(GRAMPLET,
|
||||
gramplet_title=_("Residence"),
|
||||
)
|
||||
|
||||
register(GRAMPLET,
|
||||
id="Person Gallery Gramplet",
|
||||
name=_("Person Gallery Gramplet"),
|
||||
description = _("Gramplet showing media objects for a person"),
|
||||
version="1.0.0",
|
||||
gramps_target_version="3.3",
|
||||
status = STABLE,
|
||||
fname="Gallery.py",
|
||||
height=200,
|
||||
gramplet = 'PersonGallery',
|
||||
gramplet_title=_("Gallery"),
|
||||
)
|
||||
|
||||
register(GRAMPLET,
|
||||
id="Event Gallery Gramplet",
|
||||
name=_("Event Gallery Gramplet"),
|
||||
description = _("Gramplet showing media objects for an event"),
|
||||
version="1.0.0",
|
||||
gramps_target_version="3.3",
|
||||
status = STABLE,
|
||||
fname="Gallery.py",
|
||||
height=200,
|
||||
gramplet = 'EventGallery',
|
||||
gramplet_title=_("Gallery"),
|
||||
)
|
||||
|
||||
register(GRAMPLET,
|
||||
id="Place Gallery Gramplet",
|
||||
name=_("Place Gallery Gramplet"),
|
||||
description = _("Gramplet showing media objects for a place"),
|
||||
version="1.0.0",
|
||||
gramps_target_version="3.3",
|
||||
status = STABLE,
|
||||
fname="Gallery.py",
|
||||
height=200,
|
||||
gramplet = 'PlaceGallery',
|
||||
gramplet_title=_("Gallery"),
|
||||
)
|
||||
|
||||
register(GRAMPLET,
|
||||
id="Source Gallery Gramplet",
|
||||
name=_("Source Gallery Gramplet"),
|
||||
description = _("Gramplet showing media objects for a source"),
|
||||
version="1.0.0",
|
||||
gramps_target_version="3.3",
|
||||
status = STABLE,
|
||||
fname="Gallery.py",
|
||||
height=200,
|
||||
gramplet = 'SourceGallery',
|
||||
gramplet_title=_("Gallery"),
|
||||
)
|
||||
|
||||
register(GRAMPLET,
|
||||
id="Person Attributes Gramplet",
|
||||
name=_("Person Attributes Gramplet"),
|
||||
@ -71,12 +110,220 @@ register(GRAMPLET,
|
||||
version="1.0.0",
|
||||
gramps_target_version="3.3",
|
||||
status = STABLE,
|
||||
fname="PersonAttributes.py",
|
||||
fname="Attributes.py",
|
||||
height=200,
|
||||
gramplet = 'PersonAttributes',
|
||||
gramplet_title=_("Attributes"),
|
||||
)
|
||||
|
||||
register(GRAMPLET,
|
||||
id="Event Attributes Gramplet",
|
||||
name=_("Event Attributes Gramplet"),
|
||||
description = _("Gramplet showing the attributes of an event"),
|
||||
version="1.0.0",
|
||||
gramps_target_version="3.3",
|
||||
status = STABLE,
|
||||
fname="Attributes.py",
|
||||
height=200,
|
||||
gramplet = 'EventAttributes',
|
||||
gramplet_title=_("Attributes"),
|
||||
)
|
||||
|
||||
register(GRAMPLET,
|
||||
id="Family Attributes Gramplet",
|
||||
name=_("Family Attributes Gramplet"),
|
||||
description = _("Gramplet showing the attributes of a family"),
|
||||
version="1.0.0",
|
||||
gramps_target_version="3.3",
|
||||
status = STABLE,
|
||||
fname="Attributes.py",
|
||||
height=200,
|
||||
gramplet = 'FamilyAttributes',
|
||||
gramplet_title=_("Attributes"),
|
||||
)
|
||||
|
||||
register(GRAMPLET,
|
||||
id="Media Attributes Gramplet",
|
||||
name=_("Media Attributes Gramplet"),
|
||||
description = _("Gramplet showing the attributes of a media object"),
|
||||
version="1.0.0",
|
||||
gramps_target_version="3.3",
|
||||
status = STABLE,
|
||||
fname="Attributes.py",
|
||||
height=200,
|
||||
gramplet = 'MediaAttributes',
|
||||
gramplet_title=_("Attributes"),
|
||||
)
|
||||
|
||||
register(GRAMPLET,
|
||||
id="Person Notes Gramplet",
|
||||
name=_("Person Notes Gramplet"),
|
||||
description = _("Gramplet showing the notes for a person"),
|
||||
version="1.0.0",
|
||||
gramps_target_version="3.3",
|
||||
status = STABLE,
|
||||
fname="Notes.py",
|
||||
height=200,
|
||||
gramplet = 'PersonNotes',
|
||||
gramplet_title=_("Notes"),
|
||||
)
|
||||
|
||||
register(GRAMPLET,
|
||||
id="Event Notes Gramplet",
|
||||
name=_("Event Notes Gramplet"),
|
||||
description = _("Gramplet showing the notes for an event"),
|
||||
version="1.0.0",
|
||||
gramps_target_version="3.3",
|
||||
status = STABLE,
|
||||
fname="Notes.py",
|
||||
height=200,
|
||||
gramplet = 'EventNotes',
|
||||
gramplet_title=_("Notes"),
|
||||
)
|
||||
|
||||
register(GRAMPLET,
|
||||
id="Family Notes Gramplet",
|
||||
name=_("Family Notes Gramplet"),
|
||||
description = _("Gramplet showing the notes for a family"),
|
||||
version="1.0.0",
|
||||
gramps_target_version="3.3",
|
||||
status = STABLE,
|
||||
fname="Notes.py",
|
||||
height=200,
|
||||
gramplet = 'FamilyNotes',
|
||||
gramplet_title=_("Notes"),
|
||||
)
|
||||
|
||||
register(GRAMPLET,
|
||||
id="Place Notes Gramplet",
|
||||
name=_("Place Notes Gramplet"),
|
||||
description = _("Gramplet showing the notes for a place"),
|
||||
version="1.0.0",
|
||||
gramps_target_version="3.3",
|
||||
status = STABLE,
|
||||
fname="Notes.py",
|
||||
height=200,
|
||||
gramplet = 'PlaceNotes',
|
||||
gramplet_title=_("Notes"),
|
||||
)
|
||||
|
||||
register(GRAMPLET,
|
||||
id="Source Notes Gramplet",
|
||||
name=_("Source Notes Gramplet"),
|
||||
description = _("Gramplet showing the notes for a source"),
|
||||
version="1.0.0",
|
||||
gramps_target_version="3.3",
|
||||
status = STABLE,
|
||||
fname="Notes.py",
|
||||
height=200,
|
||||
gramplet = 'SourceNotes',
|
||||
gramplet_title=_("Notes"),
|
||||
)
|
||||
|
||||
register(GRAMPLET,
|
||||
id="Repository Notes Gramplet",
|
||||
name=_("Repository Notes Gramplet"),
|
||||
description = _("Gramplet showing the notes for a repository"),
|
||||
version="1.0.0",
|
||||
gramps_target_version="3.3",
|
||||
status = STABLE,
|
||||
fname="Notes.py",
|
||||
height=200,
|
||||
gramplet = 'RepositoryNotes',
|
||||
gramplet_title=_("Notes"),
|
||||
)
|
||||
|
||||
register(GRAMPLET,
|
||||
id="Media Notes Gramplet",
|
||||
name=_("Media Notes Gramplet"),
|
||||
description = _("Gramplet showing the notes for a media object"),
|
||||
version="1.0.0",
|
||||
gramps_target_version="3.3",
|
||||
status = STABLE,
|
||||
fname="Notes.py",
|
||||
height=200,
|
||||
gramplet = 'MediaNotes',
|
||||
gramplet_title=_("Notes"),
|
||||
)
|
||||
|
||||
register(GRAMPLET,
|
||||
id="Person Sources Gramplet",
|
||||
name=_("Person Sources Gramplet"),
|
||||
description = _("Gramplet showing the sources for a person"),
|
||||
version="1.0.0",
|
||||
gramps_target_version="3.3",
|
||||
status = STABLE,
|
||||
fname="Sources.py",
|
||||
height=200,
|
||||
gramplet = 'PersonSources',
|
||||
gramplet_title=_("Sources"),
|
||||
)
|
||||
|
||||
register(GRAMPLET,
|
||||
id="Event Sources Gramplet",
|
||||
name=_("Event Sources Gramplet"),
|
||||
description = _("Gramplet showing the sources for an event"),
|
||||
version="1.0.0",
|
||||
gramps_target_version="3.3",
|
||||
status = STABLE,
|
||||
fname="Sources.py",
|
||||
height=200,
|
||||
gramplet = 'EventSources',
|
||||
gramplet_title=_("Sources"),
|
||||
)
|
||||
|
||||
register(GRAMPLET,
|
||||
id="Family Sources Gramplet",
|
||||
name=_("Family Sources Gramplet"),
|
||||
description = _("Gramplet showing the sources for a family"),
|
||||
version="1.0.0",
|
||||
gramps_target_version="3.3",
|
||||
status = STABLE,
|
||||
fname="Sources.py",
|
||||
height=200,
|
||||
gramplet = 'FamilySources',
|
||||
gramplet_title=_("Sources"),
|
||||
)
|
||||
|
||||
register(GRAMPLET,
|
||||
id="Place Sources Gramplet",
|
||||
name=_("Place Sources Gramplet"),
|
||||
description = _("Gramplet showing the sources for a place"),
|
||||
version="1.0.0",
|
||||
gramps_target_version="3.3",
|
||||
status = STABLE,
|
||||
fname="Sources.py",
|
||||
height=200,
|
||||
gramplet = 'PlaceSources',
|
||||
gramplet_title=_("Sources"),
|
||||
)
|
||||
|
||||
register(GRAMPLET,
|
||||
id="Media Sources Gramplet",
|
||||
name=_("Media Sources Gramplet"),
|
||||
description = _("Gramplet showing the sources for a media object"),
|
||||
version="1.0.0",
|
||||
gramps_target_version="3.3",
|
||||
status = STABLE,
|
||||
fname="Sources.py",
|
||||
height=200,
|
||||
gramplet = 'MediaSources',
|
||||
gramplet_title=_("Sources"),
|
||||
)
|
||||
|
||||
register(GRAMPLET,
|
||||
id="Person Children Gramplet",
|
||||
name=_("Person Children Gramplet"),
|
||||
description = _("Gramplet showing the cildren of a person"),
|
||||
version="1.0.0",
|
||||
gramps_target_version="3.3",
|
||||
status = STABLE,
|
||||
fname="Children.py",
|
||||
height=200,
|
||||
gramplet = 'PersonChildren',
|
||||
gramplet_title=_("Children"),
|
||||
)
|
||||
|
||||
register(GRAMPLET,
|
||||
id="Person Filter Gramplet",
|
||||
name=_("Person Filter Gramplet"),
|
||||
|
@ -447,4 +447,6 @@ class BasePersonView(ListView):
|
||||
("Person Details Gramplet",
|
||||
"Person Gallery Gramplet",
|
||||
"Person Residence Gramplet",
|
||||
"Person Sources Gramplet",
|
||||
"Person Notes Gramplet",
|
||||
"Person Attributes Gramplet"))
|
||||
|
@ -425,7 +425,9 @@ class PlaceBaseView(ListView):
|
||||
Define the default gramplets for the sidebar and bottombar.
|
||||
"""
|
||||
return (("Place Filter Gramplet",),
|
||||
())
|
||||
("Place Gallery Gramplet",
|
||||
"Place Sources Gramplet",
|
||||
"Place Notes Gramplet"))
|
||||
|
||||
def make_callback(func, val):
|
||||
return lambda x: func(val)
|
||||
|
@ -289,4 +289,7 @@ class EventView(ListView):
|
||||
Define the default gramplets for the sidebar and bottombar.
|
||||
"""
|
||||
return (("Event Filter Gramplet",),
|
||||
())
|
||||
("Event Gallery Gramplet",
|
||||
"Event Sources Gramplet",
|
||||
"Event Notes Gramplet",
|
||||
"Event Attributes Gramplet"))
|
||||
|
@ -344,4 +344,6 @@ class FamilyView(ListView):
|
||||
Define the default gramplets for the sidebar and bottombar.
|
||||
"""
|
||||
return (("Family Filter Gramplet",),
|
||||
())
|
||||
("Family Sources Gramplet",
|
||||
"Family Notes Gramplet",
|
||||
"Family Attributes Gramplet"))
|
||||
|
@ -493,4 +493,6 @@ class MediaView(ListView):
|
||||
Define the default gramplets for the sidebar and bottombar.
|
||||
"""
|
||||
return (("Media Filter Gramplet",),
|
||||
())
|
||||
("Media Sources Gramplet",
|
||||
"Media Notes Gramplet",
|
||||
"Media Attributes Gramplet"))
|
||||
|
@ -274,4 +274,4 @@ class RepositoryView(ListView):
|
||||
Define the default gramplets for the sidebar and bottombar.
|
||||
"""
|
||||
return (("Repository Filter Gramplet",),
|
||||
())
|
||||
("Repository Notes Gramplet",))
|
||||
|
@ -251,4 +251,5 @@ class SourceView(ListView):
|
||||
Define the default gramplets for the sidebar and bottombar.
|
||||
"""
|
||||
return (("Source Filter Gramplet",),
|
||||
())
|
||||
("Source Gallery Gramplet",
|
||||
"Source Notes Gramplet"))
|
||||
|
Loading…
Reference in New Issue
Block a user