Add a note gramplet for NoteView
This commit is contained in:
parent
84da4b896b
commit
de3648df39
@ -5,6 +5,7 @@
|
||||
# Copyright (C) 2009 Benny Malengier
|
||||
# Copyright (C) 2011 Nick Hall
|
||||
# Copyright (C) 2011 Tim G L Lyons
|
||||
# Copyright (C) 2020 Matthias Kemmer
|
||||
#
|
||||
# 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
|
||||
@ -772,6 +773,20 @@ register(GRAMPLET,
|
||||
navtypes=["Media"],
|
||||
)
|
||||
|
||||
register(GRAMPLET,
|
||||
id="Note Notes",
|
||||
name=_("Notes"),
|
||||
description = _("Gramplet showing the selected note"),
|
||||
version="1.0.0",
|
||||
gramps_target_version=MODULE_VERSION,
|
||||
status = STABLE,
|
||||
fname="notes.py",
|
||||
height=200,
|
||||
gramplet = 'NoteNotes',
|
||||
gramplet_title=_("Notes"),
|
||||
navtypes=["Note"],
|
||||
)
|
||||
|
||||
register(GRAMPLET,
|
||||
id="Person Citations",
|
||||
name=_("Person Citations"),
|
||||
|
@ -1,7 +1,8 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2011 Nick Hall
|
||||
# Copyright (C) 2011 Tim G L Lyons
|
||||
# Copyright (C) 2011 Tim G L Lyons
|
||||
# Copyright (C) 2020 Matthias Kemmer
|
||||
#
|
||||
# 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
|
||||
@ -369,3 +370,19 @@ class MediaNotes(Notes):
|
||||
self.set_has_data(False)
|
||||
else:
|
||||
self.set_has_data(False)
|
||||
|
||||
class NoteNotes(Notes):
|
||||
"""
|
||||
Display a single note in NoteView.
|
||||
"""
|
||||
def db_changed(self):
|
||||
self.connect(self.dbstate.db, 'note-update', self.update)
|
||||
self.connect_signal('Note', self.update)
|
||||
|
||||
def main(self):
|
||||
self.clear_text()
|
||||
active_handle = self.get_active('Note')
|
||||
if active_handle:
|
||||
active = self.dbstate.db.get_note_from_handle(active_handle)
|
||||
if active:
|
||||
self.texteditor.set_text(active.get_styledtext())
|
||||
|
Loading…
Reference in New Issue
Block a user