Skip to content

Commit 78beec7

Browse files
Sync addons-source@maintenance/gramps61 with upstream/gramps-project (2026-07-12)
2 parents 9f22bcb + e4f858a commit 78beec7

65 files changed

Lines changed: 3788 additions & 112 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#
2+
# Gramps - a GTK+/GNOME based genealogy program
3+
#
4+
# Copyright (C) 2026 Javad Razavian <javadr@gmail.com>
5+
#
6+
# This program is free software; you can redistribute it and/or modify
7+
# it under the terms of the GNU General Public License as published by
8+
# the Free Software Foundation; either version 2 of the License, or
9+
# (at your option) any later version.
10+
#
11+
# This program is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
# GNU General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU General Public License
17+
# along with this program; if not, write to the Free Software
18+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19+
#
20+
21+
register(
22+
GRAMPLET,
23+
id="DateOfDeath",
24+
name=_("Date of Death"),
25+
description=_("a gramplet that displays death dates in sorted order"),
26+
status=STABLE,
27+
version = '1.1.1',
28+
fname="DateOfDeathGramplet.py",
29+
authors = ["Javad Razavian"],
30+
authors_email = ["javadr@gmail.com"],
31+
height=200,
32+
gramplet="DateOfDeathGramplet",
33+
gramps_target_version="6.1",
34+
gramplet_title=_("Date of Death"),
35+
help_url="Addon:DateOfDeathGramplet",
36+
)
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
#
2+
# Gramps - a GTK+/GNOME based genealogy program
3+
#
4+
# Copyright (C) 2026 Javad Razavian <javadr@gmail.com>
5+
#
6+
# This program is free software; you can redistribute it and/or modify
7+
# it under the terms of the GNU General Public License as published by
8+
# the Free Software Foundation; either version 2 of the License, or
9+
# (at your option) any later version.
10+
#
11+
# This program is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
# GNU General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU General Public License
17+
# along with this program; if not, write to the Free Software
18+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19+
#
20+
21+
from gramps.gen.plug import Gramplet
22+
from gramps.gen.const import GRAMPS_LOCALE as glocale
23+
from gramps.gen.display.name import displayer as name_displayer
24+
from gramps.gen.lib.date import Today, Date, gregorian
25+
import gramps.gen.datehandler
26+
from gramps.gen.plug.menu import EnumeratedListOption
27+
try:
28+
_trans = glocale.get_addon_translator(__file__)
29+
except ValueError:
30+
_trans = glocale.translation
31+
_ = _trans.gettext
32+
33+
34+
class DateOfDeathGramplet(Gramplet):
35+
def init(self):
36+
self.set_text(_("No Family Tree loaded."))
37+
self.sort_mode = 'proximity'
38+
39+
def build_options(self):
40+
name_sort = _("Sort dates of death by")
41+
self.opt_sort = EnumeratedListOption(name_sort, self.sort_mode)
42+
self.opt_sort.add_item("proximity", _("Proximity to current date"))
43+
self.opt_sort.add_item("month_day", _("Month and day"))
44+
45+
self.add_option(self.opt_sort)
46+
47+
def save_options(self):
48+
self.sort_mode = self.opt_sort.get_value()
49+
50+
def save_update_options(self, obj):
51+
self.save_options()
52+
self.gui.data = [self.sort_mode]
53+
self.update()
54+
55+
def on_load(self):
56+
if len(self.gui.data) >= 1:
57+
self.sort_mode = self.gui.data[0]
58+
else:
59+
self.sort_mode = 'proximity'
60+
61+
def db_changed(self):
62+
self.connect(self.dbstate.db, 'person-add', self.update)
63+
self.connect(self.dbstate.db, 'person-delete', self.update)
64+
self.connect(self.dbstate.db, 'person-update', self.update)
65+
66+
def main(self):
67+
self.set_text(_("Processing..."))
68+
database = self.dbstate.db
69+
self.result = []
70+
71+
for person in database.iter_people():
72+
death_ref = person.get_death_ref()
73+
if not death_ref:
74+
continue
75+
death_event = database.get_event_from_handle(death_ref.ref)
76+
date_of_death = death_event.get_date_object()
77+
if not date_of_death.is_regular():
78+
continue
79+
80+
self.__calculate(database, person)
81+
82+
sort_by = self.opt_sort.get_value()
83+
if sort_by == "proximity":
84+
self.result.sort(key=lambda item: -item[0])
85+
else:
86+
self.result.sort(key=lambda item: (item[1].get_month(),
87+
item[1].get_day()))
88+
self.clear_text()
89+
90+
for diff_days, date, person, age in self.result:
91+
name = person.get_primary_name()
92+
displayer = gramps.gen.datehandler.displayer
93+
self.append_text("{}: ".format(displayer.display(date)))
94+
self.link(name_displayer.display_name(name), "Person",
95+
person.handle)
96+
if age:
97+
self.append_text(" ({})\n".format(age))
98+
else:
99+
self.append_text("\n")
100+
self.append_text("", scroll_to="begin")
101+
102+
def __calculate(self, database, person):
103+
today = Today()
104+
death_ref = person.get_death_ref()
105+
if not death_ref:
106+
return
107+
death_event = database.get_event_from_handle(death_ref.ref)
108+
date_of_death = death_event.get_date_object()
109+
if not date_of_death.is_regular():
110+
return
111+
112+
death_greg = gregorian(date_of_death)
113+
death_this_year = Date(today.get_year(),
114+
death_greg.get_month(),
115+
death_greg.get_day())
116+
diff = today - death_this_year
117+
diff_days = diff[1] * 30 + diff[2]
118+
119+
birth_ref = person.get_birth_ref()
120+
age = ""
121+
if birth_ref:
122+
birth = database.get_event_from_handle(birth_ref.ref)
123+
birth_date = birth.get_date_object()
124+
if birth_date.is_regular():
125+
age = date_of_death - birth_date
126+
127+
if diff_days <= 0:
128+
self.result.append((diff_days, date_of_death, person, age))
129+
else:
130+
self.result.append((diff_days - 365, date_of_death, person, age))

