More pylint improvements
This commit is contained in:
@ -21,22 +21,16 @@ AgeOnDateGramplet computes the age for everyone thought to be alive
|
|||||||
on a particular date.
|
on a particular date.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# Python modules
|
|
||||||
#
|
|
||||||
#------------------------------------------------------------------------
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Gramps modules
|
# Gramps modules
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
from gramps.gen.plug import Gramplet
|
from gramps.gen.plug import Gramplet
|
||||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
|
||||||
_ = glocale.translation.sgettext
|
|
||||||
from gramps.gen.datehandler import parser
|
from gramps.gen.datehandler import parser
|
||||||
from gramps.gui.plug.quick import run_quick_report_by_name
|
from gramps.gui.plug.quick import run_quick_report_by_name
|
||||||
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.translation.sgettext
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
@ -28,7 +28,6 @@ This Gramplet shows textual distributions of age breakdowns of various types.
|
|||||||
# Python modules
|
# Python modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
@ -36,11 +35,10 @@ from collections import defaultdict
|
|||||||
# Gramps modules
|
# Gramps modules
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
|
|
||||||
from gramps.gen.plug import Gramplet
|
from gramps.gen.plug import Gramplet
|
||||||
|
from gramps.gen.lib import ChildRefType
|
||||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
_ = glocale.translation.gettext
|
_ = glocale.translation.gettext
|
||||||
from gramps.gen.lib import ChildRefType
|
|
||||||
|
|
||||||
class AgeStatsGramplet(Gramplet):
|
class AgeStatsGramplet(Gramplet):
|
||||||
|
|
||||||
@ -269,13 +267,16 @@ class AgeStatsGramplet(Gramplet):
|
|||||||
max_bin = float(max(bin))
|
max_bin = float(max(bin))
|
||||||
if max_bin != 0:
|
if max_bin != 0:
|
||||||
i = 0
|
i = 0
|
||||||
self.append_text("--------" +
|
self.append_text(
|
||||||
|
"--------" +
|
||||||
self.format("", graph_width-4, fill="-", borders="++") +
|
self.format("", graph_width-4, fill="-", borders="++") +
|
||||||
"-----\n")
|
"-----\n")
|
||||||
self.append_text(column.center(8) +
|
self.append_text(
|
||||||
|
column.center(8) +
|
||||||
self.format(title, graph_width-4, align="center") +
|
self.format(title, graph_width-4, align="center") +
|
||||||
" % " + "\n")
|
" % " + "\n")
|
||||||
self.append_text("--------" +
|
self.append_text(
|
||||||
|
"--------" +
|
||||||
self.format("", graph_width-4, fill="-", borders="++") +
|
self.format("", graph_width-4, fill="-", borders="++") +
|
||||||
"-----\n")
|
"-----\n")
|
||||||
for bin in bin:
|
for bin in bin:
|
||||||
@ -292,10 +293,12 @@ class AgeStatsGramplet(Gramplet):
|
|||||||
self.append_text(glocale.format("%#5.2f", procent))
|
self.append_text(glocale.format("%#5.2f", procent))
|
||||||
self.append_text("\n")
|
self.append_text("\n")
|
||||||
i += 1
|
i += 1
|
||||||
self.append_text("--------" +
|
self.append_text(
|
||||||
|
"--------" +
|
||||||
self.format("", graph_width-4, fill="-", borders="++") +
|
self.format("", graph_width-4, fill="-", borders="++") +
|
||||||
"-----\n")
|
"-----\n")
|
||||||
self.append_text(" % " +
|
self.append_text(
|
||||||
|
" % " +
|
||||||
self.ticks(graph_width-4, start=0,
|
self.ticks(graph_width-4, start=0,
|
||||||
stop=int(max_bin/(float(sum(hash.values())))*100)) +
|
stop=int(max_bin/(float(sum(hash.values())))*100)) +
|
||||||
"\n\n")
|
"\n\n")
|
||||||
|
@ -45,7 +45,9 @@ from gramps.gen.const import GRAMPS_LOCALE as glocale
|
|||||||
_ = glocale.translation.gettext
|
_ = glocale.translation.gettext
|
||||||
|
|
||||||
class Ancestor(Gramplet):
|
class Ancestor(Gramplet):
|
||||||
|
"""
|
||||||
|
Gramplet to display ancestors of the active person.
|
||||||
|
"""
|
||||||
def init(self):
|
def init(self):
|
||||||
self.gui.WIDGET = self.build_gui()
|
self.gui.WIDGET = self.build_gui()
|
||||||
self.gui.get_container_widget().remove(self.gui.textview)
|
self.gui.get_container_widget().remove(self.gui.textview)
|
||||||
@ -120,6 +122,9 @@ class Ancestor(Gramplet):
|
|||||||
self.set_has_data(False)
|
self.set_has_data(False)
|
||||||
|
|
||||||
def add_to_tree(self, depth, parent_id, person_handle):
|
def add_to_tree(self, depth, parent_id, person_handle):
|
||||||
|
"""
|
||||||
|
Add a person to the tree.
|
||||||
|
"""
|
||||||
if depth > config.get('behavior.generation-depth'):
|
if depth > config.get('behavior.generation-depth'):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -17,12 +17,23 @@
|
|||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
#
|
#
|
||||||
|
|
||||||
from gramps.gui.listmodel import ListModel, NOSORT
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Gtk modules
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
from gi.repository import Gtk
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Gramps modules
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
from gramps.gui.listmodel import ListModel
|
||||||
from gramps.gui.plug.quick import run_quick_report_by_name
|
from gramps.gui.plug.quick import run_quick_report_by_name
|
||||||
from gramps.gen.plug import Gramplet
|
from gramps.gen.plug import Gramplet
|
||||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
_ = glocale.translation.gettext
|
_ = glocale.translation.gettext
|
||||||
from gi.repository import Gtk
|
|
||||||
|
|
||||||
class Attributes(Gramplet):
|
class Attributes(Gramplet):
|
||||||
"""
|
"""
|
||||||
|
@ -18,13 +18,24 @@
|
|||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
#
|
#
|
||||||
|
|
||||||
from gramps.gui.listmodel import ListModel, NOSORT
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Gtk modules
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
from gi.repository import Gtk
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Gramps modules
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
from gramps.gui.listmodel import ListModel
|
||||||
from gramps.gen.utils.db import navigation_label
|
from gramps.gen.utils.db import navigation_label
|
||||||
from gramps.gen.plug import Gramplet
|
from gramps.gen.plug import Gramplet
|
||||||
from gramps.gui.utils import edit_object
|
from gramps.gui.utils import edit_object
|
||||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
_ = glocale.translation.gettext
|
_ = glocale.translation.gettext
|
||||||
from gi.repository import Gtk
|
|
||||||
|
|
||||||
class Backlinks(Gramplet):
|
class Backlinks(Gramplet):
|
||||||
"""
|
"""
|
||||||
|
@ -16,16 +16,24 @@
|
|||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Gtk modules
|
||||||
|
#
|
||||||
|
#------------------------------------------------------------------------
|
||||||
|
from gi.repository import Gtk
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Gramps modules
|
# Gramps modules
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
from gramps.gen.plug import Gramplet
|
from gramps.gen.plug import Gramplet
|
||||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
|
||||||
_ = glocale.translation.sgettext
|
|
||||||
from gramps.gui.plug.quick import run_quick_report_by_name
|
from gramps.gui.plug.quick import run_quick_report_by_name
|
||||||
from gramps.gen.lib import Date
|
from gramps.gen.lib import Date
|
||||||
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.translation.sgettext
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -33,11 +41,14 @@ from gramps.gen.lib import Date
|
|||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
class CalendarGramplet(Gramplet):
|
class CalendarGramplet(Gramplet):
|
||||||
|
"""
|
||||||
|
Gramplet showing a calendar of events.
|
||||||
|
"""
|
||||||
def init(self):
|
def init(self):
|
||||||
from gi.repository import Gtk
|
|
||||||
self.set_tooltip(_("Double-click a day for details"))
|
self.set_tooltip(_("Double-click a day for details"))
|
||||||
self.gui.calendar = Gtk.Calendar()
|
self.gui.calendar = Gtk.Calendar()
|
||||||
self.gui.calendar.connect('day-selected-double-click', self.double_click)
|
self.gui.calendar.connect('day-selected-double-click',
|
||||||
|
self.double_click)
|
||||||
self.gui.calendar.set_display_options(
|
self.gui.calendar.set_display_options(
|
||||||
Gtk.CalendarDisplayOptions.SHOW_HEADING)
|
Gtk.CalendarDisplayOptions.SHOW_HEADING)
|
||||||
self.gui.get_container_widget().remove(self.gui.textview)
|
self.gui.get_container_widget().remove(self.gui.textview)
|
||||||
@ -45,13 +56,14 @@ class CalendarGramplet(Gramplet):
|
|||||||
vbox.pack_start(self.gui.calendar, False, False, 0)
|
vbox.pack_start(self.gui.calendar, False, False, 0)
|
||||||
self.gui.get_container_widget().add(vbox)
|
self.gui.get_container_widget().add(vbox)
|
||||||
vbox.show_all()
|
vbox.show_all()
|
||||||
#self.gui.calendar.show()
|
|
||||||
|
|
||||||
def post_init(self):
|
def post_init(self):
|
||||||
self.disconnect("active-changed")
|
self.disconnect("active-changed")
|
||||||
|
|
||||||
def double_click(self, obj):
|
def double_click(self, obj):
|
||||||
# bring up events on this day
|
"""
|
||||||
|
Bring up events on this day.
|
||||||
|
"""
|
||||||
year, month, day = self.gui.calendar.get_date()
|
year, month, day = self.gui.calendar.get_date()
|
||||||
date = Date()
|
date = Date()
|
||||||
date.set_yr_mon_day(year, month + 1, day)
|
date.set_yr_mon_day(year, month + 1, day)
|
||||||
|
@ -17,18 +17,29 @@
|
|||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Gtk modules
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
from gi.repository import Gtk
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Gramps modules
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
from gramps.gui.editors import EditPerson
|
from gramps.gui.editors import EditPerson
|
||||||
from gramps.gui.listmodel import ListModel, NOSORT
|
from gramps.gui.listmodel import ListModel, NOSORT
|
||||||
from gramps.gen.plug import Gramplet
|
from gramps.gen.plug import Gramplet
|
||||||
from gramps.gen.plug.report.utils import find_spouse
|
from gramps.gen.plug.report.utils import find_spouse
|
||||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
|
||||||
_ = glocale.translation.gettext
|
|
||||||
from gramps.gen.display.name import displayer as name_displayer
|
from gramps.gen.display.name import displayer as name_displayer
|
||||||
from gramps.gen.utils.db import get_birth_or_fallback, get_death_or_fallback
|
from gramps.gen.utils.db import get_birth_or_fallback, get_death_or_fallback
|
||||||
from gramps.gen.datehandler import get_date
|
from gramps.gen.datehandler import get_date
|
||||||
from gramps.gen.display.place import displayer as place_displayer
|
from gramps.gen.display.place import displayer as place_displayer
|
||||||
from gramps.gen.errors import WindowActiveError
|
from gramps.gen.errors import WindowActiveError
|
||||||
from gi.repository import Gtk
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.translation.gettext
|
||||||
|
|
||||||
class Children(Gramplet):
|
class Children(Gramplet):
|
||||||
"""
|
"""
|
||||||
|
@ -18,14 +18,25 @@
|
|||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Gtk modules
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
from gi.repository import Gtk
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Gramps modules
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
from gramps.gui.editors import EditSource, EditCitation
|
from gramps.gui.editors import EditSource, EditCitation
|
||||||
from gramps.gui.listmodel import ListModel, NOSORT
|
from gramps.gui.listmodel import ListModel, NOSORT
|
||||||
from gramps.gen.plug import Gramplet
|
from gramps.gen.plug import Gramplet
|
||||||
from gramps.gui.dbguielement import DbGUIElement
|
from gramps.gui.dbguielement import DbGUIElement
|
||||||
|
from gramps.gen.errors import WindowActiveError
|
||||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
_ = glocale.translation.gettext
|
_ = glocale.translation.gettext
|
||||||
from gramps.gen.errors import WindowActiveError
|
|
||||||
from gi.repository import Gtk
|
|
||||||
|
|
||||||
class Citations(Gramplet, DbGUIElement):
|
class Citations(Gramplet, DbGUIElement):
|
||||||
|
|
||||||
|
@ -20,21 +20,12 @@
|
|||||||
|
|
||||||
"""Descendant Gramplet"""
|
"""Descendant Gramplet"""
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# Python modules
|
|
||||||
#
|
|
||||||
#------------------------------------------------------------------------
|
|
||||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
|
||||||
_ = glocale.translation.gettext
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# GTK modules
|
# GTK modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from gi.repository import Gtk
|
from gi.repository import Gtk
|
||||||
from gi.repository import Gdk
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -49,9 +40,13 @@ from gramps.gen.display.name import displayer as name_displayer
|
|||||||
from gramps.gen.datehandler import get_date
|
from gramps.gen.datehandler import get_date
|
||||||
from gramps.gen.utils.db import get_birth_or_fallback, get_death_or_fallback
|
from gramps.gen.utils.db import get_birth_or_fallback, get_death_or_fallback
|
||||||
from gramps.gui.utils import model_to_text, text_to_clipboard
|
from gramps.gui.utils import model_to_text, text_to_clipboard
|
||||||
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.translation.gettext
|
||||||
|
|
||||||
class Descendant(Gramplet):
|
class Descendant(Gramplet):
|
||||||
|
"""
|
||||||
|
Gramplet to display descendants of the active person.
|
||||||
|
"""
|
||||||
def init(self):
|
def init(self):
|
||||||
self.gui.WIDGET = self.build_gui()
|
self.gui.WIDGET = self.build_gui()
|
||||||
self.gui.get_container_widget().remove(self.gui.textview)
|
self.gui.get_container_widget().remove(self.gui.textview)
|
||||||
@ -112,7 +107,8 @@ class Descendant(Gramplet):
|
|||||||
menu = Gtk.Menu()
|
menu = Gtk.Menu()
|
||||||
menu.set_title(_('Descendent Menu'))
|
menu.set_title(_('Descendent Menu'))
|
||||||
entries = [
|
entries = [
|
||||||
(_("Edit"), lambda obj: self.cb_double_click(treeview), sensitivity),
|
(_("Edit"), lambda obj: self.cb_double_click(treeview),
|
||||||
|
sensitivity),
|
||||||
(None, None, 0),
|
(None, None, 0),
|
||||||
(_("Copy all"), lambda obj: self.on_copy_all(treeview), 1),
|
(_("Copy all"), lambda obj: self.on_copy_all(treeview), 1),
|
||||||
]
|
]
|
||||||
@ -127,6 +123,9 @@ class Descendant(Gramplet):
|
|||||||
self.menu.popup(None, None, None, None, event.button, event.time)
|
self.menu.popup(None, None, None, None, event.button, event.time)
|
||||||
|
|
||||||
def on_copy_all(self, treeview):
|
def on_copy_all(self, treeview):
|
||||||
|
"""
|
||||||
|
Copy tree to clipboard.
|
||||||
|
"""
|
||||||
model = treeview.get_model()
|
model = treeview.get_model()
|
||||||
text = model_to_text(model, [0, 1], level=1)
|
text = model_to_text(model, [0, 1], level=1)
|
||||||
text_to_clipboard(text)
|
text_to_clipboard(text)
|
||||||
@ -155,6 +154,9 @@ class Descendant(Gramplet):
|
|||||||
self.set_has_data(False)
|
self.set_has_data(False)
|
||||||
|
|
||||||
def add_to_tree(self, parent_id, person_handle):
|
def add_to_tree(self, parent_id, person_handle):
|
||||||
|
"""
|
||||||
|
Add a person to the tree.
|
||||||
|
"""
|
||||||
person = self.dbstate.db.get_person_from_handle(person_handle)
|
person = self.dbstate.db.get_person_from_handle(person_handle)
|
||||||
name = name_displayer.display(person)
|
name = name_displayer.display(person)
|
||||||
|
|
||||||
|
@ -30,8 +30,6 @@ Provide a python evaluation window
|
|||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
import sys
|
import sys
|
||||||
from io import StringIO
|
from io import StringIO
|
||||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
|
||||||
_ = glocale.translation.gettext
|
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
@ -47,6 +45,8 @@ from gi.repository import Gtk
|
|||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
from gramps.gen.plug import Gramplet
|
from gramps.gen.plug import Gramplet
|
||||||
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.translation.gettext
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
@ -17,23 +17,32 @@
|
|||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Gtk modules
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
from gi.repository import Gtk
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Gramps modules
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
from gramps.gui.editors import EditEvent
|
from gramps.gui.editors import EditEvent
|
||||||
from gramps.gen.lib import EventRoleType
|
|
||||||
from gramps.gui.listmodel import ListModel, NOSORT
|
from gramps.gui.listmodel import ListModel, NOSORT
|
||||||
from gramps.gen.plug import Gramplet
|
from gramps.gen.plug import Gramplet
|
||||||
from gramps.gen.plug.report.utils import find_spouse
|
from gramps.gen.plug.report.utils import find_spouse
|
||||||
from gramps.gui.dbguielement import DbGUIElement
|
from gramps.gui.dbguielement import DbGUIElement
|
||||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
|
||||||
_ = glocale.translation.gettext
|
|
||||||
from gramps.gen.display.name import displayer as name_displayer
|
|
||||||
from gramps.gen.display.place import displayer as place_displayer
|
from gramps.gen.display.place import displayer as place_displayer
|
||||||
from gramps.gen.datehandler import get_date
|
from gramps.gen.datehandler import get_date
|
||||||
from gramps.gen.utils.db import (get_participant_from_event,
|
from gramps.gen.utils.db import (get_participant_from_event,
|
||||||
get_birth_or_fallback,
|
get_birth_or_fallback,
|
||||||
get_marriage_or_fallback)
|
get_marriage_or_fallback)
|
||||||
from gramps.gen.errors import WindowActiveError
|
from gramps.gen.errors import WindowActiveError
|
||||||
from gi.repository import Gtk
|
|
||||||
from gramps.gen.config import config
|
from gramps.gen.config import config
|
||||||
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.translation.gettext
|
||||||
|
|
||||||
age_precision = config.get('preferences.age-display-precision')
|
age_precision = config.get('preferences.age-display-precision')
|
||||||
|
|
||||||
|
@ -19,35 +19,18 @@
|
|||||||
|
|
||||||
## Based on the normal fanchart
|
## Based on the normal fanchart
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# Python modules
|
|
||||||
#
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
import gi
|
|
||||||
gi.require_version('Gtk', '3.0')
|
|
||||||
from gi.repository import Pango
|
|
||||||
from gi.repository import Gtk
|
|
||||||
import math
|
|
||||||
from gi.repository import Gdk
|
|
||||||
try:
|
|
||||||
import cairo
|
|
||||||
except ImportError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Gramps modules
|
# Gramps modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
|
||||||
_ = glocale.translation.gettext
|
|
||||||
from gramps.gen.plug import Gramplet
|
from gramps.gen.plug import Gramplet
|
||||||
from gramps.gen.errors import WindowActiveError
|
from gramps.gui.widgets.fanchartdesc import (FanChartDescWidget,
|
||||||
from gramps.gui.editors import EditPerson
|
FanChartDescGrampsGUI,
|
||||||
from gramps.gui.widgets.fanchartdesc import (FanChartDescWidget, FanChartDescGrampsGUI,
|
|
||||||
ANGLE_WEIGHT)
|
ANGLE_WEIGHT)
|
||||||
from gramps.gui.widgets.fanchart import FORM_HALFCIRCLE, BACKGROUND_SCHEME1
|
from gramps.gui.widgets.fanchart import FORM_HALFCIRCLE, BACKGROUND_SCHEME1
|
||||||
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.translation.gettext
|
||||||
|
|
||||||
class FanChartDescGramplet(FanChartDescGrampsGUI, Gramplet):
|
class FanChartDescGramplet(FanChartDescGrampsGUI, Gramplet):
|
||||||
"""
|
"""
|
||||||
@ -67,7 +50,8 @@ class FanChartDescGramplet(FanChartDescGrampsGUI, Gramplet):
|
|||||||
self.alpha_filter = 0.2
|
self.alpha_filter = 0.2
|
||||||
self.form = FORM_HALFCIRCLE
|
self.form = FORM_HALFCIRCLE
|
||||||
self.angle_algo = ANGLE_WEIGHT
|
self.angle_algo = ANGLE_WEIGHT
|
||||||
self.set_fan(FanChartDescWidget(self.dbstate, self.uistate, self.on_popup))
|
self.set_fan(FanChartDescWidget(self.dbstate, self.uistate,
|
||||||
|
self.on_popup))
|
||||||
# Replace the standard textview with the fan chart widget:
|
# Replace the standard textview with the fan chart widget:
|
||||||
self.gui.get_container_widget().remove(self.gui.textview)
|
self.gui.get_container_widget().remove(self.gui.textview)
|
||||||
self.gui.get_container_widget().add(self.fan)
|
self.gui.get_container_widget().add(self.fan)
|
||||||
@ -75,7 +59,9 @@ class FanChartDescGramplet(FanChartDescGrampsGUI, Gramplet):
|
|||||||
self.fan.show()
|
self.fan.show()
|
||||||
|
|
||||||
def init(self):
|
def init(self):
|
||||||
self.set_tooltip(_("Click to expand/contract person\nRight-click for options\nClick and drag in open area to rotate"))
|
self.set_tooltip(_("Click to expand/contract person\n"
|
||||||
|
"Right-click for options\n"
|
||||||
|
"Click and drag in open area to rotate"))
|
||||||
|
|
||||||
def active_changed(self, handle):
|
def active_changed(self, handle):
|
||||||
"""
|
"""
|
||||||
|
@ -25,34 +25,16 @@
|
|||||||
## Found by redwood:
|
## Found by redwood:
|
||||||
## http://www.gramps-project.org/bugs/view.php?id=2611
|
## http://www.gramps-project.org/bugs/view.php?id=2611
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# Python modules
|
|
||||||
#
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
import gi
|
|
||||||
gi.require_version('Gtk', '3.0')
|
|
||||||
from gi.repository import Pango
|
|
||||||
from gi.repository import Gtk
|
|
||||||
import math
|
|
||||||
from gi.repository import Gdk
|
|
||||||
try:
|
|
||||||
import cairo
|
|
||||||
except ImportError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Gramps modules
|
# Gramps modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
|
||||||
_ = glocale.translation.gettext
|
|
||||||
from gramps.gen.plug import Gramplet
|
from gramps.gen.plug import Gramplet
|
||||||
from gramps.gen.errors import WindowActiveError
|
|
||||||
from gramps.gui.editors import EditPerson
|
|
||||||
from gramps.gui.widgets.fanchart import (FanChartWidget, FanChartGrampsGUI,
|
from gramps.gui.widgets.fanchart import (FanChartWidget, FanChartGrampsGUI,
|
||||||
FORM_HALFCIRCLE, BACKGROUND_SCHEME1)
|
FORM_HALFCIRCLE, BACKGROUND_SCHEME1)
|
||||||
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.translation.gettext
|
||||||
|
|
||||||
class FanChartGramplet(FanChartGrampsGUI, Gramplet):
|
class FanChartGramplet(FanChartGrampsGUI, Gramplet):
|
||||||
"""
|
"""
|
||||||
@ -80,7 +62,8 @@ class FanChartGramplet(FanChartGrampsGUI, Gramplet):
|
|||||||
self.fan.show()
|
self.fan.show()
|
||||||
|
|
||||||
def init(self):
|
def init(self):
|
||||||
self.set_tooltip(_("Click to expand/contract person\nRight-click for options\nClick and drag in open area to rotate"))
|
self.set_tooltip(_("Click to expand/contract person\nRight-click for "
|
||||||
|
"options\nClick and drag in open area to rotate"))
|
||||||
|
|
||||||
def active_changed(self, handle):
|
def active_changed(self, handle):
|
||||||
"""
|
"""
|
||||||
|
@ -28,9 +28,9 @@
|
|||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
from gramps.gen.plug import Gramplet
|
from gramps.gen.plug import Gramplet
|
||||||
|
from gramps.gen.const import URL_MANUAL_PAGE
|
||||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
_ = glocale.translation.sgettext
|
_ = glocale.translation.sgettext
|
||||||
from gramps.gen.const import URL_MANUAL_PAGE
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
@ -19,17 +19,20 @@
|
|||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
"""
|
||||||
|
Module providing a gramplet interface to the sidebar filters.
|
||||||
|
"""
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Gramps modules
|
# Gramps modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from gramps.gen.plug import Gramplet
|
from gramps.gen.plug import Gramplet
|
||||||
from gramps.gui.filters.sidebar import (PersonSidebarFilter, FamilySidebarFilter,
|
from gramps.gui.filters.sidebar import (
|
||||||
EventSidebarFilter, SourceSidebarFilter,
|
PersonSidebarFilter, FamilySidebarFilter, EventSidebarFilter,
|
||||||
CitationSidebarFilter,
|
SourceSidebarFilter, CitationSidebarFilter, PlaceSidebarFilter,
|
||||||
PlaceSidebarFilter, MediaSidebarFilter,
|
MediaSidebarFilter, RepoSidebarFilter, NoteSidebarFilter)
|
||||||
RepoSidebarFilter, NoteSidebarFilter)
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
@ -18,11 +18,22 @@
|
|||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Gtk
|
||||||
|
#
|
||||||
|
#------------------------------------------------------------------------
|
||||||
|
from gi.repository import Gtk
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Gramps modules
|
||||||
|
#
|
||||||
|
#------------------------------------------------------------------------
|
||||||
from gramps.gen.plug import Gramplet
|
from gramps.gen.plug import Gramplet
|
||||||
from gramps.gui.widgets import Photo
|
from gramps.gui.widgets import Photo
|
||||||
from gramps.gen.utils.thumbnails import get_thumbnail_image
|
from gramps.gen.utils.thumbnails import get_thumbnail_image
|
||||||
from gramps.gen.utils.file import media_path_full
|
from gramps.gen.utils.file import media_path_full
|
||||||
from gi.repository import Gtk
|
|
||||||
|
|
||||||
class Gallery(Gramplet):
|
class Gallery(Gramplet):
|
||||||
"""
|
"""
|
||||||
@ -67,8 +78,7 @@ class Gallery(Gramplet):
|
|||||||
else:
|
else:
|
||||||
photo = Photo(self.uistate.screen_height() < 1000)
|
photo = Photo(self.uistate.screen_height() < 1000)
|
||||||
photo.set_pixbuf(full_path,
|
photo.set_pixbuf(full_path,
|
||||||
get_thumbnail_image(full_path,
|
get_thumbnail_image(full_path, mime_type,
|
||||||
mime_type,
|
|
||||||
media_ref.get_rectangle()))
|
media_ref.get_rectangle()))
|
||||||
self.image_list.append(photo)
|
self.image_list.append(photo)
|
||||||
self.top.pack_start(photo, False, False, 0)
|
self.top.pack_start(photo, False, False, 0)
|
||||||
|
@ -18,12 +18,23 @@
|
|||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
from collections import defaultdict
|
|
||||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
|
||||||
_ = glocale.translation.gettext
|
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Python modules
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
from collections import defaultdict
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Gramps modules
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
from gramps.gen.plug import Gramplet
|
from gramps.gen.plug import Gramplet
|
||||||
from gramps.gen.config import config
|
from gramps.gen.config import config
|
||||||
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.translation.gettext
|
||||||
|
|
||||||
_YIELD_INTERVAL = 350
|
_YIELD_INTERVAL = 350
|
||||||
|
|
||||||
@ -66,12 +77,12 @@ class GivenNameCloudGramplet(Gramplet):
|
|||||||
allnames = [person.get_primary_name()] + person.get_alternate_names()
|
allnames = [person.get_primary_name()] + person.get_alternate_names()
|
||||||
allnames = set(name.get_first_name().strip() for name in allnames)
|
allnames = set(name.get_first_name().strip() for name in allnames)
|
||||||
for givenname in allnames:
|
for givenname in allnames:
|
||||||
anyNBSP = givenname.split('\u00A0')
|
nbsp = givenname.split('\u00A0')
|
||||||
if len(anyNBSP) > 1: # there was an NBSP, a non-breaking space
|
if len(nbsp) > 1: # there was an NBSP, a non-breaking space
|
||||||
first_two = anyNBSP[0] + '\u00A0' + anyNBSP[1].split()[0]
|
first_two = nbsp[0] + '\u00A0' + nbsp[1].split()[0]
|
||||||
givensubnames[first_two] += 1
|
givensubnames[first_two] += 1
|
||||||
representative_handle[first_two] = person.handle
|
representative_handle[first_two] = person.handle
|
||||||
givenname = ' '.join(anyNBSP[1].split()[1:])
|
givenname = ' '.join(nbsp[1].split()[1:])
|
||||||
for givensubname in givenname.split():
|
for givensubname in givenname.split():
|
||||||
givensubnames[givensubname] += 1
|
givensubnames[givensubname] += 1
|
||||||
representative_handle[givensubname] = person.handle
|
representative_handle[givensubname] = person.handle
|
||||||
@ -84,7 +95,8 @@ class GivenNameCloudGramplet(Gramplet):
|
|||||||
|
|
||||||
total = cnt = 0
|
total = cnt = 0
|
||||||
for givensubname in givensubnames:
|
for givensubname in givensubnames:
|
||||||
givensubname_sort.append( (givensubnames[givensubname], givensubname) )
|
givensubname_sort.append((givensubnames[givensubname],
|
||||||
|
givensubname))
|
||||||
total += givensubnames[givensubname]
|
total += givensubnames[givensubname]
|
||||||
cnt += 1
|
cnt += 1
|
||||||
if not cnt % _YIELD_INTERVAL:
|
if not cnt % _YIELD_INTERVAL:
|
||||||
|
@ -24,14 +24,6 @@
|
|||||||
Show uncollected objects in a window.
|
Show uncollected objects in a window.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# standard python modules
|
|
||||||
#
|
|
||||||
#------------------------------------------------------------------------
|
|
||||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
|
||||||
_ = glocale.translation.gettext
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# GNOME/GTK modules
|
# GNOME/GTK modules
|
||||||
@ -49,6 +41,8 @@ import gc
|
|||||||
from gramps.gen.plug import Gramplet
|
from gramps.gen.plug import Gramplet
|
||||||
from gramps.gui.dialog import InfoDialog
|
from gramps.gui.dialog import InfoDialog
|
||||||
from gramps.gui.utils import is_right_click
|
from gramps.gui.utils import is_right_click
|
||||||
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.translation.gettext
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Python modules
|
# Gtk modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from gi.repository import Gtk
|
from gi.repository import Gtk
|
||||||
@ -162,7 +162,9 @@ class Locations(Gramplet, DbGUIElement):
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
class EnclosedBy(Locations):
|
class EnclosedBy(Locations):
|
||||||
|
"""
|
||||||
|
Gramplet showing the locations enclosed by the active place.
|
||||||
|
"""
|
||||||
def display_place(self, place, node, visited):
|
def display_place(self, place, node, visited):
|
||||||
"""
|
"""
|
||||||
Display the location hierarchy for the active place.
|
Display the location hierarchy for the active place.
|
||||||
@ -194,7 +196,9 @@ class EnclosedBy(Locations):
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
class Encloses(Locations):
|
class Encloses(Locations):
|
||||||
|
"""
|
||||||
|
Gramplet showing the locations which the active place encloses.
|
||||||
|
"""
|
||||||
def display_place(self, place, node, visited):
|
def display_place(self, place, node, visited):
|
||||||
"""
|
"""
|
||||||
Display the location hierarchy for the active place.
|
Display the location hierarchy for the active place.
|
||||||
|
@ -17,10 +17,21 @@
|
|||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Gtk modules
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
from gi.repository import Gtk
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Gramps modules
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
from gramps.gen.plug import Gramplet
|
from gramps.gen.plug import Gramplet
|
||||||
from gramps.gui.widgets import Photo
|
from gramps.gui.widgets import Photo
|
||||||
from gramps.gen.utils.file import media_path_full
|
from gramps.gen.utils.file import media_path_full
|
||||||
from gi.repository import Gtk
|
|
||||||
|
|
||||||
class MediaPreview(Gramplet):
|
class MediaPreview(Gramplet):
|
||||||
"""
|
"""
|
||||||
@ -72,7 +83,6 @@ class MediaPreview(Gramplet):
|
|||||||
"""
|
"""
|
||||||
Load the primary image if it exists.
|
Load the primary image if it exists.
|
||||||
"""
|
"""
|
||||||
self.full_path = media_path_full(self.dbstate.db,
|
self.full_path = media_path_full(self.dbstate.db, media.get_path())
|
||||||
media.get_path())
|
|
||||||
mime_type = media.get_mime_type()
|
mime_type = media.get_mime_type()
|
||||||
self.photo.set_image(self.full_path, mime_type)
|
self.photo.set_image(self.full_path, mime_type)
|
||||||
|
@ -18,13 +18,24 @@
|
|||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Gtk
|
||||||
|
#
|
||||||
|
#------------------------------------------------------------------------
|
||||||
|
from gi.repository import Gtk
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Gramps modules
|
||||||
|
#
|
||||||
|
#------------------------------------------------------------------------
|
||||||
from gramps.gen.plug import Gramplet
|
from gramps.gen.plug import Gramplet
|
||||||
from gramps.gui.widgets.styledtexteditor import StyledTextEditor
|
from gramps.gui.widgets.styledtexteditor import StyledTextEditor
|
||||||
from gramps.gui.widgets import SimpleButton
|
from gramps.gui.widgets import SimpleButton
|
||||||
from gramps.gen.lib import StyledText
|
from gramps.gen.lib import StyledText
|
||||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
_ = glocale.translation.gettext
|
_ = glocale.translation.gettext
|
||||||
from gi.repository import Gtk
|
|
||||||
|
|
||||||
class Notes(Gramplet):
|
class Notes(Gramplet):
|
||||||
"""
|
"""
|
||||||
@ -53,7 +64,8 @@ class Notes(Gramplet):
|
|||||||
hbox.pack_end(self.page, False, False, 10)
|
hbox.pack_end(self.page, False, False, 10)
|
||||||
|
|
||||||
scrolledwindow = Gtk.ScrolledWindow()
|
scrolledwindow = Gtk.ScrolledWindow()
|
||||||
scrolledwindow.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
|
scrolledwindow.set_policy(Gtk.PolicyType.AUTOMATIC,
|
||||||
|
Gtk.PolicyType.AUTOMATIC)
|
||||||
self.texteditor = StyledTextEditor()
|
self.texteditor = StyledTextEditor()
|
||||||
self.texteditor.set_editable(False)
|
self.texteditor.set_editable(False)
|
||||||
self.texteditor.set_wrap_mode(Gtk.WrapMode.WORD)
|
self.texteditor.set_wrap_mode(Gtk.WrapMode.WORD)
|
||||||
@ -96,7 +108,8 @@ class Notes(Gramplet):
|
|||||||
note_handle = self.note_list[self.current]
|
note_handle = self.note_list[self.current]
|
||||||
note = self.dbstate.db.get_note_from_handle(note_handle)
|
note = self.dbstate.db.get_note_from_handle(note_handle)
|
||||||
self.texteditor.set_text(note.get_styledtext())
|
self.texteditor.set_text(note.get_styledtext())
|
||||||
self.page.set_text(_('%(current)d of %(total)d') % {'current': self.current + 1,
|
self.page.set_text(_('%(current)d of %(total)d') %
|
||||||
|
{'current': self.current + 1,
|
||||||
'total': len(self.note_list)})
|
'total': len(self.note_list)})
|
||||||
|
|
||||||
def left_clicked(self, button):
|
def left_clicked(self, button):
|
||||||
|
@ -29,14 +29,16 @@ from html import escape
|
|||||||
# Gramps modules
|
# Gramps modules
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
|
||||||
_ = glocale.translation.sgettext
|
|
||||||
ngettext = glocale.translation.ngettext # else "nearby" comments are ignored
|
|
||||||
from gramps.gen.plug import Gramplet
|
from gramps.gen.plug import Gramplet
|
||||||
from gramps.gen.display.name import displayer as name_displayer
|
from gramps.gen.display.name import displayer as name_displayer
|
||||||
from gramps.gen.datehandler import get_date
|
from gramps.gen.datehandler import get_date
|
||||||
from gramps.gen.lib import EventType
|
from gramps.gen.lib import EventType
|
||||||
from gramps.gen.utils.db import get_birth_or_fallback, get_death_or_fallback
|
from gramps.gen.utils.db import get_birth_or_fallback, get_death_or_fallback
|
||||||
|
from gramps.gen.plug.menu import (NumberOption, BooleanOption,
|
||||||
|
EnumeratedListOption)
|
||||||
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.translation.sgettext
|
||||||
|
ngettext = glocale.translation.ngettext # else "nearby" comments are ignored
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -53,7 +55,6 @@ class PedigreeGramplet(Gramplet):
|
|||||||
self.box_mode = "UTF"
|
self.box_mode = "UTF"
|
||||||
|
|
||||||
def build_options(self):
|
def build_options(self):
|
||||||
from gramps.gen.plug.menu import NumberOption, BooleanOption, EnumeratedListOption
|
|
||||||
self.add_option(NumberOption(_("Max generations"),
|
self.add_option(NumberOption(_("Max generations"),
|
||||||
self.max_generations, 1, 100))
|
self.max_generations, 1, 100))
|
||||||
self.add_option(BooleanOption(_("Show dates"), bool(self.show_dates)))
|
self.add_option(BooleanOption(_("Show dates"), bool(self.show_dates)))
|
||||||
|
@ -18,17 +18,28 @@
|
|||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Gtk modules
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
from gi.repository import Gtk
|
||||||
|
from gi.repository import Pango
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Gramps modules
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
from gramps.gen.lib import EventType, EventRoleType
|
from gramps.gen.lib import EventType, EventRoleType
|
||||||
from gramps.gen.plug import Gramplet
|
from gramps.gen.plug import Gramplet
|
||||||
from gramps.gui.widgets import Photo
|
from gramps.gui.widgets import Photo
|
||||||
from gramps.gen.display.name import displayer as name_displayer
|
from gramps.gen.display.name import displayer as name_displayer
|
||||||
from gramps.gen.display.place import displayer as place_displayer
|
from gramps.gen.display.place import displayer as place_displayer
|
||||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
|
||||||
_ = glocale.translation.gettext
|
|
||||||
from gramps.gen.datehandler import get_date
|
from gramps.gen.datehandler import get_date
|
||||||
from gramps.gen.utils.file import media_path_full
|
from gramps.gen.utils.file import media_path_full
|
||||||
from gi.repository import Gtk
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
from gi.repository import Pango
|
_ = glocale.translation.gettext
|
||||||
|
|
||||||
class PersonDetails(Gramplet):
|
class PersonDetails(Gramplet):
|
||||||
"""
|
"""
|
||||||
|
@ -17,16 +17,27 @@
|
|||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Gtk modules
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
from gi.repository import Gtk
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Gramps modules
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
from gramps.gen.lib import EventType, EventRoleType
|
from gramps.gen.lib import EventType, EventRoleType
|
||||||
from gramps.gui.editors import EditEvent
|
from gramps.gui.editors import EditEvent
|
||||||
from gramps.gui.listmodel import ListModel, NOSORT
|
from gramps.gui.listmodel import ListModel, NOSORT
|
||||||
from gramps.gen.plug import Gramplet
|
from gramps.gen.plug import Gramplet
|
||||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
|
||||||
_ = glocale.translation.gettext
|
|
||||||
from gramps.gen.datehandler import get_date
|
from gramps.gen.datehandler import get_date
|
||||||
from gramps.gen.display.place import displayer as place_displayer
|
from gramps.gen.display.place import displayer as place_displayer
|
||||||
from gramps.gen.errors import WindowActiveError
|
from gramps.gen.errors import WindowActiveError
|
||||||
from gi.repository import Gtk
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.translation.gettext
|
||||||
|
|
||||||
class PersonResidence(Gramplet):
|
class PersonResidence(Gramplet):
|
||||||
"""
|
"""
|
||||||
|
@ -17,15 +17,26 @@
|
|||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Gtk modules
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
from gi.repository import Gtk
|
||||||
|
from gi.repository import Pango
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Gramps modules
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
from gramps.gen.plug import Gramplet
|
from gramps.gen.plug import Gramplet
|
||||||
from gramps.gui.widgets import Photo
|
from gramps.gui.widgets import Photo
|
||||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
|
||||||
_ = glocale.translation.gettext
|
|
||||||
from gramps.gen.utils.place import conv_lat_lon
|
from gramps.gen.utils.place import conv_lat_lon
|
||||||
from gramps.gen.utils.file import media_path_full
|
from gramps.gen.utils.file import media_path_full
|
||||||
from gramps.gen.display.place import displayer as place_displayer
|
from gramps.gen.display.place import displayer as place_displayer
|
||||||
from gi.repository import Gtk
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
from gi.repository import Pango
|
_ = glocale.translation.gettext
|
||||||
|
|
||||||
class PlaceDetails(Gramplet):
|
class PlaceDetails(Gramplet):
|
||||||
"""
|
"""
|
||||||
|
@ -30,14 +30,15 @@
|
|||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
from gramps.gen.plug import Gramplet
|
from gramps.gen.plug import Gramplet
|
||||||
|
from gramps.gui.plug.quick import (run_quick_report_by_name,
|
||||||
|
get_quick_report_list)
|
||||||
|
from gramps.gen.plug import (
|
||||||
|
CATEGORY_QR_PERSON, CATEGORY_QR_FAMILY, CATEGORY_QR_EVENT,
|
||||||
|
CATEGORY_QR_SOURCE, CATEGORY_QR_NOTE, CATEGORY_QR_PLACE,
|
||||||
|
CATEGORY_QR_MEDIA, CATEGORY_QR_REPOSITORY, CATEGORY_QR_CITATION,
|
||||||
|
CATEGORY_QR_SOURCE_OR_CITATION)
|
||||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
_ = glocale.translation.sgettext
|
_ = glocale.translation.sgettext
|
||||||
from gramps.gui.plug.quick import run_quick_report_by_name, get_quick_report_list
|
|
||||||
from gramps.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_CITATION,
|
|
||||||
CATEGORY_QR_SOURCE_OR_CITATION)
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
@ -20,14 +20,6 @@
|
|||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
#
|
#
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# Standard Python modules
|
|
||||||
#
|
|
||||||
#------------------------------------------------------------------------
|
|
||||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
|
||||||
_ = glocale.translation.sgettext
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Gramps modules
|
# Gramps modules
|
||||||
@ -35,10 +27,12 @@ _ = glocale.translation.sgettext
|
|||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
from gramps.plugins.lib.librecords import find_records, CALLNAME_DONTUSE
|
from gramps.plugins.lib.librecords import find_records, CALLNAME_DONTUSE
|
||||||
from gramps.gen.plug import Gramplet
|
from gramps.gen.plug import Gramplet
|
||||||
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.translation.sgettext
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# The Gramplet
|
# RecordsGramplet
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
class RecordsGramplet(Gramplet):
|
class RecordsGramplet(Gramplet):
|
||||||
|
@ -22,9 +22,9 @@
|
|||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
from gramps.gen.plug import Gramplet
|
from gramps.gen.plug import Gramplet
|
||||||
|
from gramps.gen.display.name import displayer as name_displayer
|
||||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
_ = glocale.translation.sgettext
|
_ = glocale.translation.sgettext
|
||||||
from gramps.gen.display.name import displayer as name_displayer
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
@ -17,12 +17,23 @@
|
|||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Gtk
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
from gi.repository import Gtk
|
||||||
|
from gi.repository import Pango
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Gramps modules
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
from gramps.gen.lib import UrlType
|
from gramps.gen.lib import UrlType
|
||||||
from gramps.gen.plug import Gramplet
|
from gramps.gen.plug import Gramplet
|
||||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
_ = glocale.translation.gettext
|
_ = glocale.translation.gettext
|
||||||
from gi.repository import Gtk
|
|
||||||
from gi.repository import Pango
|
|
||||||
|
|
||||||
class RepositoryDetails(Gramplet):
|
class RepositoryDetails(Gramplet):
|
||||||
"""
|
"""
|
||||||
|
@ -32,10 +32,10 @@ import time
|
|||||||
from gramps.gen.lib import Person, Family
|
from gramps.gen.lib import Person, Family
|
||||||
from gramps.gen.db import PERSON_KEY, FAMILY_KEY, TXNDEL
|
from gramps.gen.db import PERSON_KEY, FAMILY_KEY, TXNDEL
|
||||||
from gramps.gen.plug import Gramplet
|
from gramps.gen.plug import Gramplet
|
||||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
|
||||||
_ = glocale.translation.sgettext
|
|
||||||
from gramps.gen.display.name import displayer as name_displayer
|
from gramps.gen.display.name import displayer as name_displayer
|
||||||
from gramps.gen.utils.db import family_name
|
from gramps.gen.utils.db import family_name
|
||||||
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.translation.sgettext
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
@ -29,11 +29,11 @@ import posixpath
|
|||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
from gramps.gen.plug import Gramplet
|
from gramps.gen.plug import Gramplet
|
||||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
|
||||||
_ = glocale.translation.sgettext
|
|
||||||
from gramps.gen.utils.file import media_path_full
|
from gramps.gen.utils.file import media_path_full
|
||||||
from gramps.gen.datehandler import get_date
|
from gramps.gen.datehandler import get_date
|
||||||
from gramps.gen.lib import Person
|
from gramps.gen.lib import Person
|
||||||
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.translation.sgettext
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -90,9 +90,9 @@ class StatsGramplet(Gramplet):
|
|||||||
except OSError:
|
except OSError:
|
||||||
notfound.append(media.get_path())
|
notfound.append(media.get_path())
|
||||||
|
|
||||||
males = sum([v[0] for v in database.genderStats.stats.values()]) # male, female, unknown
|
males = sum([v[0] for v in database.genderStats.stats.values()])
|
||||||
females = sum([v[1] for v in database.genderStats.stats.values()]) # male, female, unknown
|
females = sum([v[1] for v in database.genderStats.stats.values()])
|
||||||
unknown = sum([v[2] for v in database.genderStats.stats.values()]) # male, female, unknown
|
unknown = sum([v[2] for v in database.genderStats.stats.values()])
|
||||||
|
|
||||||
self.clear_text()
|
self.clear_text()
|
||||||
self.append_text(_("Individuals") + "\n")
|
self.append_text(_("Individuals") + "\n")
|
||||||
|
@ -16,6 +16,11 @@
|
|||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Python modules
|
||||||
|
#
|
||||||
|
#------------------------------------------------------------------------
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
@ -24,9 +29,9 @@ from collections import defaultdict
|
|||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
from gramps.gen.plug import Gramplet
|
from gramps.gen.plug import Gramplet
|
||||||
|
from gramps.gen.config import config
|
||||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
_ = glocale.translation.sgettext
|
_ = glocale.translation.sgettext
|
||||||
from gramps.gen.config import config
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
@ -17,6 +17,18 @@
|
|||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Gtk modules
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
from gi.repository import Gtk
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Gramps modules
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
from gramps.gen.plug import Gramplet
|
from gramps.gen.plug import Gramplet
|
||||||
from gramps.gui.widgets.styledtexteditor import StyledTextEditor
|
from gramps.gui.widgets.styledtexteditor import StyledTextEditor
|
||||||
from gramps.gui.widgets import SimpleButton
|
from gramps.gui.widgets import SimpleButton
|
||||||
@ -24,7 +36,6 @@ from gramps.gen.lib import StyledText, Note, NoteType
|
|||||||
from gramps.gen.db import DbTxn
|
from gramps.gen.db import DbTxn
|
||||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
_ = glocale.translation.gettext
|
_ = glocale.translation.gettext
|
||||||
from gi.repository import Gtk
|
|
||||||
|
|
||||||
class ToDo(Gramplet):
|
class ToDo(Gramplet):
|
||||||
"""
|
"""
|
||||||
|
@ -18,14 +18,24 @@
|
|||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Gtk modules
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
from gi.repository import Gtk
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Gramps modules
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
from gramps.gen.plug import Gramplet
|
from gramps.gen.plug import Gramplet
|
||||||
from gramps.gui.widgets.styledtexteditor import StyledTextEditor
|
from gramps.gui.widgets.styledtexteditor import StyledTextEditor
|
||||||
from gramps.gui.widgets import SimpleButton
|
from gramps.gui.widgets import SimpleButton
|
||||||
from gramps.gen.lib import StyledText, Note, NoteType
|
from gramps.gen.lib import StyledText, Note, NoteType
|
||||||
from gramps.gen.filters import GenericFilterFactory, rules
|
from gramps.gen.filters import GenericFilterFactory, rules
|
||||||
from gramps.gen.utils.db import navigation_label
|
from gramps.gen.utils.db import navigation_label
|
||||||
from gramps.gen.db import DbTxn
|
|
||||||
from gi.repository import Gtk
|
|
||||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
_ = glocale.translation.gettext
|
_ = glocale.translation.gettext
|
||||||
|
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
# Python modules
|
# Python modules
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
|
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
@ -30,16 +29,15 @@ from collections import defaultdict
|
|||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
from gramps.gen.plug import Gramplet
|
from gramps.gen.plug import Gramplet
|
||||||
|
from gramps.gen.config import config
|
||||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
_ = glocale.translation.sgettext
|
_ = glocale.translation.sgettext
|
||||||
from gramps.gen.config import config
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Constants
|
# Constants
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
|
|
||||||
_YIELD_INTERVAL = 350
|
_YIELD_INTERVAL = 350
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
|
@ -18,10 +18,9 @@
|
|||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# modules
|
# Gtk modules
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
|
|
||||||
from gi.repository import Gtk
|
from gi.repository import Gtk
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
@ -32,17 +31,15 @@ from gi.repository import Gtk
|
|||||||
from gramps.gen.const import URL_WIKISTRING, URL_MANUAL_PAGE, URL_HOMEPAGE
|
from gramps.gen.const import URL_WIKISTRING, URL_MANUAL_PAGE, URL_HOMEPAGE
|
||||||
from gramps.gen.plug import Gramplet
|
from gramps.gen.plug import Gramplet
|
||||||
from gramps.gui.widgets.styledtexteditor import StyledTextEditor
|
from gramps.gui.widgets.styledtexteditor import StyledTextEditor
|
||||||
from gramps.gui.widgets import SimpleButton
|
|
||||||
from gramps.gen.lib import StyledText, StyledTextTag, StyledTextTagType
|
from gramps.gen.lib import StyledText, StyledTextTag, StyledTextTagType
|
||||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
_ = glocale.translation.sgettext
|
_ = glocale.translation.sgettext
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# functions
|
# Functions
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
|
|
||||||
def st(text):
|
def st(text):
|
||||||
""" Return text as styled text
|
""" Return text as styled text
|
||||||
"""
|
"""
|
||||||
@ -51,15 +48,13 @@ def st(text):
|
|||||||
def boldst(text):
|
def boldst(text):
|
||||||
""" Return text as bold styled text
|
""" Return text as bold styled text
|
||||||
"""
|
"""
|
||||||
tags = [StyledTextTag(StyledTextTagType.BOLD, True,
|
tags = [StyledTextTag(StyledTextTagType.BOLD, True, [(0, len(text))])]
|
||||||
[(0, len(text))])]
|
|
||||||
return StyledText(text, tags)
|
return StyledText(text, tags)
|
||||||
|
|
||||||
def linkst(text, url):
|
def linkst(text, url):
|
||||||
""" Return text as link styled text
|
""" Return text as link styled text
|
||||||
"""
|
"""
|
||||||
tags = [StyledTextTag(StyledTextTagType.LINK, url,
|
tags = [StyledTextTag(StyledTextTagType.LINK, url, [(0, len(text))])]
|
||||||
[(0, len(text))])]
|
|
||||||
return StyledText(text, tags)
|
return StyledText(text, tags)
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
@ -85,19 +80,20 @@ class WelcomeGramplet(Gramplet):
|
|||||||
top = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
top = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||||
|
|
||||||
scrolledwindow = Gtk.ScrolledWindow()
|
scrolledwindow = Gtk.ScrolledWindow()
|
||||||
scrolledwindow.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
|
scrolledwindow.set_policy(Gtk.PolicyType.AUTOMATIC,
|
||||||
|
Gtk.PolicyType.AUTOMATIC)
|
||||||
self.texteditor = StyledTextEditor()
|
self.texteditor = StyledTextEditor()
|
||||||
self.texteditor.set_editable(False)
|
self.texteditor.set_editable(False)
|
||||||
self.texteditor.set_wrap_mode(Gtk.WrapMode.WORD)
|
self.texteditor.set_wrap_mode(Gtk.WrapMode.WORD)
|
||||||
scrolledwindow.add(self.texteditor)
|
scrolledwindow.add(self.texteditor)
|
||||||
|
|
||||||
self.set_text()
|
self.display_text()
|
||||||
|
|
||||||
top.pack_start(scrolledwindow, True, True, 0)
|
top.pack_start(scrolledwindow, True, True, 0)
|
||||||
top.show_all()
|
top.show_all()
|
||||||
return top
|
return top
|
||||||
|
|
||||||
def set_text(self):
|
def display_text(self):
|
||||||
"""
|
"""
|
||||||
Display the welcome text.
|
Display the welcome text.
|
||||||
"""
|
"""
|
||||||
@ -112,14 +108,15 @@ class WelcomeGramplet(Gramplet):
|
|||||||
'%(gramps_wiki_url)sStart_with_Genealogy' %
|
'%(gramps_wiki_url)sStart_with_Genealogy' %
|
||||||
{'gramps_wiki_url': URL_WIKISTRING}) + '\n'
|
{'gramps_wiki_url': URL_WIKISTRING}) + '\n'
|
||||||
welcome += linkst(_('Gramps online manual'),
|
welcome += linkst(_('Gramps online manual'),
|
||||||
URL_WIKISTRING + URL_MANUAL_PAGE + _('locale_suffix|')) + '\n'
|
URL_WIKISTRING + URL_MANUAL_PAGE +
|
||||||
|
_('locale_suffix|')) + '\n'
|
||||||
welcome += linkst(_('Ask questions on gramps-users mailing list'),
|
welcome += linkst(_('Ask questions on gramps-users mailing list'),
|
||||||
'%(gramps_home_url)scontact/' %
|
'%(gramps_home_url)scontact/' %
|
||||||
{'gramps_home_url': URL_HOMEPAGE}) + '\n\n'
|
{'gramps_home_url': URL_HOMEPAGE}) + '\n\n'
|
||||||
|
|
||||||
welcome += boldst(_('Who makes Gramps?')) + '\n\n' + _(
|
welcome += boldst(_('Who makes Gramps?')) + '\n\n' + _(
|
||||||
'Gramps is created by genealogists for genealogists, organized in the'
|
'Gramps is created by genealogists for genealogists, organized in'
|
||||||
' Gramps Project.'
|
' the Gramps Project.'
|
||||||
' Gramps is an Open Source Software package, which means you are '
|
' Gramps is an Open Source Software package, which means you are '
|
||||||
'free to make copies and distribute it to anyone you like. It\'s '
|
'free to make copies and distribute it to anyone you like. It\'s '
|
||||||
'developed and maintained by a worldwide team of volunteers whose'
|
'developed and maintained by a worldwide team of volunteers whose'
|
||||||
@ -128,17 +125,18 @@ class WelcomeGramplet(Gramplet):
|
|||||||
'The first thing you must do is to create a new Family Tree. To '
|
'The first thing you must do is to create a new Family Tree. To '
|
||||||
'create a new Family Tree (sometimes called \'database\') select '
|
'create a new Family Tree (sometimes called \'database\') select '
|
||||||
'"Family Trees" from the menu, pick "Manage Family Trees", press '
|
'"Family Trees" from the menu, pick "Manage Family Trees", press '
|
||||||
'"New" and name your Family Tree. For more details, please read the '
|
'"New" and name your Family Tree. For more details, please read '
|
||||||
'information at the links above\n\n')
|
'the information at the links above\n\n')
|
||||||
welcome += boldst(_('Dashboard View')) + '\n\n' + _(
|
welcome += boldst(_('Dashboard View')) + '\n\n' + _(
|
||||||
'You are currently reading from the "Dashboard" view, where you can'
|
'You are currently reading from the "Dashboard" view, where you can'
|
||||||
' add your own gramplets. You can also add gramplets to any view by'
|
' add your own gramplets. You can also add gramplets to any view by'
|
||||||
' adding a sidebar and/or bottombar, and right-clicking to the right'
|
' adding a sidebar and/or bottombar, and right-clicking to the'
|
||||||
' of the tab.\n\n'
|
' right of the tab.\n\n'
|
||||||
'You can click the configuration icon in the toolbar to add additional'
|
'You can click the configuration icon in the toolbar to add'
|
||||||
' columns, while right-click on the background allows to add gramplets.'
|
' additional columns, while right-click on the background allows to'
|
||||||
' You can also drag the Properties button to reposition the gramplet '
|
' add gramplets. You can also drag the Properties button to'
|
||||||
' on this page, and detach the gramplet to float above Gramps.'
|
' reposition the gramplet on this page, and detach the gramplet to'
|
||||||
|
' float above Gramps.'
|
||||||
)
|
)
|
||||||
|
|
||||||
self.texteditor.set_text(welcome)
|
self.texteditor.set_text(welcome)
|
||||||
|
@ -227,7 +227,7 @@ class WhatNextGramplet(Gramplet):
|
|||||||
spouses = []
|
spouses = []
|
||||||
spouses_queue = []
|
spouses_queue = []
|
||||||
|
|
||||||
while (ancestors or families):
|
while ancestors or families:
|
||||||
# (Other) families of parents
|
# (Other) families of parents
|
||||||
for ancestor_group in ancestors_queue.pop(0):
|
for ancestor_group in ancestors_queue.pop(0):
|
||||||
new_family_group = []
|
new_family_group = []
|
||||||
@ -416,9 +416,7 @@ class WhatNextGramplet(Gramplet):
|
|||||||
if not name2:
|
if not name2:
|
||||||
name2 = _("(person with unknown name)")
|
name2 = _("(person with unknown name)")
|
||||||
|
|
||||||
name = _("%(name1)s and %(name2)s") % {
|
name = _("%(name1)s and %(name2)s") % {'name1': name1, 'name2': name2}
|
||||||
'name1': name1,
|
|
||||||
'name2': name2}
|
|
||||||
|
|
||||||
has_marriage = False
|
has_marriage = False
|
||||||
|
|
||||||
@ -463,9 +461,7 @@ class WhatNextGramplet(Gramplet):
|
|||||||
if not name2:
|
if not name2:
|
||||||
name2 = _("(person with unknown name)")
|
name2 = _("(person with unknown name)")
|
||||||
|
|
||||||
name = _("%(name1)s and %(name2)s") % {
|
name = _("%(name1)s and %(name2)s") % {'name1': name1, 'name2': name2}
|
||||||
'name1': name1,
|
|
||||||
'name2': name2}
|
|
||||||
|
|
||||||
if self.__family_complete_handle is not None and \
|
if self.__family_complete_handle is not None and \
|
||||||
self.__family_complete_handle not in family.get_tag_list():
|
self.__family_complete_handle not in family.get_tag_list():
|
||||||
|
Reference in New Issue
Block a user