DateOfDeathGramplet/po/ca-local.po

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
msgid ""
2+
msgstr ""
3+
"Project-Id-Version: ca\n"
4+
"Report-Msgid-Bugs-To: \n"
5+
"POT-Creation-Date: 2026-07-04 00:00-0000\n"
6+
"PO-Revision-Date: 2025-09-03 03:01+0000\n"
7+
"Last-Translator: Adolfo Jayme Barrientos <fitojb@ubuntu.com>\n"
8+
"Language-Team: Catalan <https://hosted.weblate.org/projects/gramps-project/"
9+
"addons/ca/>\n"
10+
"Language: ca\n"
11+
"MIME-Version: 1.0\n"
12+
"Content-Type: text/plain; charset=UTF-8\n"
13+
"Content-Transfer-Encoding: 8bit\n"
14+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
15+
"X-Generator: Weblate 5.13.1-dev\n"
16+
17+
msgid "Date of Death"
18+
msgstr "Data de defunció"
19+
20+
msgid "a gramplet that displays death dates in sorted order"
21+
msgstr "un gramplet que mostra les dates de defunció ordenades"
22+
23+
msgid "No Family Tree loaded."
24+
msgstr "No hi ha cap arbre familiar carregat."
25+
26+
msgid "Sort dates of death by"
27+
msgstr "Ordena les dates de mort per"
28+
29+
msgid "Month and day"
30+
msgstr "Mes i dia"
31+
32+
msgid "Proximity to current date"
33+
msgstr "Proximitat a la data actual"
34+
35+
msgid "Processing..."
36+
msgstr "Processant…"

DateOfDeathGramplet/po/da-local.po

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
msgid ""
2+
msgstr ""
3+
"Project-Id-Version: \n"
4+
"Report-Msgid-Bugs-To: \n"
5+
"POT-Creation-Date: 2026-07-04 00:00-0000\n"
6+
"PO-Revision-Date: 2025-02-25 16:12+0000\n"
7+
"Last-Translator: Kaj Arne Mikkelsen <kmi@vgdata.dk>\n"
8+
"Language-Team: Danish <https://hosted.weblate.org/projects/gramps-project/"
9+
"addons/da/>\n"
10+
"Language: da\n"
11+
"MIME-Version: 1.0\n"
12+
"Content-Type: text/plain; charset=UTF-8\n"
13+
"Content-Transfer-Encoding: 8bit\n"
14+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
15+
"X-Generator: Weblate 5.10.2-dev\n"
16+
17+
msgid "Date of Death"
18+
msgstr "Dødsdato"
19+
20+
msgid "a gramplet that displays death dates in sorted order"
21+
msgstr "en gramplet der viser dødsdatoer sorteret"
22+
23+
msgid "No Family Tree loaded."
24+
msgstr "Ingen stamtræ indlæst."
25+
26+
msgid "Sort dates of death by"
27+
msgstr "Sorter dødsdatoerne efter"
28+
29+
msgid "Month and day"
30+
msgstr "Måned og dag"
31+
32+
msgid "Proximity to current date"
33+
msgstr "Nærhed til nuværende dato"
34+
35+
msgid "Processing..."
36+
msgstr "Behandler…"

DateOfDeathGramplet/po/de-local.po

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
msgid ""
2+
msgstr ""
3+
"Project-Id-Version: de\n"
4+
"Report-Msgid-Bugs-To: \n"
5+
"POT-Creation-Date: 2026-07-04 00:00-0000\n"
6+
"PO-Revision-Date: 2025-05-19 21:02+0000\n"
7+
"Last-Translator: Mirko Leonhäuser <mirko@leonhaeuser.de>\n"
8+
"Language-Team: German <https://hosted.weblate.org/projects/gramps-project/"
9+
"addons/de/>\n"
10+
"Language: de\n"
11+
"MIME-Version: 1.0\n"
12+
"Content-Type: text/plain; charset=UTF-8\n"
13+
"Content-Transfer-Encoding: 8bit\n"
14+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
15+
"X-Generator: Weblate 5.12-dev\n"
16+
17+
msgid "Date of Death"
18+
msgstr "Todesdatum"
19+
20+
msgid "a gramplet that displays death dates in sorted order"
21+
msgstr "ein Gramplet, das die Todesdaten sortiert anzeigt"
22+
23+
msgid "No Family Tree loaded."
24+
msgstr "Kein Stammbaum geladen."
25+
26+
msgid "Sort dates of death by"
27+
msgstr "Sortieren Sie die Sterbedaten nach"
28+
29+
msgid "Month and day"
30+
msgstr "Monat und Tag"
31+
32+
msgid "Proximity to current date"
33+
msgstr "Nähe zum aktuellen Datum"
34+
35+
msgid "Processing..."
36+
msgstr "Verarbeite…"

DateOfDeathGramplet/po/es-local.po

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
msgid ""
2+
msgstr ""
3+
"Project-Id-Version: GRAMPS 3.1\n"
4+
"Report-Msgid-Bugs-To: \n"
5+
"POT-Creation-Date: 2026-07-04 00:00-0000\n"
6+
"PO-Revision-Date: 2026-05-04 21:37+0000\n"
7+
"Last-Translator: Francisco Serrador <fserrador@gmail.com>\n"
8+
"Language-Team: Spanish <https://hosted.weblate.org/projects/gramps-project/"
9+
"addons/es/>\n"
10+
"Language: es\n"
11+
"MIME-Version: 1.0\n"
12+
"Content-Type: text/plain; charset=UTF-8\n"
13+
"Content-Transfer-Encoding: 8bit\n"
14+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
15+
"X-Generator: Weblate 5.17.1\n"
16+
17+
msgid "Date of Death"
18+
msgstr "Fecha de fallecimiento"
19+
20+
msgid "a gramplet that displays death dates in sorted order"
21+
msgstr "un gramplet que muestra las fechas de fallecimiento ordenadas"
22+
"un gramplet que muestra las fechas de fallecimiento ordenadas por mes y día"
23+
24+
msgid "No Family Tree loaded."
25+
msgstr "No hay ningún árbol familiar cargado."
26+
27+
msgid "Sort dates of death by"
28+
msgstr "Ordenar fechas de muerte por"
29+
30+
msgid "Month and day"
31+
msgstr "mes y dia"
32+
33+
msgid "Proximity to current date"
34+
msgstr "Proximidad a la fecha actual"
35+
36+
msgid "Processing..."
37+
msgstr "Procesando…"

DateOfDeathGramplet/po/fa-local.po

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
msgid ""
2+
msgstr ""
3+
"Project-Id-Version: DateOfDeathGramplet\n"
4+
"Report-Msgid-Bugs-To: \n"
5+
"POT-Creation-Date: 2026-07-04 00:00-0000\n"
6+
"PO-Revision-Date: 2026-07-04 12:00+0000\n"
7+
"Last-Translator: Javad Razavian <javadr@gmail.com>\n"
8+
"Language-Team: Persian <https://hosted.weblate.org/projects/gramps-project/"
9+
"addons/fa/>\n"
10+
"Language: fa\n"
11+
"MIME-Version: 1.0\n"
12+
"Content-Type: text/plain; charset=UTF-8\n"
13+
"Content-Transfer-Encoding: 8bit\n"
14+
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
15+
"X-Generator: Weblate 5.13-dev\n"
16+
17+
msgid "Date of Death"
18+
msgstr "تاریخ فوت"
19+
20+
msgid "a gramplet that displays death dates in sorted order"
21+
msgstr "نموداری که تاریخ‌های مرگ را به ترتیب مرتب‌شده نمایش می‌دهد"
22+
23+
msgid "No Family Tree loaded."
24+
msgstr "هیچ شجره‌نامه‌ای بارگذاری نشده است."
25+
26+
msgid "Sort dates of death by"
27+
msgstr "تاریخ های مرگ را بر اساس مرتب کنید"
28+
29+
msgid "Month and day"
30+
msgstr "ماه و روز"
31+
32+
msgid "Proximity to current date"
33+
msgstr "نزدیکی به تاریخ فعلی"
34+
35+
msgid "Processing..."
36+
msgstr "در حال پردازش..."
37+
38+
#~ msgid "a gramplet that displays death dates sorted by month and day"
39+
#~ msgstr "یک گرمپلت که تاریخ‌های فوت را مرتب بر اساس ماه و روز نمایش می‌دهد"

DateOfDeathGramplet/po/fi-local.po

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
msgid ""
2+
msgstr ""
3+
"Project-Id-Version: fi\n"
4+
"Report-Msgid-Bugs-To: \n"
5+
"POT-Creation-Date: 2026-07-04 00:00-0000\n"
6+
"PO-Revision-Date: 2025-02-20 13:28+0000\n"
7+
"Last-Translator: Matti Niemelä <niememat@gmail.com>\n"
8+
"Language-Team: Finnish <https://hosted.weblate.org/projects/gramps-project/"
9+
"addons/fi/>\n"
10+
"Language: fi\n"
11+
"MIME-Version: 1.0\n"
12+
"Content-Type: text/plain; charset=UTF-8\n"
13+
"Content-Transfer-Encoding: 8bit\n"
14+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
15+
"X-Generator: Weblate 5.10.1-dev\n"
16+
"Generated-By: pygettext.py 1.4\n"
17+
18+
msgid "Date of Death"
19+
msgstr "Kuolinpäivä"
20+
21+
msgid "a gramplet that displays death dates in sorted order"
22+
msgstr "gramplet joka näyttää kuolinpäivät järjestettynä"
23+
"gramplet joka näyttää kuolinpäivät järjestettynä kuukauden ja päivän mukaan"
24+
25+
msgid "No Family Tree loaded."
26+
msgstr "Ei sukupuuta ladattu."
27+
28+
msgid "Sort dates of death by"
29+
msgstr "Lajittele kuolinpäivämäärät"
30+
31+
msgid "Month and day"
32+
msgstr "Kuukausi ja päivä"
33+
34+
msgid "Proximity to current date"
35+
msgstr "Läheisyys nykyiseen päivämäärään"
36+
37+
msgid "Processing..."
38+
msgstr "Käsitellään…"

0 commit comments

Comments
 (0)