diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000..1da66317f
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,13 @@
+# Python
+*.py[cod]
+
+# Distutils
+MANIFEST
+build/
+dist/
+
+# Gramps
+data/tips.xml
+gramps/gen/const.py
+gramps/plugins/lib/holidays.xml
+po/.intltool-merge-cache
diff --git a/Gramps.py b/Gramps.py
index 59a690e5f..30ed98abb 100644
--- a/Gramps.py
+++ b/Gramps.py
@@ -1,3 +1,4 @@
+#! /usr/bin/env python
#
# Gramps - a GTK+/GNOME based genealogy program
#
diff --git a/MANIFEST.in b/MANIFEST.in
index 16a3cc01d..f0115cb0d 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -11,34 +11,22 @@ include TestPlan.txt
recursive-include data *
recursive-include debian *
recursive-include docs *
+recursive-include gramps *
recursive-include help *
+recursive-include images *
recursive-include mac *
recursive-include po *
-recursive-include gramps *
recursive-include test *
recursive-include windows *
# Remove files created in the build
-exclude data/gramps.desktop
-exclude data/gramps.keys
-exclude data/gramps.xml
-recursive-exclude data/man *.1
-recursive-exclude data/man *.1.gz
-exclude gramps/const.py
-exclude gramps/data/tips.xml
+exclude data/tips.xml
+exclude gramps/gen/const.py
exclude gramps/plugins/lib/holidays.xml
-exclude po/*.gmo
exclude po/.intltool-merge-cache
-exclude po/stamp-it
-exclude po/POTFILES
global-exclude *.pyc
-global-exclude *.py~
global-exclude *.pyo
-global-exclude *.bak
# Remove directories which should not be included in the distribution
-prune src/guiQML
-prune src/webapp
-
-# Remove Makefiles used by autotools
-global-exclude Makefile*
+prune gramps/guiQML
+#prune gramps/webapp
diff --git a/README b/README
index 8d5ce47d7..253f0d92f 100644
--- a/README
+++ b/README
@@ -8,6 +8,7 @@ The following packages *MUST* be installed in order for Gramps to work:
Python 2.7 or greater, Python 3.2 or greater (python version cannot be mixed)
GTK 3.0 or greater
pygobject 3.3.2 or greater
+ cairo, pango, pangocairo with instrospection bindings (the gi packages)
librsvg2 (svg icon view)
xdg-utils
@@ -23,7 +24,7 @@ to your language:
The following packages are *STRONGLY RECOMMENDED* to be installed:
osmgpsmap Used to show maps in the geography view.
Without this the GeoView will not be active, see
- http://gramps-project.org/wiki/index.php?title=Gramps_3.3_Wiki_Manual_-_Main_Window#Geography_Category
+ http://gramps-project.org/wiki/index.php?title=Gramps_4.0_Wiki_Manual_-_Main_Window#Geography_Category
The package is named osmgpsmap, osm-gps-map
or python-osmgpsmap. Or obtain it from: http://nzjrs.github.com/osm-gps-map/
GraphViz Enable creation of graphs using GraphViz engine.
@@ -36,8 +37,15 @@ The following packages are *STRONGLY RECOMMENDED* to be installed:
The following packages are optional
gtkspell Enable spell checking in the notes. Gtkspell depends on
enchant. A version of gtkspell with gobject introspection
- is needed (if not the official yet, use
- https://github.com/manisandro/gtkspell3/tree/changes/gtkspell)
+ is needed, so minimally version 3.0.0
+
+ rcs The GNU Revision Control System (RCS) can be used to manage
+ multiple revisions of your family trees. See info at
+ http://www.gramps-project.org/wiki/index.php?title=Gramps_4.0_Wiki_Manual_-_Manage_Family_Trees#Archiving_a_Family_Tree
+ Only rcs is needed, NO python bindings are required
+
+ PIL Python Image Library is needed to convert non jpg images to
+ jpg so as to include them in LaTeX output
ttf-freefont More font support in the reports
@@ -63,9 +71,6 @@ No longer needed in 3.2:
No longer needed in 3.1:
yelp Gnome help browser. At the moment no help is shipped
-Remark: There is a conflict when using python-gnome2 in Ubuntu. This is evident
- with the error: TypeError: Error when calling the metaclass bases
- metaclass conflict
Documentation
---------------------------------
diff --git a/RELEASE_NOTES b/RELEASE_NOTES
index 1e60dc31d..f81ba030c 100644
--- a/RELEASE_NOTES
+++ b/RELEASE_NOTES
@@ -1,24 +1,33 @@
-Gramps 3.2 Release Notes
+"UNSTABLE Gramps 4.0.0 Alpha1 release.
-General Improvements
+This is a technology preview to allow plugin writers and packagers-installer
+writers to update their plugins and scripts. This release is not production
+ready, so use for testing!"
-* New Plugin System
-In the Help Menu -> Menu Status, all available plugins are visible. All plugins can be hidden, saving resources and hiding options you do not need. Eg: You don't use the Pedigree View? Hide it in the Plugin Status, and it will not be present anymore. You don't use vcard export? Hide it in the Plugin Status, and it will not be offered anymore.
+It is recommended to use Gramps 4.0.0 with python 3.2 so as to be ready
+for the future (python 2.7 works though).
-* Faster
-Many under the hood improvements have occurred that should improve perfamance enormously. Yes, new features are present to use all your processing power, but they are all implemented as plugins that can be hidden. Eg: Insert of a person in a 30000 people family tree took 4sec on 1.4Ghz PC in 3.1, Now it is done in milliseconds.
+The dependencies for Gramps 4.0.0 are _completely_ different than 3.4 due
+to the switch to GObject introspection, and the removal of autotools. So
+only install 4.0.0 if you are certain you can obtain the dependencies,
+see README and INSTALL.
-*New Views
-There are new views, and some views have been greatly improved
- - People view can now be sorted on the columns
- - A Place treeview is present, nicely grouping your places under country groups
- - GeoView has left it's beta status behind and shows your data on an
- online map (Openstreetmap or google maps, fast internet connection required)
- - Help Menu -> Extra Reports/Tools open a webpage with downloadable extra views
+For linux, in Ubuntu 12.10 you can install 4.0.0, but you will need to
+compile and install osmgpsmap manually to have the maps working (see
+http://www.gramps-project.org/wiki/index.php?title=GEPS_029:_GTK3-GObject_introspection_Conversion#OsmGpsMap_for_Geography )
-Other Improvements
+Major enhancements in Gramps 4.0.0:
-* Styled Notes now in most output formats that support styles, eg in the web report
-* New languages
-* Select language in which report should be created (only present now in some reports)
+* GEP 8: code reorganization: http://www.gramps-project.org/wiki/index.php?title=GEPS_008:_File_Organization
+
+* GEP 26: Replace make: http://www.gramps-project.org/wiki/index.php?title=GEPS_026:_Replace_%27make%27_for_Gramps_build
+
+* GEP 29: Gtk 3 :http://www.gramps-project.org/wiki/index.php?title=GEPS_029:_GTK3-GObject_introspection_Conversion
+
+* GEP 31: Python 3 support: http://www.gramps-project.org/wiki/index.php?title=GEPS_031:_Python_3_support
+
+More info in the manual
+http://www.gramps-project.org/wiki/index.php?title=Gramps_4.0_Wiki_Manual_-_What%27s_new%3F
+
+Everybody is invited to update the manual to make it current!
diff --git a/gramps/data/authors.xml b/data/authors.xml
similarity index 100%
rename from gramps/data/authors.xml
rename to data/authors.xml
diff --git a/data/grampsxml.dtd b/data/grampsxml.dtd
index 667c4a317..0c7f2958b 100644
--- a/data/grampsxml.dtd
+++ b/data/grampsxml.dtd
@@ -25,15 +25,15 @@
-->
@@ -215,7 +215,8 @@ EVENT
+ description?, attribute*, noteref*, citationref*, objref*,
+ tagref*)>
+ noteref*, objref*, data_item*, reporef*, tagref*)>
+ citationref*, tagref*)>
-
+
+ noteref*, objref*, data_item*, sourceref, tagref*)>
@@ -160,6 +160,9 @@
0
1
+
+
+
@@ -205,9 +208,6 @@
-
-
-
@@ -403,9 +403,6 @@
-
-
-
@@ -520,9 +517,6 @@
-
-
-
@@ -581,9 +575,6 @@
-
-
-
diff --git a/gramps/data/lds.xml b/data/lds.xml
similarity index 100%
rename from gramps/data/lds.xml
rename to data/lds.xml
diff --git a/data/man/Makefile.am b/data/man/Makefile.am
deleted file mode 100644
index 712effd33..000000000
--- a/data/man/Makefile.am
+++ /dev/null
@@ -1,14 +0,0 @@
-# This is the data/man level Makefile for Gramps
-# $Id$
-
-SUBDIRS = fr sv nl pl cs pt_BR
-
-man_IN_FILES = gramps.1.in
-man_MANS = $(man_IN_FILES:.1.in=.1)
-
-EXTRA_DIST = $(man_MANS) $(man_IN_FILES)
-
-gramps.1: $(top_builddir)/config.status gramps.1.in
- cd $(top_builddir) && CONFIG_FILES=data/man/$@ $(SHELL) ./config.status
-
-CLEANFILES=$(man_MANS)
diff --git a/data/man/conf.py b/data/man/conf.py
index 6b22c02bf..e98ebe14d 100644
--- a/data/man/conf.py
+++ b/data/man/conf.py
@@ -48,9 +48,9 @@ copyright = u'2012, Gramps project'
# built documents.
#
# The short X.Y version.
-version = '4.0'
+version = '4.1'
# The full version, including alpha/beta/rc tags.
-release = '4.0.0'
+release = 'trunk'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/data/man/cs/Makefile.am b/data/man/cs/Makefile.am
deleted file mode 100644
index 4f1441f6e..000000000
--- a/data/man/cs/Makefile.am
+++ /dev/null
@@ -1,14 +0,0 @@
-# This is the data/man/sv level Makefile for Gramps
-# $Id: Makefile.am 6189 2006-03-21 19:05:46Z rshura $
-
-man_IN_FILES = gramps.1.in
-man_MANS = $(man_IN_FILES:.1.in=.1)
-
-mandir = @mandir@/cs
-
-EXTRA_DIST = $(man_MANS) $(man_IN_FILES)
-
-gramps.1: $(top_builddir)/config.status gramps.1.in
- cd $(top_builddir) && CONFIG_FILES=data/man/cs/$@ $(SHELL) ./config.status
-
-CLEANFILES=$(man_MANS)
diff --git a/data/man/cs/cs.rst b/data/man/cs/cs.rst
index 6ac0942bb..2793b41f2 100644
--- a/data/man/cs/cs.rst
+++ b/data/man/cs/cs.rst
@@ -5,11 +5,11 @@ gramps(1) 3.4.0 gramps(1)
-JMÉNO
+**JMÉNO**
gramps - programový systém pro správu genealogického výzkumu a analýzy.
-POUŽITÍ
+**POUŽITÍ**
gramps [-?|--help] [--usage] [--version] [-l] [-u|--force-unlock]
[-O|--open= DATABÁZE [-f|--format= FORMÁT]] [-i|--import= SOUBOR
[-f|--format= FORMÁT]] [-i|--import= ...] [-e|--export= SOUBOR
@@ -17,7 +17,7 @@ POUŽITÍ
SOUBOR ] [--version]
-POPIS
+**POPIS**
Gramps je zdarma šířený Open Source genealogický program. Je napsán v
jazyce Python s využitím rozhraní GTK+/GNOME. Gramps bude povědomý
komukoli, kdo už pracoval s jinými genealogickými programy jako Family
@@ -26,8 +26,8 @@ POPIS
rozšířen a je využíván téměř všemi ostatními genealogickými programy.
-MOŽNOSTI
- gramps SOUBOR
+**MOŽNOSTI**
+ **gramps** *SOUBOR*
Pokud je zadán SOUBOR (bez dalších parametrů) jako název rodok‐
menu nebo jako adresář databáze rodokmenu, je gramps otevřeno v
interaktivním módu. Pokud je SOUBOR formátem podporovaným
@@ -39,7 +39,7 @@ MOŽNOSTI
data ve formátu podporovaném gramps, viz dále.
- -f,--format= FORMÁT
+ **-f** , **--format=** *FORMÁT*
Explicitně definuje formát SOUBORu předchozího parametru -i,
nebo -e. Pokud není parametr -f pro SOUBOR specifikován, bude
automaticky použit formát odpovídající koncovce souboru nebo
@@ -60,21 +60,22 @@ MOŽNOSTI
parametrem -f).
- -l Vypíše seznam známých rodokmenů.
+ **-l**
+ Vypíše seznam známých rodokmenů.
- -u,--force-unlock
+ **-u** , **--force-unlock**
Odemkne zamčenou databázi.
- -O,--open= DATABÁZE
- Otevření DATABÁZE. Hodnota musí být existujícím databázovým
+ **-O** , **--open=** *DATABÁZE*
+ Otevření *DATABÁZE* . Hodnota musí být existujícím databázovým
adresářem, nebo názvem existujícího rodokmenu. Pokud na
příkazové řádce nejsou žádné parametry importu nebo exportu, je
nad danou databází spuštěna interaktivní relace.
- -i,--import= SOUBOR
+ **-i** , **--import=** *SOUBOR*
Importuje data ze SOUBORu. Pokud není specifikována databáze, je
použita dočasná. Ta je po ukončení gramps smazána.
@@ -85,7 +86,7 @@ MOŽNOSTI
různá gramps ID.
- -a,--action= AKCE
+ **-a** , **--action=** *AKCE*
Provedení AKCE nad importovanými daty. Akce jsou spuštěny poté
co jsou všechny importy dat úspěšně ukončeny. V tuto chvíli jsou
podporovány následující akce: summary (stejné jako
@@ -104,17 +105,17 @@ MOŽNOSTI
konkrétní nástroj nebo zprávu. Existují ale i takové, které
jsou společné.
- name=name
+ **name=name**
Povinná předvolba určující který nástroj nebo zpráva bude
spuštěna. Pokud zadané name neodpovídá žádné dostupné
funkčnosti, vypíše se chybové hlášení následované seznamem dos‐
tupných nástrojů a zpráv (záleží na AKCE).
- show=all
+ **show=all**
Vytvoří seznam názvů všech předvoleb dostupných pro danou zprávu
nebo nástroj.
- show=optionname
+ **show=optionname**
Vypíše popis všech funkcionalit poskytnutých optionname, ale
také všechny přijatelné typy a hodnoty pro tuto volbu.
@@ -126,17 +127,17 @@ MOŽNOSTI
předvolbou -a. Akce jsou prováděny jedna za druhou v zadaném pořadí.
- -d,--debug= LOGGER_NAME
+ **-d** , **--debug=** *LOGGER_NAME*
Zapne ladicí výstup pro vývoj a testování. Detaily najdete ve
zdrojovém kódu.
- --version
+ **--version**
Vytiskne číslo verze gramps a skončí
-Chování
+**Chování**
Pokud první parametr příkazové řádky nezačíná pomlčkou, pokusí se
gramps otevřít soubor s názvem daným prvním argumentem na příkazové
řádce a spustit interaktivní relaci. Zbytek argumentů na příkazové
@@ -174,7 +175,7 @@ Chování
obvyklá přesměrování výstupů stdout a stderr příkazové řádky.
-PŘÍKLADY
+**PŘÍKLADY**
Otevření existujícího rodokmenu a import xml souboru do něho může být
proveden takto:
@@ -216,20 +217,20 @@ PŘÍKLADY
gramps
-PROMĚNNÉ PROSTŘEDÍ
+**PROMĚNNÉ PROSTŘEDÍ**
Program kontroluje, zda jsou nastaveny následující proměnné:
- LANG - popisuje, který jazyk bude použit: Příklad: pro češtinu musí mít
+ **LANG** - popisuje, který jazyk bude použit: Příklad: pro češtinu musí mít
proměnná hodnotu cs_CZ.utf8.
- GRAMPSHOME - pokud je nastavena, Gramps použije její hodnotu jako
+ **GRAMPSHOME** - pokud je nastavena, Gramps použije její hodnotu jako
adresář v němž jsou uložena nastavení a databáze. Ve výchozím stavu,
kdy proměnná není nastavena gramps předpokládá že adresář s databázemi
a nastavením bude vytvořen v adresáři s uživatelským profile (popsán
proměnnou prostředí HOME v Linuxu nebo USERPROFILE ve Windows 2000/XP).
-KONCEPTY
+**KONCEPTY**
gramps podporuje systém zásuvných modulů založených na jazyku python
jehož prostřednictvím umožňuje přidání import/export modulů, modulů
pro vytváření zpráv, nástrojů a zobrazovacích filtrů bez nutnosti
@@ -240,17 +241,22 @@ KONCEPTY
nebo LaTeX. Tím dává možnost přizpůsobit formát požadavku uživatelů.
-ZNÁMÉ CHYBY A OMEZENÍ
+**ZNÁMÉ CHYBY A OMEZENÍ**
nejsou
-SOUBORY
- ${PREFIX}/bin/gramps
- ${PREFIX}/share/gramps
- ${HOME}/.gramps
+**SOUBORY**
+
+ *${PREFIX}/bin/gramps*
+
+ *${PREFIX}/lib/python/dist-packages/gramps/*
+
+ *${PREFIX}/share/*
+
+ *${HOME}/.gramps*
-AUTOŘI
+**AUTOŘI**
Donald Allingham
http://gramps-project.org/
@@ -262,7 +268,7 @@ AUTOŘI
Zdeněk Hataš
-DOKUMENTACE
+**DOKUMENTACE**
Uživatelská dokumentace je k dispozici prostřednictvím standardního
prohlížeče nápovědy GNOME ve formě příručky Gramps. Příručka je také
dostupná ve formátu XML jako gramps-manual.xml v adresáři doc/gramps-
@@ -273,4 +279,4 @@ DOKUMENTACE
-Leden 2011 3.4.0 gramps(1)
+Leden 2012 3.4.0 gramps(1)
diff --git a/data/man/en.rst b/data/man/en.rst
index 849c1cf2c..6b99fb62a 100644
--- a/data/man/en.rst
+++ b/data/man/en.rst
@@ -1,7 +1,7 @@
English
=======
-gramps(1) 4.0.0 gramps(1)
+gramps(1) @VERSION@ gramps(1)
@@ -262,11 +262,14 @@ gramps(1) 4.0.0 gramps(1)
**KNOWN BUGS AND LIMITATIONS**
-**FILES**
+**FILES**
+
*${PREFIX}/bin/gramps*
- *${PREFIX}/share/gramps*
+ *${PREFIX}/lib/python/dist-packages/gramps/*
+
+ *${PREFIX}/share/*
*${HOME}/.gramps*
@@ -293,4 +296,4 @@ gramps(1) 4.0.0 gramps(1)
-January 2013 4.0.0 gramps(1)
+gramps(1) @VERSION@ gramps(1)
diff --git a/data/man/fr/Makefile.am b/data/man/fr/Makefile.am
deleted file mode 100644
index c43637490..000000000
--- a/data/man/fr/Makefile.am
+++ /dev/null
@@ -1,14 +0,0 @@
-# This is the data/man/fr level Makefile for Gramps
-# $Id$
-
-man_IN_FILES = gramps.1.in
-man_MANS = $(man_IN_FILES:.1.in=.1)
-
-mandir = @mandir@/fr
-
-EXTRA_DIST = $(man_MANS) $(man_IN_FILES)
-
-gramps.1: $(top_builddir)/config.status gramps.1.in
- cd $(top_builddir) && CONFIG_FILES=data/man/fr/$@ $(SHELL) ./config.status
-
-CLEANFILES=$(man_MANS)
diff --git a/data/man/fr/conf.py b/data/man/fr/conf.py
index 5aea67a6c..e3032122c 100644
--- a/data/man/fr/conf.py
+++ b/data/man/fr/conf.py
@@ -48,9 +48,9 @@ copyright = u'2012, Gramps project'
# built documents.
#
# The short X.Y version.
-version = '4.0'
+version = '4.1'
# The full version, including alpha/beta/rc tags.
-release = '4.0.0'
+release = 'trunk'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/data/man/fr/fr.rst b/data/man/fr/fr.rst
index d9cef1e93..7caa6433a 100644
--- a/data/man/fr/fr.rst
+++ b/data/man/fr/fr.rst
@@ -1,9 +1,7 @@
French
=======
-
-gramps(1) 4.0.0 gramps(1)
-
+gramps(1) @VERSION@ gramps(1)
**NOM**
@@ -34,33 +32,33 @@ gramps(1) 4.0.0 gramps(1)
**OPTIONS**
**gramps** *FICHIER*
- Si *FICHIER* est désigné (sans autres commandes) comme arbre
- familial ou comme répertoire d'arbre familial, alors une session
- interactive est ouverte. Si *FICHIER* est un format de fichier
- supporté par Gramps, une base vide est créée dont le nom est
- celui du *FICHIER* et les données y seront importées. Les autres
- options sont ignorées. Ce type de lancement permet d'utiliser
- gramps pour manipuler des données comme dans un navigateur web.
- Les formats natifs de gramps sont acceptés, voir ci-dessous.
+ Si *FICHIER* est désigné (sans autres commandes) comme arbre
+ familial ou comme répertoire d'arbre familial, alors une session
+ interactive est ouverte. Si *FICHIER* est un format de fichier
+ supporté par Gramps, une base vide est créée dont le nom est
+ celui du *FICHIER* et les données y seront importées. Les autres
+ options sont ignorées. Ce type de lancement permet d'utiliser
+ gramps pour manipuler des données comme dans un navigateur web.
+ Les formats natifs de gramps sont acceptés, voir ci-dessous.
**-f** , **--format=** *FORMAT*
- Le format spécifique du *FICHIER* est précédé par les arguments
- **-i** , ou **-e** . Si l'option **-f** n'est pas donnée pour le *FICHIER* ,
- alors le format sera celui de l'extension ou du type-MIME.
+ Le format spécifique du *FICHIER* est précédé par les arguments
+ **-i** , ou **-e** . Si l'option **-f** n'est pas donnée pour le *FICHIER* ,
+ alors le format sera celui de l'extension ou du type-MIME.
- Les formats de sortie disponibles sont **gramps-xml** (deviné si
- *FICHIER* se termine par **.gramps** ), et **gedcom** (deviné si *FICHIER* se
- termine par **.ged** ), ou tout autre fichier d'exportation
- disponible dans le système de plugin Gramps.
+ Les formats de sortie disponibles sont **gramps-xml** (deviné si
+ *FICHIER* se termine par **.gramps** ), et **gedcom** (deviné si *FICHIER* se
+ termine par **.ged** ), ou tout autre fichier d'exportation
+ disponible dans le système de plugin Gramps.
- Les formats disponibles pour l'importation sont **grdb** ,
- **gramps-xml** , **gedcom** , **gramps-pkg** (deviné si *FICHIER* se termine par
- **.gpkg** ), et **geneweb** (deviné si *FICHIER* se termine par **.gw** ).
+ Les formats disponibles pour l'importation sont **grdb** ,
+ **gramps-xml** , **gedcom** , **gramps-pkg** (deviné si *FICHIER* se termine par
+ **.gpkg** ), et **geneweb** (deviné si *FICHIER* se termine par **.gw** ).
- Les formats disponibles pour l'exportation sont **gramps-xml** , **ged‐
- com** , **gramps-pkg** , **wft** (deviné si *FICHIER* se termine par **.wft** ),
- **geneweb** .
+ Les formats disponibles pour l'exportation sont **gramps-xml** , **ged‐
+ com** , **gramps-pkg** , **wft** (deviné si *FICHIER* se termine par **.wft** ),
+ **geneweb** .
**-l**
@@ -68,29 +66,29 @@ gramps(1) 4.0.0 gramps(1)
**-u** , **--force-unlock**
- Débloquer une base de données verrouillée.
+ Débloquer une base de données verrouillée.
**-O** , **--open=** *BASE_DE_DONNEES*
- Ouvrir une *BASE_DE_DONNEES* qui doit être une base présente dans
- le répertoire des bases ou le nom d'un arbre familial existant.
- Si aucune action n'est définie, les options d'import ou d'export
- sont données par la ligne de commande puis une session interac‐
- tive est ouverte, utilisant cette base de données.
+ Ouvrir une *BASE_DE_DONNEES* qui doit être une base présente dans
+ le répertoire des bases ou le nom d'un arbre familial existant.
+ Si aucune action n'est définie, les options d'import ou d'export
+ sont données par la ligne de commande puis une session interactive
+ est ouverte, utilisant cette base de données.
- Seulement une base peut être ouverte. Si vous utilisez plusieurs
- sources, vous devez utiliser l'option d'import.
+ Seulement une base peut être ouverte. Si vous utilisez plusieurs
+ sources, vous devez utiliser l'option d'import.
**-i** , **--import=** *FICHIER*
- Importer des données depuis un *FICHIER* . Si vous n'avez pas
- spécifié de base de données alors une base de données temporaire
- est utilisée; elle sera effacée quand vous quitterez gramps.
+ Importer des données depuis un *FICHIER* . Si vous n'avez pas
+ spécifié de base de données alors une base de données temporaire
+ est utilisée; elle sera effacée quand vous quitterez gramps.
- Quand plus d'un fichier doit être importé, chacun doit être
- précédé par la commande **-i** . Ces fichiers sont importés dans le
- même ordre, i.e. **-i** *FICHIER1* **-i** *FICHIER2* et **-i** *FICHIER2* **-i**
- *FICHIER1* vont tous les deux produire différents IDs gramps.
+ Quand plus d'un fichier doit être importé, chacun doit être
+ précédé par la commande **-i** . Ces fichiers sont importés dans le
+ même ordre, **-i** *FICHIER1* **-i** *FICHIER2* et **-i** *FICHIER2* **-i**
+ *FICHIER1* vont tous les deux produire différents IDs gramps.
**-e** , **--export=** *FICHIER*
@@ -104,40 +102,38 @@ gramps(1) 4.0.0 gramps(1)
**-a** , **--action=** *ACTION*
- Accomplir une *ACTION* sur les données importées. C'est effectué à
- la fin de l'importation. Les actions possibles sont **summary**
- (comme le rapport -> Afficher -> Statistiques sur la base),
- **check** (comme l'outil -> Réparation de la base -> Vérifier et
- réparer), **report** (produit un rapport) et **tool** (utilise un
- outil), ces derniers ont besoin de OPTION précédé par la com‐
- mande -p.
+ Accomplir une *ACTION* sur les données importées. C'est effectué à
+ la fin de l'importation. Les actions possibles sont **summary**
+ (comme le rapport -> Afficher -> Statistiques sur la base),
+ **check** (comme l'outil -> Réparation de la base -> Vérifier et
+ réparer), **report** (produit un rapport) et **tool** (utilise un
+ outil), ces derniers ont besoin de *OPTION* précédé par la commande -p.
- L' *OPTION* doit satisfaire ces conditions:
- Il ne doit pas y avoir d'espace. Si certains arguments doivent
- utiliser des espaces, la chaîne doit être encadrée par des
- guillemets. Les options vont par paire nom et valeur. Une
- paire est séparée par un signe égal. Différentes paires sont
- séparées par une virgule.
+ L' *OPTION* doit satisfaire ces conditions:
+ Il ne doit pas y avoir d'espace. Si certains arguments doivent
+ utiliser des espaces, la chaîne doit être encadrée par des
+ guillemets. Les options vont par paire nom et valeur. Une
+ paire est séparée par un signe égal. Différentes paires sont
+ séparées par une virgule.
- La plupart des options sont spécifiques à chaque rapport. Même
- s'il existe des options communes.
+ La plupart des options sont spécifiques à chaque rapport. Même
+ s'il existe des options communes.
- **name=name**
- Cette option est obligatoire, elle détermine quel rapport ou
- outil sera utilisé. Si le name saisi ne correspond à aucun mod‐
- ule disponible, un message d'erreur sera ajouté.
+ **name=name**
+ Cette option est obligatoire, elle détermine quel rapport ou
+ outil sera utilisé. Si le name saisi ne correspond à aucun
+ module disponible, un message d'erreur sera ajouté.
- **show=all**
- Cette option produit une liste avec les noms des options
- disponibles pour un rapport donné.
+ **show=all**
+ Cette option produit une liste avec les noms des options
+ disponibles pour un rapport donné.
- **show=optionname**
- Cette option affiche une description de toutes les fonction‐
- nalités proposées par optionname, aussi bien les types que les
- valeurs pour une option.
+ **show=optionname**
+ Cette option affiche une description de toutes les fonctionnalités
+ proposées par optionname, aussi bien les types que les valeurs pour une option.
- Utiliser les options ci-dessus pour trouver tout sur un rapport
- choisi.
+ Utiliser les options ci-dessus pour trouver tout sur un rapport
+ choisi.
Quand plus d'une action doit être effectuée, chacune doit être précédée
@@ -146,23 +142,23 @@ gramps(1) 4.0.0 gramps(1)
**-d** , **--debug=** *NOM_LOGGER*
- Permet les logs de debug pour le développement et les tests.
- Regarder le code source pour les détails.
+ Permet les logs de debug pour le développement et les tests.
+ Regarder le code source pour les détails.
**--version**
- Imprime le numéro de version pour gramps puis quitte.
+ Imprime le numéro de version pour gramps puis quitte.
**Opération**
Si le premie argument de la ligne de commande ne commence pas par un
- tiret (i.e. pas d'instruction), gramps va essayer d'ouvrir la base de
- données avec le nom donné par le premier argument et démarrer une ses‐
+ tiret (i.e. pas d'instruction), gramps va essayer d'ouvrir la base de
+ données avec le nom donné par le premier argument et démarrer une ses‐
sion interactive, en ignorant le reste de la ligne de commande.
- Si la commande **-O** est notée, alors gramps va essayer le fichier défini
+ Si la commande **-O** est notée, alors gramps va essayer le fichier défini
et va travailler avec ses données, comme pour les autres paramètres de
la ligne de commande.
@@ -172,8 +168,8 @@ gramps(1) 4.0.0 gramps(1)
L'ordre des options **-i** , **-e** , ou **-a** n'a pas de sens. L'ordre actuel est
- toujours : imports -> actions -> exports. Mais l'ouverture doit tou‐
- jours être la première !
+ toujours : imports -> actions -> exports. Mais l'ouverture doit toujours
+ être la première !
Si aucune option **-O** ou **-i** n'est donnée, gramps lancera sa propre
@@ -185,7 +181,7 @@ gramps(1) 4.0.0 gramps(1)
Cette base sera **import_db.grdb** dans le répertoire **~/.gramps/import**.
- Les erreurs rencontrées lors d'importation, d'exportation, ou d'action, seront
+ Les erreurs rencontrées lors d'importation, d'exportation, ou d'action, seront
mémorisées en *stdout* (si elles sont le fait de la manipulation par
gramps) ou en *stderr* (si elles ne sont pas le fait d'une manipulation).
Utilisez les shell de redirection de *stdout* et *stderr* pour sauver
@@ -193,46 +189,46 @@ gramps(1) 4.0.0 gramps(1)
**EXEMPLES**
- Pour ouvrir un arbre familial et y importer un fichier XML, on peut
+ Pour ouvrir un arbre familial et y importer un fichier XML, on peut
saisir:
- **gramps -O** *'Mon Arbre Familial'* **-i** *~/db3.gramps*
+ **gramps -O** *'Mon Arbre Familial'* **-i** *~/db3.gramps*
- Ceci ouvre un arbre familial, pour faire la même chose, mais importer
- dans un arbre familial temporaire et démarrer une session interactive,
- on peut saisir:
+ Ceci ouvre un arbre familial, pour faire la même chose, mais importer
+ dans un arbre familial temporaire et démarrer une session interactive,
+ on peut saisir :
- **gramps -i** *'Mon Arbre Familial'* **-i** *~/db3.gramps*
+ **gramps -i** *'Mon Arbre Familial'* **-i** *~/db3.gramps*
- Lecture de quatre bases de données dont les formats peuvent être
+ Lecture de quatre bases de données dont les formats peuvent être
devinés d'après les noms, puis vérification des données:
**gramps -i** *file1.ged* **-i** *file2.tgz* **-i** *~/db3.gramps*
**-i** *file4.wft* **-a** *check*
- Si vous voulez préciser les formats de fichiers dans l'exemple ci-
+ Si vous voulez préciser lesformats de fichiers dans l'exemple ci-
dessus, complétez les noms de fichiers par les options -f appropriées:
**gramps -i** *file1.ged* **-f** *gedcom* **-i** *file2.tgz* **-f**
*gramps-pkg* **-i** *~/db3.gramps* **-f** *gramps-xml* **-i** *file4.wft*
**-f** *wft* **-a** *check*
- Pour enregistrer le résultat des lectures, donnez l'option -e
- (utiliser -f si le nom de fichier ne permet pas à gramps de deviner le
+ Pour enregistrer le résultat des lectures, donnez l'option **-e**
+ (utiliser -f si le nom de fichier ne permet pas à gramps de deviner le
format):
**gramps -i** *file1.ged* **-i** *file2.tgz* **-e** *~/new-package*
**-f** *gramps-pkg*
- Pour lire trois ensembles de données puis lancer une session interac‐
- tive de gramps sur le tout :
+ Pour lire trois ensembles de données puis lancer une session
+ interactive de gramps sur le tout :
- **gramps -i** *file1.ged* **-i** *file2.tgz* **-i** *~/db3.gramps*
+ **gramps -i** *file1.ged* **-i** *file2.tgz* **-i** *~/db3.gramps*
- Pour lancer l'outil de vérification de la base de données depuis la
+ Pour lancer l'outil de vérification de la base de données depuis la
ligne de commande et obtenir le résultat :
- **gramps -O** *'My Family Tree'* **-a** *tool* **-p name=** *verify*
+ **gramps -O** *'My Family Tree'* **-a** *tool* **-p name=** *verify*
Enfin, pour lancer une session interactive normale, entrer :
@@ -242,35 +238,37 @@ gramps(1) 4.0.0 gramps(1)
**VARIABLES D'ENVIRONMENT**
Le programme vérifie si ces variables d'environnement sont déclarées:
- **LANG** - décrit, quelle langue est utilisée: Ex.: pour le français on
+ **LANG** - décrit, quelle langue est utilisée: Ex.: pour le français on
peut définir fr_FR.UTF-8.
- **GRAMPSHOME** - si défini, force Gramps à utiliser un répertoire
- spécifique pour y conserver ses préférences et bases de données. Par
- défaut, cette variable n'est pas active et Gramps sait que les options
- et bases de données doivent être créées dans le répertoire par défaut
- de l'utilisateur (la variable d'environnement HOME pour Linux ou USER‐
+ **GRAMPSHOME** - si défini, force Gramps à utiliser un répertoire
+ spécifique pour y conserver ses préférences et bases de données. Par
+ défaut, cette variable n'est pas active et Gramps sait que les options
+ et bases de données doivent être créées dans le répertoire par défaut
+ de l'utilisateur (la variable d'environnement HOME pour Linux ou USER‐
PROFILE pour Windows 2000/XP).
**CONCEPTS**
- Gramps est un système basé sur le support de plugin-python, permettant
- d'importer et d'exporter, la saisie, générer des rapports, des outils,
- et afficher des filtres pouvant être ajoutés sans modifier le pro‐
- gramme.
+ Gramps est un système basé sur le support de plugin-python, permettant
+ d'importer et d'exporter, la saisie, générer des rapports, des outils,
+ et afficher des filtres pouvant être ajoutés sans modifier le programme.
Par ailleurs, gramps permet la génération directe : impression, rap‐
ports avec sortie vers d'autres formats, comme *LibreOffice.org* ,
- *HTML* , ou *LaTeX* pour permettre à l'utilisateur de choisir selon ses
+ *HTML* , ou *LaTeX* pour permettre à l'utilisateur de choisir selon ses
besoins
**BUGS CONNUS ET LIMITATIONS**
+
**FICHIERS**
*${PREFIX}/bin/gramps*
- *${PREFIX}/share/gramps*
+ *${PREFIX}/lib/python/dist-packages/gramps/*
+
+ *${PREFIX}/share/*
*${HOME}/.gramps*
@@ -279,24 +277,24 @@ gramps(1) 4.0.0 gramps(1)
Donald Allingham
http://gramps-project.org/
- Cette page man a d'abord été écrite par:
+ Cette page man a d'abord été écrite par :
Brandon L. Griffith
pour Debian GNU/Linux système.
- Cette page man est maintenue par:
+ Cette page man est maintenue par :
Gramps project
- La traduction française:
+ La traduction française :
Jérôme Rapinat
**DOCUMENTATION**
- La documentation-utilisateur est disponible par via un navigateur
+ La documentation-utilisateur est disponible par un navigateur
standard sous la forme du manuel Gramps.
- La documentation pour développeur est disponible sur le site
+ La documentation pour développeur est disponible sur le site
http://www.gramps-project.org/wiki/index.php?title=Portal:Developers .
-Janvier 2013 4.0.0 gramps(1)
+gramps(1) @VERSION@ gramps(1)
diff --git a/data/man/fr/gramps.1.in b/data/man/fr/gramps.1.in
index 1053512b5..fd0294cc3 100644
--- a/data/man/fr/gramps.1.in
+++ b/data/man/fr/gramps.1.in
@@ -1,4 +1,4 @@
-.TH "GRAMPS" "1" "02 December 2012" "4.0" "Gramps"
+.TH "GRAMPS" "1" "28 December 2012" "4.0" "Gramps"
.SH NAME
gramps \- Gramps Documentation
.
@@ -28,10 +28,10 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
.
.sp
-gramps(1) 4.0.0 gramps(1)
+gramps(1) @VERSION@ gramps(1)
.INDENT 0.0
.TP
.B \fBNOM\fP
@@ -72,7 +72,7 @@ Les formats natifs de gramps sont acceptés, voir ci\-dessous.
.TP
.B \fB\-f\fP , \fB\-\-format=\fP \fIFORMAT\fP
Le format spécifique du \fIFICHIER\fP est précédé par les arguments
-\fB\-i\fP , ou \fB\-e\fP . Si l\(aqoption \fB\-f\fP n\(aqest pas donnée pour le \fIFICHIER\fP ,
+\fB\-i\fP , ou \fB\-e\fP . Si l\(aqoption \fB\-f\fP n\(aqest pas donnée pour le \fIFICHIER\fP ,
alors le format sera celui de l\(aqextension ou du type\-MIME.
.sp
Les formats de sortie disponibles sont \fBgramps\-xml\fP (deviné si
@@ -96,10 +96,10 @@ Débloquer une base de données verrouillée.
.TP
.B \fB\-O\fP , \fB\-\-open=\fP \fIBASE_DE_DONNEES\fP
Ouvrir une \fIBASE_DE_DONNEES\fP qui doit être une base présente dans
-le répertoire des bases ou le nom d\(aqun arbre familial existant.
+le répertoire des bases ou le nom d\(aqun arbre familial existant.
Si aucune action n\(aqest définie, les options d\(aqimport ou d\(aqexport
-sont données par la ligne de commande puis une session interac‐
-tive est ouverte, utilisant cette base de données.
+sont données par la ligne de commande puis une session interactive
+est ouverte, utilisant cette base de données.
.sp
Seulement une base peut être ouverte. Si vous utilisez plusieurs
sources, vous devez utiliser l\(aqoption d\(aqimport.
@@ -109,9 +109,9 @@ Importer des données depuis un \fIFICHIER\fP . Si vous n\(aqavez pas
spécifié de base de données alors une base de données temporaire
est utilisée; elle sera effacée quand vous quitterez gramps.
.sp
-Quand plus d\(aqun fichier doit être importé, chacun doit être
+Quand plus d\(aqun fichier doit être importé, chacun doit être
précédé par la commande \fB\-i\fP . Ces fichiers sont importés dans le
-même ordre, i.e. \fB\-i\fP \fIFICHIER1\fP \fB\-i\fP \fIFICHIER2\fP et \fB\-i\fP \fIFICHIER2\fP \fB\-i\fP
+même ordre, \fB\-i\fP \fIFICHIER1\fP \fB\-i\fP \fIFICHIER2\fP et \fB\-i\fP \fIFICHIER2\fP \fB\-i\fP
\fIFICHIER1\fP vont tous les deux produire différents IDs gramps.
.TP
.B \fB\-e\fP , \fB\-\-export=\fP \fIFICHIER\fP
@@ -125,38 +125,36 @@ même ordre.
.TP
.B \fB\-a\fP , \fB\-\-action=\fP \fIACTION\fP
Accomplir une \fIACTION\fP sur les données importées. C\(aqest effectué à
-la fin de l\(aqimportation. Les actions possibles sont \fBsummary\fP
-(comme le rapport \-> Afficher \-> Statistiques sur la base),
-\fBcheck\fP (comme l\(aqoutil \-> Réparation de la base \-> Vérifier et
-réparer), \fBreport\fP (produit un rapport) et \fBtool\fP (utilise un
-outil), ces derniers ont besoin de OPTION précédé par la com‐
-mande \-p.
+la fin de l\(aqimportation. Les actions possibles sont \fBsummary\fP
+(comme le rapport \-> Afficher \-> Statistiques sur la base),
+\fBcheck\fP (comme l\(aqoutil \-> Réparation de la base \-> Vérifier et
+réparer), \fBreport\fP (produit un rapport) et \fBtool\fP (utilise un
+outil), ces derniers ont besoin de \fIOPTION\fP précédé par la commande \-p.
.sp
L\(aq \fIOPTION\fP doit satisfaire ces conditions:
-Il ne doit pas y avoir d\(aqespace. Si certains arguments doivent
-utiliser des espaces, la chaîne doit être encadrée par des
-guillemets. Les options vont par paire nom et valeur. Une
+Il ne doit pas y avoir d\(aqespace. Si certains arguments doivent
+utiliser des espaces, la chaîne doit être encadrée par des
+guillemets. Les options vont par paire nom et valeur. Une
paire est séparée par un signe égal. Différentes paires sont
séparées par une virgule.
.sp
-La plupart des options sont spécifiques à chaque rapport. Même
+La plupart des options sont spécifiques à chaque rapport. Même
s\(aqil existe des options communes.
.sp
\fBname=name\fP
-Cette option est obligatoire, elle détermine quel rapport ou
-outil sera utilisé. Si le name saisi ne correspond à aucun mod‐
-ule disponible, un message d\(aqerreur sera ajouté.
+Cette option est obligatoire, elle détermine quel rapport ou
+outil sera utilisé. Si le name saisi ne correspond à aucun
+module disponible, un message d\(aqerreur sera ajouté.
.sp
\fBshow=all\fP
-Cette option produit une liste avec les noms des options
+Cette option produit une liste avec les noms des options
disponibles pour un rapport donné.
.sp
\fBshow=optionname\fP
-Cette option affiche une description de toutes les fonction‐
-nalités proposées par optionname, aussi bien les types que les
-valeurs pour une option.
+Cette option affiche une description de toutes les fonctionnalités
+proposées par optionname, aussi bien les types que les valeurs pour une option.
.sp
-Utiliser les options ci\-dessus pour trouver tout sur un rapport
+Utiliser les options ci\-dessus pour trouver tout sur un rapport
choisi.
.UNINDENT
.sp
@@ -166,7 +164,7 @@ l\(aqordre spécifié.
.INDENT 7.0
.TP
.B \fB\-d\fP , \fB\-\-debug=\fP \fINOM_LOGGER\fP
-Permet les logs de debug pour le développement et les tests.
+Permet les logs de debug pour le développement et les tests.
Regarder le code source pour les détails.
.TP
.B \fB\-\-version\fP
@@ -175,11 +173,11 @@ Imprime le numéro de version pour gramps puis quitte.
.TP
.B \fBOpération\fP
Si le premie argument de la ligne de commande ne commence pas par un
-tiret (i.e. pas d\(aqinstruction), gramps va essayer d\(aqouvrir la base de
-données avec le nom donné par le premier argument et démarrer une ses‐
+tiret (i.e. pas d\(aqinstruction), gramps va essayer d\(aqouvrir la base de
+données avec le nom donné par le premier argument et démarrer une ses‐
sion interactive, en ignorant le reste de la ligne de commande.
.sp
-Si la commande \fB\-O\fP est notée, alors gramps va essayer le fichier défini
+Si la commande \fB\-O\fP est notée, alors gramps va essayer le fichier défini
et va travailler avec ses données, comme pour les autres paramètres de
la ligne de commande.
.sp
@@ -187,8 +185,8 @@ Avec ou sans la commande \fB\-O\fP , il peut y avoir plusieurs imports,
exports, et actions dans la ligne de commande \fB\-i\fP , \fB\-e\fP , et \fB\-a\fP .
.sp
L\(aqordre des options \fB\-i\fP , \fB\-e\fP , ou \fB\-a\fP n\(aqa pas de sens. L\(aqordre actuel est
-toujours : imports \-> actions \-> exports. Mais l\(aqouverture doit tou‐
-jours être la première !
+toujours : imports \-> actions \-> exports. Mais l\(aqouverture doit toujours
+être la première !
.sp
Si aucune option \fB\-O\fP ou \fB\-i\fP n\(aqest donnée, gramps lancera sa propre
fenêtre et demarrera avec une base vide, puisqu\(aqil n\(aqy a pas données.
@@ -204,7 +202,7 @@ Utilisez les shell de redirection de \fIstdout\fP et \fIstderr\fP pour sauver
les messages et les erreurs dans les fichiers.
.TP
.B \fBEXEMPLES\fP
-Pour ouvrir un arbre familial et y importer un fichier XML, on peut
+Pour ouvrir un arbre familial et y importer un fichier XML, on peut
saisir:
.INDENT 7.0
.INDENT 3.5
@@ -212,16 +210,16 @@ saisir:
.UNINDENT
.UNINDENT
.sp
-Ceci ouvre un arbre familial, pour faire la même chose, mais importer
-dans un arbre familial temporaire et démarrer une session interactive,
-on peut saisir:
+Ceci ouvre un arbre familial, pour faire la même chose, mais importer
+dans un arbre familial temporaire et démarrer une session interactive,
+on peut saisir :
.INDENT 7.0
.INDENT 3.5
\fBgramps \-i\fP \fI\(aqMon Arbre Familial\(aq\fP \fB\-i\fP \fI~/db3.gramps\fP
.UNINDENT
.UNINDENT
.sp
-Lecture de quatre bases de données dont les formats peuvent être
+Lecture de quatre bases de données dont les formats peuvent être
devinés d\(aqaprès les noms, puis vérification des données:
.INDENT 7.0
.INDENT 3.5
@@ -230,7 +228,7 @@ devinés d\(aqaprès les noms, puis vérification des données:
.UNINDENT
.UNINDENT
.sp
-Si vous voulez préciser les formats de fichiers dans l\(aqexemple ci\-
+Si vous voulez préciser lesformats de fichiers dans l\(aqexemple ci\-
dessus, complétez les noms de fichiers par les options \-f appropriées:
.INDENT 7.0
.INDENT 3.5
@@ -240,8 +238,8 @@ dessus, complétez les noms de fichiers par les options \-f appropriées:
.UNINDENT
.UNINDENT
.sp
-Pour enregistrer le résultat des lectures, donnez l\(aqoption \-e
-(utiliser \-f si le nom de fichier ne permet pas à gramps de deviner le
+Pour enregistrer le résultat des lectures, donnez l\(aqoption \fB\-e\fP
+(utiliser \-f si le nom de fichier ne permet pas à gramps de deviner le
format):
.INDENT 7.0
.INDENT 3.5
@@ -250,15 +248,15 @@ format):
.UNINDENT
.UNINDENT
.sp
-Pour lire trois ensembles de données puis lancer une session interac‐
-tive de gramps sur le tout :
+Pour lire trois ensembles de données puis lancer une session
+interactive de gramps sur le tout :
.INDENT 7.0
.INDENT 3.5
\fBgramps \-i\fP \fIfile1.ged\fP \fB\-i\fP \fIfile2.tgz\fP \fB\-i\fP \fI~/db3.gramps\fP
.UNINDENT
.UNINDENT
.sp
-Pour lancer l\(aqoutil de vérification de la base de données depuis la
+Pour lancer l\(aqoutil de vérification de la base de données depuis la
ligne de commande et obtenir le résultat :
.INDENT 7.0
.INDENT 3.5
@@ -276,35 +274,37 @@ Enfin, pour lancer une session interactive normale, entrer :
.B \fBVARIABLES D\(aqENVIRONMENT\fP
Le programme vérifie si ces variables d\(aqenvironnement sont déclarées:
.sp
-\fBLANG\fP \- décrit, quelle langue est utilisée: Ex.: pour le français on
+\fBLANG\fP \- décrit, quelle langue est utilisée: Ex.: pour le français on
peut définir fr_FR.UTF\-8.
.sp
-\fBGRAMPSHOME\fP \- si défini, force Gramps à utiliser un répertoire
-spécifique pour y conserver ses préférences et bases de données. Par
-défaut, cette variable n\(aqest pas active et Gramps sait que les options
-et bases de données doivent être créées dans le répertoire par défaut
-de l\(aqutilisateur (la variable d\(aqenvironnement HOME pour Linux ou USER‐
+\fBGRAMPSHOME\fP \- si défini, force Gramps à utiliser un répertoire
+spécifique pour y conserver ses préférences et bases de données. Par
+défaut, cette variable n\(aqest pas active et Gramps sait que les options
+et bases de données doivent être créées dans le répertoire par défaut
+de l\(aqutilisateur (la variable d\(aqenvironnement HOME pour Linux ou USER‐
PROFILE pour Windows 2000/XP).
.TP
.B \fBCONCEPTS\fP
-Gramps est un système basé sur le support de plugin\-python, permettant
-d\(aqimporter et d\(aqexporter, la saisie, générer des rapports, des outils,
-et afficher des filtres pouvant être ajoutés sans modifier le pro‐
-gramme.
+Gramps est un système basé sur le support de plugin\-python, permettant
+d\(aqimporter et d\(aqexporter, la saisie, générer des rapports, des outils,
+et afficher des filtres pouvant être ajoutés sans modifier le programme.
.sp
Par ailleurs, gramps permet la génération directe : impression, rap‐
ports avec sortie vers d\(aqautres formats, comme \fILibreOffice.org\fP ,
-\fIHTML\fP , ou \fILaTeX\fP pour permettre à l\(aqutilisateur de choisir selon ses
+\fIHTML\fP , ou \fILaTeX\fP pour permettre à l\(aqutilisateur de choisir selon ses
besoins
.UNINDENT
.sp
\fBBUGS CONNUS ET LIMITATIONS\fP
+.sp
\fBFICHIERS\fP
.INDENT 0.0
.INDENT 3.5
\fI${PREFIX}/bin/gramps\fP
.sp
-\fI${PREFIX}/share/gramps\fP
+\fI${PREFIX}/lib/python/dist\-packages/gramps/\fP
+.sp
+\fI${PREFIX}/share/\fP
.sp
\fI${HOME}/.gramps\fP
.UNINDENT
@@ -315,29 +315,28 @@ besoins
Donald Allingham <\fI\%don@gramps-project.org\fP>
\fI\%http://gramps-project.org/\fP
.sp
-Cette page man a d\(aqabord été écrite par:
+Cette page man a d\(aqabord été écrite par :
Brandon L. Griffith <\fI\%brandon@debian.org\fP>
pour Debian GNU/Linux système.
.sp
-Cette page man est maintenue par:
+Cette page man est maintenue par :
Gramps project <\fI\%xxx@gramps-project.org\fP>
.sp
-La traduction française:
+La traduction française :
Jérôme Rapinat <\fI\%romjerome@yahoo.fr\fP>
.TP
.B \fBDOCUMENTATION\fP
-La documentation\-utilisateur est disponible par via un navigateur
+La documentation\-utilisateur est disponible par un navigateur
standard sous la forme du manuel Gramps.
.sp
-La documentation pour développeur est disponible sur le site
+La documentation pour développeur est disponible sur le site
\fI\%http://www.gramps-project.org/wiki/index.php?title=Portal:Developers\fP .
.UNINDENT
.sp
-Janvier 2013 4.0.0 gramps(1)
+gramps(1) @VERSION@ gramps(1)
.SH AUTHOR
Jerome Rapinat
.SH COPYRIGHT
2012, Gramps project
.\" Generated by docutils manpage writer.
-.\"
.
diff --git a/data/man/gramps.1.in b/data/man/gramps.1.in
index f69cba5f1..762561022 100644
--- a/data/man/gramps.1.in
+++ b/data/man/gramps.1.in
@@ -298,9 +298,11 @@ or LaTeX to allow the users to modify the format to suit their needs.
.SH FILES
.LP
-\fI${PREFIX}/bin/gramps\fP
+\fI${PREFIX}/bin/gramps\fP
.br
-\fI${PREFIX}/share/gramps\fP
+\fI${PREFIX}/lib/python/dist\-packages/gramps/\fP
+.br
+\fI${PREFIX}/share/\fP
.br
\fI${HOME}/.gramps\fP
diff --git a/data/man/nl/Makefile.am b/data/man/nl/Makefile.am
deleted file mode 100644
index e373796a2..000000000
--- a/data/man/nl/Makefile.am
+++ /dev/null
@@ -1,15 +0,0 @@
-# This is the data/man/nl level Makefile for Gramps
-# $Id: Makefile.am 9819 2008-01-15 15:42:10Z bmcage $
-
-mandir = @mandir@/nl
-
-man_IN_FILES = gramps.1.in
-man_MANS = $(man_IN_FILES:.1.in=.1)
-
-EXTRA_DIST = $(man_MANS) $(man_IN_FILES)
-
-gramps.1: $(top_builddir)/config.status gramps.1.in
- cd $(top_builddir) && CONFIG_FILES=data/man/nl/$@ $(SHELL) ./config.status
-
-CLEANFILES=$(man_MANS)
-
diff --git a/data/man/nl/nl.rst b/data/man/nl/nl.rst
index be01727fb..5e680786f 100644
--- a/data/man/nl/nl.rst
+++ b/data/man/nl/nl.rst
@@ -5,11 +5,11 @@ gramps(1) 3.4.0 gramps(1)
-NAAM
+**NAAM**
gramps - Genealogisch Onderzoek en Analyse Beheersysteem.
-SAMENVATTING
+**SAMENVATTING**
gramps [-?|--help] [--usage] [--version] [-O|--open= GEGEVENSBESTAND
[-f|--format= FORMAAT]] [-i|--import= BESTAND [-f|--format= FORMAAT]]
[-i|--import= ...] [-e|--export= BESTAND [-f|--format= FORMAAT]]
@@ -17,7 +17,7 @@ SAMENVATTING
sion]
-BESCHRIJVING
+**BESCHRIJVING**
Gramps is een Free/OpenSource genealogisch programma dat in Python,
geschreven is en gebruik maakt van de GTK+/GNOME interface. Gramps zal
voor iedereen die al gewerkt heeft met andere genealogische programma's
@@ -27,14 +27,14 @@ BESCHRIJVING
che software.
-OPTIES
- grampsBESTAND
- Wanneer BESTAND opgegeven wordt (zonder vlaggen) als een famili‐
+**OPTIES**
+ **gramps** *BESTAND*
+ Wanneer *BESTAND* opgegeven wordt (zonder vlaggen) als een famili‐
estamboom of als een familistamboommap, dan wordt dit bestand
geopend en een interactieve sessie wordt gestart. Indien BESTAND
een bestandsformaat dat door Gramps herkent wordt, zal een lege
familiestamboom aangemaakt worden. De bestandsnaam wordt
- gebaseerd op de BESTAND naam en de gegevens worden in dit
+ gebaseerd op de *BESTAND* naam en de gegevens worden in dit
bestand geïmporteerd. Met resterende opties wordt geen rekening
gehouden. Deze wijze van opstarten is zeer bruikbaar om Gramps
te gebruiken voor genealogische gegevens via een webbrowser.
@@ -42,7 +42,7 @@ OPTIES
Gramps behandelen, zie onder.
- -f,--format= FORMAAT
+ **-f** , **--format=** *FORMAAT*
Expliciet een formaat opgeven voor BESTAND door de optie -i, of
-e mee te geven. Indien de -f optie niet opgegeven wordt voor
BESTAND, wordt het formaat gebaseerd op de bestandsextensie of
@@ -216,7 +216,7 @@ OPTIES
**gramps**
-CONCEPTEN
+**CONCEPTEN**
Ondersteuning van een op python-gebaseerd plugin systeem. Dit laat toe
om verslagen, hulpgereedschappen en vensterfilters toe te voegen zonder
dat het hoofdprogramma dient aangepast.
@@ -226,17 +226,20 @@ CONCEPTEN
of LaTeX. Zo kunnen gebruikers het formaat wijzigen naar eigen wens.
-GEKENDE BUGS EN BEPERKINGEN
-BESTANDEN
+**GEKENDE BUGS EN BEPERKINGEN**
+
+**BESTANDEN**
*${PREFIX}/bin/gramps*
- *${PREFIX}/share/gramps*
+ *${PREFIX}/lib/python/dist-packages/gramps/*
+
+ *${PREFIX}/share/*
*${HOME}/.gramps*
-AUTEURS
+**AUTEURS**
Donald Allingham
http://gramps-project.org/
@@ -251,11 +254,8 @@ AUTEURS
Erik De Richter
-DOCUMENTATIE
- De gebruikersdocumentatie is beschikbaar via de normale GNOME Help
- browser in de vorm van een Gramps-handleiding. De handleiding is ook
- beschikbaar in XML-formaat: gramps-manual.xml onder doc/gramps-man‐
- ual/$LANG in de officiële brondistributie.
+**DOCUMENTATIE**
+ De gebruikersdocumentatie is beschikbaar via browser in de webstek.
De ontwikkelingsdocumentatie kan gevonden worden op de
http://www.gramps-project.org/wiki/index.php?title=Portal:Developers
@@ -263,4 +263,4 @@ DOCUMENTATIE
-August 2005 3.4.0 gramps(1)
+August 2005 4.0.0 gramps(1)
diff --git a/data/man/pl/Makefile.am b/data/man/pl/Makefile.am
deleted file mode 100644
index f45e822c6..000000000
--- a/data/man/pl/Makefile.am
+++ /dev/null
@@ -1,14 +0,0 @@
-# This is the data/man/sv level Makefile for Gramps
-# $Id: Makefile.am 6189 2006-03-21 19:05:46Z rshura $
-
-man_IN_FILES = gramps.1.in
-man_MANS = $(man_IN_FILES:.1.in=.1)
-
-mandir = @mandir@/pl
-
-EXTRA_DIST = $(man_MANS) $(man_IN_FILES)
-
-gramps.1: $(top_builddir)/config.status gramps.1.in
- cd $(top_builddir) && CONFIG_FILES=data/man/pl/$@ $(SHELL) ./config.status
-
-CLEANFILES=$(man_MANS)
diff --git a/data/man/pl/pl.rst b/data/man/pl/pl.rst
index 46719580b..c338f016a 100644
--- a/data/man/pl/pl.rst
+++ b/data/man/pl/pl.rst
@@ -5,14 +5,14 @@ gramps(1) 3.4.0 gramps(1)
-NAME
+**NAME**
gramps - Genealogical Research and Analysis Management Programming Sys‐
tem.
(w wolnym tłumaczeniu: System Wspomagania Badań Genealogicznych i Pro‐
gramowego Zarządzania Tą Informacją)
-SYNOPSIS
+**SYNOPSIS**
gramps [-?|--help] [--usage] [--version] [-l] [-u|--force-unlock]
[-O|--open= BAZA_DANYCH [-f|--format= FORMAT]] [-i|--import= PLIK
[-f|--format= FORMAT]] [-i|--import= ...] [-e|--export= PLIK
@@ -20,7 +20,7 @@ SYNOPSIS
[ PLIK ] [--version]
-OPIS
+**OPIS**
Gramps jest wolnym, darmowym programem genealogicznym OpenSource. Jest
napisany w Python, przy użyciu interfejsu GTK+/GNOME. Dla każdego, kto
wcześniej używał innego programu genealogicznego (np. Family Tree
@@ -30,9 +30,9 @@ OPIS
jest używany przez większość programów genealogicznych na świecie.
-OPCJE
- gramps PLIK
- Kiedy PLIK jest podany (bez żadnych flag) jako nazwa drzewa
+**OPCJE**
+ **gramps** *PLIK*
+ Kiedy *PLIK* jest podany (bez żadnych flag) jako nazwa drzewa
rodzinnego albo nazwa katalogu z drzewem, to wybrane drzewo jest
otwierane i rozpoczynana jest sesja interaktywna. Jeśli PLIK
jest formatem rozpoznawanym przez Gramps, to tworzone jest puste
@@ -43,7 +43,7 @@ OPCJE
akceptuje każdy format natywny dla grampsa, zobacz poniżej.
- -f,--format= FORMAT
+ **-f** , **--format=** *FORMAT*
Jawne określenie formatu PLIKU przez poprzedzenie opcji -i, lub
-e. Jeśli opcja -f nie jest podana dla żadnego PLIKU, to format
pliku jest określany na podstawie rozszerzenia albo typu MIME.
@@ -63,22 +63,23 @@ OPCJE
iso (używany tylko, jeśli jawnie określony przez parametr -f ).
- -l Wyświetla listę dosŧępnych drzew genealogicznych.
+ **-l**
+ Wyświetla listę dosŧępnych drzew genealogicznych.
- -u,--force-unlock
+ **-u** , **--force-unlock**
Wymusza odblokowanie bazy danych.
- -O,--open= BAZA_DANYCH
- Otwiera BAZĘ_DANYCH, która musi istnieć w katalogu baz lub być
+ **-O** , **--open=** *BAZA_DANYCH*
+ Otwiera *BAZĘ_DANYCH* , która musi istnieć w katalogu baz lub być
nazwą istniejącego drzewa rodzinnego. Jeśli nie podano akcji, to
opcje eksportu albo importu są wykonywane, a następnie jest
uruchamiana sesja interaktywna z otwarciem wybranej bazy.
- -i,--import= PLIK
- Importuje dane z PLIKU. Jeśli nie określono bazy danych, to
+ **-i** , **--import=** *PLIK*
+ Importuje dane z *PLIKU* . Jeśli nie określono bazy danych, to
tworzona jest tymczasowa baza kasowana po zamknięciu programu.
Kiedy podany jest więcej niż jeden plik do importu, to każdy z
@@ -88,8 +89,8 @@ OPCJE
bazie wynikowej.
- -e,--export= PLIK
- Eksportuje dane do PLIKU. Dla formatu iso, PLIK natomiast nazwą
+ **-e** , **--export=** *PLIK*
+ Eksportuje dane do *PLIKU* . Dla formatu iso, PLIK natomiast nazwą
katalogu, do którego baza danych gramps zostanie zapisana. Dla
gramps-xml, gedcom, wft, gramps-pkg, oraz geneweb, PLIK jest
nazwą pliku wynikowego.
@@ -99,7 +100,7 @@ OPCJE
podanej przez parametry kolejności.
- -a,--action= AKCJA
+ **-a** , **--action=** *AKCJA*
Wykonuje AKCJĘ na zaimportowanych danych. Działanie to jest
wykonywane dopiero, gdy wszystkie określone importy zakończą się
powodzeniem. Aktualnie dostępne akcje to:
@@ -122,18 +123,18 @@ OPCJE
konkretnej opcji, jednak część z opcji jest wspólna, szczególnie
dla raportów.
- name=nazwa
+ **name=nazwa**
Opcja wymagana, określający który raport czy narzędzie będzie
uruchamiane. Jeśli podana wartość nazwy nie pasuje do żadnego
dostępnego raportu czy narzędzia, zostanie wyświetlony komunikat
o błędzie oraz lista dostępnych raportów albo opcji (w
zależności od wartości parametru AKCJA).
- show=all
+ **show=all**
Wyświetla listę wszystkich nazw dostępnych opcji wraz z krótkim
opisem dla danego raportu albo narzędzia.
- show=nazwa_opcji
+ **show=nazwa_opcji**
Wyświetla opis funkcji udostępnianej przez daną nazwę_opcji, jak
również listę parametrów, które akceptuje dana opcja.
@@ -146,43 +147,16 @@ OPCJE
jności w jakiej występują w linii poleceń.
- -d,--debug= NAZWA_LOGGERA
+ **-d** , **--debug=** *NAZWA_LOGGERA*
Włącza logi debuggowania dla celów programistycznych i
testowych. Zobacz do kodu źródłowego po szczegóły.
- --version
+ **--version**
Wyświetla wersję programu i kończy działanie.
-
- Następujące opcje są używane przy aktywacji Bonobo:
-
- --oaf-ior-fd=FD
- Deskryptor pliku, do którego wpisać OAF IOR.
-
- --oaf-activate-iid= IID
- OAF IID do aktywacji.
-
- --oaf-private
- Wstgrzymuje rejestrację serwera przez OAF.
-
-
-
- Następujące opcje są używane do kontroli dźwięku generowanego za pomocą
- Gnome Library.
-
- --disable-sound
- Wyłącza użycie serwera dźwięku.
-
- --enable-sound
- Włącza użycie serwera dźwięku.
-
- --espeaker= HOSTNAME:PORT
- Host:port na którym jest uruchomiony serwer dźwięku.
-
-
-Działanie
+**Działanie**
Jeśli pierwszy argument nie rozpoczyna się znakiem myślnik, (nie jest
flagą), to gramps będzie próbował otworzyć plik podany przez pierwszy
argument, a następnie sesję interaktywną a pozostałą część parametrów w
@@ -222,7 +196,7 @@ Działanie
cje i błędy do pliku.
-PRZYKŁADY
+**PRZYKŁADY**
Aby otworzyć istniejące drzewo rodzinne i zaimportować dane do niego,
można wpisać:
@@ -267,21 +241,22 @@ PRZYKŁADY
gramps
-ZMIENNE ŚRODOWISKOWE
+**ZMIENNE ŚRODOWISKOWE**
+
Program sprawdza w systemie istnienie i wartości następujących zmien‐
nych:
- LANG - określa ustawienia, jaki język zostanie wybrany. Np.: polski to
+ **LANG** - określa ustawienia, jaki język zostanie wybrany. Np.: polski to
pl_PL.UTF-8.
- GRAMPSHOME - określa folder, w którym będzie zapisywane ustawienia i
+ **GRAMPSHOME** - określa folder, w którym będzie zapisywane ustawienia i
bazy programu. Domyślnie jest on nieustawiony, a program przyjmuje, że
katalog z danymi zostanie utworzony w profilu użytkownika (zmienna HOME
pod Linuxem albo USERPROFILE pod Windows 2000/XP).
-KONCEPCJA
+**KONCEPCJA**
Obsługa systemu rozszerzeń bazującego na pythonie, pozwalającego na
dodawanie formatów importu i eksportu zapisów, generatorów raportów,
narzędzi i filtrów wyświetlania bez modyfikowania głównego programu
@@ -292,19 +267,24 @@ KONCEPCJA
użytkownikm wybór formatu wyjściowego w zależności od ich potrzeb.
-ZNANE BŁĘDY I OGRANICZENIA
+**ZNANE BŁĘDY I OGRANICZENIA**
Prawdopodobne. Lista błędów i propozycji znajduje się na:
http://www.gramps-project.org/wiki/index.php?title=Portal:Developers .
-PLIKI
- ${PREFIX}/bin/gramps
- ${PREFIX}/share/gramps
- ${HOME}/.gramps (jeśli nie użyta została zmienna środowiskowa GRAMP‐
- SHOME)
+**PLIKI**
+
+ *${PREFIX}/bin/gramps*
+
+ *${PREFIX}/lib/python/dist-packages/gramps/*
+
+ *${PREFIX}/share/*
+
+ *${HOME}/.gramps (jeśli nie użyta została zmienna środowiskowa GRAMP‐
+ SHOME)*
-AUTORZY
+**AUTORZY**
Donald Allingham
http://gramps-project.org/
@@ -317,15 +297,12 @@ AUTORZY
Tłumaczenie na polski: Łukasz Rymarczyk
-DOCUMENTATION
- Dokumentacja użytkownika jest dostępna poprzez standardową przeglądarkę
- pomocy systemu GNOME. Dokumentacja dostępna jest także w formacie XML
- jako plik gramps-manual.xml w folderze doc/gramps-manual/$LANG w
- głównym źródle dystrybucji.
+**DOCUMENTATION**
+ Dokumentacja użytkownika jest dostępna poprzez standardową przeglądarkę.
Dokumentacja dla programistów jest dostępna na stronie projektu:
http://www.gramps-project.org/wiki/index.php?title=Portal:Developers
-January 2008 3.4.0 gramps(1)
+January 2008 4.0.0 gramps(1)
diff --git a/data/man/pt_BR/Makefile.am b/data/man/pt_BR/Makefile.am
deleted file mode 100644
index 3238e6e92..000000000
--- a/data/man/pt_BR/Makefile.am
+++ /dev/null
@@ -1,14 +0,0 @@
-# This is the data/pt_BR level Makefile for Gramps
-# $Id: Makefile.am 16377 2011-01-13 18:32:42Z matlas $
-
-man_IN_FILES = gramps.1.in
-man_MANS = $(man_IN_FILES:.1.in=.1)
-
-mandir = @mandir@/pt_BR
-
-EXTRA_DIST = $(man_MANS) $(man_IN_FILES)
-
-gramps.1: $(top_builddir)/config.status gramps.1.in
- cd $(top_builddir) && CONFIG_FILES=data/man/pt_BR/$@ $(SHELL) ./config.status
-
-CLEANFILES=$(man_MANS)
diff --git a/data/man/pt_BR/pt_BR.rst b/data/man/pt_BR/pt_BR.rst
index f8d07f16e..4c727d54c 100644
--- a/data/man/pt_BR/pt_BR.rst
+++ b/data/man/pt_BR/pt_BR.rst
@@ -6,306 +6,288 @@ gramps(1) 4.0.0 gramps(1)
**NOME**
-----
-
-gramps - Programa para pesquisa geneal?gica.
+ gramps - Programa para pesquisa genealógica.
**RESUMO**
-------
+ gramps [-?|--help] [--usage] [--version] [-l] [-u|--force-unlock]
+ [-O|--open= BANCODEDADOS [-f|--format= FORMATO]] [-i|--import= ARQUIVO
+ [-f|--format= FORMATO]] [-i|--import= ...] [-e|--export= ARQUIVO
+ [-f|--format= FORMATO]] [-a|--action= AÇÃO] [-p|--options= OPÇÕES]]
+ [ ARQUIVO ] [--version]
-**gramps** [**-?|--help**] [**--usage**] [**--version**] [**-l**] [**-u
-|--force-unlock**] [**-O|--open=** *BANCODEDADOS* [**-f|--format=**
-*FORMATO*]] [**-i|--import=** *ARQUIVO* [**-f|--format=** *FORMATO*]]
-[**-i|--import=** *...*] [**-e|--export=** *ARQUIVO* [**-f|--format=**
-*FORMATO*]] [**-a|--action=** *A??O*] [**-p|--options=** *OP??ES*]] [
-*ARQUIVO* ] [**--version**]
+**DESCRIÇÃO**
-**DESCRI??O**
+ Gramps é um programa de genealogia livre e de código aberto.
+ Ele é escrito em Python e usa a interface GTK+/GNOME.
+ Gramps deve parecer familiar a qualquer pessoa que já tenha usado
+ outro programa de genealogia, tais como o Family Tree Maker (TM),
+ Personal Ancestral Files (TM), ou o GNU Geneweb. Ele suporta a
+ importação do formato GEDCOM, que é amplamente usado por quase
+ todos os outros programas de genealogia.
------------
-*Gramps* ? um programa de genealogia livre e de c?digo aberto. Ele ? escrito
-em Python e usa a interface GTK+/GNOME. Gramps deve parecer familiar a
-qualquer pessoa que j? tenha usado outro programa de genealogia, tais como o
-*Family Tree Maker (TM)*, *Personal Ancestral Files (TM)*, ou o GNU Geneweb.
-Ele suporta a importa??o do formato GEDCOM, que ? amplamente usado por quase
-todos os outros programas de genealogia.
+**OPÇÕES**
+ **gramps** *ARQUIVO*
+ Quando *ARQUIVO* for indicado (sem qualquer outra opção) como um
+ nome de árvore genealógica ou como pasta do banco de dados,
+ ela será aberta e iniciada uma sessão interativa. Se *ARQUIVO* for
+ um formato compreendido pelo Gramps, será criada uma árvore
+ genealógica vazia com o nome baseado no ARQUIVO e os dados são
+ importados para ela. As demais opções serão ignoradas. Esta
+ forma de execução é apropriada para usar o Gramps como manipulador
+ de dados genealógicos em, por exemplo, navegadores Web. Este método
+ aceita qualquer formato de dados nativo do Gramps, conforme abaixo.
-OP??ES
---------
+ **-f** , **--format=** *FORMATO*
+ Indica expressamente o formato do *ARQUIVO*, precedente das opções
+ -i ou -e. Se a opção -f não for fornecida para um ARQUIVO, o
+ formato será identificado de acordo com a sua extensão ou tipo MIME.
-**gramps*** ARQUIVO* Quando *ARQUIVO* for indicado (sem qualquer outra op??o)
-como um nome de ?rvore geneal?gica ou como pasta do banco de dados, ela ser?
-aberta e iniciada uma sess?o interativa. Se ARQUIVO for um formato
-compreendido pelo Gramps, ser? criada uma ?rvore geneal?gica vazia com o nome
-baseado no *ARQUIVO* e os dados s?o importados para ela. As demais op??es
-ser?o ignoradas. Esta forma de execu??o ? apropriada para usar o Gramps como
-manipulador de dados geneal?gicos em, por exemplo, navegadores Web. Este
-m?todo aceita qualquer formato de dados nativo do Gramps, conforme abaixo.
+ Os formatos disponíveis para exportação são gramps-xml (se o ARQUIVO
+ terminar com .gramps), gedcom (se o ARQUIVO terminar com .ged) ou
+ qualquer outro formato de arquivo disponível através do sistema de
+ plugins do Gramps.
-**-f,--format=*** FORMATO* Indica expressamente o formato do *ARQUIVO*,
-precedente das op??es **-i** ou **-e**. Se a op??o **-f** n?o for fornecida
-para um *ARQUIVO*, o formato ser? identificado de acordo com a sua extens?o
-ou tipo MIME.
+ Os formatos disponíveis para importação são grdb, gramps-xml, gedcom,
+ gramps-pkg (se o ARQUIVO terminar com .gpkg), e geneweb
+ (se o ARQUIVO terminar com .gw).
-Os formatos dispon?veis para exporta??o s?o **gramps-xml** (se o *ARQUIVO*
-terminar com **.gramps**), **gedcom** (se o *ARQUIVO* terminar com **.ged**)
-ou qualquer outro formato de arquivo dispon?vel atrav?s do sistema de plugins
-do Gramps.
+ Os formatos disponíveis para exportação são gramps-xml, gedcom,
+ gramps-pkg, wft (se o ARQUIVO terminar com .wft), geneweb.
+ **-l**
+ Exibe uma lista com as árvores genealógicas conhecidas.
-Os formatos dispon?veis para importa??o s?o **grdb**, **gramps-xml**,
-**gedcom**, **gramps-pkg** (se o *ARQUIVO* terminar com **.gpkg**), e
-**geneweb** (se o *ARQUIVO* terminar com **.gw**).
+ **-u** , **--force-unlock**
+ Desbloqueia um banco de dados previamente bloqueado.
-Os formatos dispon?veis para exporta??o s?o **gramps-xml**, **gedcom**,
-**gramps-pkg**, **wft** (se o *ARQUIVO* terminar com **.wft**), **geneweb**,
-e **iso** (deve sempre ser indicado com a op??o **-f**).
-**-l** Exibe uma lista com as ?rvores geneal?gicas conhecidas.
+ **-O** , **--open=** *BANCODEDADOS*
+ Abre o *BANCODEDADOS* , que deve ser uma pasta de banco de dados
+ ou um nome de árvore genealógica existentes. Se não forem indicadas
+ opções de ação, importação ou exportação na linha de comando,
+ será iniciada uma sessão interativa usando este banco de dados.
-**-u,--force-unlock** Desbloqueia um banco de dados previamente bloqueado.
-**-O,--open=*** BANCODEDADOS* Abre o *BANCODEDADOS*, que deve ser uma pasta
-de banco de dados ou um nome de ?rvore geneal?gica existentes. Se n?o forem
-indicadas op??es de a??o, importa??o ou exporta??o na linha de comando, ser?
-iniciada uma sess?o interativa usando este banco de dados.
+ **-i** , **--import=** *ARQUIVO*
+ Importa os dados do ARQUIVO. Se não for indicado um banco de dados,
+ o Gramps usará um arquivo temporário, que será excluído ao sair
+ do programa.
-**-i,--import=*** ARQUIVO* Importa os dados do *ARQUIVO*. Se n?o for indicado
-um banco de dados, o Gramps usar? um arquivo tempor?rio, que ser? exclu?do ao
-sair do programa.
+ Quando mais de um arquivo de origem for indicado, cada um deles
+ deve ser precedido da opção -i. Os arquivos são importados na ordem
+ indicada, por exemplo, -i ARQUIVO1 -i ARQUIVO2 e -i ARQUIVO2 -i
+ ARQUIVO1 poderá produzir diferentes gramps IDs no banco de dados
+ resultante.
-Quando mais de um arquivo de origem for indicado, cada um deles deve ser
-precedido da op??o **-i**. Os arquivos s?o importados na ordem indicada, por
-exemplo, **-i** *ARQUIVO1* **-i** *ARQUIVO2* e **-i** *ARQUIVO2* **-i**
-*ARQUIVO1* poder? produzir diferentes gramps IDs no banco de dados
-resultante.
-**-a,--action=*** A??O* Executa a *A??O* nos dados importados. Isto ser?
-executado ap?s a conclus?o de todas as importa??es. At? o momento, as a??es
-dispon?veis s?o **summary** (o mesmo que Relat?rios->Exibir->Resumo),
-**check** (o mesmo que Ferramentas->Processamento do banco de
-dados->Verificar e reparar), **report** (gera o relat?rio), e **tool**
-(executa uma ferramenta de plugin). Para o **report** e **tool** ? necess?rio
-fornecer *OP??ES* (com uso da op??o **-p**).
+ **-a** , **--action=** *AÇÃO*
+ Executa a *AÇÃO* nos dados importados. Isto será executado após a
+ conclusão de todas as importações. Até o momento, as ações
+ disponíveis são summary (o mesmo que Relatórios->Exibir->Resumo),
+ check (o mesmo que Ferramentas->Processamento do banco de dados->
+ Verificar e reparar), report (gera o relatório), e tool (executa
+ uma ferramenta de plugin). Para o report e tool é necessário
+ fornecer OPÇÕES (com uso da opção -p).
-As *OP??ES* devem satisfazer as seguintes condi??es:
-N?o podem conter espa?os. Se alguns argumentos precisam incluir espa?os, a
-string deve ser colocada entre aspas, ou seja, seguir a sintaxe do shell.
-String de op??o ? uma lista de pares com o nome e o valor (separados por
-sinal de igual). Os pares de nome e valor devem ser separados por v?rgula.
+ As OPÇÕES devem satisfazer as seguintes condições:
+ Não podem conter espaços. Se alguns argumentos precisam incluir
+ espaços, a string deve ser colocada entre aspas, ou seja, seguir
+ a sintaxe do shell. String de opção é uma lista de pares com o
+ nome e o valor (separados por sinal de igual). Os pares de nome
+ e valor devem ser separados por vírgula.
-Muitas op??es s?o espec?ficas de cada relat?rio ou ferramenta. Entretanto,
-algumas op??es s?o comuns.
+ Muitas opções são específicas de cada relatório ou ferramenta.
+ Entretanto, algumas opções são comuns.
-**name=nome**
-Esta op??o obrigat?ria determina qual relat?rio ou ferramenta ser? executado.
-Se o *nome* fornecido n?o corresponder a um relat?rio ou ferramenta, ser?
-exibida uma mensagem de erro seguida de uma lista de relat?rios e ferramentas
-dispon?veis (dependendo da *A??O*).
+ **name=nome**
+ Esta opção obrigatória determina qual relatório ou ferramenta
+ será executado. Se o nome fornecido não corresponder a um
+ relatório ou ferramenta, será exibida uma mensagem de erro
+ seguida de uma lista de relatórios e ferramentas disponíveis
+ dependendo da AÇÃO).
-**show=all**
-Isto ir? gerar uma lista com os nomes para todas as op??es dispon?veis de um
-determinado relat?rio ou ferramenta.
+ **show=all**
+ Isto irá gerar uma lista com os nomes para todas as opções
+ disponíveis de um determinado relatório ou ferramenta.
-**show=nome_op??o**
-Isto ir? exibir a descri??o da funcionalidade indicada por *nome_op??o*, bem
-como quais s?o os tipos aceit?veis e os valores para esta op??o.
+ **show=nome_opção**
+ Isto irá exibir a descrição da funcionalidade indicada por nome_opção,
+ bem como quais são os tipos aceitáveis e os valores para esta opção.
-Use as op??es acima para descobrir tudo sobre um determinado relat?rio.
+ Use as opções acima para descobrir tudo sobre um determinado relatório.
-Quando mais de uma a??o de sa?da for indicada, cada uma deve ser precedida da
-op??o **-a**. As a??es s?o realizadas uma a uma, na ordem indicada.
+ Quando mais de uma ação de saída for indicada, cada uma deve ser
+ precedida da opção -a. As ações são realizadas uma a uma, na ordem
+ indicada.
-**-d,--debug=*** ARQUIVO_REGISTRO* Ativa os registros para desenvolvimento e
-testes. Veja o c?digo-fonte para mais detalhes. **--version** Exibe o n?mero
-da vers?o do Gramps e finaliza.
+ **-d** , **--debug=** *ARQUIVO_REGISTRO*
+ Ativa os registros para desenvolvimento e testes. Veja o código-fonte
+ para mais detalhes.
+
+ **--version**
+ Exibe o número da versão do Gramps e finaliza.
+
+**Operação**
+ Se o primeiro argumento da linha de comando não começar com um
+ traço (isto é, sem uma opção), o Gramps tentará abrir o arquivo
+ com o nome fornecido pelo primeiro argumento e iniciar a sessão
+ interativa, ignorando o resto dos argumentos da linha de comando.
-Opera??o
+ Se for fornecida a opção -O, então o Gramps tentará abrir o banco
+ de dados indicado e trabalhar com estes dados, de acordo com as
+ instruções dos parâmetros adicionais da linha de comando.
-----------
+ Com ou sem a opção -O, pode haver múltiplas importações, exportações
+ e ações indicadas pela linha de comando usando as opções -i, -e e -a.
-Se o primeiro argumento da linha de comando n?o come?ar com um tra?o (isto ?,
-sem uma op??o), o Gramps tentar? abrir o arquivo com o nome fornecido pelo
-primeiro argumento e iniciar a sess?o interativa, ignorando o resto dos
-argumentos da linha de comando.
-Se for fornecida a op??o **-O**, ent?o o Gramps tentar? abrir o banco de
-dados indicado e trabalhar com estes dados, de acordo com as instru??es dos
-par?metros adicionais da linha de comando.
+ A ordem das opções -i, -e ou -a não importa. A ordem utilizada
+ será sempre esta: todas as importações (se existirem) -> todas
+ as ações (se existirem) -> todas as exportações (se existirem).
+ Mas a abertura deve estar sempre em primeiro lugar!
-Com ou sem a op??o **-O**, pode haver m?ltiplas importa??es, exporta??es e
-a??es indicadas pela linha de comando usando as op??es **-i**, **-e** e
-**-a**.
-A ordem das op??es **-i**, **-e** ou **-a** n?o importa. A ordem utilizada
-ser? sempre esta: todas as importa??es (se existirem) -> todas as a??es (se
-existirem) -> todas as exporta??es (se existirem). Mas a abertura deve estar
-sempre em primeiro lugar!
+ Se as opções -O ou -i não forem fornecidas, o Gramps será aberto
+ com a sua janela principal e iniciará a sessão interativa padrão
+ com um banco de dados vazio, uma vez que não há nada a processar.
-Se as op??es **-O** ou **-i** n?o forem fornecidas, o Gramps ser? aberto com
-a sua janela principal e iniciar? a sess?o interativa padr?o com um banco de
-dados vazio, uma vez que n?o h? nada a processar.
-Se as op??es **-e** ou **-a** n?o forem fornecidas, o Gramps ser? aberto com
-a sua janela principal e iniciar? a sess?o interativa padr?o com um banco de
-dados resultante de todas as importa??es. Este banco de dados est? localizado
-no arquivo **import_db.grdb** da pasta **~/.gramps/import**.
+ Se as opções -e ou -a não forem fornecidas, o Gramps será aberto
+ com a sua janela principal e iniciará a sessão interativa padrão
+ com um banco de dados resultante de todas as importações. Este
+ banco de dados está localizado no arquivo import_db.grdb da
+ pasta ~/.gramps/import.
-Os erros encontrados durante a importa??o, exporta??o ou a??o, ser?o
-direcionados para *stdout* (se forem exce??es tratadas pelo Gramps) ou para
-*stderr* (se n?o forem tratadas). Use redirecionamentos usuais de *stdout* e
-*stderr* do shell para salvar mensagens e erros em arquivos.
+ Os erros encontrados durante a importação, exportação ou ação,
+ serão direcionados para stdout (se forem exceções tratadas pelo
+ Gramps) ou para stderr (se não forem tratadas). Use redirecionamentos
+ usuais de stdout e stderr do shell para salvar mensagens e erros
+ em arquivos.
-EXEMPLOS
---------
-Abrir uma ?rvore geneal?gica existente e importar um arquivo xml para ela:
+**EXEMPLOS**
- **gramps** **-O** *'Minha ?rvore geneal?gica'* **-i** *~/db3.gramps*
+ Abrir uma árvore genealógica existente e importar um arquivo xml para
+ ela:
+
+ gramps -O 'Minha árvore genealógica' -i ~/db3.gramps
-Fazer as
-mesmas altera??es da ?rvore geneal?gica do comando anterior, mas importar a
-?rvore geneal?gica tempor?ria e iniciar uma sess?o interativa:
+ Fazer as mesmas alterações da árvore genealógica do comando anterior,
+ mas importar a árvore genealógica temporária e iniciar uma sessão
+ interativa:
+
+ gramps -i 'Minha árvore genealógica' -i ~/db3.gramps
- **gramps**
- **-i** *'Minha ?rvore geneal?gica'* **-i** *~/db3.gramps*
+ Importar quatro bancos de dados (cujos formatos podem ser
+ reconhecidos pelos nomes) e verificar a existência de erros no
+ banco de dados resultante:
+
+ gramps -i arquivo1.ged -i arquivo2.tgz -i ~/db3.gramps -i
+ arquivo4.wft -a check
-Importar quatro
-bancos de dados (cujos formatos podem ser reconhecidos pelos nomes) e
-verificar a exist?ncia de erros no banco de dados resultante:
+ Indicar de forma explícita os formatos do exemplo acima, atribuindo
+ os nomes dos arquivos com as opções -f apropriadas:
+
+ gramps -i arquivo1.ged -f gedcom -i arquivo2.tgz -f gramps-pkg
+ -i ~/db3.gramps -f gramps-xml -i arquivo4.wft -f wft -a check
- **gramps**
- **-i** *arquivo1.ged* **-i** *arquivo2.tgz* **-i** *~/db3.gramps* **-i**
- *arquivo4.wft* **-a** *check*
+ Gravar o banco de dados resultante de todas as importações,
+ indicando a opção -e (use -f se o nome do arquivo não permirtir
+ que o gramps reconheça o formato automaticamente):
+
+ gramps -i arquivo1.ged -i arquivo2.tgz -e ~/novo-pacote -f gramps-pkg
-Indicar de forma expl?cita os formatos do
-exemplo acima, atribuindo os nomes dos arquivos com as op??es **-f**
-apropriadas:
+ Importar três bancos de dados e iniciar a sessão interativa do
+ Gramps com o resultado:
+
+ gramps -i arquivo1.ged -i arquivo2.tgz -i ~/db3.gramps
- **gramps** **-i** *arquivo1.ged* **-f** *gedcom* **-i** *arquivo2.tgz*
- **-f** *gramps-pkg* **-i** *~/db3.gramps* **-f** *gramps-xml*
- **-i** *arquivo4.wft* **-f** *wft* **-a** *check*
+ Executar a ferramenta de verificação a partir da linha de
+ comando e direcionar o resultado para stdout:
+
+ gramps -O 'Minha árvore genealógica' -a tool -p name=verify
-Gravar o banco de dados
-resultante de todas as importa??es, indicando a op??o **-e** (use **-f** se o
-nome do arquivo n?o permirtir que o gramps reconhe?a o formato
-automaticamente):
+ Finalmente, para iniciar uma sessão interativa normal, digite:
+
+ gramps
+
+**VARIÁVEIS DE AMBIENTE**
- **gramps** **-i** *arquivo1.ged* **-i** *arquivo2.tgz*
- **-e** *~/novo-pacote* **-f** *gramps-pkg*
+ O programa verifica se estas variáveis de ambiente estão definidas:
+ **LANG** - identifica o idioma a ser usado. Ex.: Para o idioma português do Brasil, a variável deve ser definida como pt_BR.UTF-8.
-Importar tr?s bancos de dados e iniciar a sess?o interativa do Gramps com o resultado:
+ **GRAMPSHOME** - se definida, força o Gramps a usar a pasta indicada para armazenar as configurações e os bancos de dados do programa. Por padrão, esta variável não é definida e o Gramps assume que a pasta com todos os bancos de dados e configurações do perfil devem ser criadas na pasta do usuário (descrita na variável de ambiente HOME no Linux ou USERPROFILE no Windows 2000/XP).
- **gramps** **-i**
- *arquivo1.ged* **-i** *arquivo2.tgz* **-i** *~/db3.gramps*
-
-Executar a ferramenta de verifica??o a partir da linha de comando e direcionar o
-resultado para stdout:
-
- **gramps** **-O** *'Minha ?rvore geneal?gica'* **-a** *tool* **-p**
- **name**=*verify*
-
-Finalmente, para iniciar uma sess?o
-interativa normal, digite:
-
- **gramps**
-
-
-**VARI?VEIS DE AMBIENTE**
-
-----------------------
-
-O programa verifica se estas vari?veis de ambiente est?o definidas:
-
-**LANG** - identifica o idioma a ser usado. Ex.: Para o idioma portugu?s do
-Brasil, a vari?vel deve ser definida como pt_BR.UTF-8.
-
-**GRAMPSHOME** - se definida, for?a o Gramps a usar a pasta indicada para
-armazenar as configura??es e os bancos de dados do programa. Por padr?o, esta
-vari?vel n?o ? definida e o Gramps assume que a pasta com todos os bancos de
-dados e configura??es do perfil devem ser criadas na pasta do usu?rio
-(descrita na vari?vel de ambiente HOME no Linux ou USERPROFILE no Windows
-2000/XP).
**CONCEITOS**
----------
+ Suporta um sistema de plugins baseado em Python, permitindo acrescentar
+ importações e exportações adicionais, geradores de relatórios,
+ ferramentas e filtros de exibição, sem modificação do programa principal.
-Suporta um sistema de plugins baseado em Python, permitindo acrescentar
-importa??es e exporta??es adicionais, geradores de relat?rios, ferramentas e
-filtros de exibi??o, sem modifica??o do programa principal.
-
-Al?m da impress?o direta, ? poss?vel gerar relat?rios em diversos formatos de
-arquivo, tais como *OpenOffice.org*, *AbiWord*, HTML ou LaTeX, para permitir
-aos usu?rios a modifica??o de acordo com suas necessidades.
-
-
-**LIMITA??ES E ERROS CONHECIDOS**
-
--------------------------------
-
-
-**ARQUIVOS**
-
---------
-
-*${PREFIX}/bin/gramps*
-*${PREFIX}/share/gramps*
-*${HOME}/.gramps*
-
-
-**AUTORES**
-
--------
-
-Donald Allingham *<`don@gramps-project.org`_>*
-*`http://gramps.sourceforge.net`_*
-
-Este manual foi originalmente escrito por:
-Brandon L. Griffith *<`brandon@debian.org`_>*
-para inclus?o na distribui??o Debian GNU/Linux.
-
-Este manual ? atualmente mantido pelo:
-Projeto Gramps *<`xxx@gramps-project.org`_>*
+ Além da impressão direta, é possível gerar relatórios em diversos
+ formatos de arquivo, tais como OpenOffice.org, AbiWord, HTML ou
+ LaTeX, para permitir aos usuários a modificação de acordo com
+ suas necessidades.
-**DOCUMENTA??O**
+**LIMITAÇÕES E ERROS CONHECIDOS**
---------------
+*ARQUIVOS**
-A documenta??o para usu?rios est? dispon?vel atrav?s da op??o de ajuda padr?o
-do GNOME, na forma de Manual do Gramps. O Manual tamb?m est? dispon?vel no
-formato XML como **gramps-manual.xml** em *doc/gramps-manual/$LANG* nas
-fontes oficiais da sua distribui??o.
-
-A documenta??o para desenvolvedores pode ser encontrada na p?gina
-*`http://developers.gramps-project.org`_*.
+ *${PREFIX}/bin/gramps*
+
+ *${PREFIX}/lib/python/dist-packages/gramps/*
+
+ *${PREFIX}/share/*
+
+ *${HOME}/.gramps*
-**TRADU??O**
+*AUTORES*
-----------
+ Donald Allingham
+ http://gramps.sourceforge.net
+ Este manual foi originalmente escrito por:
+ Brandon L. Griffith
+ para inclusão na distribuição Debian GNU/Linux.
-``Andr? Marcelo Alvarenga <`andrealvarenga@gmx.net`_> em 05/08/2012``
+ Este manual é atualmente mantido pelo:
+ Projeto Gramps
+
+
+**DOCUMENTAÇÃO**
+
+ A documentação para usuários está disponível através da
+ opção de ajuda.
+
+ A documentação para desenvolvedores pode ser encontrada na
+ página http://developers.gramps-project.org.
+
+
+
+**TRADUÇÃO**
+
+André Marcelo Alvarenga em 05/08/2012
January 2013 4.0.0 gramps(1)
diff --git a/data/man/sv/Makefile.am b/data/man/sv/Makefile.am
deleted file mode 100644
index 786f2c5f7..000000000
--- a/data/man/sv/Makefile.am
+++ /dev/null
@@ -1,14 +0,0 @@
-# This is the data/man/sv level Makefile for Gramps
-# $Id: Makefile.am 6189 2006-03-21 19:05:46Z rshura $
-
-man_IN_FILES = gramps.1.in
-man_MANS = $(man_IN_FILES:.1.in=.1)
-
-mandir = @mandir@/sv
-
-EXTRA_DIST = $(man_MANS) $(man_IN_FILES)
-
-gramps.1: $(top_builddir)/config.status gramps.1.in
- cd $(top_builddir) && CONFIG_FILES=data/man/sv/$@ $(SHELL) ./config.status
-
-CLEANFILES=$(man_MANS)
diff --git a/data/man/sv/sv.rst b/data/man/sv/sv.rst
index c357c4133..43bdf6ef7 100644
--- a/data/man/sv/sv.rst
+++ b/data/man/sv/sv.rst
@@ -5,12 +5,12 @@ Gramps(1) 3.4.0 Gramps(1)
-NAMN
+**NAMN**
Gramps - Genealogical Research and Analysis Management Programming Sys‐
tem.
-SAMMANFATTNING
+**SAMMANFATTNING**
Gramps [-?|--help] [--usage] [--version] [-l] [-u|--force-unlock]
[-O|--open= DATABAS [-f|--format= FORMAT]] [-i|--import= FIL [-f|--for‐
mat= FORMAT]] [-i|--import= ...] [-e|--export= FIL [-f|--format= FOR‐
@@ -18,7 +18,7 @@ SAMMANFATTNING
[--version]
-BESKRIVNING
+**BESKRIVNING**
Gramps är ett Free/OpenSource släktforskningsprogram. Det är skrivet i
Python, med hjälp av GTK+/GNOME gränssnittet. Gramps bör kännas bekant
för de flesta, som har använt andra släktforskningsprogram tidigare,
@@ -27,9 +27,9 @@ BESKRIVNING
används över hela världen av nästan all släktforskningsprogramvara.
-ALTERNATIV
- Gramps FIL
- När FIL ges (utan några flaggor) som namn på ett familjeträd
+**ALTERNATIV**
+ **Gramps** *FIL*
+ När *FIL* ges (utan några flaggor) som namn på ett familjeträd
eller som en mapp med familjeträd, så öppnas detta och en inter‐
aktiv session startas. Om FIL är en fil, vars format förstås av
Gramps, skapas ett tomt famljeträd, vars namn är grundat på nam‐
@@ -40,7 +40,7 @@ ALTERNATIV
Gramps, se nedan.
- -f,--format= FORMAT
+ **-f** , **--format=** *FORMAT*
Uttryckligen specificera format på FIL givet av föregående -i
eller -e-alternativ. Om -f-alternativet inte ges för någon FIL,
gissas filformat för den filen utgående från dess filändelse
@@ -60,21 +60,22 @@ ALTERNATIV
(gissas aldrig, specificeras alltid med -f-alternativ).
- -l Listar alla databaser/familjeträd.
+ **-l**
+ Listar alla databaser/familjeträd.
- -u,--force-unlock
+ **-u** , **--force-unlock**
Tvingar upplåsning av databas.
- -O,--open= DATABAS
- Öppnar DATABAS, som måste vara en befitlig databasmapp eller ett
+ **-O** , **--open=** *DATABAS*
+ Öppnar *DATABAS* , som måste vara en befitlig databasmapp eller ett
befintligt familjeträd. Om ingen åtgärd, import eller export-
alternativ anges på kommandoraden så startas en interaktiv ses‐
sion med den angivna databasen.
- -i,--import= FIL
+ **-i** , **--import=** *FIL*
Importera data från FIL. Om du inte har specificerat en databas,
skapas en temporär sådan, som tas bort när Gramps avslutas.
@@ -84,25 +85,25 @@ ALTERNATIV
resulterande databasen.
- -e,--export= FIL
- Exporterar data till FIL. För iso-format, är FIL i själva verket
+ **-e** , **--export=** *FIL*
+ Exporterar data till *FIL* . För iso-format, är *FIL* i själva verket
namnet på den mapp, som Gramps databas kommer att skrivas till.
- För Gramps-xml, gedcom, wft, Gramps-pkg och geneweb, är FIL nam‐
+ För Gramps-xml, gedcom, wft, Gramps-pkg och geneweb, är *FIL* nam‐
net på resultatfilen.
Om mer är en utdatafil anges, måste varje föregås av en -e-
flagga. Filerna skrivs en efter en i den givna ordningen.
- -a,--action= ÅTGÄRD
+ **-a** , **--action=** *ÅTGÄRD*
Utför ÅTGÄRD på importerade data. Detta görs efter att all
import har avslutats felfritt. F. n. är följand åtgärder möjliga
summary (samma som Rapporter->Visa->Sammanfattning av
databasen) , check (samma som Verktyg->Reparera databas ->Kon‐
- trollera och reparera) samt report ( skapar report, kräver en
- ALTERNATIVSTRÄNG lämnad via **-p** flaggan ) .
+ trollera och reparera) samt report ( skapar report, kräver
+ en *ALTERNATIVSTRÄNG* lämnad via **-p** flaggan ) .
- ALTERNATIVSTRÄNG-en måste uppfylla följand villkor:
+ *ALTERNATIVSTRÄNG* -en måste uppfylla följand villkor:
Får ej innehålla några mellanslag. Om några argument behöver
inbegripa mellanslag, måste strängen omslutas av anföring‐
stecken. Alternativsträngen är en lista med par av namn och
@@ -112,17 +113,17 @@ ALTERNATIV
De flesta rapportalternativ är unika för varje rapport eller
verktyg. Emellertid finns det gemensamm alternativ.
- name=rapportnamn
+ **name=rapportnamn**
Detta är obligatoriskt och bestämmer vilken rapport som skall
skapas. Om det givna namn inte motsvarar någon möjlig rapport
eller verktyg, kommer ett felmeddelande att skrivas ut, följt av
möjliga namn på rapporter eller verktyg.
- show=all
+ **show=all**
Detta ger en lista med namn på alla möjliga alternativ för en
bestämd rapport eller verktyg.
- show=optionname
+ **show=optionname**
Detta skriver ut beskrivningen av den funktion, som optionname
innebär, likväl vad som är godkända typer och värden för detta
alternativ.
@@ -135,15 +136,15 @@ ALTERNATIV
Åtgärderna utförs en och en i den givna turordningen.
- -d,--debug= LOGGER_NAME
+ **-d** , **--debug=** *LOGGER_NAME*
Kopplar på avlusningshjälpmedel för utveckling och tester. För
detaljer hänvisas till källkoder
- --version
+ **--version**
Skriver ur Gramps versionsnummer och avslutar
-Operation
+**Operation**
Om första argumentet på kommandoraden inte inledds med ett minustecken
(d. v. s. ingen flagga), kommer Gramps att försöka öppna den fil, vars
namn givits av det första argumentet samt påbörja en interaktiv session
@@ -184,7 +185,7 @@ Operation
fel i filer.
-EXAMPEL
+**EXAMPEL**
För att öppna ett befintligt familjeträd och importera en xml-fil till
det, kan man skriva:
@@ -230,7 +231,7 @@ EXAMPEL
Gramps
-BEGREPP
+**BEGREPP**
Stöder ett python-baserat system för tilläggsprogram, som möjliggör att
import- och export-funktioner, rapportgeneratorer, verktyg samt vis‐
ningsfilter, kan komplettera Gramps utan ändringar i huvudprogrammet.
@@ -240,17 +241,19 @@ BEGREPP
användaren kan tillåtas att ändra format för att passa behoven.
-KÄNDA FEL OCH BEGRÄNSNINGAR
-FILER
+**KÄNDA FEL OCH BEGRÄNSNINGAR**
+**FILER**
*${PREFIX}/bin/gramps*
- *${PREFIX}/share/gramps*
+ *${PREFIX}/lib/python/dist-packages/gramps/*
+
+ *${PREFIX}/share/*
*${HOME}/.gramps*
-FÖRFATTARE
+**FÖRFATTARE**
Donald Allingham
http://gramps-project.org/
@@ -265,7 +268,7 @@ FÖRFATTARE
Peter Landgren
-DOCUMENTATION
+**DOCUMENTATION**
Användardokumentationen är tillgänglig genom GNOME's standard hjälp-
bläddrare i form av Gramps-handboken. Handboken finns även i XML-format
som gramps-manual.xml under doc/gramps-manual/$LANG i den officiella
@@ -275,4 +278,4 @@ DOCUMENTATION
http://www.gramps-project.org/wiki/index.php?title=Portal:Developers
-Januari 2008 3.4.0 Gramps(1)
+Januari 2013 4.0.0 Gramps(1)
diff --git a/data/man/update_man.py b/data/man/update_man.py
index e44c7c37e..9b744f7c3 100644
--- a/data/man/update_man.py
+++ b/data/man/update_man.py
@@ -36,6 +36,12 @@ import os
import sys
from argparse import ArgumentParser
+DOCUTILS = True
+try:
+ import docutils.core, docutils.writers
+except:
+ DOCUTILS = False
+
LANGUAGES = ['sv', 'nl', 'pl', 'cs', 'pt_BR', 'fr']
VERSION = '4.0.0'
DATE = ''
@@ -46,11 +52,11 @@ SPHINXBUILD = 'sphinx-build'
if sys.platform == 'win32':
pythonCmd = os.path.join(sys.prefix, 'bin', 'python.exe')
sphinxCmd = os.path.join(sys.prefix, 'bin', 'sphinx-build.exe')
-elif sys.platform == 'linux2' or os.name == 'darwin':
+elif sys.platform in ['linux2', 'darwin', 'cygwin']:
pythonCmd = os.path.join(sys.prefix, 'bin', 'python')
sphinxCmd = SPHINXBUILD
else:
- print ("ERROR: unknown system, don't know sphinx, ... commands")
+ print ("Update Man ERROR: unknown system, don't know sphinx, ... commands")
sys.exit(0)
def tests():
@@ -70,6 +76,9 @@ def tests():
os.system('''%(program)s''' % {'program': sphinxCmd})
except:
print ('Please, install sphinx')
+
+ if not DOCUTILS:
+ print('\nNo docutils support, cannot use -m/--man and -o/--odt arguments.')
def main():
"""
@@ -87,8 +96,16 @@ def main():
help="test if 'python' and 'sphinx' are properly installed")
parser.add_argument("-b", "--build",
- action="store_true", dest="build", default=True,
- help="build documentation")
+ action="store_true", dest="build", default=False,
+ help="build man documentation (via sphinx-build)")
+
+ parser.add_argument("-m", "--man",
+ action="store_true", dest="man", default=False,
+ help="build man documentation (via docutils)")
+
+ parser.add_argument("-o", "--odt",
+ action="store_true", dest="odt", default=False,
+ help="build odt documentation (via docutils)")
args = parser.parse_args()
@@ -98,6 +115,12 @@ def main():
if args.build:
build()
+ if args.man and DOCUTILS:
+ man()
+
+ if args.odt and DOCUTILS:
+ odt()
+
def build():
"""
Build documentation.
@@ -107,7 +130,8 @@ def build():
os.system('''%(program)s -b html . _build/html''' % {'program': sphinxCmd})
os.system('''%(program)s -b htmlhelp . _build/htmlhelp''' % {'program': sphinxCmd})
- os.system('''%(program)s -b man . .''' % {'program': sphinxCmd})
+ if DOCUTILS:
+ os.system('''%(program)s -b man . .''' % {'program': sphinxCmd})
os.system('''%(program)s -b text . _build/text''' % {'program': sphinxCmd})
os.system('''%(program)s -b changes . _build/changes''' % {'program': sphinxCmd})
#os.system('''%(program)s -b linkcheck . _build/linkcheck''' % {'program': sphinxCmd})
@@ -118,13 +142,42 @@ def build():
% {'lang': lang, 'program': sphinxCmd})
os.system('''%(program)s -b htmlhelp -D language="%(lang)s" master_doc="%(lang)s" %(lang)s %(lang)s'''
% {'lang': lang, 'program': sphinxCmd})
- os.system('''%(program)s -b man %(lang)s %(lang)s'''
- % {'lang': lang, 'program': sphinxCmd})
+ if DOCUTILS:
+ os.system('''%(program)s -b man %(lang)s %(lang)s'''
+ % {'lang': lang, 'program': sphinxCmd})
os.system('''%(program)s -b text -D language="%(lang)s" master_doc="%(lang)s" %(lang)s %(lang)s'''
% {'lang': lang, 'program': sphinxCmd})
# for update/migration
os.system('''%(program)s -b gettext -D language="%(lang)s" master_doc="%(lang)s" . _build/gettext/%(lang)s'''
% {'lang': lang, 'program': sphinxCmd})
+
+def man():
+ """
+ man file generation via docutils (python)
+
+ from docutils.core import publish_cmdline, default_description
+ from docutils.writers import manpage
+ """
+
+ os.system('''rst2man en.rst gramps.1''')
+
+ for lang in LANGUAGES:
+ os.system('''rst2man %(lang)s/%(lang)s.rst -l %(lang)s %(lang)s/gramps.1'''
+ % {'lang': lang})
+
+def odt():
+ """
+ odt file generation via docutils (python)
+
+ from docutils.core import publish_cmdline_to_binary, default_description
+ from docutils.writers.odf_odt import Writer, Reader
+ """
+
+ os.system('''rst2odt en.rst gramps.odt''')
+
+ for lang in LANGUAGES:
+ os.system('''rst2odt %(lang)s/%(lang)s.rst -l %(lang)s %(lang)s/gramps.odt'''
+ % {'lang': lang})
if __name__ == "__main__":
main()
diff --git a/gramps/data/papersize.xml b/data/papersize.xml
similarity index 100%
rename from gramps/data/papersize.xml
rename to data/papersize.xml
diff --git a/gramps/data/templates/404.html b/data/templates/404.html
similarity index 100%
rename from gramps/data/templates/404.html
rename to data/templates/404.html
diff --git a/gramps/data/templates/500.html b/data/templates/500.html
similarity index 100%
rename from gramps/data/templates/500.html
rename to data/templates/500.html
diff --git a/data/templates/admin/base_site.html b/data/templates/admin/base_site.html
new file mode 100644
index 000000000..d31a0fd82
--- /dev/null
+++ b/data/templates/admin/base_site.html
@@ -0,0 +1,22 @@
+{% extends "admin/base.html" %}
+{% load i18n %}
+
+{% block title %}{{ title }} | My New Title{% endblock %}
+
+{% block branding %}
+My new title for the Admin site!
+{% endblock %}
+
+{% block nav-global %}
+ {% if user.is_staff %}
+
+
+ Website home
+ Admin home
+ Invoices
+ New Users
+ All Users
+ {% endif %}
+{% endblock %}
diff --git a/gramps/data/templates/browse_page.html b/data/templates/browse_page.html
similarity index 100%
rename from gramps/data/templates/browse_page.html
rename to data/templates/browse_page.html
diff --git a/gramps/data/templates/detail_breadcrumb.html b/data/templates/detail_breadcrumb.html
similarity index 100%
rename from gramps/data/templates/detail_breadcrumb.html
rename to data/templates/detail_breadcrumb.html
diff --git a/gramps/data/templates/gramps-base.html b/data/templates/gramps-base.html
similarity index 100%
rename from gramps/data/templates/gramps-base.html
rename to data/templates/gramps-base.html
diff --git a/gramps/data/templates/main_page.html b/data/templates/main_page.html
similarity index 100%
rename from gramps/data/templates/main_page.html
rename to data/templates/main_page.html
diff --git a/gramps/data/templates/paginator.html b/data/templates/paginator.html
similarity index 100%
rename from gramps/data/templates/paginator.html
rename to data/templates/paginator.html
diff --git a/gramps/data/templates/pick.html b/data/templates/pick.html
similarity index 100%
rename from gramps/data/templates/pick.html
rename to data/templates/pick.html
diff --git a/gramps/data/templates/reference.html b/data/templates/reference.html
similarity index 100%
rename from gramps/data/templates/reference.html
rename to data/templates/reference.html
diff --git a/gramps/data/templates/registration/login.html b/data/templates/registration/login.html
similarity index 100%
rename from gramps/data/templates/registration/login.html
rename to data/templates/registration/login.html
diff --git a/gramps/data/templates/table_header.html b/data/templates/table_header.html
similarity index 100%
rename from gramps/data/templates/table_header.html
rename to data/templates/table_header.html
diff --git a/gramps/data/templates/user_page.html b/data/templates/user_page.html
similarity index 100%
rename from gramps/data/templates/user_page.html
rename to data/templates/user_page.html
diff --git a/gramps/data/templates/view_citation_detail.html b/data/templates/view_citation_detail.html
similarity index 100%
rename from gramps/data/templates/view_citation_detail.html
rename to data/templates/view_citation_detail.html
diff --git a/gramps/data/templates/view_citations.html b/data/templates/view_citations.html
similarity index 100%
rename from gramps/data/templates/view_citations.html
rename to data/templates/view_citations.html
diff --git a/gramps/data/templates/view_event_detail.html b/data/templates/view_event_detail.html
similarity index 100%
rename from gramps/data/templates/view_event_detail.html
rename to data/templates/view_event_detail.html
diff --git a/gramps/data/templates/view_events.html b/data/templates/view_events.html
similarity index 100%
rename from gramps/data/templates/view_events.html
rename to data/templates/view_events.html
diff --git a/gramps/data/templates/view_families.html b/data/templates/view_families.html
similarity index 100%
rename from gramps/data/templates/view_families.html
rename to data/templates/view_families.html
diff --git a/gramps/data/templates/view_family_detail.html b/data/templates/view_family_detail.html
similarity index 100%
rename from gramps/data/templates/view_family_detail.html
rename to data/templates/view_family_detail.html
diff --git a/gramps/data/templates/view_media.html b/data/templates/view_media.html
similarity index 100%
rename from gramps/data/templates/view_media.html
rename to data/templates/view_media.html
diff --git a/gramps/data/templates/view_media_detail.html b/data/templates/view_media_detail.html
similarity index 100%
rename from gramps/data/templates/view_media_detail.html
rename to data/templates/view_media_detail.html
diff --git a/gramps/data/templates/view_name_detail.html b/data/templates/view_name_detail.html
similarity index 98%
rename from gramps/data/templates/view_name_detail.html
rename to data/templates/view_name_detail.html
index b3aceb49a..e995a4f0c 100644
--- a/gramps/data/templates/view_name_detail.html
+++ b/data/templates/view_name_detail.html
@@ -115,7 +115,7 @@
- {% note_table nameform.model user action "/person/%s/name/%s/note" person.handle nameform.model.order %}
+ {% note_table nameform.model user action "/note/$act/person/%s/name/%s" person.handle nameform.model.order %}
diff --git a/gramps/data/templates/view_note_detail.html b/data/templates/view_note_detail.html
similarity index 100%
rename from gramps/data/templates/view_note_detail.html
rename to data/templates/view_note_detail.html
diff --git a/gramps/data/templates/view_notes.html b/data/templates/view_notes.html
similarity index 100%
rename from gramps/data/templates/view_notes.html
rename to data/templates/view_notes.html
diff --git a/gramps/data/templates/view_page.html b/data/templates/view_page.html
similarity index 100%
rename from gramps/data/templates/view_page.html
rename to data/templates/view_page.html
diff --git a/gramps/data/templates/view_page_detail.html b/data/templates/view_page_detail.html
similarity index 100%
rename from gramps/data/templates/view_page_detail.html
rename to data/templates/view_page_detail.html
diff --git a/gramps/data/templates/view_people.html b/data/templates/view_people.html
similarity index 100%
rename from gramps/data/templates/view_people.html
rename to data/templates/view_people.html
diff --git a/gramps/data/templates/view_person_detail.html b/data/templates/view_person_detail.html
similarity index 100%
rename from gramps/data/templates/view_person_detail.html
rename to data/templates/view_person_detail.html
diff --git a/gramps/data/templates/view_place_detail.html b/data/templates/view_place_detail.html
similarity index 100%
rename from gramps/data/templates/view_place_detail.html
rename to data/templates/view_place_detail.html
diff --git a/gramps/data/templates/view_places.html b/data/templates/view_places.html
similarity index 100%
rename from gramps/data/templates/view_places.html
rename to data/templates/view_places.html
diff --git a/gramps/data/templates/view_report.html b/data/templates/view_report.html
similarity index 100%
rename from gramps/data/templates/view_report.html
rename to data/templates/view_report.html
diff --git a/gramps/data/templates/view_report_detail.html b/data/templates/view_report_detail.html
similarity index 100%
rename from gramps/data/templates/view_report_detail.html
rename to data/templates/view_report_detail.html
diff --git a/gramps/data/templates/view_repositories.html b/data/templates/view_repositories.html
similarity index 100%
rename from gramps/data/templates/view_repositories.html
rename to data/templates/view_repositories.html
diff --git a/gramps/data/templates/view_repository.html b/data/templates/view_repository.html
similarity index 100%
rename from gramps/data/templates/view_repository.html
rename to data/templates/view_repository.html
diff --git a/gramps/data/templates/view_repository_detail.html b/data/templates/view_repository_detail.html
similarity index 100%
rename from gramps/data/templates/view_repository_detail.html
rename to data/templates/view_repository_detail.html
diff --git a/gramps/data/templates/view_source_detail.html b/data/templates/view_source_detail.html
similarity index 100%
rename from gramps/data/templates/view_source_detail.html
rename to data/templates/view_source_detail.html
diff --git a/gramps/data/templates/view_sources.html b/data/templates/view_sources.html
similarity index 100%
rename from gramps/data/templates/view_sources.html
rename to data/templates/view_sources.html
diff --git a/gramps/data/templates/view_surname_detail.html b/data/templates/view_surname_detail.html
similarity index 100%
rename from gramps/data/templates/view_surname_detail.html
rename to data/templates/view_surname_detail.html
diff --git a/gramps/data/templates/view_tag.html b/data/templates/view_tag.html
similarity index 100%
rename from gramps/data/templates/view_tag.html
rename to data/templates/view_tag.html
diff --git a/gramps/data/templates/view_tag_detail.html b/data/templates/view_tag_detail.html
similarity index 100%
rename from gramps/data/templates/view_tag_detail.html
rename to data/templates/view_tag_detail.html
diff --git a/gramps/data/templates/view_tags.html b/data/templates/view_tags.html
similarity index 100%
rename from gramps/data/templates/view_tags.html
rename to data/templates/view_tags.html
diff --git a/gramps/data/tips.xml.in b/data/tips.xml.in
similarity index 100%
rename from gramps/data/tips.xml.in
rename to data/tips.xml.in
diff --git a/docs/coregui/gui.rst b/docs/coregui/gui.rst
index d7ee22983..0d0ed3952 100644
--- a/docs/coregui/gui.rst
+++ b/docs/coregui/gui.rst
@@ -1,13 +1,13 @@
##########################
-The :mod:`gui` Module
+The :mod:`gramps.gui` Module
##########################
-.. automodule:: gui
+.. automodule:: gramps.gui
*****************************
Gramps
*****************************
-.. automodule:: gui.grampsgui
+.. automodule:: gramps.gui.grampsgui
.. autoclass:: Gramps
:members:
:undoc-members:
@@ -16,7 +16,7 @@ Gramps
*****************************
About Dialog
*****************************
-.. automodule:: gui.aboutdialog
+.. automodule:: gramps.gui.aboutdialog
.. autoclass:: AuthorParser
:members:
:undoc-members:
@@ -29,7 +29,7 @@ About Dialog
*****************************
Base Sidebar
*****************************
-.. automodule:: gui.basesidebar
+.. automodule:: gramps.gui.basesidebar
.. autoclass:: BaseSidebar
:members:
:undoc-members:
@@ -38,7 +38,7 @@ Base Sidebar
*****************************
Column Order
*****************************
-.. automodule:: gui.columnorder
+.. automodule:: gramps.gui.columnorder
.. autoclass:: ColumnOrder
:members:
:undoc-members:
@@ -47,7 +47,7 @@ Column Order
*****************************
Configuration
*****************************
-.. automodule:: gui.configure
+.. automodule:: gramps.gui.configure
.. autoclass:: ConfigureDialog
:members:
:undoc-members:
@@ -64,7 +64,7 @@ Configuration
*****************************
GUI Element (DB)
*****************************
-.. automodule:: gui.dbguielement
+.. automodule:: gramps.gui.dbguielement
.. autoclass:: DbGUIElement
:members:
:undoc-members:
@@ -73,7 +73,7 @@ GUI Element (DB)
*****************************
DB Loader
*****************************
-.. automodule:: gui.dbloader
+.. automodule:: gramps.gui.dbloader
.. autoclass:: DbLoader
:members:
:undoc-members:
@@ -86,7 +86,7 @@ DB Loader
*****************************
DB Manager
*****************************
-.. automodule:: gui.dbman
+.. automodule:: gramps.gui.dbman
.. autoclass:: DbManager
:members:
:undoc-members:
@@ -95,7 +95,7 @@ DB Manager
*****************************
Filter Editor
*****************************
-.. automodule:: gui.editors.filtereditor
+.. automodule:: gramps.gui.editors.filtereditor
.. autoclass:: EditFilter
:members:
:undoc-members:
@@ -156,7 +156,7 @@ Filter Editor
*****************************
Gramps Bar
*****************************
-.. automodule:: gui.grampsbar
+.. automodule:: gramps.gui.grampsbar
.. autoclass:: DetachedWindow
:members:
:undoc-members:
@@ -173,7 +173,7 @@ Gramps Bar
*****************************
Navigator
*****************************
-.. automodule:: gui.navigator
+.. automodule:: gramps.gui.navigator
.. autoclass:: Navigator
:members:
:undoc-members:
@@ -182,7 +182,7 @@ Navigator
*****************************
Plugins Manager
*****************************
-.. automodule:: gui.pluginmanager
+.. automodule:: gramps.gui.pluginmanager
.. autoclass:: GuiPluginManager
:members:
:undoc-members:
@@ -191,7 +191,7 @@ Plugins Manager
*****************************
User
*****************************
-.. automodule:: gui.user
+.. automodule:: gramps.gui.user
.. autoclass:: User
:members:
:undoc-members:
@@ -200,7 +200,7 @@ User
*****************************
Utils
*****************************
-.. automodule:: gui.utils
+.. automodule:: gramps.gui.utils
.. autoclass:: CLIDialog
:members:
:undoc-members:
@@ -217,7 +217,7 @@ Utils
*****************************
Views Manager
*****************************
-.. automodule:: gui.viewmanager
+.. automodule:: gramps.gui.viewmanager
.. autoclass:: ViewManager
:members:
:undoc-members:
diff --git a/docs/date.rst b/docs/date.rst
index 3b50b862e..ced18e43b 100644
--- a/docs/date.rst
+++ b/docs/date.rst
@@ -273,7 +273,7 @@ The :class:`Date Edition` Classes
DateEdit
====================================
-.. automodule:: gui.editors.editdate
+.. automodule:: gramps.gui.editors.editdate
:members:
:undoc-members:
:show-inheritance:
diff --git a/docs/update_doc.py b/docs/update_doc.py
index 352942230..b4cbe3b39 100644
--- a/docs/update_doc.py
+++ b/docs/update_doc.py
@@ -42,11 +42,11 @@ SPHINXBUILD = 'sphinx-build'
if sys.platform == 'win32':
pythonCmd = os.path.join(sys.prefix, 'bin', 'python.exe')
sphinxCmd = os.path.join(sys.prefix, 'bin', 'sphinx-build.exe')
-elif sys.platform == 'linux2' or os.name == 'darwin':
+elif sys.platform in ['linux2', 'darwin', 'cygwin']:
pythonCmd = os.path.join(sys.prefix, 'bin', 'python')
sphinxCmd = SPHINXBUILD
else:
- print ("ERROR: unknown system, don't know sphinx, ... commands")
+ print ("Update Docs ERROR: unknown system, don't know sphinx, ... commands")
sys.exit(0)
def tests():
diff --git a/example/csv/example.csv b/example/csv/example.csv
new file mode 100644
index 000000000..a3a2ba88f
--- /dev/null
+++ b/example/csv/example.csv
@@ -0,0 +1,7 @@
+person,surname,given
+a,"CSV Surname","Given 1"
+b,"CSV Surname","Given 2"
+
+marriage,mother,father
+1,a,b
+
diff --git a/example/gramps/data.gramps b/example/gramps/data.gramps
index ee015b8a0..44cd7b913 100644
Binary files a/example/gramps/data.gramps and b/example/gramps/data.gramps differ
diff --git a/gramps/cli/arghandler.py b/gramps/cli/arghandler.py
index e21180339..d04b65a85 100644
--- a/gramps/cli/arghandler.py
+++ b/gramps/cli/arghandler.py
@@ -39,7 +39,8 @@ Module responsible for handling the command line arguments for GRAMPS.
from __future__ import print_function
import os
import sys
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
@@ -185,9 +186,9 @@ class ArgHandler(object):
else:
# Need to convert to system file encoding before printing
# For non latin characters in path/file/user names
- print(msg1.encode(sys.getfilesystemencoding()), file=sys.stderr)
+ print(msg1.encode(sys.stdout.encoding, 'backslashreplace'), file=sys.stderr)
if msg2 is not None:
- print(msg2.encode(sys.getfilesystemencoding()), file=sys.stderr)
+ print(msg2.encode(sys.stdout.encoding, 'backslashreplace'), file=sys.stderr)
#-------------------------------------------------------------------------
# Argument parser: sorts out given arguments
@@ -294,7 +295,7 @@ class ArgHandler(object):
else:
ask = input
ans = ask(_('OK to overwrite? (yes/no) ') \
- .encode(sys.getfilesystemencoding()))
+ .encode(sys.stdout.encoding, 'backslashreplace'))
except EOFError:
print()
sys.exit(0)
@@ -408,26 +409,26 @@ class ArgHandler(object):
if self.list:
print(_('List of known family trees in your database path\n').\
- encode(sys.getfilesystemencoding()))
+ encode(sys.stdout.encoding, 'backslashreplace'))
for name, dirname in sorted(self.dbman.family_tree_list(),
key=lambda pair: pair[0].lower()):
print((_("%(full_DB_path)s with name \"%(f_t_name)s\"") % \
{'full_DB_path' : dirname,
- 'f_t_name' : name}).encode(sys.getfilesystemencoding()))
+ 'f_t_name' : name}).encode(sys.stdout.encoding, 'backslashreplace'))
sys.exit(0)
if self.list_more:
- print(_('Gramps Family Trees:').encode(sys.getfilesystemencoding()))
+ print(_('Gramps Family Trees:').encode(sys.stdout.encoding, 'backslashreplace'))
summary_list = self.dbman.family_tree_summary()
for summary in sorted(summary_list,
key=lambda sum: sum["Family tree"].lower()):
print(_("Family Tree \"%s\":").\
- encode(sys.getfilesystemencoding()) % summary["Family tree"])
+ encode(sys.stdout.encoding, 'backslashreplace') % summary["Family tree"])
for item in sorted(summary):
if item != "Family tree":
print((" %s: %s" % (item, summary[item])).\
- encode(sys.getfilesystemencoding()))
+ encode(sys.stdout.encoding, 'backslashreplace'))
sys.exit(0)
self.__open_action()
@@ -442,7 +443,7 @@ class ArgHandler(object):
for expt in self.exports:
# Need to convert path/filename to str before printing
# For non latin characters in Windows path/file/user names
- fn = expt[0].encode(sys.getfilesystemencoding())
+ fn = expt[0].encode(sys.stdout.encoding, 'backslashreplace')
fmt = str(expt[1])
print(_("Exporting: file %(filename)s, "
"format %(format)s.") % \
@@ -480,7 +481,7 @@ class ArgHandler(object):
self.imp_db_path, title = self.dbman.create_new_db_cli()
else:
self.imp_db_path = get_empty_tempdir("import_dbdir") \
- .encode(sys.getfilesystemencoding())
+ .encode(sys.stdout.encoding, 'backslashreplace')
newdb = DbBsddb()
newdb.write_version(self.imp_db_path)
@@ -494,7 +495,7 @@ class ArgHandler(object):
sys.exit(0)
for imp in self.imports:
- fn = imp[0].encode(sys.getfilesystemencoding())
+ fn = imp[0].encode(sys.stdout.encoding, 'backslashreplace')
fmt = str(imp[1])
msg = _("Importing: file %(filename)s, format %(format)s.") % \
{'filename' : fn, 'format' : fmt}
@@ -623,10 +624,10 @@ class ArgHandler(object):
# Print cli report name ([item[0]), GUI report name (item[4])
if len(pdata.id) <= 25:
print(" %s%s- %s" % ( pdata.id, " " * (26 - len(pdata.id)),
- pdata.name.encode(sys.getfilesystemencoding())), file=sys.stderr)
+ pdata.name.encode(sys.stdout.encoding, 'backslashreplace')), file=sys.stderr)
else:
print(" %s\t- %s" % (pdata.id,
- pdata.name.encode(sys.getfilesystemencoding())), file=sys.stderr)
+ pdata.name.encode(sys.stdout.encoding, 'backslashreplace')), file=sys.stderr)
elif action == "tool":
from gramps.gui.plug import tool
@@ -664,10 +665,10 @@ class ArgHandler(object):
# Print cli report name ([item[0]), GUI report name (item[4])
if len(pdata.id) <= 25:
print(" %s%s- %s" % ( pdata.id, " " * (26 - len(pdata.id)),
- pdata.name.encode(sys.getfilesystemencoding())), file=sys.stderr)
+ pdata.name.encode(sys.stdout.encoding, 'backslashreplace')), file=sys.stderr)
else:
print(" %s\t- %s" % (pdata.id,
- pdata.name.encode(sys.getfilesystemencoding())), file=sys.stderr)
+ pdata.name.encode(sys.stdout.encoding, 'backslashreplace')), file=sys.stderr)
elif action == "book":
try:
diff --git a/gramps/cli/argparser.py b/gramps/cli/argparser.py
index 9215f828c..e3a2cce0c 100644
--- a/gramps/cli/argparser.py
+++ b/gramps/cli/argparser.py
@@ -39,7 +39,8 @@ Module responsible for handling the command line arguments for GRAMPS.
from __future__ import print_function
import sys
import getopt
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import logging
#-------------------------------------------------------------------------
@@ -292,7 +293,7 @@ class ArgParser(object):
self.list_more = True
elif option in ('-s','--show'):
print ("Gramps config settings from %s:" % \
- config.filename.encode(sys.getfilesystemencoding()))
+ config.filename.encode(sys.stdout.encoding, 'backslashreplace'))
for section in config.data:
for setting in config.data[section]:
print ("%s.%s=%s" % (
@@ -402,7 +403,7 @@ class ArgParser(object):
"""
if self.help:
# Convert Help messages to file system encoding before printing
- print (_HELP.encode(sys.getfilesystemencoding()))
+ print (_HELP.encode(sys.stdout.encoding, 'backslashreplace'))
sys.exit(0)
def print_usage(self):
@@ -411,5 +412,5 @@ class ArgParser(object):
"""
if self.usage:
# Convert Help messages to file system encoding before printing
- print (_USAGE.encode(sys.getfilesystemencoding()))
+ print (_USAGE.encode(sys.stdout.encoding, 'backslashreplace'))
sys.exit(0)
diff --git a/gramps/cli/clidbman.py b/gramps/cli/clidbman.py
index cfe496acf..6cf57cf60 100644
--- a/gramps/cli/clidbman.py
+++ b/gramps/cli/clidbman.py
@@ -44,7 +44,6 @@ else:
from urllib.parse import urlparse
from urllib.request import urlopen, url2pathname
import tempfile
-from gramps.gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
# set up logging
@@ -58,6 +57,8 @@ LOG = logging.getLogger(".clidbman")
# gramps modules
#
#-------------------------------------------------------------------------
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.db import DbBsddb
from gramps.gen.plug import BasePluginManager
from gramps.gen.config import config
@@ -158,6 +159,7 @@ class CLIDbManager(object):
try:
dbmap1.open(fname, META, db.DB_HASH, db.DB_RDONLY)
except:
+ env.close()
return "Unknown", "Unknown"
version = dbmap1.get('version', default=None)
dbmap1.close()
@@ -191,7 +193,7 @@ class CLIDbManager(object):
retval["Locked?"] = "no"
retval["DB version"] = version
if sys.version_info[0] < 3:
- retval["Family tree"] = name.encode(sys.getfilesystemencoding())
+ retval["Family tree"] = name.encode(glocale.getfilesystemencoding())
else:
retval["Family tree"] = name
retval["Path"] = dirpath
@@ -206,7 +208,7 @@ class CLIDbManager(object):
# make the default directory if it does not exist
dbdir = os.path.expanduser(config.get('behavior.database-path'))
if sys.version_info[0] < 3:
- dbdir = dbdir.encode(sys.getfilesystemencoding())
+ dbdir = dbdir.encode(glocale.getfilesystemencoding())
db_ok = make_dbdir(dbdir)
self.current_names = []
@@ -217,6 +219,7 @@ class CLIDbManager(object):
if os.path.isfile(path_name):
file = open(path_name)
name = file.readline().strip()
+ file.close()
(tval, last) = time_val(dirpath)
(enable, stock_id) = self.icon_values(dirpath, self.active,
@@ -413,7 +416,7 @@ def make_dbdir(dbdir):
if not os.path.isdir(dbdir):
os.makedirs(dbdir)
except (IOError, OSError) as msg:
- msg = conv_to_unicode(str(msg), sys.getfilesystemencoding())
+ msg = conv_to_unicode(str(msg), glocale.getfilesystemencoding())
LOG.error(_("\nERROR: Wrong database path in Edit Menu->Preferences.\n"
"Open preferences and set correct database path.\n\n"
"Details: Could not make database directory:\n %s\n\n") % msg)
@@ -442,7 +445,7 @@ def find_next_db_dir():
base = "%x" % int(time.time())
dbdir = os.path.expanduser(config.get('behavior.database-path'))
if sys.version_info[0] < 3:
- dbdir = dbdir.encode(sys.getfilesystemencoding())
+ dbdir = dbdir.encode(glocale.getfilesystemencoding())
new_path = os.path.join(dbdir, base)
if not os.path.isdir(new_path):
break
@@ -485,7 +488,7 @@ def find_locker_name(dirpath):
# Convert username to unicode according to system encoding
# Otherwise problems with non ASCII characters in
# username in Windows
- username = conv_to_unicode(username, sys.getfilesystemencoding())
+ username = conv_to_unicode(username, glocale.getfilesystemencoding())
# feature request 2356: avoid genitive form
last = _("Locked by %s") % username
ifile.close()
diff --git a/gramps/cli/grampscli.py b/gramps/cli/grampscli.py
index 90b70057b..ef57acc66 100644
--- a/gramps/cli/grampscli.py
+++ b/gramps/cli/grampscli.py
@@ -35,7 +35,8 @@ Provides also two small base classes: CLIDbLoader, CLIManager
#-------------------------------------------------------------------------
from __future__ import print_function
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import os
import sys
@@ -296,10 +297,10 @@ def startcli(errors, argparser):
#already errors encountered. Show first one on terminal and exit
# Convert error message to file system encoding before print
errmsg = _('Error encountered: %s') % errors[0][0]
- errmsg = errmsg.encode(sys.getfilesystemencoding())
+ errmsg = errmsg.encode(sys.stdout.encoding, 'backslashreplace')
print(errmsg)
errmsg = _(' Details: %s') % errors[0][1]
- errmsg = errmsg.encode(sys.getfilesystemencoding())
+ errmsg = errmsg.encode(sys.stdout.encoding, 'backslashreplace')
print(errmsg)
sys.exit(1)
@@ -307,10 +308,10 @@ def startcli(errors, argparser):
# Convert error message to file system encoding before print
errmsg = _('Error encountered in argument parsing: %s') \
% argparser.errors[0][0]
- errmsg = errmsg.encode(sys.getfilesystemencoding())
+ errmsg = errmsg.encode(sys.stdout.encoding, 'backslashreplace')
print(errmsg)
errmsg = _(' Details: %s') % argparser.errors[0][1]
- errmsg = errmsg.encode(sys.getfilesystemencoding())
+ errmsg = errmsg.encode(sys.stdout.encoding, 'backslashreplace')
print(errmsg)
sys.exit(1)
diff --git a/gramps/cli/plug/__init__.py b/gramps/cli/plug/__init__.py
index ae5fc5cb0..d7f695175 100644
--- a/gramps/cli/plug/__init__.py
+++ b/gramps/cli/plug/__init__.py
@@ -35,7 +35,8 @@
#-------------------------------------------------------------------------
from __future__ import print_function
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import traceback
import os
import sys
@@ -570,11 +571,11 @@ class CommandLineReport(object):
# Make the output nicer to read, assume a tab has 8 spaces
tabs = '\t\t' if len(key) < 10 else '\t'
optmsg = " %s%s%s (%s)" % (key, tabs, opt[1], opt[0])
- print(optmsg.encode(sys.getfilesystemencoding()))
+ print(optmsg.encode(sys.stdout.encoding, 'backslashreplace'))
else:
optmsg = " %s%s%s" % (key, tabs,
_('(no help available)'))
- print(optmsg.encode(sys.getfilesystemencoding()))
+ print(optmsg.encode(sys.stdout.encoding, 'backslashreplace'))
print((_(" Use '%(donottranslate)s' to see description "
"and acceptable values") %
{'donottranslate' : "show=option"}))
@@ -587,10 +588,10 @@ class CommandLineReport(object):
if isinstance(vals, (list, tuple)):
for val in vals:
optmsg = " %s" % val
- print(optmsg.encode(sys.getfilesystemencoding()))
+ print(optmsg.encode(sys.stdout.encoding, 'backslashreplace'))
else:
optmsg = " %s" % opt[2]
- print(optmsg.encode(sys.getfilesystemencoding()))
+ print(optmsg.encode(sys.stdout.encoding, 'backslashreplace'))
else:
#there was a show option given, but the option is invalid
@@ -726,6 +727,7 @@ def cl_book(database, name, book, options_str_dict):
clr.marginr, clr.margint, clr.marginb))
user = User()
rptlist = []
+ global_style = None
for item in book.get_item_list():
# The option values were loaded magically by the book parser.
@@ -743,6 +745,12 @@ def cl_book(database, name, book, options_str_dict):
report_class, item.option_class, user)
style_sheet = create_style_sheet(item)
rptlist.append((obj, style_sheet))
+ if ( item.name == 'table_of_contents' or
+ item.name == 'alphabetical_index' ): # ugly hack: FIXME
+ if global_style is None:
+ global_style = style_sheet
+ else:
+ global_style = create_style_sheet(item, global_style)
doc.open(clr.option_class.get_output())
doc.init()
@@ -754,6 +762,8 @@ def cl_book(database, name, book, options_str_dict):
newpage = 1
rpt.begin_report()
rpt.write_report()
+ if global_style:
+ doc.set_style_sheet(global_style)
doc.close()
#------------------------------------------------------------------------
diff --git a/gramps/cli/user.py b/gramps/cli/user.py
index ea9d9933d..2896de4d3 100644
--- a/gramps/cli/user.py
+++ b/gramps/cli/user.py
@@ -38,7 +38,8 @@ import sys
# Gramps Modules
#
#------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.user import User
#------------------------------------------------------------------------
diff --git a/gramps/data/Makefile.am b/gramps/data/Makefile.am
deleted file mode 100644
index f8a79d0c5..000000000
--- a/gramps/data/Makefile.am
+++ /dev/null
@@ -1,21 +0,0 @@
-# This is the src/data level Makefile for gramps
-# $Id$
-#
-SUBDIRS =
-
-pkgdatadir = $(datadir)/@PACKAGE@/data
-
-dist_pkgdata_DATA = \
- authors.xml \
- papersize.xml \
- tips.xml\
- lds.xml
-
-# Rules for files with translatable strings
-# These are taken care of by the intltool
-xml_in_files = tips.xml.in
-xml_files = $(xml_in_files:.xml.in=.xml)
-@INTLTOOL_XML_NOMERGE_RULE@
-
-EXTRA_DIST = $(xml_in_files)
-CLEANFILES = $(xml_files)
diff --git a/gramps/gen/config.py b/gramps/gen/config.py
index b73e9be66..b7753cb1d 100644
--- a/gramps/gen/config.py
+++ b/gramps/gen/config.py
@@ -4,7 +4,7 @@
#
# Copyright (C) 2005-2007 Donald N. Allingham
# Copyright (C) 2008-2009 Gary Burton
-# Copyright (C) 2009 Doug Blank
+# Copyright (C) 2009-2012 Doug Blank
# Copyright (C) 2011 Tim G L Lyons
#
# This program is free software; you can redistribute it and/or modify
@@ -41,7 +41,8 @@ import logging
# Gramps imports
#
#---------------------------------------------------------------
-from .ggettext import gettext as _
+from .const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from .const import HOME_DIR, USER_HOME, VERSION_DIR
from .utils.configmanager import ConfigManager
@@ -151,6 +152,7 @@ register('behavior.surname-guessing', 0)
register('behavior.use-tips', False)
register('behavior.welcome', 100)
register('behavior.web-search-url', 'http://google.com/#&q=%(text)s')
+register('behavior.addons-url', "http://svn.code.sf.net/p/gramps-addons/code/trunk/")
register('export.proxy-order', [
["privacy", 0],
@@ -187,7 +189,7 @@ register('interface.clipboard-height', 300)
register('interface.clipboard-width', 300)
register('interface.dont-ask', False)
register('interface.view-categories',
- ["Gramplets", "People", "Relationships", "Families",
+ ["Dashboard", "People", "Relationships", "Families",
"Ancestry", "Events", "Places", "Geography", "Sources",
"Citations", "Repositories", "Media", "Notes"])
register('interface.edit-filter-width', 500)
@@ -208,6 +210,7 @@ register('interface.filter', False)
register('interface.filter-editor-width', 400)
register('interface.filter-editor-height', 350)
register('interface.fullscreen', False)
+register('interface.grampletbar-close', False)
register('interface.height', 500)
register('interface.lds-height', 450)
register('interface.lds-width', 600)
@@ -278,6 +281,8 @@ register('preferences.date-format', 0)
register('preferences.calendar-format-report', 0)
register('preferences.cprefix', 'C%04d')
register('preferences.default-source', False)
+register('preferences.tag-on-import', False)
+register('preferences.tag-on-import-format', _("Imported %Y/%m/%d %H:%M:%S"))
register('preferences.eprefix', 'E%04d')
register('preferences.family-warn', True)
register('preferences.fprefix', 'F%04d')
diff --git a/gramps/gen/const.py.in b/gramps/gen/const.py.in
index d7bbc0c66..a73680192 100644
--- a/gramps/gen/const.py.in
+++ b/gramps/gen/const.py.in
@@ -42,7 +42,7 @@ import uuid
# Gramps modules
#
#-------------------------------------------------------------------------
-from .ggettext import sgettext as _
+from .svn_revision import get_svn_revision
#-------------------------------------------------------------------------
#
@@ -50,11 +50,20 @@ from .ggettext import sgettext as _
#
#-------------------------------------------------------------------------
PROGRAM_NAME = "Gramps"
-if "@VERSIONSTRING@" == "@" + "VERSIONSTRING" + "@":
- VERSION = "4.0.0"
-else:
- VERSION = "@VERSIONSTRING@"
-VERSION_TUPLE = (4, 0, 0)
+VERSION = "@VERSIONSTRING@"
+if VERSION == "@" + "VERSIONSTRING" + "@":
+ raise Exception("Please run 'python setup.py build'")
+def get_version_tuple(v):
+ """ Get the numeric-dotted part of version number"""
+ retval = ""
+ for c in v:
+ if c.isdigit() or (c == "." and retval.count(".") <= 1):
+ retval += c
+ else:
+ break
+ return tuple(map(int, retval.split(".")))
+VERSION_TUPLE = get_version_tuple(VERSION)
+major_version = "%s.%s" % (VERSION_TUPLE[0], VERSION_TUPLE[1])
#-------------------------------------------------------------------------
#
@@ -65,11 +74,11 @@ URL_HOMEPAGE = "http://gramps-project.org/"
URL_MAILINGLIST = "http://sourceforge.net/mail/?group_id=25770"
URL_BUGTRACKER = "http://bugs.gramps-project.org/bug_report_advanced_page.php"
URL_WIKISTRING = "http://gramps-project.org/wiki/index.php?title="
-URL_MANUAL_PAGE = "Gramps_4.0_Wiki_Manual"
+URL_MANUAL_PAGE = "Gramps_%s_Wiki_Manual" % major_version
WIKI_FAQ = "FAQ"
-WIKI_KEYBINDINGS = "Gramps_4.0_Wiki_Manual_-_Keybindings"
-WIKI_EXTRAPLUGINS= "4.0_Addons"
-WIKI_EXTRAPLUGINS_RAWDATA = "Plugins4.0&action=raw"
+WIKI_KEYBINDINGS = "Gramps_%s_Wiki_Manual_-_Keybindings" % major_version
+WIKI_EXTRAPLUGINS= "%s_Addons" % major_version
+WIKI_EXTRAPLUGINS_RAWDATA = "Plugins%s&action=raw" % major_version
#-------------------------------------------------------------------------
#
@@ -84,25 +93,6 @@ APP_GRAMPS_PKG = "application/x-gramps-package"
APP_GENEWEB = "application/x-geneweb"
APP_VCARD = ["text/x-vcard", "text/x-vcalendar"]
-#-------------------------------------------------------------------------
-#
-# system paths
-#
-#-------------------------------------------------------------------------
-if sys.platform == "win32":
- if sys.prefix == os.path.dirname(os.getcwd()):
- PREFIXDIR = sys.prefix
- SYSCONFDIR = os.path.join(sys.prefix, "etc")
- else:
- PREFIXDIR = os.path.join(os.path.dirname(__file__), os.pardir)
- SYSCONFDIR = os.path.join(PREFIXDIR, "etc")
-elif sys.platform == "darwin" and sys.prefix != sys.exec_prefix:
- PREFIXDIR = sys.prefix
- SYSCONFDIR = os.path.join(sys.prefix, "etc")
-else:
- PREFIXDIR = "@prefix@"
- SYSCONFDIR = "@sysconfdir@"
-
#-------------------------------------------------------------------------
#
# Platforms
@@ -145,24 +135,6 @@ if sys.version_info[0] < 3:
else:
pass
-#-------------------------------------------------------------------------
-#
-# Paths to files - assumes that files reside in the same directory as
-# this one, and that the plugins directory is in a directory below this.
-#
-#-------------------------------------------------------------------------
-ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(
- __file__), os.pardir))
-if sys.version_info[0] < 3:
- # test for sys.frozen to detect a py2exe executable on Windows
- if hasattr(sys, "frozen"):
- ROOT_DIR = os.path.abspath(os.path.dirname(
- unicode(sys.executable, sys.getfilesystemencoding())))
- else:
- ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(
- unicode(__file__, sys.getfilesystemencoding())), os.pardir))
-
-IMAGE_DIR = os.path.join(ROOT_DIR, "images")
VERSION_DIR = os.path.join(
HOME_DIR, "gramps%s%s" % (VERSION_TUPLE[0], VERSION_TUPLE[1]))
@@ -180,15 +152,28 @@ USER_PLUGINS = os.path.join(VERSION_DIR, "plugins")
USER_DIRLIST = (HOME_DIR, VERSION_DIR, ENV_DIR, TEMP_DIR, THUMB_DIR,
THUMB_NORMAL, THUMB_LARGE, USER_PLUGINS)
-ICON = os.path.join(ROOT_DIR, "images", "gramps.png")
-LOGO = os.path.join(ROOT_DIR, "images", "logo.png")
-SPLASH = os.path.join(ROOT_DIR, "images", "splash.jpg")
-LICENSE_FILE = os.path.join(ROOT_DIR, "COPYING")
+#-------------------------------------------------------------------------
+#
+# Paths to python modules - assumes that the root directory is one level
+# above this one, and that the plugins directory is below the root directory.
+#
+#-------------------------------------------------------------------------
+ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(
+ __file__), os.pardir))
+if sys.version_info[0] < 3:
+ # test for sys.frozen to detect a py2exe executable on Windows
+ if hasattr(sys, "frozen"):
+ ROOT_DIR = os.path.abspath(os.path.dirname(
+ unicode(sys.executable, sys.getfilesystemencoding())))
+ else:
+ ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(
+ unicode(__file__, sys.getfilesystemencoding())), os.pardir))
+
+VERSION += get_svn_revision(ROOT_DIR)
#
# Glade files
#
-
GLADE_DIR = os.path.join(ROOT_DIR, "gui", "glade")
GLADE_FILE = os.path.join(GLADE_DIR, "gramps.glade")
PERSON_GLADE = os.path.join(GLADE_DIR, "edit_person.glade")
@@ -198,29 +183,51 @@ RULE_GLADE = os.path.join(GLADE_DIR, "rule.glade")
PLUGINS_DIR = os.path.join(ROOT_DIR, "plugins")
-DATA_DIR = os.path.join(ROOT_DIR, "data")
WEB_DIR = os.path.join(ROOT_DIR, 'webapp')
-#SYSTEM_FILTERS = os.path.join(DATA_DIR, "system_filters.xml")
-TIP_DATA = os.path.join(DATA_DIR, "tips.xml")
WEBSTUFF_DIR = os.path.join(PLUGINS_DIR, "webstuff")
WEBSTUFF_IMAGE_DIR = os.path.join(WEBSTUFF_DIR, "images")
-PAPERSIZE = os.path.join(DATA_DIR, "papersize.xml")
-
-USE_TIPS = False
+USE_TIPS = False
if os.sys.platform in WINDOWS:
USE_THUMBNAILER = False
else:
USE_THUMBNAILER = True
+#-------------------------------------------------------------------------
+#
+# Paths to data files.
+#
+#-------------------------------------------------------------------------
+LOCALE_DIR = "@LOCALE_DIR@"
+DATA_DIR = "@DATA_DIR@"
+IMAGE_DIR = "@IMAGE_DIR@"
+DOC_DIR = "@DOC_DIR@"
+
+TIP_DATA = os.path.join(DATA_DIR, "tips.xml")
+PAPERSIZE = os.path.join(DATA_DIR, "papersize.xml")
+
+ICON = os.path.join(IMAGE_DIR, "gramps.png")
+LOGO = os.path.join(IMAGE_DIR, "logo.png")
+SPLASH = os.path.join(IMAGE_DIR, "splash.jpg")
+
+LICENSE_FILE = os.path.join(DOC_DIR, 'COPYING')
+#-------------------------------------------------------------------------
+#
+# Init Localization
+#
+#-------------------------------------------------------------------------
+from .utils.grampslocale import GrampsLocale
+GRAMPS_LOCALE = GrampsLocale()
+_ = GRAMPS_LOCALE.get_translation().sgettext
+
#-------------------------------------------------------------------------
#
# About box information
#
#-------------------------------------------------------------------------
COPYRIGHT_MSG = "© 2001-2006 Donald N. Allingham\n" \
- "© 2007-2012 The Gramps Developers"
+ "© 2007-2013 The Gramps Developers"
COMMENTS = _("Gramps (Genealogical Research and Analysis "
"Management Programming System) is a personal "
"genealogy program.")
@@ -325,3 +332,29 @@ LONGOPTS = [
SHORTOPTS = "O:C:i:e:f:a:p:d:c:lLhuv?s"
GRAMPS_UUID = uuid.UUID('516cd010-5a41-470f-99f8-eb22f1098ad6')
+
+def need_to_update_const():
+ """ Check to see if this file is older than
+ setup.py or const.py.in """
+ this_file = os.path.join(ROOT_DIR, "gen", "const.py")
+ in_file = os.path.join(ROOT_DIR, "gen", "const.py.in")
+ setup_file = os.path.join(ROOT_DIR, "..", "setup.py")
+
+ if (os.path.exists(this_file) and
+ os.path.exists(in_file) and
+ os.path.exists(setup_file)):
+
+ this_file_time = os.path.getmtime(this_file)
+ in_file_time = os.path.getmtime(in_file)
+ setup_file_time = os.path.getmtime(setup_file)
+
+ # Is this file older than others? If so,
+ # need to run setup
+ return (this_file_time < in_file_time or
+ this_file_time < setup_file_time)
+ else:
+ # Can't tell because can't find the files
+ return False
+
+if need_to_update_const():
+ print("Outdated gramps.gen.const; please run 'python setup.py build'")
diff --git a/gramps/gen/constfunc.py b/gramps/gen/constfunc.py
index 7144ed264..f4425ba15 100644
--- a/gramps/gen/constfunc.py
+++ b/gramps/gen/constfunc.py
@@ -64,6 +64,13 @@ else:
STRTYPE = str
UNITYPE = str
cuni = conv_to_unicode_direct
+
+# handle in database is bytes, while internally Gramps wants unicode for py3
+if sys.version_info[0] < 3:
+ handle2internal = lambda x: x
+else:
+ handle2internal = lambda x: conv_to_unicode(x, 'utf-8')
+
#-------------------------------------------------------------------------
#
# Platform determination functions
diff --git a/gramps/gen/datehandler/_date_nb.py b/gramps/gen/datehandler/_date_nb.py
index eb7066af9..7f9a77416 100644
--- a/gramps/gen/datehandler/_date_nb.py
+++ b/gramps/gen/datehandler/_date_nb.py
@@ -176,4 +176,4 @@ class DateDisplayNb(DateDisplay):
# Register classes
#
#-------------------------------------------------------------------------
-register_datehandler(('nb_NO', 'nb', 'norsk', 'Norwegian'), DateParserNb, DateDisplayNb)
+register_datehandler(('nb_NO', 'nb', 'nn_NO', 'nn', 'norsk', 'Norwegian'), DateParserNb, DateDisplayNb)
diff --git a/gramps/gen/datehandler/_grampslocale.py b/gramps/gen/datehandler/_grampslocale.py
index 0fd81916f..211bb64e2 100644
--- a/gramps/gen/datehandler/_grampslocale.py
+++ b/gramps/gen/datehandler/_grampslocale.py
@@ -25,6 +25,8 @@ import locale
import sys
from ..constfunc import mac, win, conv_to_unicode
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+
"""
Some OS environments do not support the locale.nl_langinfo() method
of determing month names and other date related information.
@@ -41,7 +43,11 @@ else:
#locale returns unicode in python 3
to_uni = lambda x, y: x
try:
- codeset = locale.nl_langinfo(locale.CODESET)
+ codeset = glocale.get_translation().info()["charset"]
+except KeyError:
+ codeset = "UTF-8"
+
+try:
month_to_int = {
to_uni(locale.nl_langinfo(locale.MON_1), codeset).lower() : 1,
@@ -137,69 +143,64 @@ try:
except:
import time
- codeset = None
- if win() or mac():
- codeset = locale.getlocale()[1]
- if codeset is None:
- codeset = locale.getpreferredencoding()
month_to_int = {
- to_uni(time.strftime('%B',(0,1,1,1,1,1,1,1,1)), codeset).lower() : 1,
- to_uni(time.strftime('%b',(0,1,1,1,1,1,1,1,1)), codeset).lower() : 1,
- to_uni(time.strftime('%B',(0,2,1,1,1,1,1,1,1)), codeset).lower() : 2,
- to_uni(time.strftime('%b',(0,2,1,1,1,1,1,1,1)), codeset).lower() : 2,
- to_uni(time.strftime('%B',(0,3,1,1,1,1,1,1,1)), codeset).lower() : 3,
- to_uni(time.strftime('%b',(0,3,1,1,1,1,1,1,1)), codeset).lower() : 3,
- to_uni(time.strftime('%B',(0,4,1,1,1,1,1,1,1)), codeset).lower() : 4,
- to_uni(time.strftime('%b',(0,4,1,1,1,1,1,1,1)), codeset).lower() : 4,
- to_uni(time.strftime('%B',(0,5,1,1,1,1,1,1,1)), codeset).lower() : 5,
- to_uni(time.strftime('%b',(0,5,1,1,1,1,1,1,1)), codeset).lower() : 5,
- to_uni(time.strftime('%B',(0,6,1,1,1,1,1,1,1)), codeset).lower() : 6,
- to_uni(time.strftime('%b',(0,6,1,1,1,1,1,1,1)), codeset).lower() : 6,
- to_uni(time.strftime('%B',(0,7,1,1,1,1,1,1,1)), codeset).lower() : 7,
- to_uni(time.strftime('%b',(0,7,1,1,1,1,1,1,1)), codeset).lower() : 7,
- to_uni(time.strftime('%B',(0,8,1,1,1,1,1,1,1)), codeset).lower() : 8,
- to_uni(time.strftime('%b',(0,8,1,1,1,1,1,1,1)), codeset).lower() : 8,
- to_uni(time.strftime('%B',(0,9,1,1,1,1,1,1,1)), codeset).lower() : 9,
- to_uni(time.strftime('%b',(0,9,1,1,1,1,1,1,1)), codeset).lower() : 9,
- to_uni(time.strftime('%B',(0,10,1,1,1,1,1,1,1)), codeset).lower() : 10,
- to_uni(time.strftime('%b',(0,10,1,1,1,1,1,1,1)), codeset).lower() : 10,
- to_uni(time.strftime('%B',(0,11,1,1,1,1,1,1,1)), codeset).lower() : 11,
- to_uni(time.strftime('%b',(0,11,1,1,1,1,1,1,1)), codeset).lower() : 11,
- to_uni(time.strftime('%B',(0,12,1,1,1,1,1,1,1)), codeset).lower() : 12,
- to_uni(time.strftime('%b',(0,12,1,1,1,1,1,1,1)), codeset).lower() : 12,
+ to_uni(time.strftime('%B',(1,1,1,1,1,1,1,1,1)), codeset).lower() : 1,
+ to_uni(time.strftime('%b',(1,1,1,1,1,1,1,1,1)), codeset).lower() : 1,
+ to_uni(time.strftime('%B',(1,2,1,1,1,1,1,1,1)), codeset).lower() : 2,
+ to_uni(time.strftime('%b',(1,2,1,1,1,1,1,1,1)), codeset).lower() : 2,
+ to_uni(time.strftime('%B',(1,3,1,1,1,1,1,1,1)), codeset).lower() : 3,
+ to_uni(time.strftime('%b',(1,3,1,1,1,1,1,1,1)), codeset).lower() : 3,
+ to_uni(time.strftime('%B',(1,4,1,1,1,1,1,1,1)), codeset).lower() : 4,
+ to_uni(time.strftime('%b',(1,4,1,1,1,1,1,1,1)), codeset).lower() : 4,
+ to_uni(time.strftime('%B',(1,5,1,1,1,1,1,1,1)), codeset).lower() : 5,
+ to_uni(time.strftime('%b',(1,5,1,1,1,1,1,1,1)), codeset).lower() : 5,
+ to_uni(time.strftime('%B',(1,6,1,1,1,1,1,1,1)), codeset).lower() : 6,
+ to_uni(time.strftime('%b',(1,6,1,1,1,1,1,1,1)), codeset).lower() : 6,
+ to_uni(time.strftime('%B',(1,7,1,1,1,1,1,1,1)), codeset).lower() : 7,
+ to_uni(time.strftime('%b',(1,7,1,1,1,1,1,1,1)), codeset).lower() : 7,
+ to_uni(time.strftime('%B',(1,8,1,1,1,1,1,1,1)), codeset).lower() : 8,
+ to_uni(time.strftime('%b',(1,8,1,1,1,1,1,1,1)), codeset).lower() : 8,
+ to_uni(time.strftime('%B',(1,9,1,1,1,1,1,1,1)), codeset).lower() : 9,
+ to_uni(time.strftime('%b',(1,9,1,1,1,1,1,1,1)), codeset).lower() : 9,
+ to_uni(time.strftime('%B',(1,10,1,1,1,1,1,1,1)), codeset).lower() : 10,
+ to_uni(time.strftime('%b',(1,10,1,1,1,1,1,1,1)), codeset).lower() : 10,
+ to_uni(time.strftime('%B',(1,11,1,1,1,1,1,1,1)), codeset).lower() : 11,
+ to_uni(time.strftime('%b',(1,11,1,1,1,1,1,1,1)), codeset).lower() : 11,
+ to_uni(time.strftime('%B',(1,12,1,1,1,1,1,1,1)), codeset).lower() : 12,
+ to_uni(time.strftime('%b',(1,12,1,1,1,1,1,1,1)), codeset).lower() : 12,
}
long_months = (
"",
- to_uni(time.strftime('%B',(0,1,1,1,1,1,1,1,1)), codeset),
- to_uni(time.strftime('%B',(0,2,1,1,1,1,1,1,1)), codeset),
- to_uni(time.strftime('%B',(0,3,1,1,1,1,1,1,1)), codeset),
- to_uni(time.strftime('%B',(0,4,1,1,1,1,1,1,1)), codeset),
- to_uni(time.strftime('%B',(0,5,1,1,1,1,1,1,1)), codeset),
- to_uni(time.strftime('%B',(0,6,1,1,1,1,1,1,1)), codeset),
- to_uni(time.strftime('%B',(0,7,1,1,1,1,1,1,1)), codeset),
- to_uni(time.strftime('%B',(0,8,1,1,1,1,1,1,1)), codeset),
- to_uni(time.strftime('%B',(0,9,1,1,1,1,1,1,1)), codeset),
- to_uni(time.strftime('%B',(0,10,1,1,1,1,1,1,1)), codeset),
- to_uni(time.strftime('%B',(0,11,1,1,1,1,1,1,1)), codeset),
- to_uni(time.strftime('%B',(0,12,1,1,1,1,1,1,1)), codeset),
+ to_uni(time.strftime('%B',(1,1,1,1,1,1,1,1,1)), codeset),
+ to_uni(time.strftime('%B',(1,2,1,1,1,1,1,1,1)), codeset),
+ to_uni(time.strftime('%B',(1,3,1,1,1,1,1,1,1)), codeset),
+ to_uni(time.strftime('%B',(1,4,1,1,1,1,1,1,1)), codeset),
+ to_uni(time.strftime('%B',(1,5,1,1,1,1,1,1,1)), codeset),
+ to_uni(time.strftime('%B',(1,6,1,1,1,1,1,1,1)), codeset),
+ to_uni(time.strftime('%B',(1,7,1,1,1,1,1,1,1)), codeset),
+ to_uni(time.strftime('%B',(1,8,1,1,1,1,1,1,1)), codeset),
+ to_uni(time.strftime('%B',(1,9,1,1,1,1,1,1,1)), codeset),
+ to_uni(time.strftime('%B',(1,10,1,1,1,1,1,1,1)), codeset),
+ to_uni(time.strftime('%B',(1,11,1,1,1,1,1,1,1)), codeset),
+ to_uni(time.strftime('%B',(1,12,1,1,1,1,1,1,1)), codeset),
)
short_months = (
"",
- to_uni(time.strftime('%b',(0,1,1,1,1,1,1,1,1)), codeset),
- to_uni(time.strftime('%b',(0,2,1,1,1,1,1,1,1)), codeset),
- to_uni(time.strftime('%b',(0,3,1,1,1,1,1,1,1)), codeset),
- to_uni(time.strftime('%b',(0,4,1,1,1,1,1,1,1)), codeset),
- to_uni(time.strftime('%b',(0,5,1,1,1,1,1,1,1)), codeset),
- to_uni(time.strftime('%b',(0,6,1,1,1,1,1,1,1)), codeset),
- to_uni(time.strftime('%b',(0,7,1,1,1,1,1,1,1)), codeset),
- to_uni(time.strftime('%b',(0,8,1,1,1,1,1,1,1)), codeset),
- to_uni(time.strftime('%b',(0,9,1,1,1,1,1,1,1)), codeset),
- to_uni(time.strftime('%b',(0,10,1,1,1,1,1,1,1)), codeset),
- to_uni(time.strftime('%b',(0,11,1,1,1,1,1,1,1)), codeset),
- to_uni(time.strftime('%b',(0,12,1,1,1,1,1,1,1)), codeset),
+ to_uni(time.strftime('%b',(1,1,1,1,1,1,1,1,1)), codeset),
+ to_uni(time.strftime('%b',(1,2,1,1,1,1,1,1,1)), codeset),
+ to_uni(time.strftime('%b',(1,3,1,1,1,1,1,1,1)), codeset),
+ to_uni(time.strftime('%b',(1,4,1,1,1,1,1,1,1)), codeset),
+ to_uni(time.strftime('%b',(1,5,1,1,1,1,1,1,1)), codeset),
+ to_uni(time.strftime('%b',(1,6,1,1,1,1,1,1,1)), codeset),
+ to_uni(time.strftime('%b',(1,7,1,1,1,1,1,1,1)), codeset),
+ to_uni(time.strftime('%b',(1,8,1,1,1,1,1,1,1)), codeset),
+ to_uni(time.strftime('%b',(1,9,1,1,1,1,1,1,1)), codeset),
+ to_uni(time.strftime('%b',(1,10,1,1,1,1,1,1,1)), codeset),
+ to_uni(time.strftime('%b',(1,11,1,1,1,1,1,1,1)), codeset),
+ to_uni(time.strftime('%b',(1,12,1,1,1,1,1,1,1)), codeset),
)
# Gramps day number: Sunday => 1, Monday => 2, etc
@@ -213,24 +214,24 @@ except:
# just a dummy.
long_days = (
"",
- to_uni(time.strftime('%A',(0,1,1,1,1,1,6,1,1)), codeset), # Sunday
- to_uni(time.strftime('%A',(0,1,1,1,1,1,0,1,1)), codeset), # Monday
- to_uni(time.strftime('%A',(0,1,1,1,1,1,1,1,1)), codeset), # Tuesday
- to_uni(time.strftime('%A',(0,1,1,1,1,1,2,1,1)), codeset), # Wednesday
- to_uni(time.strftime('%A',(0,1,1,1,1,1,3,1,1)), codeset), # Thursday
- to_uni(time.strftime('%A',(0,1,1,1,1,1,4,1,1)), codeset), # Friday
- to_uni(time.strftime('%A',(0,1,1,1,1,1,5,1,1)), codeset), # Saturday
+ to_uni(time.strftime('%A',(1,1,1,1,1,1,6,1,1)), codeset), # Sunday
+ to_uni(time.strftime('%A',(1,1,1,1,1,1,0,1,1)), codeset), # Monday
+ to_uni(time.strftime('%A',(1,1,1,1,1,1,1,1,1)), codeset), # Tuesday
+ to_uni(time.strftime('%A',(1,1,1,1,1,1,2,1,1)), codeset), # Wednesday
+ to_uni(time.strftime('%A',(1,1,1,1,1,1,3,1,1)), codeset), # Thursday
+ to_uni(time.strftime('%A',(1,1,1,1,1,1,4,1,1)), codeset), # Friday
+ to_uni(time.strftime('%A',(1,1,1,1,1,1,5,1,1)), codeset), # Saturday
)
short_days = (
"",
- to_uni(time.strftime('%a',(0,1,1,1,1,1,6,1,1)), codeset), # Sunday
- to_uni(time.strftime('%a',(0,1,1,1,1,1,0,1,1)), codeset), # Monday
- to_uni(time.strftime('%a',(0,1,1,1,1,1,1,1,1)), codeset), # Tuesday
- to_uni(time.strftime('%a',(0,1,1,1,1,1,2,1,1)), codeset), # Wednesday
- to_uni(time.strftime('%a',(0,1,1,1,1,1,3,1,1)), codeset), # Thursday
- to_uni(time.strftime('%a',(0,1,1,1,1,1,4,1,1)), codeset), # Friday
- to_uni(time.strftime('%a',(0,1,1,1,1,1,5,1,1)), codeset), # Saturday
+ to_uni(time.strftime('%a',(1,1,1,1,1,1,6,1,1)), codeset), # Sunday
+ to_uni(time.strftime('%a',(1,1,1,1,1,1,0,1,1)), codeset), # Monday
+ to_uni(time.strftime('%a',(1,1,1,1,1,1,1,1,1)), codeset), # Tuesday
+ to_uni(time.strftime('%a',(1,1,1,1,1,1,2,1,1)), codeset), # Wednesday
+ to_uni(time.strftime('%a',(1,1,1,1,1,1,3,1,1)), codeset), # Thursday
+ to_uni(time.strftime('%a',(1,1,1,1,1,1,4,1,1)), codeset), # Friday
+ to_uni(time.strftime('%a',(1,1,1,1,1,1,5,1,1)), codeset), # Saturday
)
# depending on the locale, the value returned for 20th Feb 2009 could be
diff --git a/gramps/gen/db/base.py b/gramps/gen/db/base.py
index 3821f8b54..b9bc836ff 100644
--- a/gramps/gen/db/base.py
+++ b/gramps/gen/db/base.py
@@ -32,7 +32,8 @@ from this class.
# Python libraries
#
#-------------------------------------------------------------------------
-from ..ggettext import gettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/db/dictionary.py b/gramps/gen/db/dictionary.py
index 8595e8b9f..c5623c2f9 100644
--- a/gramps/gen/db/dictionary.py
+++ b/gramps/gen/db/dictionary.py
@@ -195,6 +195,7 @@ class DictionaryDb(DbWriteBase, DbReadBase):
}
# skip GEDCOM cross-ref check for now:
self.set_feature("skip-check-xref", True)
+ self.set_feature("skip-import-additions", True)
self.readonly = False
self.db_is_open = True
self.name_formats = []
@@ -255,6 +256,20 @@ class DictionaryDb(DbWriteBase, DbReadBase):
self.txn = DictionaryTxn("DbDictionary Transaction", self)
self.transaction = None
+ def version_supported(self):
+ """Return True when the file has a supported version."""
+ return True
+
+ def get_table_names(self):
+ """Return a list of valid table names."""
+ return list(self._tables.keys())
+
+ def get_table_metadata(self, table_name):
+ """Return the metadata for a valid table name."""
+ if table_name in self._tables:
+ return self._tables[table_name]
+ return None
+
def transaction_commit(self, txn):
pass
diff --git a/gramps/gen/db/exceptions.py b/gramps/gen/db/exceptions.py
index 91ff64e48..ef4d0910f 100644
--- a/gramps/gen/db/exceptions.py
+++ b/gramps/gen/db/exceptions.py
@@ -27,7 +27,8 @@
# Standard python modules
#
#-------------------------------------------------------------------------
-from ..ggettext import gettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
class DbException(Exception):
diff --git a/gramps/gen/db/read.py b/gramps/gen/db/read.py
index 9770a11ea..1113e1a29 100644
--- a/gramps/gen/db/read.py
+++ b/gramps/gen/db/read.py
@@ -40,7 +40,6 @@ else:
import pickle
import time
import random
-import locale
import os
from sys import maxsize
@@ -49,7 +48,8 @@ if config.get('preferences.use-bsddb3') or sys.version_info[0] >= 3:
from bsddb3 import db
else:
from bsddb import db
-from ..ggettext import gettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import re
import logging
@@ -81,6 +81,7 @@ from . import (BsddbBaseCursor, DbReadBase)
from ..utils.id import create_id
from ..errors import DbError
from ..constfunc import UNITYPE, STRTYPE, cuni
+from ..const import GRAMPS_LOCALE as glocale
LOG = logging.getLogger(DBLOGNAME)
LOG = logging.getLogger(".citation")
@@ -103,6 +104,17 @@ DBERRS = (db.DBRunRecoveryError, db.DBAccessError,
# Helper functions
#
#-------------------------------------------------------------------------
+def find_byte_surname(key, data):
+ """
+ Creating a surname from raw data of a person, to use for sort and index
+ returns a byte string
+ """
+ surn = __index_surname(data[3][5])
+ # in python 3 we work with unicode internally, but need byte function sometimes
+ if isinstance(surn, UNITYPE):
+ return surn.encode('utf-8')
+ return surn
+
def find_surname(key, data):
"""
Creating a surname from raw data of a person, to use for sort and index
@@ -128,7 +140,10 @@ def __index_surname(surn_list):
NameOriginType.PATRONYMIC, NameOriginType.MATRONYMIC]) ])
else:
surn = ""
- return surn.encode('utf-8')
+ if sys.version_info[0] < 3:
+ return surn.encode('utf-8')
+ else:
+ return surn
#-------------------------------------------------------------------------
@@ -792,6 +807,8 @@ class DbBsddbRead(DbReadBase, Callback):
return self.get_from_handle(handle, Location, self.location_map)
def __get_obj_from_gramps_id(self, val, tbl, class_, prim_tbl):
+ if isinstance(tbl, dict):
+ return None ## trying to get object too early
if isinstance(val, UNITYPE):
val = val.encode('utf-8')
try:
@@ -1577,6 +1594,8 @@ class DbBsddbRead(DbReadBase, Callback):
"""
Helper method for get_raw__data methods
"""
+ if table is None:
+ return None ## trying to get object too early
if isinstance(handle, UNITYPE):
handle = handle.encode('utf-8')
try:
@@ -1699,7 +1718,7 @@ class DbBsddbRead(DbReadBase, Callback):
def __sortbyperson_key(self, handle):
if isinstance(handle, UNITYPE):
handle = handle.encode('utf-8')
- return locale.strxfrm(find_surname(handle,
+ return glocale.sort_key(find_surname(handle,
self.person_map.get(handle)))
def __sortbyplace(self, first, second):
@@ -1707,13 +1726,13 @@ class DbBsddbRead(DbReadBase, Callback):
first = first.encode('utf-8')
if isinstance(second, UNITYPE):
second = second.encode('utf-8')
- return locale.strcoll(self.place_map.get(first)[2],
+ return glocale.strcoll(self.place_map.get(first)[2],
self.place_map.get(second)[2])
def __sortbyplace_key(self, place):
if isinstance(place, UNITYPE):
place = place.encode('utf-8')
- return locale.strxfrm(self.place_map.get(place)[2])
+ return glocale.sort_key(self.place_map.get(place)[2])
def __sortbysource(self, first, second):
if isinstance(first, UNITYPE):
@@ -1722,13 +1741,13 @@ class DbBsddbRead(DbReadBase, Callback):
second = second.encode('utf-8')
source1 = cuni(self.source_map[first][2])
source2 = cuni(self.source_map[second][2])
- return locale.strcoll(source1, source2)
+ return glocale.strcoll(source1, source2)
def __sortbysource_key(self, key):
if isinstance(key, UNITYPE):
key = key.encode('utf-8')
source = cuni(self.source_map[key][2])
- return locale.strxfrm(source)
+ return glocale.sort_key(source)
def __sortbycitation(self, first, second):
if isinstance(first, UNITYPE):
@@ -1737,13 +1756,13 @@ class DbBsddbRead(DbReadBase, Callback):
second = second.encode('utf-8')
citation1 = cuni(self.citation_map[first][3])
citation2 = cuni(self.citation_map[second][3])
- return locale.strcoll(citation1, citation2)
+ return glocale.strcoll(citation1, citation2)
def __sortbycitation_key(self, key):
if isinstance(key, UNITYPE):
key = key.encode('utf-8')
citation = cuni(self.citation_map[key][3])
- return locale.strxfrm(citation)
+ return glocale.sort_key(citation)
def __sortbymedia(self, first, second):
if isinstance(first, UNITYPE):
@@ -1752,13 +1771,13 @@ class DbBsddbRead(DbReadBase, Callback):
second = second.encode('utf-8')
media1 = self.media_map[first][4]
media2 = self.media_map[second][4]
- return locale.strcoll(media1, media2)
+ return glocale.strcoll(media1, media2)
def __sortbymedia_key(self, key):
if isinstance(key, UNITYPE):
key = key.encode('utf-8')
media = self.media_map[key][4]
- return locale.strxfrm(media)
+ return glocale.sort_key(media)
def __sortbytag(self, first, second):
if isinstance(first, UNITYPE):
@@ -1767,13 +1786,13 @@ class DbBsddbRead(DbReadBase, Callback):
second = second.encode('utf-8')
tag1 = self.tag_map[first][1]
tag2 = self.tag_map[second][1]
- return locale.strcoll(tag1, tag2)
+ return glocale.strcoll(tag1, tag2)
def __sortbytag_key(self, key):
if isinstance(key, UNITYPE):
key = key.encode('utf-8')
tag = self.tag_map[key][1]
- return locale.strxfrm(tag)
+ return glocale.sort_key(tag)
def set_mediapath(self, path):
"""Set the default media path for database, path should be utf-8."""
diff --git a/gramps/gen/db/undoredo.py b/gramps/gen/db/undoredo.py
index 311a36346..0f9789bfa 100644
--- a/gramps/gen/db/undoredo.py
+++ b/gramps/gen/db/undoredo.py
@@ -46,13 +46,15 @@ if config.get('preferences.use-bsddb3') or sys.version_info[0] >= 3:
from bsddb3 import db
else:
from bsddb import db
-from ..ggettext import gettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
# Gramps modules
#
#-------------------------------------------------------------------------
+from ..constfunc import conv_to_unicode, handle2internal
from .dbconst import *
from . import BSDDBTxn
from ..errors import DbError
@@ -67,6 +69,7 @@ DBERRS = (db.DBRunRecoveryError, db.DBAccessError,
_SIGBASE = ('person', 'family', 'source', 'event', 'media', 'place',
'location', 'repository', 'reference', 'note', 'tag', 'citation')
+
#-------------------------------------------------------------------------
#
# DbUndo class
@@ -316,7 +319,7 @@ class DbUndo(object):
"""
try:
if data is None:
- emit(signal_root + '-delete', ([handle],))
+ emit(signal_root + '-delete', ([handle2internal(handle)],))
db_map.delete(handle, txn=self.txn)
else:
ex_data = db_map.get(handle, txn=self.txn)
@@ -325,7 +328,7 @@ class DbUndo(object):
else:
signal = signal_root + '-add'
db_map.put(handle, data, txn=self.txn)
- emit(signal, ([handle],))
+ emit(signal, ([handle2internal(handle)],))
except DBERRS as msg:
self.db._log_error()
diff --git a/gramps/gen/db/upgrade.py b/gramps/gen/db/upgrade.py
index 52e85a1b8..d498f83b2 100644
--- a/gramps/gen/db/upgrade.py
+++ b/gramps/gen/db/upgrade.py
@@ -30,7 +30,8 @@ import time
import logging
LOG = logging.getLogger(".citation")
-from ..ggettext import gettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from ..constfunc import cuni
"""
@@ -42,13 +43,14 @@ if config.get('preferences.use-bsddb3') or sys.version_info[0] >= 3:
else:
from bsddb import db
from . import BSDDBTxn
+from ..constfunc import UNITYPE
from ..lib.nameorigintype import NameOriginType
from .write import _mkname, SURNAMES
from .dbconst import (PERSON_KEY, FAMILY_KEY, EVENT_KEY, MEDIA_KEY, PLACE_KEY,
LOCATION_KEY, REPOSITORY_KEY)
from gramps.gui.dialog import (InfoDialog)
-def gramps_upgrade_17(self):
+def gramps_upgrade_18(self):
self.set_total(len(self.place_map))
self.children = {None: []}
for handle in self.place_map.keys():
@@ -72,7 +74,7 @@ def gramps_upgrade_17(self):
self.update()
with BSDDBTxn(self.env, self.metadata) as txn:
- txn.put(b'version', 17)
+ txn.put(b'version', 18)
def add_reference(self, pri_handle, ref_handle):
key = (PLACE_KEY, pri_handle)
@@ -113,6 +115,94 @@ def match_location(self, parent, item, lat_long):
txn.put(str(handle), new_location)
return handle
+def gramps_upgrade_17(self):
+ """Upgrade database from version 16 to 17. This upgrade adds tags to
+ event, place, repository, source and citation objects.
+ """
+ length = (len(self.event_map) + len(self.place_map) +
+ len(self.repository_map) + len(self.source_map) +
+ len(self.citation_map))
+ self.set_total(length)
+
+ # ---------------------------------
+ # Modify Event
+ # ---------------------------------
+ # Add new tag_list field.
+ for handle in self.event_map.keys():
+ event = self.event_map[handle]
+ new_event = list(event)
+ new_event = new_event[:11] + [[]] + new_event[11:]
+ new_event = tuple(new_event)
+ with BSDDBTxn(self.env, self.event_map) as txn:
+ if isinstance(handle, UNITYPE):
+ handle = handle.encode('utf-8')
+ txn.put(handle, new_event)
+ self.update()
+
+ # ---------------------------------
+ # Modify Place
+ # ---------------------------------
+ # Add new tag_list field.
+ for handle in self.place_map.keys():
+ place = self.place_map[handle]
+ new_place = list(place)
+ new_place = new_place[:12] + [[]] + new_place[12:]
+ new_place = tuple(new_place)
+ with BSDDBTxn(self.env, self.place_map) as txn:
+ if isinstance(handle, UNITYPE):
+ handle = handle.encode('utf-8')
+ txn.put(handle, new_place)
+ self.update()
+
+ # ---------------------------------
+ # Modify Repository
+ # ---------------------------------
+ # Add new tag_list field.
+ for handle in self.repository_map.keys():
+ repository = self.repository_map[handle]
+ new_repository = list(repository)
+ new_repository = new_repository[:8] + [[]] + new_repository[8:]
+ new_repository = tuple(new_repository)
+ with BSDDBTxn(self.env, self.repository_map) as txn:
+ if isinstance(handle, UNITYPE):
+ handle = handle.encode('utf-8')
+ txn.put(handle, new_repository)
+ self.update()
+
+ # ---------------------------------
+ # Modify Source
+ # ---------------------------------
+ # Add new tag_list field.
+ for handle in self.source_map.keys():
+ source = self.source_map[handle]
+ new_source = list(source)
+ new_source = new_source[:11] + [[]] + new_source[11:]
+ new_source = tuple(new_source)
+ with BSDDBTxn(self.env, self.source_map) as txn:
+ if isinstance(handle, UNITYPE):
+ handle = handle.encode('utf-8')
+ txn.put(handle, new_source)
+ self.update()
+
+ # ---------------------------------
+ # Modify Citation
+ # ---------------------------------
+ # Add new tag_list field.
+ for handle in self.citation_map.keys():
+ citation = self.citation_map[handle]
+ new_citation = list(citation)
+ new_citation = new_citation[:10] + [[]] + new_citation[10:]
+ new_citation = tuple(new_citation)
+ with BSDDBTxn(self.env, self.citation_map) as txn:
+ if isinstance(handle, UNITYPE):
+ handle = handle.encode('utf-8')
+ txn.put(handle, new_citation)
+ self.update()
+
+ # Bump up database version. Separate transaction to save metadata.
+ with BSDDBTxn(self.env, self.metadata) as txn:
+ txn.put(b'version', 17)
+
def gramps_upgrade_16(self):
"""Upgrade database from version 15 to 16. This upgrade converts all
SourceRef child objects to Citation Primary objects.
@@ -209,7 +299,9 @@ def gramps_upgrade_16(self):
new_citation_list, note_list, change, tag_list,
private, person_ref_list)
with BSDDBTxn(self.env, self.person_map) as txn:
- txn.put(str(handle), new_person)
+ if isinstance(handle, UNITYPE):
+ handle = handle.encode('utf-8')
+ txn.put(handle, new_person)
self.update()
LOG.debug("%d persons upgraded with %d citations in %d seconds. " %
@@ -241,7 +333,9 @@ def gramps_upgrade_16(self):
change, date, tag_list, private)
LOG.debug(" upgrade new_media %s" % [new_media])
with BSDDBTxn(self.env, self.media_map) as txn:
- txn.put(str(handle), new_media)
+ if isinstance(handle, UNITYPE):
+ handle = handle.encode('utf-8')
+ txn.put(handle, new_media)
LOG.debug(" update ref map media %s" % [handle,
self.get_object_from_handle(handle) ])
self.update()
@@ -260,7 +354,7 @@ def gramps_upgrade_16(self):
start_time = time.time()
for place_handle in self.place_map.keys():
place = self.place_map[place_handle]
- (handle, gramps_id, title, int, lat,
+ (handle, gramps_id, title, longi, lat,
main_loc, alt_loc, urls, media_list, source_list, note_list,
change, private) = place
if source_list:
@@ -273,11 +367,13 @@ def gramps_upgrade_16(self):
self, media_list)
if source_list or media_list:
new_place = (handle, gramps_id, title,
- int, lat, main_loc, alt_loc, urls,
+ longi, lat, main_loc, alt_loc, urls,
media_list, new_citation_list, note_list,
change, private)
with BSDDBTxn(self.env, self.place_map) as txn:
- txn.put(str(handle), new_place)
+ if isinstance(handle, UNITYPE):
+ handle = handle.encode('utf-8')
+ txn.put(handle, new_place)
self.update()
LOG.debug("%d places upgraded with %d citations in %d seconds. " %
@@ -325,7 +421,9 @@ def gramps_upgrade_16(self):
attribute_list, lds_seal_list, new_citation_list,
note_list, change, tag_list, private)
with BSDDBTxn(self.env, self.family_map) as txn:
- txn.put(str(handle), new_family)
+ if isinstance(handle, UNITYPE):
+ handle = handle.encode('utf-8')
+ txn.put(handle, new_family)
self.update()
LOG.debug("%d familys upgraded with %d citations in %d seconds. " %
@@ -365,7 +463,9 @@ def gramps_upgrade_16(self):
attribute_list,
change, private)
with BSDDBTxn(self.env, self.event_map) as txn:
- txn.put(str(handle), new_event)
+ if isinstance(handle, UNITYPE):
+ handle = handle.encode('utf-8')
+ txn.put(handle, new_event)
t2 = time.time()
upgrade_time += t2 - t1
t3 = time.time()
@@ -397,7 +497,9 @@ def gramps_upgrade_16(self):
new_repository = (handle, gramps_id, the_type, name, note_list,
address_list, urls, change, private)
with BSDDBTxn(self.env, self.repository_map) as txn:
- txn.put(str(handle), new_repository)
+ if isinstance(handle, UNITYPE):
+ handle = handle.encode('utf-8')
+ txn.put(handle, new_repository)
self.update()
LOG.debug("%d repositorys upgraded with %d citations in %d seconds. " %
@@ -600,7 +702,9 @@ def convert_source_list_to_citation_list_16(self, source_list):
date, page, confidence, ref, note_list, new_media_list,
new_data_map, new_change, private)
with BSDDBTxn(self.env, self.citation_map) as txn:
- txn.put(str(new_handle), new_citation)
+ if isinstance(new_handle, UNITYPE):
+ new_handle = new_handle.encode('utf-8')
+ txn.put(new_handle, new_citation)
self.cmap_index += 1
# # add backlinks for references from Citation to Source
# with BSDDBTxn(self.env) as txn:
@@ -686,7 +790,9 @@ def gramps_upgrade_15(self):
)
with BSDDBTxn(self.env, self.person_map) as txn:
- txn.put(str(handle), new_person)
+ if isinstance(handle, UNITYPE):
+ handle = handle.encode('utf-8')
+ txn.put(handle, new_person)
self.update()
#surname is now different, remove secondary index with names
_db = db.DB(self.env)
@@ -709,7 +815,9 @@ def gramps_upgrade_15(self):
new_family[13] = []
new_family = tuple(new_family)
with BSDDBTxn(self.env, self.family_map) as txn:
- txn.put(str(handle), new_family)
+ if isinstance(handle, UNITYPE):
+ handle = handle.encode('utf-8')
+ txn.put(handle, new_family)
self.update()
# ---------------------------------
@@ -726,7 +834,9 @@ def gramps_upgrade_15(self):
new_note[6] = []
new_note = tuple(new_note)
with BSDDBTxn(self.env, self.note_map) as txn:
- txn.put(str(handle), new_note)
+ if isinstance(handle, UNITYPE):
+ handle = handle.encode('utf-8')
+ txn.put(handle, new_note)
self.update()
# ---------------------------------
@@ -739,7 +849,9 @@ def gramps_upgrade_15(self):
new_media[10] = []
new_media = tuple(new_media)
with BSDDBTxn(self.env, self.media_map) as txn:
- txn.put(str(handle), new_media)
+ if isinstance(handle, UNITYPE):
+ handle = handle.encode('utf-8')
+ txn.put(handle, new_media)
self.update()
# ---------------------------------
@@ -753,7 +865,9 @@ def gramps_upgrade_15(self):
#new_event[11] = []
new_event = tuple(new_event)
with BSDDBTxn(self.env, self.event_map) as txn:
- txn.put(str(handle), new_event)
+ if isinstance(handle, UNITYPE):
+ handle = handle.encode('utf-8')
+ txn.put(handle, new_event)
self.update()
# ---------------------------------
@@ -769,7 +883,9 @@ def gramps_upgrade_15(self):
new_place = new_place[:12] + new_place[13:]
new_place = tuple(new_place)
with BSDDBTxn(self.env, self.place_map) as txn:
- txn.put(str(handle), new_place)
+ if isinstance(handle, UNITYPE):
+ handle = handle.encode('utf-8')
+ txn.put(handle, new_place)
self.update()
# ---------------------------------
@@ -782,7 +898,9 @@ def gramps_upgrade_15(self):
new_source = new_source[:11] + new_source[12:]
new_source = tuple(new_source)
with BSDDBTxn(self.env, self.source_map) as txn:
- txn.put(str(handle), new_source)
+ if isinstance(handle, UNITYPE):
+ handle = handle.encode('utf-8')
+ txn.put(handle, new_source)
self.update()
# ---------------------------------
@@ -796,7 +914,9 @@ def gramps_upgrade_15(self):
new_repository[5] = list(map(convert_address, new_repository[5]))
new_repository = tuple(new_repository)
with BSDDBTxn(self.env, self.repository_map) as txn:
- txn.put(str(handle), new_repository)
+ if isinstance(handle, UNITYPE):
+ handle = handle.encode('utf-8')
+ txn.put(handle, new_repository)
self.update()
# Bump up database version. Separate transaction to save metadata.
@@ -818,6 +938,8 @@ def convert_marker(self, marker_field):
tag.set_name(tag_name)
tag.set_priority(len(self.tags))
with BSDDBTxn(self.env, self.tag_map) as txn:
+ if isinstance(handle, UNITYPE):
+ handle = handle.encode('utf-8')
txn.put(handle, tag.serialize())
self.tags[tag_name] = handle
return self.tags[tag_name]
@@ -884,7 +1006,9 @@ def gramps_upgrade_14(self):
new_note = (handle, gramps_id, styled_text, format, note_type,
change, marker, private)
with BSDDBTxn(self.env, self.note_map) as txn:
- txn.put(str(handle), new_note)
+ if isinstance(handle, UNITYPE):
+ handle = handle.encode('utf-8')
+ txn.put(handle, new_note)
self.update()
# ---------------------------------
@@ -904,7 +1028,9 @@ def gramps_upgrade_14(self):
description, place, new_source_list, note_list,
new_media_list, new_attribute_list, change,marker,private)
with BSDDBTxn(self.env, self.event_map) as txn:
- txn.put(str(handle), new_event)
+ if isinstance(handle, UNITYPE):
+ handle = handle.encode('utf-8')
+ txn.put(handle, new_event)
self.update()
# ---------------------------------
@@ -986,7 +1112,9 @@ def gramps_upgrade_14(self):
)
with BSDDBTxn(self.env, self.person_map) as txn:
- txn.put(str(handle), new_person)
+ if isinstance(handle, UNITYPE):
+ handle = handle.encode('utf-8')
+ txn.put(handle, new_person)
self.update()
# ---------------------------------
@@ -1018,7 +1146,9 @@ def gramps_upgrade_14(self):
change, marker, private)
with BSDDBTxn(self.env, self.family_map) as txn:
- txn.put(str(handle), new_family)
+ if isinstance(handle, UNITYPE):
+ handle = handle.encode('utf-8')
+ txn.put(handle, new_family)
self.update()
# ---------------------------------
@@ -1043,7 +1173,9 @@ def gramps_upgrade_14(self):
new_address_list, urls, change, marker, private)
with BSDDBTxn(self.env, self.repository_map) as txn:
- txn.put(str(handle), new_repository)
+ if isinstance(handle, UNITYPE):
+ handle = handle.encode('utf-8')
+ txn.put(handle, new_repository)
self.update()
# ---------------------------------
@@ -1061,7 +1193,9 @@ def gramps_upgrade_14(self):
new_date, marker, private)
with BSDDBTxn(self.env, self.media_map) as txn:
- txn.put(str(handle), new_media)
+ if isinstance(handle, UNITYPE):
+ handle = handle.encode('utf-8')
+ txn.put(handle, new_media)
self.update()
# ---------------------------------
@@ -1069,17 +1203,19 @@ def gramps_upgrade_14(self):
# ---------------------------------
for place_handle in self.place_map.keys():
place = self.place_map[place_handle]
- (handle, gramps_id, title, int, lat,
+ (handle, gramps_id, title, longi, lat,
main_loc, alt_loc, urls, media_list, source_list, note_list,
change, marker, private) = place
new_media_list = new_media_list_14(media_list)
new_source_list = new_source_list_14(source_list)
- new_place = (handle, gramps_id, title, int, lat,
+ new_place = (handle, gramps_id, title, longi, lat,
main_loc, alt_loc, urls, new_media_list,
new_source_list, note_list, change, marker, private)
with BSDDBTxn(self.env, self.place_map) as txn:
- txn.put(str(handle), new_place)
+ if isinstance(handle, UNITYPE):
+ handle = handle.encode('utf-8')
+ txn.put(handle, new_place)
self.update()
# ---------------------------------
@@ -1098,7 +1234,9 @@ def gramps_upgrade_14(self):
marker, private)
with BSDDBTxn(self.env, self.source_map) as txn:
- txn.put(str(handle), new_source)
+ if isinstance(handle, UNITYPE):
+ handle = handle.encode('utf-8')
+ txn.put(handle, new_source)
self.update()
# Bump up database version. Separate transaction to save metadata.
diff --git a/gramps/gen/db/write.py b/gramps/gen/db/write.py
index f5b21d2dc..f17f6d26b 100644
--- a/gramps/gen/db/write.py
+++ b/gramps/gen/db/write.py
@@ -40,13 +40,11 @@ else:
import pickle
import os
import time
-import locale
import bisect
from functools import wraps
import logging
from sys import maxsize
-from ..ggettext import gettext as _
from ..config import config
if config.get('preferences.use-bsddb3') or sys.version_info[0] >= 3:
from bsddb3 import dbshelve, db
@@ -75,18 +73,20 @@ from ..lib.researcher import Researcher
from . import (DbBsddbRead, DbWriteBase, BSDDBTxn,
DbTxn, BsddbBaseCursor, BsddbDowngradeError, DbVersionError,
DbEnvironmentError, DbUpgradeRequiredError, find_surname,
- find_surname_name, DbUndoBSDDB as DbUndo)
+ find_byte_surname, find_surname_name, DbUndoBSDDB as DbUndo)
from .dbconst import *
from ..utils.callback import Callback
-from ..utils.cast import (conv_unicode_tosrtkey, conv_dbstr_to_unicode)
+from ..utils.cast import conv_dbstr_to_unicode
from ..updatecallback import UpdateCallback
from ..errors import DbError
-from ..constfunc import win, conv_to_unicode, cuni, UNITYPE
+from ..constfunc import win, conv_to_unicode, cuni, UNITYPE, handle2internal
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
_LOG = logging.getLogger(DBLOGNAME)
LOG = logging.getLogger(".citation")
_MINVERSION = 9
-_DBVERSION = 17
+_DBVERSION = 18
IDTRANS = "person_id"
FIDTRANS = "family_id"
@@ -170,7 +170,7 @@ KEY_TO_NAME_MAP = {PERSON_KEY: 'person',
# Helper functions
#
#-------------------------------------------------------------------------
-
+
def find_idmap(key, data):
""" return id for association of secondary index.
returns a byte string
@@ -756,7 +756,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
if not self.readonly:
assoc = [
- (self.person_map, self.surnames, find_surname),
+ (self.person_map, self.surnames, find_byte_surname),
(self.person_map, self.id_trans, find_idmap),
(self.family_map, self.fid_trans, find_idmap),
(self.event_map, self.eid_trans, find_idmap),
@@ -953,6 +953,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
def delete_primary_from_reference_map(self, handle, transaction, txn=None):
"""
Remove all references to the primary object from the reference_map.
+ handle should be utf-8
"""
primary_cur = self.get_reference_map_primary_cursor()
@@ -971,8 +972,12 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
# so we need the second tuple give us a reference that we can
# combine with the primary_handle to get the main key.
-
- main_key = (handle, pickle.loads(data)[1][1])
+ if sys.version_info[0] < 3:
+ #handle should be in python 2 str
+ main_key = (handle, pickle.loads(data)[1][1])
+ else:
+ #python 3 work internally with unicode
+ main_key = (handle.decode('utf-8'), pickle.loads(data)[1][1])
# The trick is not to remove while inside the cursor,
# but collect them all and remove after the cursor is closed
@@ -1046,7 +1051,12 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
the passed transaction.
"""
if isinstance(key, tuple):
- #create a string key
+ #create a byte string key, first validity check in python 3!
+ for val in key:
+ if sys.version_info[0] >= 3 and isinstance(val, bytes):
+ raise DbError(_('An attempt is made to safe a reference key '
+ 'which is partly bytecode, this is not allowed.\n'
+ 'Key is %s') % str(key))
key = str(key)
if isinstance(key, UNITYPE):
key = key.encode('utf-8')
@@ -1604,7 +1614,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
self.emit('person-groupname-rebuild', (name, grouppar))
def sort_surname_list(self):
- self.surname_list.sort(key=conv_unicode_tosrtkey)
+ self.surname_list.sort(key=glocale.sort_key)
@catch_db_error
def build_surname_list(self):
@@ -1616,7 +1626,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
#TODO GTK3: Why double conversion? Convert to a list of str objects!
self.surname_list = sorted(
map(conv_dbstr_to_unicode, set(self.surnames.keys())),
- key=conv_unicode_tosrtkey)
+ key=glocale.sort_key)
def add_to_surname_list(self, person, batch_transaction):
"""
@@ -2019,10 +2029,10 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
"""
if (obj_type, trans_type) in transaction:
if trans_type == TXNDEL:
- handles = [handle for handle, data in
+ handles = [handle2internal(handle) for handle, data in
transaction[(obj_type, trans_type)]]
else:
- handles = [handle for handle, data in
+ handles = [handle2internal(handle) for handle, data in
transaction[(obj_type, trans_type)]
if (handle, None) not in transaction[(obj_type,
TXNDEL)]]
@@ -2120,6 +2130,8 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
upgrade.gramps_upgrade_16(self)
if version < 17:
upgrade.gramps_upgrade_17(self)
+ if version < 18:
+ upgrade.gramps_upgrade_18(self)
self.reset()
self.set_total(6)
diff --git a/gramps/gen/display/name.py b/gramps/gen/display/name.py
index 13ffa0de7..578bff562 100644
--- a/gramps/gen/display/name.py
+++ b/gramps/gen/display/name.py
@@ -53,8 +53,11 @@ Specific symbols for parts of a name are defined:
# Python modules
#
#-------------------------------------------------------------------------
-from ..ggettext import sgettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
import re
+import logging
+LOG = logging.getLogger(".gramps.gen")
#-------------------------------------------------------------------------
#
@@ -1047,8 +1050,17 @@ def fn(%s):
else:
return p + str + s
return cleanup_name("%s" %% (%s))""" % (args, new_fmt, ",".join(param))
- exec(s)
-
- return locals()['fn']
+ try:
+ exec(s) in globals(), locals()
+ return locals()['fn']
+ except:
+ LOG.error("\n" + 'Wrong name format string %s' % new_fmt
+ +"\n" + ("ERROR, Edit Name format in Preferences->Display to correct")
+ +"\n" + _('Wrong name format string %s') % new_fmt
+ +"\n" + ("ERROR, Edit Name format in Preferences->Display to correct")
+ )
+ def errfn(*arg):
+ return _("ERROR, Edit Name format in Preferences")
+ return errfn
displayer = NameDisplay()
diff --git a/gramps/gen/filters/_filterlist.py b/gramps/gen/filters/_filterlist.py
index 0f86c341a..56ce5bb8d 100644
--- a/gramps/gen/filters/_filterlist.py
+++ b/gramps/gen/filters/_filterlist.py
@@ -40,6 +40,7 @@ import collections
from ._filterparser import FilterParser
from ..plug import BasePluginManager
from ..constfunc import STRTYPE
+from ..const import GRAMPS_LOCALE as glocale
PLUGMAN = BasePluginManager.get_instance()
#-------------------------------------------------------------------------
@@ -111,6 +112,7 @@ class FilterList(object):
parser.parse(the_file)
the_file.close()
except (IOError, OSError):
+ print("IO/OSError in _filterlist.py")
pass
except SAXParseException:
print("Parser error")
@@ -123,7 +125,7 @@ class FilterList(object):
return l.replace('"', '"')
def save(self):
- f = open(self.file.encode(sys.getfilesystemencoding()), 'w')
+ f = open(self.file.encode(glocale.getfilesystemencoding()), 'w')
f.write("\n")
f.write('\n')
for namespace in self.filter_namespaces:
diff --git a/gramps/gen/filters/_filterparser.py b/gramps/gen/filters/_filterparser.py
index f9ec36905..5291d8611 100644
--- a/gramps/gen/filters/_filterparser.py
+++ b/gramps/gen/filters/_filterparser.py
@@ -28,7 +28,8 @@
from __future__ import print_function, unicode_literals
from xml.sax import handler
-from ..ggettext import gettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/_changedsincebase.py b/gramps/gen/filters/rules/_changedsincebase.py
index 031d99a00..f052f584b 100644
--- a/gramps/gen/filters/rules/_changedsincebase.py
+++ b/gramps/gen/filters/rules/_changedsincebase.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ...ggettext import gettext as _
+from ...const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import re
import time
diff --git a/gramps/gen/filters/rules/_everything.py b/gramps/gen/filters/rules/_everything.py
index 3dfb460c5..5b0ad50d2 100644
--- a/gramps/gen/filters/rules/_everything.py
+++ b/gramps/gen/filters/rules/_everything.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ...ggettext import gettext as _
+from ...const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/_hasattributebase.py b/gramps/gen/filters/rules/_hasattributebase.py
index 3cf93e168..0b189caf0 100644
--- a/gramps/gen/filters/rules/_hasattributebase.py
+++ b/gramps/gen/filters/rules/_hasattributebase.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ...ggettext import gettext as _
+from ...const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/_hascitationbase.py b/gramps/gen/filters/rules/_hascitationbase.py
index c03722761..6f69837be 100644
--- a/gramps/gen/filters/rules/_hascitationbase.py
+++ b/gramps/gen/filters/rules/_hascitationbase.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ...ggettext import gettext as _
+from ...const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/_haseventbase.py b/gramps/gen/filters/rules/_haseventbase.py
index 2161acbad..5628b1db7 100644
--- a/gramps/gen/filters/rules/_haseventbase.py
+++ b/gramps/gen/filters/rules/_haseventbase.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ...ggettext import gettext as _
+from ...const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/_hasgallerybase.py b/gramps/gen/filters/rules/_hasgallerybase.py
index 16ae2e9cc..19fe804db 100755
--- a/gramps/gen/filters/rules/_hasgallerybase.py
+++ b/gramps/gen/filters/rules/_hasgallerybase.py
@@ -28,7 +28,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ...ggettext import gettext as _
+from ...const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/_hasgrampsid.py b/gramps/gen/filters/rules/_hasgrampsid.py
index 652ff2b47..115d62542 100644
--- a/gramps/gen/filters/rules/_hasgrampsid.py
+++ b/gramps/gen/filters/rules/_hasgrampsid.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ...ggettext import gettext as _
+from ...const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/_hasldsbase.py b/gramps/gen/filters/rules/_hasldsbase.py
index 790d6d6f7..9def6f1b8 100755
--- a/gramps/gen/filters/rules/_hasldsbase.py
+++ b/gramps/gen/filters/rules/_hasldsbase.py
@@ -28,7 +28,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ...ggettext import gettext as _
+from ...const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/_hasnotebase.py b/gramps/gen/filters/rules/_hasnotebase.py
index e73842518..ea688715a 100755
--- a/gramps/gen/filters/rules/_hasnotebase.py
+++ b/gramps/gen/filters/rules/_hasnotebase.py
@@ -29,7 +29,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ...ggettext import gettext as _
+from ...const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/_hasnoteregexbase.py b/gramps/gen/filters/rules/_hasnoteregexbase.py
index 86e7ca4aa..a32b06cd8 100644
--- a/gramps/gen/filters/rules/_hasnoteregexbase.py
+++ b/gramps/gen/filters/rules/_hasnoteregexbase.py
@@ -26,7 +26,8 @@
#
#-------------------------------------------------------------------------
import re
-from ...ggettext import gettext as _
+from ...const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/_hasnotesubstrbase.py b/gramps/gen/filters/rules/_hasnotesubstrbase.py
index ca2a5cf10..1a7427445 100644
--- a/gramps/gen/filters/rules/_hasnotesubstrbase.py
+++ b/gramps/gen/filters/rules/_hasnotesubstrbase.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ...ggettext import gettext as _
+from ...const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/_hasreferencecountbase.py b/gramps/gen/filters/rules/_hasreferencecountbase.py
index 497dbf4f8..6cee7b745 100644
--- a/gramps/gen/filters/rules/_hasreferencecountbase.py
+++ b/gramps/gen/filters/rules/_hasreferencecountbase.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ...ggettext import gettext as _
+from ...const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/_hassourcebase.py b/gramps/gen/filters/rules/_hassourcebase.py
index 7da17576f..774b242d7 100644
--- a/gramps/gen/filters/rules/_hassourcebase.py
+++ b/gramps/gen/filters/rules/_hassourcebase.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ...ggettext import gettext as _
+from ...const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/_hassourcecountbase.py b/gramps/gen/filters/rules/_hassourcecountbase.py
index bd1228d49..61cbad48c 100755
--- a/gramps/gen/filters/rules/_hassourcecountbase.py
+++ b/gramps/gen/filters/rules/_hassourcecountbase.py
@@ -28,7 +28,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ...ggettext import gettext as _
+from ...const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/_hassourceofbase.py b/gramps/gen/filters/rules/_hassourceofbase.py
index d9011963b..728f2d1d4 100644
--- a/gramps/gen/filters/rules/_hassourceofbase.py
+++ b/gramps/gen/filters/rules/_hassourceofbase.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ...ggettext import gettext as _
+from ...const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/_hastagbase.py b/gramps/gen/filters/rules/_hastagbase.py
index 0b62e294e..6837d1e61 100644
--- a/gramps/gen/filters/rules/_hastagbase.py
+++ b/gramps/gen/filters/rules/_hastagbase.py
@@ -27,7 +27,8 @@ Rule that checks for an object with a particular tag.
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ...ggettext import gettext as _
+from ...const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/_hastextmatchingsubstringof.py b/gramps/gen/filters/rules/_hastextmatchingsubstringof.py
index d3656a688..50bae9cd3 100644
--- a/gramps/gen/filters/rules/_hastextmatchingsubstringof.py
+++ b/gramps/gen/filters/rules/_hastextmatchingsubstringof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ...ggettext import gettext as _
+from ...const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/_isprivate.py b/gramps/gen/filters/rules/_isprivate.py
index 9489990cb..85db6af6b 100644
--- a/gramps/gen/filters/rules/_isprivate.py
+++ b/gramps/gen/filters/rules/_isprivate.py
@@ -23,7 +23,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ...ggettext import gettext as _
+from ...const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/_ispublic.py b/gramps/gen/filters/rules/_ispublic.py
index 611462fc9..07cca589a 100644
--- a/gramps/gen/filters/rules/_ispublic.py
+++ b/gramps/gen/filters/rules/_ispublic.py
@@ -26,7 +26,8 @@
# GRAMPS modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from . import Rule
#-------------------------------------------------------------------------
diff --git a/gramps/gen/filters/rules/_matcheseventfilterbase.py b/gramps/gen/filters/rules/_matcheseventfilterbase.py
index d7fbc375e..a2addbab0 100644
--- a/gramps/gen/filters/rules/_matcheseventfilterbase.py
+++ b/gramps/gen/filters/rules/_matcheseventfilterbase.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ...ggettext import gettext as _
+from ...const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/_matchesfilterbase.py b/gramps/gen/filters/rules/_matchesfilterbase.py
index d8b874b2e..98c25ba77 100644
--- a/gramps/gen/filters/rules/_matchesfilterbase.py
+++ b/gramps/gen/filters/rules/_matchesfilterbase.py
@@ -25,14 +25,19 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ...ggettext import gettext as _
+import logging
+LOG = logging.getLogger(".filter")
#-------------------------------------------------------------------------
#
# GRAMPS modules
#
#-------------------------------------------------------------------------
-from .. import CustomFilters
+# we need global variableCustomFilters, so we need to query gramps.gen.filters
+# when we need this variable, not import it at the start!
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
+import gramps.gen.filters
from . import Rule
#-------------------------------------------------------------------------
@@ -48,31 +53,36 @@ class MatchesFilterBase(Rule):
Subclasses need to define the namespace class attribute.
"""
-
labels = [_('Filter name:')]
name = 'Objects matching the '
description = "Matches objects matched by the specified filter name"
category = _('General filters')
def prepare(self, db):
- if CustomFilters:
- filters = CustomFilters.get_filters_dict(self.namespace)
+ if gramps.gen.filters.CustomFilters:
+ filters = gramps.gen.filters.CustomFilters.get_filters_dict(self.namespace)
if self.list[0] in filters:
filt = filters[self.list[0]]
for rule in filt.flist:
rule.requestprepare(db)
+ else:
+ LOG.warning(_("Can't find filter %s in the defined custom filters")
+ % self.list[0])
+ else:
+ LOG.warning(_("Can't find filter %s in the defined custom filters")
+ % self.list[0])
def reset(self):
- if CustomFilters:
- filters = CustomFilters.get_filters_dict(self.namespace)
+ if gramps.gen.filters.CustomFilters:
+ filters = gramps.gen.filters.CustomFilters.get_filters_dict(self.namespace)
if self.list[0] in filters:
filt = filters[self.list[0]]
for rule in filt.flist:
rule.requestreset()
def apply(self, db, obj):
- if CustomFilters:
- filters = CustomFilters.get_filters_dict(self.namespace)
+ if gramps.gen.filters.CustomFilters:
+ filters = gramps.gen.filters.CustomFilters.get_filters_dict(self.namespace)
if self.list[0] in filters:
filt = filters[self.list[0]]
return filt.check(db, obj.handle)
@@ -82,8 +92,8 @@ class MatchesFilterBase(Rule):
"""
Return the selected filter or None.
"""
- if CustomFilters:
- filters = CustomFilters.get_filters_dict(self.namespace)
+ if gramps.gen.filters.CustomFilters:
+ filters = gramps.gen.filters.CustomFilters.get_filters_dict(self.namespace)
if self.list[0] in filters:
return filters[self.list[0]]
return None
diff --git a/gramps/gen/filters/rules/_matchessourceconfidencebase.py b/gramps/gen/filters/rules/_matchessourceconfidencebase.py
index f0281dc81..f346b02d8 100644
--- a/gramps/gen/filters/rules/_matchessourceconfidencebase.py
+++ b/gramps/gen/filters/rules/_matchessourceconfidencebase.py
@@ -29,7 +29,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ...ggettext import gettext as _
+from ...const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/_matchessourcefilterbase.py b/gramps/gen/filters/rules/_matchessourcefilterbase.py
index e803916fc..250bcc348 100644
--- a/gramps/gen/filters/rules/_matchessourcefilterbase.py
+++ b/gramps/gen/filters/rules/_matchessourcefilterbase.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ...ggettext import gettext as _
+from ...const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/_regexpidbase.py b/gramps/gen/filters/rules/_regexpidbase.py
index 99ed1a004..cb486e01a 100644
--- a/gramps/gen/filters/rules/_regexpidbase.py
+++ b/gramps/gen/filters/rules/_regexpidbase.py
@@ -26,7 +26,8 @@
#
#-------------------------------------------------------------------------
import re
-from ...ggettext import gettext as _
+from ...const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/_rule.py b/gramps/gen/filters/rules/_rule.py
index d4f7140a5..ee2bfcb6f 100644
--- a/gramps/gen/filters/rules/_rule.py
+++ b/gramps/gen/filters/rules/_rule.py
@@ -30,7 +30,8 @@ Base class for filter rules.
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ...ggettext import gettext as _
+from ...const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import re
#-------------------------------------------------------------------------
diff --git a/gramps/gen/filters/rules/citation/__init__.py b/gramps/gen/filters/rules/citation/__init__.py
index 717879e8e..d29446045 100644
--- a/gramps/gen/filters/rules/citation/__init__.py
+++ b/gramps/gen/filters/rules/citation/__init__.py
@@ -42,6 +42,7 @@ from ._matchespagesubstringof import MatchesPageSubstringOf
from ._matchesrepositoryfilter import MatchesRepositoryFilter
from ._matchessourcefilter import MatchesSourceFilter
from ._regexpidof import RegExpIdOf
+from ._hastag import HasTag
editor_rule_list = [
HasCitation,
@@ -59,5 +60,6 @@ editor_rule_list = [
MatchesPageSubstringOf,
MatchesRepositoryFilter,
MatchesSourceFilter,
- RegExpIdOf
+ RegExpIdOf,
+ HasTag
]
diff --git a/gramps/gen/filters/rules/citation/_allcitations.py b/gramps/gen/filters/rules/citation/_allcitations.py
index 71bc3b32e..1f7de3bf0 100644
--- a/gramps/gen/filters/rules/citation/_allcitations.py
+++ b/gramps/gen/filters/rules/citation/_allcitations.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/citation/_changedsince.py b/gramps/gen/filters/rules/citation/_changedsince.py
index 9d78b9fb4..ee43f6cea 100644
--- a/gramps/gen/filters/rules/citation/_changedsince.py
+++ b/gramps/gen/filters/rules/citation/_changedsince.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/citation/_citationprivate.py b/gramps/gen/filters/rules/citation/_citationprivate.py
index 54c67407f..b92b9b22d 100644
--- a/gramps/gen/filters/rules/citation/_citationprivate.py
+++ b/gramps/gen/filters/rules/citation/_citationprivate.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/citation/_hascitation.py b/gramps/gen/filters/rules/citation/_hascitation.py
index 0c59473e7..66e1e9320 100644
--- a/gramps/gen/filters/rules/citation/_hascitation.py
+++ b/gramps/gen/filters/rules/citation/_hascitation.py
@@ -28,7 +28,8 @@ Filter rule to match citation data.
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/citation/_hasgallery.py b/gramps/gen/filters/rules/citation/_hasgallery.py
index 69c3b0519..82c99da84 100755
--- a/gramps/gen/filters/rules/citation/_hasgallery.py
+++ b/gramps/gen/filters/rules/citation/_hasgallery.py
@@ -28,7 +28,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/citation/_hasidof.py b/gramps/gen/filters/rules/citation/_hasidof.py
index 7dffeddf0..f773b9e78 100644
--- a/gramps/gen/filters/rules/citation/_hasidof.py
+++ b/gramps/gen/filters/rules/citation/_hasidof.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/citation/_hasnote.py b/gramps/gen/filters/rules/citation/_hasnote.py
index 46135b009..650c280f2 100755
--- a/gramps/gen/filters/rules/citation/_hasnote.py
+++ b/gramps/gen/filters/rules/citation/_hasnote.py
@@ -29,7 +29,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/citation/_hasnotematchingsubstringof.py b/gramps/gen/filters/rules/citation/_hasnotematchingsubstringof.py
index 45c27552f..a28b691cf 100644
--- a/gramps/gen/filters/rules/citation/_hasnotematchingsubstringof.py
+++ b/gramps/gen/filters/rules/citation/_hasnotematchingsubstringof.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/citation/_hasnoteregexp.py b/gramps/gen/filters/rules/citation/_hasnoteregexp.py
index cd32e9607..1d6217bbe 100644
--- a/gramps/gen/filters/rules/citation/_hasnoteregexp.py
+++ b/gramps/gen/filters/rules/citation/_hasnoteregexp.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/citation/_hasreferencecountof.py b/gramps/gen/filters/rules/citation/_hasreferencecountof.py
index 4f2c8a7c6..c6e5cc306 100644
--- a/gramps/gen/filters/rules/citation/_hasreferencecountof.py
+++ b/gramps/gen/filters/rules/citation/_hasreferencecountof.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/citation/_hassource.py b/gramps/gen/filters/rules/citation/_hassource.py
index 5bd2bf4b9..a8635e51a 100644
--- a/gramps/gen/filters/rules/citation/_hassource.py
+++ b/gramps/gen/filters/rules/citation/_hassource.py
@@ -29,7 +29,8 @@ Filter rule to match citation with a particular source.
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/citation/_hastag.py b/gramps/gen/filters/rules/citation/_hastag.py
new file mode 100644
index 000000000..a5c1ddf22
--- /dev/null
+++ b/gramps/gen/filters/rules/citation/_hastag.py
@@ -0,0 +1,51 @@
+#
+# Gramps - a GTK+/GNOME based genealogy program
+#
+# Copyright (C) 2010 Nick Hall
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# $Id$
+"""
+Rule that checks for a citation with a particular tag.
+"""
+
+#-------------------------------------------------------------------------
+#
+# Standard Python modules
+#
+#-------------------------------------------------------------------------
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
+
+#-------------------------------------------------------------------------
+#
+# GRAMPS modules
+#
+#-------------------------------------------------------------------------
+from .._hastagbase import HasTagBase
+
+#-------------------------------------------------------------------------
+#
+# HasTag
+#
+#-------------------------------------------------------------------------
+class HasTag(HasTagBase):
+ """
+ Rule that checks for a citation with a particular tag.
+ """
+ labels = [ _('Tag:') ]
+ name = _('Citations with the ')
+ description = _("Matches citations with the particular tag")
diff --git a/gramps/gen/filters/rules/citation/_matchesfilter.py b/gramps/gen/filters/rules/citation/_matchesfilter.py
index 23f66af21..ec15e9f85 100644
--- a/gramps/gen/filters/rules/citation/_matchesfilter.py
+++ b/gramps/gen/filters/rules/citation/_matchesfilter.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/citation/_matchespagesubstringof.py b/gramps/gen/filters/rules/citation/_matchespagesubstringof.py
index 60c555c24..09bd9ec4d 100644
--- a/gramps/gen/filters/rules/citation/_matchespagesubstringof.py
+++ b/gramps/gen/filters/rules/citation/_matchespagesubstringof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/citation/_matchesrepositoryfilter.py b/gramps/gen/filters/rules/citation/_matchesrepositoryfilter.py
index 602e570f3..be63a2924 100644
--- a/gramps/gen/filters/rules/citation/_matchesrepositoryfilter.py
+++ b/gramps/gen/filters/rules/citation/_matchesrepositoryfilter.py
@@ -28,7 +28,8 @@
#-------------------------------------------------------------------------
import logging
LOG = logging.getLogger(".citation")
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/citation/_matchessourcefilter.py b/gramps/gen/filters/rules/citation/_matchessourcefilter.py
index 3f018e850..f8bf6cfdd 100644
--- a/gramps/gen/filters/rules/citation/_matchessourcefilter.py
+++ b/gramps/gen/filters/rules/citation/_matchessourcefilter.py
@@ -27,7 +27,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/citation/_regexpidof.py b/gramps/gen/filters/rules/citation/_regexpidof.py
index 51ae317a4..ce3a3c2b9 100644
--- a/gramps/gen/filters/rules/citation/_regexpidof.py
+++ b/gramps/gen/filters/rules/citation/_regexpidof.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/event/__init__.py b/gramps/gen/filters/rules/event/__init__.py
index 41c3132d0..16100b4cc 100644
--- a/gramps/gen/filters/rules/event/__init__.py
+++ b/gramps/gen/filters/rules/event/__init__.py
@@ -47,6 +47,7 @@ from ._matchessourcefilter import MatchesSourceFilter
from ._hasattribute import HasAttribute
from ._hasdata import HasData
from ._changedsince import ChangedSince
+from ._hastag import HasTag
editor_rule_list = [
AllEvents,
@@ -67,5 +68,6 @@ editor_rule_list = [
MatchesSourceFilter,
HasAttribute,
HasData,
- ChangedSince
+ ChangedSince,
+ HasTag
]
diff --git a/gramps/gen/filters/rules/event/_allevents.py b/gramps/gen/filters/rules/event/_allevents.py
index 58a0e40e9..d1d4ae5ee 100644
--- a/gramps/gen/filters/rules/event/_allevents.py
+++ b/gramps/gen/filters/rules/event/_allevents.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/event/_changedsince.py b/gramps/gen/filters/rules/event/_changedsince.py
index bc4078a6c..a49179d9a 100644
--- a/gramps/gen/filters/rules/event/_changedsince.py
+++ b/gramps/gen/filters/rules/event/_changedsince.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/event/_eventprivate.py b/gramps/gen/filters/rules/event/_eventprivate.py
index 72ceb556c..05952357a 100644
--- a/gramps/gen/filters/rules/event/_eventprivate.py
+++ b/gramps/gen/filters/rules/event/_eventprivate.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/event/_hasattribute.py b/gramps/gen/filters/rules/event/_hasattribute.py
index 386b9cc3a..bf5bf0b61 100644
--- a/gramps/gen/filters/rules/event/_hasattribute.py
+++ b/gramps/gen/filters/rules/event/_hasattribute.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/event/_hascitation.py b/gramps/gen/filters/rules/event/_hascitation.py
index 1ba1ace9b..de69708bd 100644
--- a/gramps/gen/filters/rules/event/_hascitation.py
+++ b/gramps/gen/filters/rules/event/_hascitation.py
@@ -29,7 +29,8 @@ Filter rule to match event with a particular citation.
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/event/_hasdata.py b/gramps/gen/filters/rules/event/_hasdata.py
index cb5284de3..c74b2ba1e 100644
--- a/gramps/gen/filters/rules/event/_hasdata.py
+++ b/gramps/gen/filters/rules/event/_hasdata.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/event/_hasgallery.py b/gramps/gen/filters/rules/event/_hasgallery.py
index 3fe726cd7..a267e8bad 100755
--- a/gramps/gen/filters/rules/event/_hasgallery.py
+++ b/gramps/gen/filters/rules/event/_hasgallery.py
@@ -28,7 +28,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/event/_hasidof.py b/gramps/gen/filters/rules/event/_hasidof.py
index 47a6f5562..4c094a047 100644
--- a/gramps/gen/filters/rules/event/_hasidof.py
+++ b/gramps/gen/filters/rules/event/_hasidof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/event/_hasnote.py b/gramps/gen/filters/rules/event/_hasnote.py
index 2c5ebd5f2..1cc979ac4 100755
--- a/gramps/gen/filters/rules/event/_hasnote.py
+++ b/gramps/gen/filters/rules/event/_hasnote.py
@@ -28,7 +28,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/event/_hasnotematchingsubstringof.py b/gramps/gen/filters/rules/event/_hasnotematchingsubstringof.py
index ee41f4b33..f706aa9c8 100644
--- a/gramps/gen/filters/rules/event/_hasnotematchingsubstringof.py
+++ b/gramps/gen/filters/rules/event/_hasnotematchingsubstringof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/event/_hasnoteregexp.py b/gramps/gen/filters/rules/event/_hasnoteregexp.py
index 498b6e125..8f0500b81 100644
--- a/gramps/gen/filters/rules/event/_hasnoteregexp.py
+++ b/gramps/gen/filters/rules/event/_hasnoteregexp.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/event/_hasreferencecountof.py b/gramps/gen/filters/rules/event/_hasreferencecountof.py
index b4e006a5d..c361499c2 100644
--- a/gramps/gen/filters/rules/event/_hasreferencecountof.py
+++ b/gramps/gen/filters/rules/event/_hasreferencecountof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/event/_hassourcecount.py b/gramps/gen/filters/rules/event/_hassourcecount.py
index a318b5716..bec77fd27 100644
--- a/gramps/gen/filters/rules/event/_hassourcecount.py
+++ b/gramps/gen/filters/rules/event/_hassourcecount.py
@@ -27,7 +27,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/event/_hastag.py b/gramps/gen/filters/rules/event/_hastag.py
new file mode 100644
index 000000000..ebcf9fe8f
--- /dev/null
+++ b/gramps/gen/filters/rules/event/_hastag.py
@@ -0,0 +1,51 @@
+#
+# Gramps - a GTK+/GNOME based genealogy program
+#
+# Copyright (C) 2010 Nick Hall
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# $Id$
+"""
+Rule that checks for an event with a particular tag.
+"""
+
+#-------------------------------------------------------------------------
+#
+# Standard Python modules
+#
+#-------------------------------------------------------------------------
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
+
+#-------------------------------------------------------------------------
+#
+# GRAMPS modules
+#
+#-------------------------------------------------------------------------
+from .._hastagbase import HasTagBase
+
+#-------------------------------------------------------------------------
+#
+# HasTag
+#
+#-------------------------------------------------------------------------
+class HasTag(HasTagBase):
+ """
+ Rule that checks for an event with a particular tag.
+ """
+ labels = [ _('Tag:') ]
+ name = _('Events with the ')
+ description = _("Matches events with the particular tag")
diff --git a/gramps/gen/filters/rules/event/_hastype.py b/gramps/gen/filters/rules/event/_hastype.py
index 625f603e2..780548dff 100644
--- a/gramps/gen/filters/rules/event/_hastype.py
+++ b/gramps/gen/filters/rules/event/_hastype.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/event/_matchesfilter.py b/gramps/gen/filters/rules/event/_matchesfilter.py
index 0ad712a08..1c87b36f8 100644
--- a/gramps/gen/filters/rules/event/_matchesfilter.py
+++ b/gramps/gen/filters/rules/event/_matchesfilter.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/event/_matchespersonfilter.py b/gramps/gen/filters/rules/event/_matchespersonfilter.py
index 11ae8ae73..4ecbd73e2 100644
--- a/gramps/gen/filters/rules/event/_matchespersonfilter.py
+++ b/gramps/gen/filters/rules/event/_matchespersonfilter.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/event/_matchessourceconfidence.py b/gramps/gen/filters/rules/event/_matchessourceconfidence.py
index feae5830c..5d040d9ed 100644
--- a/gramps/gen/filters/rules/event/_matchessourceconfidence.py
+++ b/gramps/gen/filters/rules/event/_matchessourceconfidence.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import sgettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/event/_matchessourcefilter.py b/gramps/gen/filters/rules/event/_matchessourcefilter.py
index b802c4fa1..7cb61501d 100644
--- a/gramps/gen/filters/rules/event/_matchessourcefilter.py
+++ b/gramps/gen/filters/rules/event/_matchessourcefilter.py
@@ -27,7 +27,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/event/_regexpidof.py b/gramps/gen/filters/rules/event/_regexpidof.py
index 9cbb1b97d..a6adc0f1a 100644
--- a/gramps/gen/filters/rules/event/_regexpidof.py
+++ b/gramps/gen/filters/rules/event/_regexpidof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/family/__init__.py b/gramps/gen/filters/rules/family/__init__.py
index 7d2c5ff01..f61edbacf 100644
--- a/gramps/gen/filters/rules/family/__init__.py
+++ b/gramps/gen/filters/rules/family/__init__.py
@@ -60,6 +60,7 @@ from ._childhasnameof import ChildHasNameOf
from ._childhasidof import ChildHasIdOf
from ._changedsince import ChangedSince
from ._hastag import HasTag
+from ._hastwins import HasTwins
editor_rule_list = [
AllFamilies,
@@ -89,4 +90,5 @@ editor_rule_list = [
ChildHasIdOf,
ChangedSince,
HasTag,
+ HasTwins,
]
diff --git a/gramps/gen/filters/rules/family/_allfamilies.py b/gramps/gen/filters/rules/family/_allfamilies.py
index d3bb04c11..c11dd9625 100644
--- a/gramps/gen/filters/rules/family/_allfamilies.py
+++ b/gramps/gen/filters/rules/family/_allfamilies.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/family/_changedsince.py b/gramps/gen/filters/rules/family/_changedsince.py
index f142c7d03..172ed76cc 100644
--- a/gramps/gen/filters/rules/family/_changedsince.py
+++ b/gramps/gen/filters/rules/family/_changedsince.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/family/_childhasidof.py b/gramps/gen/filters/rules/family/_childhasidof.py
index aae58e238..b68198b89 100644
--- a/gramps/gen/filters/rules/family/_childhasidof.py
+++ b/gramps/gen/filters/rules/family/_childhasidof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/family/_childhasnameof.py b/gramps/gen/filters/rules/family/_childhasnameof.py
index 71ec16b6a..8a4c7efca 100644
--- a/gramps/gen/filters/rules/family/_childhasnameof.py
+++ b/gramps/gen/filters/rules/family/_childhasnameof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/family/_familyprivate.py b/gramps/gen/filters/rules/family/_familyprivate.py
index 7e77cb576..775bce695 100644
--- a/gramps/gen/filters/rules/family/_familyprivate.py
+++ b/gramps/gen/filters/rules/family/_familyprivate.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/family/_fatherhasidof.py b/gramps/gen/filters/rules/family/_fatherhasidof.py
index 57fa18378..3e73fc31d 100644
--- a/gramps/gen/filters/rules/family/_fatherhasidof.py
+++ b/gramps/gen/filters/rules/family/_fatherhasidof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/family/_fatherhasnameof.py b/gramps/gen/filters/rules/family/_fatherhasnameof.py
index 4277c4f7d..7f443917b 100644
--- a/gramps/gen/filters/rules/family/_fatherhasnameof.py
+++ b/gramps/gen/filters/rules/family/_fatherhasnameof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/family/_hasattribute.py b/gramps/gen/filters/rules/family/_hasattribute.py
index 91d672a24..6a1acda43 100644
--- a/gramps/gen/filters/rules/family/_hasattribute.py
+++ b/gramps/gen/filters/rules/family/_hasattribute.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/family/_hascitation.py b/gramps/gen/filters/rules/family/_hascitation.py
index 13af919b5..426989a8c 100644
--- a/gramps/gen/filters/rules/family/_hascitation.py
+++ b/gramps/gen/filters/rules/family/_hascitation.py
@@ -29,7 +29,8 @@ Filter rule to match family with a particular citation.
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/family/_hasevent.py b/gramps/gen/filters/rules/family/_hasevent.py
index 41cfb0ecb..90a9d2289 100644
--- a/gramps/gen/filters/rules/family/_hasevent.py
+++ b/gramps/gen/filters/rules/family/_hasevent.py
@@ -28,7 +28,8 @@ Filter rule to match families with a particular event.
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/family/_hasgallery.py b/gramps/gen/filters/rules/family/_hasgallery.py
index f03d24f76..e91b05284 100755
--- a/gramps/gen/filters/rules/family/_hasgallery.py
+++ b/gramps/gen/filters/rules/family/_hasgallery.py
@@ -28,7 +28,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/family/_hasidof.py b/gramps/gen/filters/rules/family/_hasidof.py
index 78aaa5da6..80d1e0a9e 100644
--- a/gramps/gen/filters/rules/family/_hasidof.py
+++ b/gramps/gen/filters/rules/family/_hasidof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/family/_haslds.py b/gramps/gen/filters/rules/family/_haslds.py
index 2be58a65a..ada984ccf 100755
--- a/gramps/gen/filters/rules/family/_haslds.py
+++ b/gramps/gen/filters/rules/family/_haslds.py
@@ -28,7 +28,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/family/_hasnote.py b/gramps/gen/filters/rules/family/_hasnote.py
index 26a47da5a..b129a1839 100755
--- a/gramps/gen/filters/rules/family/_hasnote.py
+++ b/gramps/gen/filters/rules/family/_hasnote.py
@@ -28,7 +28,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/family/_hasnotematchingsubstringof.py b/gramps/gen/filters/rules/family/_hasnotematchingsubstringof.py
index 0b230a9e4..055fd1ac7 100644
--- a/gramps/gen/filters/rules/family/_hasnotematchingsubstringof.py
+++ b/gramps/gen/filters/rules/family/_hasnotematchingsubstringof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/family/_hasnoteregexp.py b/gramps/gen/filters/rules/family/_hasnoteregexp.py
index 6bf8635cd..ec9ca1744 100644
--- a/gramps/gen/filters/rules/family/_hasnoteregexp.py
+++ b/gramps/gen/filters/rules/family/_hasnoteregexp.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/family/_hasreferencecountof.py b/gramps/gen/filters/rules/family/_hasreferencecountof.py
index c604ce8f4..ad612653e 100644
--- a/gramps/gen/filters/rules/family/_hasreferencecountof.py
+++ b/gramps/gen/filters/rules/family/_hasreferencecountof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/family/_hasreltype.py b/gramps/gen/filters/rules/family/_hasreltype.py
index 78f3557f9..5fc0e5490 100644
--- a/gramps/gen/filters/rules/family/_hasreltype.py
+++ b/gramps/gen/filters/rules/family/_hasreltype.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/family/_hassourcecount.py b/gramps/gen/filters/rules/family/_hassourcecount.py
index 0db41ee83..4ef925a9d 100755
--- a/gramps/gen/filters/rules/family/_hassourcecount.py
+++ b/gramps/gen/filters/rules/family/_hassourcecount.py
@@ -28,7 +28,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/family/_hassourceof.py b/gramps/gen/filters/rules/family/_hassourceof.py
index ef6785200..7e2161471 100644
--- a/gramps/gen/filters/rules/family/_hassourceof.py
+++ b/gramps/gen/filters/rules/family/_hassourceof.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/family/_hastag.py b/gramps/gen/filters/rules/family/_hastag.py
index 78f6fb735..423346ad8 100644
--- a/gramps/gen/filters/rules/family/_hastag.py
+++ b/gramps/gen/filters/rules/family/_hastag.py
@@ -27,7 +27,8 @@ Rule that checks for a family with a particular tag.
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/family/_hastwins.py b/gramps/gen/filters/rules/family/_hastwins.py
new file mode 100644
index 000000000..3aa384e60
--- /dev/null
+++ b/gramps/gen/filters/rules/family/_hastwins.py
@@ -0,0 +1,65 @@
+#
+# Gramps - a GTK+/GNOME based genealogy program
+#
+# Copyright (C) 2013 Nick Hall
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+# $Id$
+
+#-------------------------------------------------------------------------
+#
+# Standard Python modules
+#
+#-------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------
+#
+# GRAMPS modules
+#
+#-------------------------------------------------------------------------
+from .. import Rule
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
+from ....lib.childreftype import ChildRefType
+
+#-------------------------------------------------------------------------
+#
+# HasTwins
+#
+#-------------------------------------------------------------------------
+class HasTwins(Rule):
+ """Rule that checks for a family with twins"""
+
+ name = _('Families with twins')
+ description = _("Matches families with twins")
+ category = _('Child filters')
+
+ def apply(self, db, family):
+ date_list = []
+ for childref in family.get_child_ref_list():
+ if int(childref.get_mother_relation()) == ChildRefType.BIRTH:
+ child = db.get_person_from_handle(childref.ref)
+ birthref = child.get_birth_ref()
+ if birthref:
+ birth = db.get_event_from_handle(birthref.ref)
+ sortval = birth.get_date_object().get_sort_value()
+ if sortval != 0:
+ if sortval in date_list:
+ return True
+ else:
+ date_list.append(sortval)
+ return False
diff --git a/gramps/gen/filters/rules/family/_isbookmarked.py b/gramps/gen/filters/rules/family/_isbookmarked.py
index 37cf00ae4..9dd1a7b77 100644
--- a/gramps/gen/filters/rules/family/_isbookmarked.py
+++ b/gramps/gen/filters/rules/family/_isbookmarked.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/family/_matchesfilter.py b/gramps/gen/filters/rules/family/_matchesfilter.py
index 7b412cd38..bd2e635d0 100644
--- a/gramps/gen/filters/rules/family/_matchesfilter.py
+++ b/gramps/gen/filters/rules/family/_matchesfilter.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/family/_matchessourceconfidence.py b/gramps/gen/filters/rules/family/_matchessourceconfidence.py
index f2e7fc74b..5dd8ce413 100644
--- a/gramps/gen/filters/rules/family/_matchessourceconfidence.py
+++ b/gramps/gen/filters/rules/family/_matchessourceconfidence.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import sgettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/family/_motherhasidof.py b/gramps/gen/filters/rules/family/_motherhasidof.py
index ce6cb1191..841d76790 100644
--- a/gramps/gen/filters/rules/family/_motherhasidof.py
+++ b/gramps/gen/filters/rules/family/_motherhasidof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/family/_motherhasnameof.py b/gramps/gen/filters/rules/family/_motherhasnameof.py
index 5c9b73b4f..f42e30279 100644
--- a/gramps/gen/filters/rules/family/_motherhasnameof.py
+++ b/gramps/gen/filters/rules/family/_motherhasnameof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/family/_regexpchildname.py b/gramps/gen/filters/rules/family/_regexpchildname.py
index a3769eefb..a353421e7 100644
--- a/gramps/gen/filters/rules/family/_regexpchildname.py
+++ b/gramps/gen/filters/rules/family/_regexpchildname.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/family/_regexpfathername.py b/gramps/gen/filters/rules/family/_regexpfathername.py
index e11b1d642..18c92f773 100644
--- a/gramps/gen/filters/rules/family/_regexpfathername.py
+++ b/gramps/gen/filters/rules/family/_regexpfathername.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/family/_regexpidof.py b/gramps/gen/filters/rules/family/_regexpidof.py
index dfc7f6252..0c501d76c 100644
--- a/gramps/gen/filters/rules/family/_regexpidof.py
+++ b/gramps/gen/filters/rules/family/_regexpidof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/family/_regexpmothername.py b/gramps/gen/filters/rules/family/_regexpmothername.py
index 2ad18019a..ef6ea928f 100644
--- a/gramps/gen/filters/rules/family/_regexpmothername.py
+++ b/gramps/gen/filters/rules/family/_regexpmothername.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/family/_searchchildname.py b/gramps/gen/filters/rules/family/_searchchildname.py
index 0e50f0603..e653103a9 100644
--- a/gramps/gen/filters/rules/family/_searchchildname.py
+++ b/gramps/gen/filters/rules/family/_searchchildname.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/family/_searchfathername.py b/gramps/gen/filters/rules/family/_searchfathername.py
index acec58143..83f4c9000 100644
--- a/gramps/gen/filters/rules/family/_searchfathername.py
+++ b/gramps/gen/filters/rules/family/_searchfathername.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/family/_searchmothername.py b/gramps/gen/filters/rules/family/_searchmothername.py
index ef3acc4ca..ee0ebeb83 100644
--- a/gramps/gen/filters/rules/family/_searchmothername.py
+++ b/gramps/gen/filters/rules/family/_searchmothername.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/media/_allmedia.py b/gramps/gen/filters/rules/media/_allmedia.py
index 8a4db8157..4ef9eff29 100644
--- a/gramps/gen/filters/rules/media/_allmedia.py
+++ b/gramps/gen/filters/rules/media/_allmedia.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/media/_changedsince.py b/gramps/gen/filters/rules/media/_changedsince.py
index 20802c907..14110d7f8 100644
--- a/gramps/gen/filters/rules/media/_changedsince.py
+++ b/gramps/gen/filters/rules/media/_changedsince.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/media/_hasattribute.py b/gramps/gen/filters/rules/media/_hasattribute.py
index cc13ead0f..6e5d7eded 100644
--- a/gramps/gen/filters/rules/media/_hasattribute.py
+++ b/gramps/gen/filters/rules/media/_hasattribute.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/media/_hascitation.py b/gramps/gen/filters/rules/media/_hascitation.py
index 8a72ac8aa..07c8a44e7 100644
--- a/gramps/gen/filters/rules/media/_hascitation.py
+++ b/gramps/gen/filters/rules/media/_hascitation.py
@@ -28,7 +28,8 @@ Filter rule to match persons with a particular citation.
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/media/_hasidof.py b/gramps/gen/filters/rules/media/_hasidof.py
index 9315b59fc..eb9f64311 100644
--- a/gramps/gen/filters/rules/media/_hasidof.py
+++ b/gramps/gen/filters/rules/media/_hasidof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/media/_hasmedia.py b/gramps/gen/filters/rules/media/_hasmedia.py
index 4fad9a894..59450c91f 100644
--- a/gramps/gen/filters/rules/media/_hasmedia.py
+++ b/gramps/gen/filters/rules/media/_hasmedia.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/media/_hasnotematchingsubstringof.py b/gramps/gen/filters/rules/media/_hasnotematchingsubstringof.py
index c3ce4138e..5fd6c489a 100644
--- a/gramps/gen/filters/rules/media/_hasnotematchingsubstringof.py
+++ b/gramps/gen/filters/rules/media/_hasnotematchingsubstringof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/media/_hasnoteregexp.py b/gramps/gen/filters/rules/media/_hasnoteregexp.py
index f2ad8e1ad..ce262f154 100644
--- a/gramps/gen/filters/rules/media/_hasnoteregexp.py
+++ b/gramps/gen/filters/rules/media/_hasnoteregexp.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/media/_hasreferencecountof.py b/gramps/gen/filters/rules/media/_hasreferencecountof.py
index 931905f0f..eaba932a6 100644
--- a/gramps/gen/filters/rules/media/_hasreferencecountof.py
+++ b/gramps/gen/filters/rules/media/_hasreferencecountof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/media/_hassourcecount.py b/gramps/gen/filters/rules/media/_hassourcecount.py
index db33fa12c..5f79fa301 100644
--- a/gramps/gen/filters/rules/media/_hassourcecount.py
+++ b/gramps/gen/filters/rules/media/_hassourcecount.py
@@ -28,7 +28,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/media/_hassourceof.py b/gramps/gen/filters/rules/media/_hassourceof.py
index 9a88b2509..f59cac150 100644
--- a/gramps/gen/filters/rules/media/_hassourceof.py
+++ b/gramps/gen/filters/rules/media/_hassourceof.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/media/_hastag.py b/gramps/gen/filters/rules/media/_hastag.py
index 6782ce428..7a831eb49 100644
--- a/gramps/gen/filters/rules/media/_hastag.py
+++ b/gramps/gen/filters/rules/media/_hastag.py
@@ -27,7 +27,8 @@ Rule that checks for a media object with a particular tag.
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/media/_matchesfilter.py b/gramps/gen/filters/rules/media/_matchesfilter.py
index 943ef9400..d24c76534 100644
--- a/gramps/gen/filters/rules/media/_matchesfilter.py
+++ b/gramps/gen/filters/rules/media/_matchesfilter.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/media/_matchessourceconfidence.py b/gramps/gen/filters/rules/media/_matchessourceconfidence.py
index df87c4c33..d6aa8568b 100644
--- a/gramps/gen/filters/rules/media/_matchessourceconfidence.py
+++ b/gramps/gen/filters/rules/media/_matchessourceconfidence.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import sgettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/media/_mediaprivate.py b/gramps/gen/filters/rules/media/_mediaprivate.py
index 8e28537d7..8c91b01ea 100644
--- a/gramps/gen/filters/rules/media/_mediaprivate.py
+++ b/gramps/gen/filters/rules/media/_mediaprivate.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/media/_regexpidof.py b/gramps/gen/filters/rules/media/_regexpidof.py
index e857b046e..aff710a50 100644
--- a/gramps/gen/filters/rules/media/_regexpidof.py
+++ b/gramps/gen/filters/rules/media/_regexpidof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/note/__init__.py b/gramps/gen/filters/rules/note/__init__.py
index 7b41f3f1f..3f2e9a8e2 100644
--- a/gramps/gen/filters/rules/note/__init__.py
+++ b/gramps/gen/filters/rules/note/__init__.py
@@ -36,6 +36,7 @@ from ._matchesfilter import MatchesFilter
from ._hasnote import HasNote
from ._changedsince import ChangedSince
from ._hastag import HasTag
+from ._hastype import HasType
editor_rule_list = [
AllNotes,
@@ -49,4 +50,5 @@ editor_rule_list = [
MatchesFilter,
ChangedSince,
HasTag,
+ HasType,
]
diff --git a/gramps/gen/filters/rules/note/_allnotes.py b/gramps/gen/filters/rules/note/_allnotes.py
index 7c28fd1b6..129945e8a 100644
--- a/gramps/gen/filters/rules/note/_allnotes.py
+++ b/gramps/gen/filters/rules/note/_allnotes.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/note/_changedsince.py b/gramps/gen/filters/rules/note/_changedsince.py
index 7d4321e4b..075ebb3e2 100644
--- a/gramps/gen/filters/rules/note/_changedsince.py
+++ b/gramps/gen/filters/rules/note/_changedsince.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/note/_hasidof.py b/gramps/gen/filters/rules/note/_hasidof.py
index 3cc7ed815..8f0104ac7 100644
--- a/gramps/gen/filters/rules/note/_hasidof.py
+++ b/gramps/gen/filters/rules/note/_hasidof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/note/_hasnote.py b/gramps/gen/filters/rules/note/_hasnote.py
index 3a9011d8f..5a0809359 100644
--- a/gramps/gen/filters/rules/note/_hasnote.py
+++ b/gramps/gen/filters/rules/note/_hasnote.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/note/_hasreferencecountof.py b/gramps/gen/filters/rules/note/_hasreferencecountof.py
index 0bb82bca7..43a6d75e4 100644
--- a/gramps/gen/filters/rules/note/_hasreferencecountof.py
+++ b/gramps/gen/filters/rules/note/_hasreferencecountof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/note/_hastag.py b/gramps/gen/filters/rules/note/_hastag.py
index e0ec1f2a2..3bb325f51 100644
--- a/gramps/gen/filters/rules/note/_hastag.py
+++ b/gramps/gen/filters/rules/note/_hastag.py
@@ -27,7 +27,8 @@ Rule that checks for a note with a particular tag.
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/note/_hastype.py b/gramps/gen/filters/rules/note/_hastype.py
new file mode 100644
index 000000000..d8a5a21ad
--- /dev/null
+++ b/gramps/gen/filters/rules/note/_hastype.py
@@ -0,0 +1,58 @@
+#
+# Gramps - a GTK+/GNOME based genealogy program
+#
+# Copyright (C) 2002-2006 Donald N. Allingham
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+# $Id$
+
+#-------------------------------------------------------------------------
+#
+# Standard Python modules
+#
+#-------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------
+#
+# Gramps modules
+#
+#-------------------------------------------------------------------------
+from ....lib.notetype import NoteType
+from .. import Rule
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
+
+#-------------------------------------------------------------------------
+#
+# HasType
+#
+#-------------------------------------------------------------------------
+class HasType(Rule):
+ """Rule that checks for a note of a particular type."""
+
+ labels = [ _('Note type:') ]
+ name = _('Notes with the particular type')
+ description = _("Matches notes with the particular type ")
+ category = _('General filters')
+
+ def apply(self, db, note):
+ if not self.list[0]:
+ return False
+ else:
+ specified_type = NoteType()
+ specified_type.set_from_xml_str(self.list[0])
+ return note.get_type() == specified_type
diff --git a/gramps/gen/filters/rules/note/_matchesfilter.py b/gramps/gen/filters/rules/note/_matchesfilter.py
index b415b273a..f27afe02e 100644
--- a/gramps/gen/filters/rules/note/_matchesfilter.py
+++ b/gramps/gen/filters/rules/note/_matchesfilter.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/note/_matchesregexpof.py b/gramps/gen/filters/rules/note/_matchesregexpof.py
index af564ab16..340597143 100644
--- a/gramps/gen/filters/rules/note/_matchesregexpof.py
+++ b/gramps/gen/filters/rules/note/_matchesregexpof.py
@@ -27,7 +27,8 @@
#
#-------------------------------------------------------------------------
import re
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/note/_matchessubstringof.py b/gramps/gen/filters/rules/note/_matchessubstringof.py
index 0aef3d1e6..d824b89a1 100644
--- a/gramps/gen/filters/rules/note/_matchessubstringof.py
+++ b/gramps/gen/filters/rules/note/_matchessubstringof.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/note/_noteprivate.py b/gramps/gen/filters/rules/note/_noteprivate.py
index de77b35fa..5c77c9adc 100644
--- a/gramps/gen/filters/rules/note/_noteprivate.py
+++ b/gramps/gen/filters/rules/note/_noteprivate.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/note/_regexpidof.py b/gramps/gen/filters/rules/note/_regexpidof.py
index f8c2d5630..863a8923b 100644
--- a/gramps/gen/filters/rules/note/_regexpidof.py
+++ b/gramps/gen/filters/rules/note/_regexpidof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_changedsince.py b/gramps/gen/filters/rules/person/_changedsince.py
index b811e9c47..d33b83260 100644
--- a/gramps/gen/filters/rules/person/_changedsince.py
+++ b/gramps/gen/filters/rules/person/_changedsince.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_deeprelationshippathbetween.py b/gramps/gen/filters/rules/person/_deeprelationshippathbetween.py
index 8a5540495..e9a0486fb 100644
--- a/gramps/gen/filters/rules/person/_deeprelationshippathbetween.py
+++ b/gramps/gen/filters/rules/person/_deeprelationshippathbetween.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_disconnected.py b/gramps/gen/filters/rules/person/_disconnected.py
index 55363fc00..03816123f 100644
--- a/gramps/gen/filters/rules/person/_disconnected.py
+++ b/gramps/gen/filters/rules/person/_disconnected.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_everyone.py b/gramps/gen/filters/rules/person/_everyone.py
index d199c8e38..fc5b15900 100644
--- a/gramps/gen/filters/rules/person/_everyone.py
+++ b/gramps/gen/filters/rules/person/_everyone.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_familywithincompleteevent.py b/gramps/gen/filters/rules/person/_familywithincompleteevent.py
index d7da77b21..f81b5ea14 100644
--- a/gramps/gen/filters/rules/person/_familywithincompleteevent.py
+++ b/gramps/gen/filters/rules/person/_familywithincompleteevent.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_hasaddress.py b/gramps/gen/filters/rules/person/_hasaddress.py
index ba2719c9b..61e8765ca 100755
--- a/gramps/gen/filters/rules/person/_hasaddress.py
+++ b/gramps/gen/filters/rules/person/_hasaddress.py
@@ -28,7 +28,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_hasalternatename.py b/gramps/gen/filters/rules/person/_hasalternatename.py
index 8b528bc2c..1c19295e6 100644
--- a/gramps/gen/filters/rules/person/_hasalternatename.py
+++ b/gramps/gen/filters/rules/person/_hasalternatename.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_hasassociation.py b/gramps/gen/filters/rules/person/_hasassociation.py
index 3689353e2..84aba02b6 100755
--- a/gramps/gen/filters/rules/person/_hasassociation.py
+++ b/gramps/gen/filters/rules/person/_hasassociation.py
@@ -28,7 +28,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_hasattribute.py b/gramps/gen/filters/rules/person/_hasattribute.py
index 56fa0323b..99fcf9e62 100644
--- a/gramps/gen/filters/rules/person/_hasattribute.py
+++ b/gramps/gen/filters/rules/person/_hasattribute.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_hasbirth.py b/gramps/gen/filters/rules/person/_hasbirth.py
index a7626f7d5..86eb69483 100644
--- a/gramps/gen/filters/rules/person/_hasbirth.py
+++ b/gramps/gen/filters/rules/person/_hasbirth.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_hascitation.py b/gramps/gen/filters/rules/person/_hascitation.py
index 444bcce7b..7fe5c24ae 100644
--- a/gramps/gen/filters/rules/person/_hascitation.py
+++ b/gramps/gen/filters/rules/person/_hascitation.py
@@ -28,7 +28,8 @@ Filter rule to match persons with a particular citation.
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_hascommonancestorwith.py b/gramps/gen/filters/rules/person/_hascommonancestorwith.py
index 05a8a2026..bb21790af 100644
--- a/gramps/gen/filters/rules/person/_hascommonancestorwith.py
+++ b/gramps/gen/filters/rules/person/_hascommonancestorwith.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_hascommonancestorwithfiltermatch.py b/gramps/gen/filters/rules/person/_hascommonancestorwithfiltermatch.py
index 06e20216c..0b0b1ca89 100644
--- a/gramps/gen/filters/rules/person/_hascommonancestorwithfiltermatch.py
+++ b/gramps/gen/filters/rules/person/_hascommonancestorwithfiltermatch.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_hasdeath.py b/gramps/gen/filters/rules/person/_hasdeath.py
index 091f466dc..fcce0efdc 100644
--- a/gramps/gen/filters/rules/person/_hasdeath.py
+++ b/gramps/gen/filters/rules/person/_hasdeath.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_hasevent.py b/gramps/gen/filters/rules/person/_hasevent.py
index 6444bd233..7462968ab 100644
--- a/gramps/gen/filters/rules/person/_hasevent.py
+++ b/gramps/gen/filters/rules/person/_hasevent.py
@@ -28,7 +28,8 @@ Filter rule to match persons with a particular event.
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_hasfamilyattribute.py b/gramps/gen/filters/rules/person/_hasfamilyattribute.py
index c0d34b5eb..fc45da3d5 100644
--- a/gramps/gen/filters/rules/person/_hasfamilyattribute.py
+++ b/gramps/gen/filters/rules/person/_hasfamilyattribute.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_hasfamilyevent.py b/gramps/gen/filters/rules/person/_hasfamilyevent.py
index 0985993ad..aff4089f8 100644
--- a/gramps/gen/filters/rules/person/_hasfamilyevent.py
+++ b/gramps/gen/filters/rules/person/_hasfamilyevent.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_hasgallery.py b/gramps/gen/filters/rules/person/_hasgallery.py
index ba309903f..598229b08 100644
--- a/gramps/gen/filters/rules/person/_hasgallery.py
+++ b/gramps/gen/filters/rules/person/_hasgallery.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_hasidof.py b/gramps/gen/filters/rules/person/_hasidof.py
index 9350b354b..82661fca5 100644
--- a/gramps/gen/filters/rules/person/_hasidof.py
+++ b/gramps/gen/filters/rules/person/_hasidof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_haslds.py b/gramps/gen/filters/rules/person/_haslds.py
index 05575f150..5a9a73f06 100755
--- a/gramps/gen/filters/rules/person/_haslds.py
+++ b/gramps/gen/filters/rules/person/_haslds.py
@@ -28,7 +28,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_hasnameof.py b/gramps/gen/filters/rules/person/_hasnameof.py
index 681e3cf71..f42f0062d 100644
--- a/gramps/gen/filters/rules/person/_hasnameof.py
+++ b/gramps/gen/filters/rules/person/_hasnameof.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import sgettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
import re
#-------------------------------------------------------------------------
diff --git a/gramps/gen/filters/rules/person/_hasnameorigintype.py b/gramps/gen/filters/rules/person/_hasnameorigintype.py
index ff2760981..c8fb041f8 100644
--- a/gramps/gen/filters/rules/person/_hasnameorigintype.py
+++ b/gramps/gen/filters/rules/person/_hasnameorigintype.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_hasnametype.py b/gramps/gen/filters/rules/person/_hasnametype.py
index 8f863e40b..0d105d9c6 100644
--- a/gramps/gen/filters/rules/person/_hasnametype.py
+++ b/gramps/gen/filters/rules/person/_hasnametype.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_hasnickname.py b/gramps/gen/filters/rules/person/_hasnickname.py
index 33c69d945..3637f5bc0 100644
--- a/gramps/gen/filters/rules/person/_hasnickname.py
+++ b/gramps/gen/filters/rules/person/_hasnickname.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_hasnote.py b/gramps/gen/filters/rules/person/_hasnote.py
index cfac1b00a..13293bb60 100644
--- a/gramps/gen/filters/rules/person/_hasnote.py
+++ b/gramps/gen/filters/rules/person/_hasnote.py
@@ -28,7 +28,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_hasnotematchingsubstringof.py b/gramps/gen/filters/rules/person/_hasnotematchingsubstringof.py
index 94f5cf303..9c07adb07 100644
--- a/gramps/gen/filters/rules/person/_hasnotematchingsubstringof.py
+++ b/gramps/gen/filters/rules/person/_hasnotematchingsubstringof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_hasnoteregexp.py b/gramps/gen/filters/rules/person/_hasnoteregexp.py
index ae0296de9..ed03e4785 100644
--- a/gramps/gen/filters/rules/person/_hasnoteregexp.py
+++ b/gramps/gen/filters/rules/person/_hasnoteregexp.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_hasrelationship.py b/gramps/gen/filters/rules/person/_hasrelationship.py
index 6ecaf9797..24bf62570 100644
--- a/gramps/gen/filters/rules/person/_hasrelationship.py
+++ b/gramps/gen/filters/rules/person/_hasrelationship.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_hassourcecount.py b/gramps/gen/filters/rules/person/_hassourcecount.py
index 8cded5cde..2df5c0d3d 100755
--- a/gramps/gen/filters/rules/person/_hassourcecount.py
+++ b/gramps/gen/filters/rules/person/_hassourcecount.py
@@ -28,7 +28,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_hassourceof.py b/gramps/gen/filters/rules/person/_hassourceof.py
index a91f13115..079a392e4 100644
--- a/gramps/gen/filters/rules/person/_hassourceof.py
+++ b/gramps/gen/filters/rules/person/_hassourceof.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_hastag.py b/gramps/gen/filters/rules/person/_hastag.py
index 9bf56e888..fe3910823 100644
--- a/gramps/gen/filters/rules/person/_hastag.py
+++ b/gramps/gen/filters/rules/person/_hastag.py
@@ -27,7 +27,8 @@ Rule that checks for a person with a particular tag.
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_hastextmatchingsubstringof.py b/gramps/gen/filters/rules/person/_hastextmatchingsubstringof.py
index b4077cf93..79731cce4 100644
--- a/gramps/gen/filters/rules/person/_hastextmatchingsubstringof.py
+++ b/gramps/gen/filters/rules/person/_hastextmatchingsubstringof.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import logging
LOG = logging.getLogger(".citationfilter")
diff --git a/gramps/gen/filters/rules/person/_hasunknowngender.py b/gramps/gen/filters/rules/person/_hasunknowngender.py
index 818ad3df5..ab4c5380d 100644
--- a/gramps/gen/filters/rules/person/_hasunknowngender.py
+++ b/gramps/gen/filters/rules/person/_hasunknowngender.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_havealtfamilies.py b/gramps/gen/filters/rules/person/_havealtfamilies.py
index fcfdcbd93..5e86ad7bc 100644
--- a/gramps/gen/filters/rules/person/_havealtfamilies.py
+++ b/gramps/gen/filters/rules/person/_havealtfamilies.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_havechildren.py b/gramps/gen/filters/rules/person/_havechildren.py
index be012a140..9d8559338 100644
--- a/gramps/gen/filters/rules/person/_havechildren.py
+++ b/gramps/gen/filters/rules/person/_havechildren.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_incompletenames.py b/gramps/gen/filters/rules/person/_incompletenames.py
index 6590aad0b..992324e36 100644
--- a/gramps/gen/filters/rules/person/_incompletenames.py
+++ b/gramps/gen/filters/rules/person/_incompletenames.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_isancestorof.py b/gramps/gen/filters/rules/person/_isancestorof.py
index 331f4fa11..b605d7e31 100644
--- a/gramps/gen/filters/rules/person/_isancestorof.py
+++ b/gramps/gen/filters/rules/person/_isancestorof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_isancestoroffiltermatch.py b/gramps/gen/filters/rules/person/_isancestoroffiltermatch.py
index 5b771f9a1..d878128d7 100644
--- a/gramps/gen/filters/rules/person/_isancestoroffiltermatch.py
+++ b/gramps/gen/filters/rules/person/_isancestoroffiltermatch.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_isbookmarked.py b/gramps/gen/filters/rules/person/_isbookmarked.py
index 0836ba4f1..a54ed2bc1 100644
--- a/gramps/gen/filters/rules/person/_isbookmarked.py
+++ b/gramps/gen/filters/rules/person/_isbookmarked.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_ischildoffiltermatch.py b/gramps/gen/filters/rules/person/_ischildoffiltermatch.py
index 87776e5b0..76f69e467 100644
--- a/gramps/gen/filters/rules/person/_ischildoffiltermatch.py
+++ b/gramps/gen/filters/rules/person/_ischildoffiltermatch.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_isdefaultperson.py b/gramps/gen/filters/rules/person/_isdefaultperson.py
index e2e4d1d46..a5da52b72 100644
--- a/gramps/gen/filters/rules/person/_isdefaultperson.py
+++ b/gramps/gen/filters/rules/person/_isdefaultperson.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_isdescendantfamilyof.py b/gramps/gen/filters/rules/person/_isdescendantfamilyof.py
index ecff7deb9..23e369049 100644
--- a/gramps/gen/filters/rules/person/_isdescendantfamilyof.py
+++ b/gramps/gen/filters/rules/person/_isdescendantfamilyof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
try:
set()
except NameError:
diff --git a/gramps/gen/filters/rules/person/_isdescendantfamilyoffiltermatch.py b/gramps/gen/filters/rules/person/_isdescendantfamilyoffiltermatch.py
index d4d1ed477..05b48e90b 100644
--- a/gramps/gen/filters/rules/person/_isdescendantfamilyoffiltermatch.py
+++ b/gramps/gen/filters/rules/person/_isdescendantfamilyoffiltermatch.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_isdescendantof.py b/gramps/gen/filters/rules/person/_isdescendantof.py
index 116ca97e0..7bd4050c6 100644
--- a/gramps/gen/filters/rules/person/_isdescendantof.py
+++ b/gramps/gen/filters/rules/person/_isdescendantof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_isdescendantoffiltermatch.py b/gramps/gen/filters/rules/person/_isdescendantoffiltermatch.py
index f2461b52a..0ebae5862 100644
--- a/gramps/gen/filters/rules/person/_isdescendantoffiltermatch.py
+++ b/gramps/gen/filters/rules/person/_isdescendantoffiltermatch.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_isduplicatedancestorof.py b/gramps/gen/filters/rules/person/_isduplicatedancestorof.py
index 51944bf9b..226964f48 100644
--- a/gramps/gen/filters/rules/person/_isduplicatedancestorof.py
+++ b/gramps/gen/filters/rules/person/_isduplicatedancestorof.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_isfemale.py b/gramps/gen/filters/rules/person/_isfemale.py
index 55a43ce04..26598f327 100644
--- a/gramps/gen/filters/rules/person/_isfemale.py
+++ b/gramps/gen/filters/rules/person/_isfemale.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_islessthannthgenerationancestorof.py b/gramps/gen/filters/rules/person/_islessthannthgenerationancestorof.py
index 966d91aa6..082016e5d 100644
--- a/gramps/gen/filters/rules/person/_islessthannthgenerationancestorof.py
+++ b/gramps/gen/filters/rules/person/_islessthannthgenerationancestorof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_islessthannthgenerationancestorofbookmarked.py b/gramps/gen/filters/rules/person/_islessthannthgenerationancestorofbookmarked.py
index a52fc91ef..d710dea08 100644
--- a/gramps/gen/filters/rules/person/_islessthannthgenerationancestorofbookmarked.py
+++ b/gramps/gen/filters/rules/person/_islessthannthgenerationancestorofbookmarked.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
try:
set()
diff --git a/gramps/gen/filters/rules/person/_islessthannthgenerationancestorofdefaultperson.py b/gramps/gen/filters/rules/person/_islessthannthgenerationancestorofdefaultperson.py
index 2abcf55c8..3f42cb67b 100644
--- a/gramps/gen/filters/rules/person/_islessthannthgenerationancestorofdefaultperson.py
+++ b/gramps/gen/filters/rules/person/_islessthannthgenerationancestorofdefaultperson.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_islessthannthgenerationdescendantof.py b/gramps/gen/filters/rules/person/_islessthannthgenerationdescendantof.py
index dc434df57..fb7fa91e6 100644
--- a/gramps/gen/filters/rules/person/_islessthannthgenerationdescendantof.py
+++ b/gramps/gen/filters/rules/person/_islessthannthgenerationdescendantof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_ismale.py b/gramps/gen/filters/rules/person/_ismale.py
index a1b345282..509eb0b6d 100644
--- a/gramps/gen/filters/rules/person/_ismale.py
+++ b/gramps/gen/filters/rules/person/_ismale.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_ismorethannthgenerationancestorof.py b/gramps/gen/filters/rules/person/_ismorethannthgenerationancestorof.py
index 25ba42b44..5b8e7eb92 100644
--- a/gramps/gen/filters/rules/person/_ismorethannthgenerationancestorof.py
+++ b/gramps/gen/filters/rules/person/_ismorethannthgenerationancestorof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_ismorethannthgenerationdescendantof.py b/gramps/gen/filters/rules/person/_ismorethannthgenerationdescendantof.py
index 585cbef9b..ece20a1d0 100644
--- a/gramps/gen/filters/rules/person/_ismorethannthgenerationdescendantof.py
+++ b/gramps/gen/filters/rules/person/_ismorethannthgenerationdescendantof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_isparentoffiltermatch.py b/gramps/gen/filters/rules/person/_isparentoffiltermatch.py
index a6354eb48..8af459bd3 100644
--- a/gramps/gen/filters/rules/person/_isparentoffiltermatch.py
+++ b/gramps/gen/filters/rules/person/_isparentoffiltermatch.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_isrelatedwith.py b/gramps/gen/filters/rules/person/_isrelatedwith.py
index fec4ed206..f60b4ce3e 100644
--- a/gramps/gen/filters/rules/person/_isrelatedwith.py
+++ b/gramps/gen/filters/rules/person/_isrelatedwith.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_issiblingoffiltermatch.py b/gramps/gen/filters/rules/person/_issiblingoffiltermatch.py
index c03faaa9e..a8188eb23 100644
--- a/gramps/gen/filters/rules/person/_issiblingoffiltermatch.py
+++ b/gramps/gen/filters/rules/person/_issiblingoffiltermatch.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_isspouseoffiltermatch.py b/gramps/gen/filters/rules/person/_isspouseoffiltermatch.py
index 2aee0c31a..1a9b67903 100644
--- a/gramps/gen/filters/rules/person/_isspouseoffiltermatch.py
+++ b/gramps/gen/filters/rules/person/_isspouseoffiltermatch.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_iswitness.py b/gramps/gen/filters/rules/person/_iswitness.py
index 6fb18005a..92d052530 100644
--- a/gramps/gen/filters/rules/person/_iswitness.py
+++ b/gramps/gen/filters/rules/person/_iswitness.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_matcheseventfilter.py b/gramps/gen/filters/rules/person/_matcheseventfilter.py
index 7a7763a94..08ef6bf3f 100644
--- a/gramps/gen/filters/rules/person/_matcheseventfilter.py
+++ b/gramps/gen/filters/rules/person/_matcheseventfilter.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_matchesfilter.py b/gramps/gen/filters/rules/person/_matchesfilter.py
index e1aa81245..420b0577a 100644
--- a/gramps/gen/filters/rules/person/_matchesfilter.py
+++ b/gramps/gen/filters/rules/person/_matchesfilter.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_matchessourceconfidence.py b/gramps/gen/filters/rules/person/_matchessourceconfidence.py
index 138fa17cb..17c9a7fc2 100644
--- a/gramps/gen/filters/rules/person/_matchessourceconfidence.py
+++ b/gramps/gen/filters/rules/person/_matchessourceconfidence.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import sgettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_matchidof.py b/gramps/gen/filters/rules/person/_matchidof.py
index 1b437568c..67240638d 100644
--- a/gramps/gen/filters/rules/person/_matchidof.py
+++ b/gramps/gen/filters/rules/person/_matchidof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_missingparent.py b/gramps/gen/filters/rules/person/_missingparent.py
index 8492c2cf8..4de452e25 100644
--- a/gramps/gen/filters/rules/person/_missingparent.py
+++ b/gramps/gen/filters/rules/person/_missingparent.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_multiplemarriages.py b/gramps/gen/filters/rules/person/_multiplemarriages.py
index 49c674a2b..7e16e65e1 100644
--- a/gramps/gen/filters/rules/person/_multiplemarriages.py
+++ b/gramps/gen/filters/rules/person/_multiplemarriages.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_nevermarried.py b/gramps/gen/filters/rules/person/_nevermarried.py
index b484745d6..cb82ed657 100644
--- a/gramps/gen/filters/rules/person/_nevermarried.py
+++ b/gramps/gen/filters/rules/person/_nevermarried.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_nobirthdate.py b/gramps/gen/filters/rules/person/_nobirthdate.py
index 5c2e78d14..68b670153 100644
--- a/gramps/gen/filters/rules/person/_nobirthdate.py
+++ b/gramps/gen/filters/rules/person/_nobirthdate.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_nodeathdate.py b/gramps/gen/filters/rules/person/_nodeathdate.py
index 63d5491ec..cb5ef8d78 100644
--- a/gramps/gen/filters/rules/person/_nodeathdate.py
+++ b/gramps/gen/filters/rules/person/_nodeathdate.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_peopleprivate.py b/gramps/gen/filters/rules/person/_peopleprivate.py
index 829b70412..88d068260 100644
--- a/gramps/gen/filters/rules/person/_peopleprivate.py
+++ b/gramps/gen/filters/rules/person/_peopleprivate.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_peoplepublic.py b/gramps/gen/filters/rules/person/_peoplepublic.py
index 8013969e6..116243d27 100644
--- a/gramps/gen/filters/rules/person/_peoplepublic.py
+++ b/gramps/gen/filters/rules/person/_peoplepublic.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_personwithincompleteevent.py b/gramps/gen/filters/rules/person/_personwithincompleteevent.py
index 694bc5fca..864795f60 100644
--- a/gramps/gen/filters/rules/person/_personwithincompleteevent.py
+++ b/gramps/gen/filters/rules/person/_personwithincompleteevent.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_probablyalive.py b/gramps/gen/filters/rules/person/_probablyalive.py
index d1f2bec8f..fa69d9520 100644
--- a/gramps/gen/filters/rules/person/_probablyalive.py
+++ b/gramps/gen/filters/rules/person/_probablyalive.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_regexpidof.py b/gramps/gen/filters/rules/person/_regexpidof.py
index 31ae5b72f..0b984ec2d 100644
--- a/gramps/gen/filters/rules/person/_regexpidof.py
+++ b/gramps/gen/filters/rules/person/_regexpidof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_regexpname.py b/gramps/gen/filters/rules/person/_regexpname.py
index fe2e2919c..535f2eafe 100644
--- a/gramps/gen/filters/rules/person/_regexpname.py
+++ b/gramps/gen/filters/rules/person/_regexpname.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_relationshippathbetween.py b/gramps/gen/filters/rules/person/_relationshippathbetween.py
index 466b76a07..eae96400e 100644
--- a/gramps/gen/filters/rules/person/_relationshippathbetween.py
+++ b/gramps/gen/filters/rules/person/_relationshippathbetween.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/person/_relationshippathbetweenbookmarks.py b/gramps/gen/filters/rules/person/_relationshippathbetweenbookmarks.py
index 344c9c918..ad66f260d 100644
--- a/gramps/gen/filters/rules/person/_relationshippathbetweenbookmarks.py
+++ b/gramps/gen/filters/rules/person/_relationshippathbetweenbookmarks.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
try:
set()
except NameError:
diff --git a/gramps/gen/filters/rules/person/_searchname.py b/gramps/gen/filters/rules/person/_searchname.py
index eb0bf6e86..4ae961830 100644
--- a/gramps/gen/filters/rules/person/_searchname.py
+++ b/gramps/gen/filters/rules/person/_searchname.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/place/__init__.py b/gramps/gen/filters/rules/place/__init__.py
index 4b856f9da..a00797818 100644
--- a/gramps/gen/filters/rules/place/__init__.py
+++ b/gramps/gen/filters/rules/place/__init__.py
@@ -44,6 +44,7 @@ from ._inlatlonneighborhood import InLatLonNeighborhood
from ._matcheseventfilter import MatchesEventFilter
from ._matchessourceconfidence import MatchesSourceConfidence
from ._changedsince import ChangedSince
+from ._hastag import HasTag
editor_rule_list = [
AllPlaces,
@@ -65,4 +66,5 @@ editor_rule_list = [
InLatLonNeighborhood,
MatchesEventFilter,
ChangedSince,
+ HasTag
]
diff --git a/gramps/gen/filters/rules/place/_allplaces.py b/gramps/gen/filters/rules/place/_allplaces.py
index ad3c4dbd7..07384ee8d 100644
--- a/gramps/gen/filters/rules/place/_allplaces.py
+++ b/gramps/gen/filters/rules/place/_allplaces.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/place/_changedsince.py b/gramps/gen/filters/rules/place/_changedsince.py
index de9bd222e..bfbe1889d 100644
--- a/gramps/gen/filters/rules/place/_changedsince.py
+++ b/gramps/gen/filters/rules/place/_changedsince.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/place/_hascitation.py b/gramps/gen/filters/rules/place/_hascitation.py
index 2e5322f5f..3757ae1f3 100644
--- a/gramps/gen/filters/rules/place/_hascitation.py
+++ b/gramps/gen/filters/rules/place/_hascitation.py
@@ -29,7 +29,8 @@ Filter rule to match family with a particular citation.
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/place/_hasgallery.py b/gramps/gen/filters/rules/place/_hasgallery.py
index 9ad91ad52..c50c87abd 100755
--- a/gramps/gen/filters/rules/place/_hasgallery.py
+++ b/gramps/gen/filters/rules/place/_hasgallery.py
@@ -28,7 +28,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/place/_hasidof.py b/gramps/gen/filters/rules/place/_hasidof.py
index c2be8a6e4..f4e9254b5 100644
--- a/gramps/gen/filters/rules/place/_hasidof.py
+++ b/gramps/gen/filters/rules/place/_hasidof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/place/_hasnolatorlon.py b/gramps/gen/filters/rules/place/_hasnolatorlon.py
index fbc17f247..b7c2c0711 100644
--- a/gramps/gen/filters/rules/place/_hasnolatorlon.py
+++ b/gramps/gen/filters/rules/place/_hasnolatorlon.py
@@ -27,7 +27,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/place/_hasnote.py b/gramps/gen/filters/rules/place/_hasnote.py
index cd936c109..4fb270b28 100755
--- a/gramps/gen/filters/rules/place/_hasnote.py
+++ b/gramps/gen/filters/rules/place/_hasnote.py
@@ -28,7 +28,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/place/_hasnotematchingsubstringof.py b/gramps/gen/filters/rules/place/_hasnotematchingsubstringof.py
index 333eef214..5ec53ad03 100644
--- a/gramps/gen/filters/rules/place/_hasnotematchingsubstringof.py
+++ b/gramps/gen/filters/rules/place/_hasnotematchingsubstringof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/place/_hasnoteregexp.py b/gramps/gen/filters/rules/place/_hasnoteregexp.py
index 4242cd226..b0d0cd5da 100644
--- a/gramps/gen/filters/rules/place/_hasnoteregexp.py
+++ b/gramps/gen/filters/rules/place/_hasnoteregexp.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/place/_hasplace.py b/gramps/gen/filters/rules/place/_hasplace.py
index d9d1afb1b..b92754a63 100644
--- a/gramps/gen/filters/rules/place/_hasplace.py
+++ b/gramps/gen/filters/rules/place/_hasplace.py
@@ -27,7 +27,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/place/_hasreferencecountof.py b/gramps/gen/filters/rules/place/_hasreferencecountof.py
index 8f337bd38..3a8e05c46 100644
--- a/gramps/gen/filters/rules/place/_hasreferencecountof.py
+++ b/gramps/gen/filters/rules/place/_hasreferencecountof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/place/_hassourcecount.py b/gramps/gen/filters/rules/place/_hassourcecount.py
index 6f47e12e5..4b878164c 100644
--- a/gramps/gen/filters/rules/place/_hassourcecount.py
+++ b/gramps/gen/filters/rules/place/_hassourcecount.py
@@ -28,7 +28,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/place/_hassourceof.py b/gramps/gen/filters/rules/place/_hassourceof.py
index 6c846b9af..240fcb6f1 100644
--- a/gramps/gen/filters/rules/place/_hassourceof.py
+++ b/gramps/gen/filters/rules/place/_hassourceof.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/place/_hastag.py b/gramps/gen/filters/rules/place/_hastag.py
new file mode 100644
index 000000000..7f70998c6
--- /dev/null
+++ b/gramps/gen/filters/rules/place/_hastag.py
@@ -0,0 +1,51 @@
+#
+# Gramps - a GTK+/GNOME based genealogy program
+#
+# Copyright (C) 2010 Nick Hall
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# $Id$
+"""
+Rule that checks for a place with a particular tag.
+"""
+
+#-------------------------------------------------------------------------
+#
+# Standard Python modules
+#
+#-------------------------------------------------------------------------
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
+
+#-------------------------------------------------------------------------
+#
+# GRAMPS modules
+#
+#-------------------------------------------------------------------------
+from .._hastagbase import HasTagBase
+
+#-------------------------------------------------------------------------
+#
+# HasTag
+#
+#-------------------------------------------------------------------------
+class HasTag(HasTagBase):
+ """
+ Rule that checks for a place with a particular tag.
+ """
+ labels = [ _('Tag:') ]
+ name = _('Places with the ')
+ description = _("Matches places with the particular tag")
diff --git a/gramps/gen/filters/rules/place/_inlatlonneighborhood.py b/gramps/gen/filters/rules/place/_inlatlonneighborhood.py
index 880a4ae0d..493a6653e 100644
--- a/gramps/gen/filters/rules/place/_inlatlonneighborhood.py
+++ b/gramps/gen/filters/rules/place/_inlatlonneighborhood.py
@@ -27,7 +27,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/place/_matcheseventfilter.py b/gramps/gen/filters/rules/place/_matcheseventfilter.py
index a38f2f2c4..10382965d 100644
--- a/gramps/gen/filters/rules/place/_matcheseventfilter.py
+++ b/gramps/gen/filters/rules/place/_matcheseventfilter.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/place/_matchesfilter.py b/gramps/gen/filters/rules/place/_matchesfilter.py
index 8e6100322..b49c09ad4 100644
--- a/gramps/gen/filters/rules/place/_matchesfilter.py
+++ b/gramps/gen/filters/rules/place/_matchesfilter.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/place/_matchessourceconfidence.py b/gramps/gen/filters/rules/place/_matchessourceconfidence.py
index 0fe30d397..df39e314f 100644
--- a/gramps/gen/filters/rules/place/_matchessourceconfidence.py
+++ b/gramps/gen/filters/rules/place/_matchessourceconfidence.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import sgettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/place/_placeprivate.py b/gramps/gen/filters/rules/place/_placeprivate.py
index 65e1dc73b..ffddbbfe1 100644
--- a/gramps/gen/filters/rules/place/_placeprivate.py
+++ b/gramps/gen/filters/rules/place/_placeprivate.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/place/_regexpidof.py b/gramps/gen/filters/rules/place/_regexpidof.py
index b0d8a8035..984f8bdf0 100644
--- a/gramps/gen/filters/rules/place/_regexpidof.py
+++ b/gramps/gen/filters/rules/place/_regexpidof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/repository/__init__.py b/gramps/gen/filters/rules/repository/__init__.py
index 13761fef3..b3c32f9eb 100644
--- a/gramps/gen/filters/rules/repository/__init__.py
+++ b/gramps/gen/filters/rules/repository/__init__.py
@@ -35,6 +35,7 @@ from ._matchesfilter import MatchesFilter
from ._hasrepo import HasRepo
from ._changedsince import ChangedSince
from ._matchesnamesubstringof import MatchesNameSubstringOf
+from ._hastag import HasTag
editor_rule_list = [
AllRepos,
@@ -46,5 +47,6 @@ editor_rule_list = [
RepoPrivate,
MatchesFilter,
ChangedSince,
- MatchesNameSubstringOf
+ MatchesNameSubstringOf,
+ HasTag
]
diff --git a/gramps/gen/filters/rules/repository/_allrepos.py b/gramps/gen/filters/rules/repository/_allrepos.py
index 4ce03d3b3..beab09d5e 100644
--- a/gramps/gen/filters/rules/repository/_allrepos.py
+++ b/gramps/gen/filters/rules/repository/_allrepos.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/repository/_changedsince.py b/gramps/gen/filters/rules/repository/_changedsince.py
index 07010061a..37fe0babc 100644
--- a/gramps/gen/filters/rules/repository/_changedsince.py
+++ b/gramps/gen/filters/rules/repository/_changedsince.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/repository/_hasidof.py b/gramps/gen/filters/rules/repository/_hasidof.py
index 112d49c5b..cb8b46c44 100644
--- a/gramps/gen/filters/rules/repository/_hasidof.py
+++ b/gramps/gen/filters/rules/repository/_hasidof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/repository/_hasnotematchingsubstringof.py b/gramps/gen/filters/rules/repository/_hasnotematchingsubstringof.py
index 1f0e12e10..e1349a2c6 100644
--- a/gramps/gen/filters/rules/repository/_hasnotematchingsubstringof.py
+++ b/gramps/gen/filters/rules/repository/_hasnotematchingsubstringof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/repository/_hasnoteregexp.py b/gramps/gen/filters/rules/repository/_hasnoteregexp.py
index f01be904e..6e2089026 100644
--- a/gramps/gen/filters/rules/repository/_hasnoteregexp.py
+++ b/gramps/gen/filters/rules/repository/_hasnoteregexp.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/repository/_hasreferencecountof.py b/gramps/gen/filters/rules/repository/_hasreferencecountof.py
index 8b120e009..eb587c3ae 100644
--- a/gramps/gen/filters/rules/repository/_hasreferencecountof.py
+++ b/gramps/gen/filters/rules/repository/_hasreferencecountof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/repository/_hasrepo.py b/gramps/gen/filters/rules/repository/_hasrepo.py
index 49ac7f321..37c3e45fd 100644
--- a/gramps/gen/filters/rules/repository/_hasrepo.py
+++ b/gramps/gen/filters/rules/repository/_hasrepo.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/repository/_hastag.py b/gramps/gen/filters/rules/repository/_hastag.py
new file mode 100644
index 000000000..5011ef881
--- /dev/null
+++ b/gramps/gen/filters/rules/repository/_hastag.py
@@ -0,0 +1,51 @@
+#
+# Gramps - a GTK+/GNOME based genealogy program
+#
+# Copyright (C) 2010 Nick Hall
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# $Id$
+"""
+Rule that checks for a repository with a particular tag.
+"""
+
+#-------------------------------------------------------------------------
+#
+# Standard Python modules
+#
+#-------------------------------------------------------------------------
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
+
+#-------------------------------------------------------------------------
+#
+# GRAMPS modules
+#
+#-------------------------------------------------------------------------
+from .._hastagbase import HasTagBase
+
+#-------------------------------------------------------------------------
+#
+# HasTag
+#
+#-------------------------------------------------------------------------
+class HasTag(HasTagBase):
+ """
+ Rule that checks for a repository with a particular tag.
+ """
+ labels = [ _('Tag:') ]
+ name = _('Repositories with the ')
+ description = _("Matches repositories with the particular tag")
diff --git a/gramps/gen/filters/rules/repository/_matchesfilter.py b/gramps/gen/filters/rules/repository/_matchesfilter.py
index 8f7a583a5..7725190da 100644
--- a/gramps/gen/filters/rules/repository/_matchesfilter.py
+++ b/gramps/gen/filters/rules/repository/_matchesfilter.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/repository/_matchesnamesubstringof.py b/gramps/gen/filters/rules/repository/_matchesnamesubstringof.py
index 90124ddb0..7cb3c7d0a 100644
--- a/gramps/gen/filters/rules/repository/_matchesnamesubstringof.py
+++ b/gramps/gen/filters/rules/repository/_matchesnamesubstringof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/repository/_regexpidof.py b/gramps/gen/filters/rules/repository/_regexpidof.py
index a25b7d651..13b26e548 100644
--- a/gramps/gen/filters/rules/repository/_regexpidof.py
+++ b/gramps/gen/filters/rules/repository/_regexpidof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/repository/_repoprivate.py b/gramps/gen/filters/rules/repository/_repoprivate.py
index a4210b579..8c7b9c1ff 100644
--- a/gramps/gen/filters/rules/repository/_repoprivate.py
+++ b/gramps/gen/filters/rules/repository/_repoprivate.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/source/__init__.py b/gramps/gen/filters/rules/source/__init__.py
index fd67b8a40..696d8f5f7 100644
--- a/gramps/gen/filters/rules/source/__init__.py
+++ b/gramps/gen/filters/rules/source/__init__.py
@@ -43,6 +43,7 @@ from ._hasrepository import HasRepository
from ._matchestitlesubstringof import MatchesTitleSubstringOf
from ._hasrepositorycallnumberref import HasRepositoryCallNumberRef
from ._matchesrepositoryfilter import MatchesRepositoryFilter
+from ._hastag import HasTag
editor_rule_list = [
AllSources,
@@ -59,5 +60,6 @@ editor_rule_list = [
HasRepository,
MatchesTitleSubstringOf,
HasRepositoryCallNumberRef,
- MatchesRepositoryFilter
+ MatchesRepositoryFilter,
+ HasTag
]
diff --git a/gramps/gen/filters/rules/source/_allsources.py b/gramps/gen/filters/rules/source/_allsources.py
index 438d2efbc..081d2c9c9 100644
--- a/gramps/gen/filters/rules/source/_allsources.py
+++ b/gramps/gen/filters/rules/source/_allsources.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/source/_changedsince.py b/gramps/gen/filters/rules/source/_changedsince.py
index 48427d097..8c08e526b 100644
--- a/gramps/gen/filters/rules/source/_changedsince.py
+++ b/gramps/gen/filters/rules/source/_changedsince.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/source/_hasgallery.py b/gramps/gen/filters/rules/source/_hasgallery.py
index dd56fcba8..28f2d7627 100755
--- a/gramps/gen/filters/rules/source/_hasgallery.py
+++ b/gramps/gen/filters/rules/source/_hasgallery.py
@@ -28,7 +28,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/source/_hasidof.py b/gramps/gen/filters/rules/source/_hasidof.py
index d2bd73d80..835090223 100644
--- a/gramps/gen/filters/rules/source/_hasidof.py
+++ b/gramps/gen/filters/rules/source/_hasidof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/source/_hasnote.py b/gramps/gen/filters/rules/source/_hasnote.py
index cade6df58..35ab07a48 100755
--- a/gramps/gen/filters/rules/source/_hasnote.py
+++ b/gramps/gen/filters/rules/source/_hasnote.py
@@ -28,7 +28,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/source/_hasnotematchingsubstringof.py b/gramps/gen/filters/rules/source/_hasnotematchingsubstringof.py
index 2ba763b54..7b27b1434 100644
--- a/gramps/gen/filters/rules/source/_hasnotematchingsubstringof.py
+++ b/gramps/gen/filters/rules/source/_hasnotematchingsubstringof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/source/_hasnoteregexp.py b/gramps/gen/filters/rules/source/_hasnoteregexp.py
index 631b27e66..7a0369f84 100644
--- a/gramps/gen/filters/rules/source/_hasnoteregexp.py
+++ b/gramps/gen/filters/rules/source/_hasnoteregexp.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/source/_hasreferencecountof.py b/gramps/gen/filters/rules/source/_hasreferencecountof.py
index 4b1022ace..327767824 100644
--- a/gramps/gen/filters/rules/source/_hasreferencecountof.py
+++ b/gramps/gen/filters/rules/source/_hasreferencecountof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/source/_hasrepository.py b/gramps/gen/filters/rules/source/_hasrepository.py
index 3dceab31a..481d5c8d1 100644
--- a/gramps/gen/filters/rules/source/_hasrepository.py
+++ b/gramps/gen/filters/rules/source/_hasrepository.py
@@ -29,7 +29,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/source/_hasrepositorycallnumberref.py b/gramps/gen/filters/rules/source/_hasrepositorycallnumberref.py
index 54c097ac0..4cd900a5f 100644
--- a/gramps/gen/filters/rules/source/_hasrepositorycallnumberref.py
+++ b/gramps/gen/filters/rules/source/_hasrepositorycallnumberref.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/source/_hastag.py b/gramps/gen/filters/rules/source/_hastag.py
new file mode 100644
index 000000000..7a1480fce
--- /dev/null
+++ b/gramps/gen/filters/rules/source/_hastag.py
@@ -0,0 +1,51 @@
+#
+# Gramps - a GTK+/GNOME based genealogy program
+#
+# Copyright (C) 2010 Nick Hall
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# $Id$
+"""
+Rule that checks for a source with a particular tag.
+"""
+
+#-------------------------------------------------------------------------
+#
+# Standard Python modules
+#
+#-------------------------------------------------------------------------
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
+
+#-------------------------------------------------------------------------
+#
+# GRAMPS modules
+#
+#-------------------------------------------------------------------------
+from .._hastagbase import HasTagBase
+
+#-------------------------------------------------------------------------
+#
+# HasTag
+#
+#-------------------------------------------------------------------------
+class HasTag(HasTagBase):
+ """
+ Rule that checks for a source with a particular tag.
+ """
+ labels = [ _('Tag:') ]
+ name = _('Sources with the ')
+ description = _("Matches sources with the particular tag")
diff --git a/gramps/gen/filters/rules/source/_matchesfilter.py b/gramps/gen/filters/rules/source/_matchesfilter.py
index fd3ea414b..e0fe78452 100644
--- a/gramps/gen/filters/rules/source/_matchesfilter.py
+++ b/gramps/gen/filters/rules/source/_matchesfilter.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/source/_matchesrepositoryfilter.py b/gramps/gen/filters/rules/source/_matchesrepositoryfilter.py
index 2c31f55e0..a0930e3df 100644
--- a/gramps/gen/filters/rules/source/_matchesrepositoryfilter.py
+++ b/gramps/gen/filters/rules/source/_matchesrepositoryfilter.py
@@ -26,7 +26,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/source/_matchestitlesubstringof.py b/gramps/gen/filters/rules/source/_matchestitlesubstringof.py
index d1c7b11d1..6cdc9b105 100644
--- a/gramps/gen/filters/rules/source/_matchestitlesubstringof.py
+++ b/gramps/gen/filters/rules/source/_matchestitlesubstringof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/source/_regexpidof.py b/gramps/gen/filters/rules/source/_regexpidof.py
index a08076660..00aee261b 100644
--- a/gramps/gen/filters/rules/source/_regexpidof.py
+++ b/gramps/gen/filters/rules/source/_regexpidof.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/filters/rules/source/_sourceprivate.py b/gramps/gen/filters/rules/source/_sourceprivate.py
index 191ef9ee4..ff8b01683 100644
--- a/gramps/gen/filters/rules/source/_sourceprivate.py
+++ b/gramps/gen/filters/rules/source/_sourceprivate.py
@@ -25,7 +25,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ....ggettext import gettext as _
+from ....const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/ggettext.py b/gramps/gen/ggettext.py
deleted file mode 100644
index 2bf887300..000000000
--- a/gramps/gen/ggettext.py
+++ /dev/null
@@ -1,94 +0,0 @@
-#
-# Gramps - a GTK+/GNOME based genealogy program
-#
-# Copyright (C) 2000-2006 Donald N. Allingham
-# Copyright (C) 2009-2010 Brian G. Matherly
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-
-# $Id$
-
-"""
-This module ("Gramps Gettext") is an extension to the Python gettext module.
-"""
-
-#------------------------------------------------------------------------
-#
-# python modules
-#
-#------------------------------------------------------------------------
-import gettext as pgettext
-
-import sys
-if sys.version_info[0] < 3:
- cuni = unicode
-else:
- cuni = str
-
-def gettext(msgid):
- """
- Obtain translation of gettext, return a unicode object
- :param msgid: The string to translated.
- :type msgid: unicode
- :returns: Translation or the original.
- :rtype: unicode
- """
- # If msgid =="" then gettext will return po file header
- # and that's not what we want.
- if len(msgid.strip()) == 0:
- return msgid
- return cuni(pgettext.gettext(msgid))
-
-def ngettext(singular, plural, n):
- """
- The translation of singular/plural is returned unless the translation is
- not available and the singular contains the separator. In that case,
- the returned value is the singular.
-
- :param singular: The singular form of the string to be translated.
- may contain a context seperator
- :type singular: unicode
- :param plural: The plural form of the string to be translated.
- :type plural: unicode
- :param n: the amount for which to decide the translation
- :type n: int
- :returns: Translation or the original.
- :rtype: unicode
- """
- return cuni(pgettext.ngettext(singular, plural, n))
-
-def sgettext(msgid, sep='|'):
- """
- Strip the context used for resolving translation ambiguities.
-
- The translation of msgid is returned unless the translation is
- not available and the msgid contains the separator. In that case,
- the returned value is the portion of msgid following the last
- separator. Default separator is '|'.
-
- :param msgid: The string to translated.
- :type msgid: unicode
- :param sep: The separator marking the context.
- :type sep: unicode
- :returns: Translation or the original with context stripped.
- :rtype: unicode
-
- """
- msgval = pgettext.gettext(msgid)
- if msgval == msgid:
- sep_idx = msgid.rfind(sep)
- msgval = msgid[sep_idx+1:]
- return cuni(msgval)
diff --git a/gramps/gen/lib/attrtype.py b/gramps/gen/lib/attrtype.py
index 53dd9e4e1..55e922bc6 100644
--- a/gramps/gen/lib/attrtype.py
+++ b/gramps/gen/lib/attrtype.py
@@ -29,7 +29,8 @@ Provide the different Attribute Types for GRAMPS.
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ..ggettext import gettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
# GRAMPS modules
diff --git a/gramps/gen/lib/childreftype.py b/gramps/gen/lib/childreftype.py
index 720f0da0d..b48348745 100644
--- a/gramps/gen/lib/childreftype.py
+++ b/gramps/gen/lib/childreftype.py
@@ -28,7 +28,8 @@ Provide the different child reference types.
# standard python modules
#
#-------------------------------------------------------------------------
-from ..ggettext import gettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/lib/citation.py b/gramps/gen/lib/citation.py
index 77408cc30..090b0fdf9 100644
--- a/gramps/gen/lib/citation.py
+++ b/gramps/gen/lib/citation.py
@@ -43,7 +43,9 @@ from .primaryobj import PrimaryObject
from .mediabase import MediaBase
from .notebase import NoteBase
from .datebase import DateBase
+from .tagbase import TagBase
from ..constfunc import cuni
+from .handle import Handle
#-------------------------------------------------------------------------
#
@@ -90,7 +92,8 @@ class Citation(MediaBase, NoteBase, PrimaryObject, DateBase):
MediaBase.serialize(self), # 7
self.datamap, # 8
self.change, # 9
- self.private) # 10
+ TagBase.serialize(self), # 10
+ self.private) # 11
def to_struct(self):
"""
@@ -112,17 +115,18 @@ class Citation(MediaBase, NoteBase, PrimaryObject, DateBase):
:returns: Returns a struct containing the data of the object.
:rtype: dict
"""
- return {"handle": self.handle, # 0
+ return {"handle": Handle("Citation", self.handle), # 0
"gramps_id": self.gramps_id, # 1
"date": DateBase.to_struct(self), # 2
"page": cuni(self.page), # 3
"confidence": self.confidence, # 4
- "source_handle": self.source_handle, # 5
+ "source_handle": Handle("Source", self.source_handle), # 5
"note_list": NoteBase.to_struct(self), # 6
"media_list": MediaBase.to_struct(self), # 7
"datamap": self.datamap, # 8
"change": self.change, # 9
- "private": self.private} # 10
+ "tag_list": TagBase.to_struct(self), # 10
+ "private": self.private} # 11
def unserialize(self, data):
"""
@@ -139,12 +143,14 @@ class Citation(MediaBase, NoteBase, PrimaryObject, DateBase):
media_list, # 7
self.datamap, # 8
self.change, # 9
- self.private # 10
+ tag_list, # 10
+ self.private # 11
) = data
DateBase.unserialize(self, date)
NoteBase.unserialize(self, note_list)
MediaBase.unserialize(self, media_list)
+ TagBase.unserialize(self, tag_list)
return self
def _has_handle_reference(self, classname, handle):
@@ -243,7 +249,8 @@ class Citation(MediaBase, NoteBase, PrimaryObject, DateBase):
:returns: List of (classname, handle) tuples for referenced objects.
:rtype: list
"""
- ret = self.get_referenced_note_handles()
+ ret = (self.get_referenced_note_handles() +
+ self.get_referenced_tag_handles())
if self.get_reference_handle():
ret += [('Source', self.get_reference_handle())]
return ret
@@ -258,6 +265,7 @@ class Citation(MediaBase, NoteBase, PrimaryObject, DateBase):
self._merge_privacy(acquisition)
self._merge_note_list(acquisition)
self._merge_media_list(acquisition)
+ self._merge_tag_list(acquisition)
# merge confidence
level_priority = [0, 4, 1, 3, 2]
idx = min(level_priority.index(self.confidence),
diff --git a/gramps/gen/lib/citationbase.py b/gramps/gen/lib/citationbase.py
index af015fd36..233faa6e2 100644
--- a/gramps/gen/lib/citationbase.py
+++ b/gramps/gen/lib/citationbase.py
@@ -34,6 +34,13 @@ CitationBase class for GRAMPS.
import logging
LOG = logging.getLogger(".citation")
+#-------------------------------------------------------------------------
+#
+# Gramps modules
+#
+#-------------------------------------------------------------------------
+from .handle import Handle
+
#-------------------------------------------------------------------------
#
# CitationBase class
@@ -89,7 +96,7 @@ class CitationBase(object):
:returns: Returns a struct containing the data of the object.
:rtype: list
"""
- return self.citation_list
+ return [Handle("Citation", c) for c in self.citation_list]
def unserialize(self, data):
"""
diff --git a/gramps/gen/lib/date.py b/gramps/gen/lib/date.py
index 832ae0b91..e5a7d8980 100644
--- a/gramps/gen/lib/date.py
+++ b/gramps/gen/lib/date.py
@@ -29,8 +29,6 @@
#
#------------------------------------------------------------------------
from __future__ import unicode_literals, division
-from ..ggettext import sgettext as _
-from ..ggettext import ngettext
#------------------------------------------------------------------------
#
@@ -52,6 +50,10 @@ log = logging.getLogger(".Date")
# Gramps modules
#
#------------------------------------------------------------------------
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
+ngettext = glocale.get_translation().ngettext
+
from .calendar import (gregorian_sdn, julian_sdn, hebrew_sdn,
french_sdn, persian_sdn, islamic_sdn, swedish_sdn,
gregorian_ymd, julian_ymd, hebrew_ymd,
diff --git a/gramps/gen/lib/event.py b/gramps/gen/lib/event.py
index aeecd2f3d..653324ca3 100644
--- a/gramps/gen/lib/event.py
+++ b/gramps/gen/lib/event.py
@@ -46,7 +46,9 @@ from .mediabase import MediaBase
from .attrbase import AttributeBase
from .datebase import DateBase
from .placebase import PlaceBase
+from .tagbase import TagBase
from .eventtype import EventType
+from .handle import Handle
#-------------------------------------------------------------------------
#
@@ -115,7 +117,7 @@ class Event(CitationBase, NoteBase, MediaBase, AttributeBase,
NoteBase.serialize(self),
MediaBase.serialize(self),
AttributeBase.serialize(self),
- self.change, self.private)
+ self.change, TagBase.serialize(self), self.private)
def to_struct(self):
"""
@@ -137,17 +139,18 @@ class Event(CitationBase, NoteBase, MediaBase, AttributeBase,
:returns: Returns a struct containing the data of the object.
:rtype: dict
"""
- return {"handle": self.handle,
+ return {"handle": Handle("Event", self.handle),
"gramps_id": self.gramps_id,
"type": self.__type.to_struct(),
"date": DateBase.to_struct(self),
"description": self.__description,
- "place": self.place,
+ "place": Handle("Place", self.place),
"citation_list": CitationBase.to_struct(self),
"note_list": NoteBase.to_struct(self),
"media_list": MediaBase.to_struct(self),
"attribute_list": AttributeBase.to_struct(self),
"change": self.change,
+ "tag_list": TagBase.to_struct(self),
"private": self.private}
def unserialize(self, data):
@@ -162,7 +165,7 @@ class Event(CitationBase, NoteBase, MediaBase, AttributeBase,
(self.handle, self.gramps_id, the_type, date,
self.__description, self.place,
citation_list, note_list, media_list, attribute_list,
- self.change, self.private) = data
+ self.change, tag_list, self.private) = data
self.__type = EventType()
self.__type.unserialize(the_type)
@@ -171,6 +174,7 @@ class Event(CitationBase, NoteBase, MediaBase, AttributeBase,
AttributeBase.unserialize(self, attribute_list)
CitationBase.unserialize(self, citation_list)
NoteBase.unserialize(self, note_list)
+ TagBase.unserialize(self, tag_list)
return self
def _has_handle_reference(self, classname, handle):
@@ -262,8 +266,9 @@ class Event(CitationBase, NoteBase, MediaBase, AttributeBase,
:returns: List of (classname, handle) tuples for referenced objects.
:rtype: list
"""
- ret = self.get_referenced_note_handles() + \
- self.get_referenced_citation_handles()
+ ret = (self.get_referenced_note_handles() +
+ self.get_referenced_citation_handles() +
+ self.get_referenced_tag_handles())
if self.place:
ret.append(('Place', self.place))
return ret
@@ -337,6 +342,7 @@ class Event(CitationBase, NoteBase, MediaBase, AttributeBase,
self._merge_note_list(acquisition)
self._merge_citation_list(acquisition)
self._merge_media_list(acquisition)
+ self._merge_tag_list(acquisition)
def set_type(self, the_type):
"""
diff --git a/gramps/gen/lib/eventroletype.py b/gramps/gen/lib/eventroletype.py
index b9bd2ad4d..c2658fed9 100644
--- a/gramps/gen/lib/eventroletype.py
+++ b/gramps/gen/lib/eventroletype.py
@@ -28,7 +28,8 @@ Provide the different event roles.
# Python modules
#
#------------------------------------------------------------------------
-from ..ggettext import sgettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/lib/eventtype.py b/gramps/gen/lib/eventtype.py
index 040783ef0..ddde001ce 100644
--- a/gramps/gen/lib/eventtype.py
+++ b/gramps/gen/lib/eventtype.py
@@ -29,7 +29,8 @@ Provide the different event types
# Python modules
#
#------------------------------------------------------------------------
-from ..ggettext import sgettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/lib/family.py b/gramps/gen/lib/family.py
index d11e470e9..d1e6da37f 100644
--- a/gramps/gen/lib/family.py
+++ b/gramps/gen/lib/family.py
@@ -52,6 +52,7 @@ from .tagbase import TagBase
from .childref import ChildRef
from .familyreltype import FamilyRelType
from .const import IDENTICAL, EQUAL, DIFFERENT
+from .handle import Handle
#-------------------------------------------------------------------------
#
@@ -59,7 +60,7 @@ from .const import IDENTICAL, EQUAL, DIFFERENT
#
#-------------------------------------------------------------------------
class Family(CitationBase, NoteBase, MediaBase, AttributeBase, LdsOrdBase,
- TagBase, PrimaryObject):
+ PrimaryObject):
"""
The Family record is the GRAMPS in-memory representation of the
relationships between people. It contains all the information
@@ -90,7 +91,6 @@ class Family(CitationBase, NoteBase, MediaBase, AttributeBase, LdsOrdBase,
MediaBase.__init__(self)
AttributeBase.__init__(self)
LdsOrdBase.__init__(self)
- TagBase.__init__(self)
self.father_handle = None
self.mother_handle = None
self.child_ref_list = []
@@ -148,10 +148,10 @@ class Family(CitationBase, NoteBase, MediaBase, AttributeBase, LdsOrdBase,
:returns: Returns a struct containing the data of the object.
:rtype: dict
"""
- return {"handle": self.handle,
+ return {"handle": Handle("Family", self.handle),
"gramps_id": self.gramps_id,
- "father_handle": self.father_handle,
- "mother_handle": self.mother_handle,
+ "father_handle": Handle("Person", self.father_handle),
+ "mother_handle": Handle("Person", self.mother_handle),
"child_ref_list": [cr.to_struct() for cr in self.child_ref_list],
"type": self.type.to_struct(),
"event_ref_list": [er.to_struct() for er in self.event_ref_list],
diff --git a/gramps/gen/lib/familyreltype.py b/gramps/gen/lib/familyreltype.py
index 0e9d20e9a..b6cf2b4a8 100644
--- a/gramps/gen/lib/familyreltype.py
+++ b/gramps/gen/lib/familyreltype.py
@@ -27,7 +27,8 @@ Provide the different family reference types.
# Python modules
#
#------------------------------------------------------------------------
-from ..ggettext import gettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/lib/grampstype.py b/gramps/gen/lib/grampstype.py
index 33658a444..9dbdc4f33 100644
--- a/gramps/gen/lib/grampstype.py
+++ b/gramps/gen/lib/grampstype.py
@@ -31,13 +31,14 @@ Base type for all gramps types.
#
#------------------------------------------------------------------------
from __future__ import unicode_literals
-from ..ggettext import gettext as _
#-------------------------------------------------------------------------
#
# GRAMPS modules
#
#-------------------------------------------------------------------------
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from ..constfunc import STRTYPE
_UNKNOWN = _('Unknown')
diff --git a/gramps/gen/lib/handle.py b/gramps/gen/lib/handle.py
new file mode 100644
index 000000000..8b93bd2e4
--- /dev/null
+++ b/gramps/gen/lib/handle.py
@@ -0,0 +1,35 @@
+#
+# Gramps - a GTK+/GNOME based genealogy program
+#
+# Copyright (C) 2013 Doug Blank
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+# $Id$
+
+from gramps.gen.constfunc import UNITYPE
+
+class Handle:
+ def __init__(self, classname, handle):
+ """ Class to hold type and handle of referenced item """
+ self.classname = classname
+ if handle and not isinstance(handle, UNITYPE):
+ handle = handle.decode('utf-8')
+ self.handle = handle
+
+ def __repr__(self):
+ return "Handle(%s, %s)" % (self.classname, self.handle)
+
diff --git a/gramps/gen/lib/ldsord.py b/gramps/gen/lib/ldsord.py
index 041a6d4f6..17352ff3c 100644
--- a/gramps/gen/lib/ldsord.py
+++ b/gramps/gen/lib/ldsord.py
@@ -31,7 +31,8 @@ LDS Ordinance class for GRAMPS.
# Python modules
#
#-------------------------------------------------------------------------
-from ..ggettext import gettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from warnings import warn
#-------------------------------------------------------------------------
diff --git a/gramps/gen/lib/markertype.py b/gramps/gen/lib/markertype.py
index 781cea62d..ffafc9236 100644
--- a/gramps/gen/lib/markertype.py
+++ b/gramps/gen/lib/markertype.py
@@ -31,7 +31,8 @@ when loading old database files.
# Python modules
#
#-------------------------------------------------------------------------
-from ..ggettext import gettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/lib/mediaobj.py b/gramps/gen/lib/mediaobj.py
index ac434a295..279fcb457 100644
--- a/gramps/gen/lib/mediaobj.py
+++ b/gramps/gen/lib/mediaobj.py
@@ -52,6 +52,7 @@ from .notebase import NoteBase
from .datebase import DateBase
from .attrbase import AttributeBase
from .tagbase import TagBase
+from .handle import Handle
#-------------------------------------------------------------------------
#
@@ -59,7 +60,7 @@ from .tagbase import TagBase
#
#-------------------------------------------------------------------------
class MediaObject(CitationBase, NoteBase, DateBase, AttributeBase,
- TagBase, PrimaryObject):
+ PrimaryObject):
"""
Container for information about an image file, including location,
description and privacy.
@@ -80,7 +81,6 @@ class MediaObject(CitationBase, NoteBase, DateBase, AttributeBase,
NoteBase.__init__(self, source)
DateBase.__init__(self, source)
AttributeBase.__init__(self, source)
- TagBase.__init__(self)
if source:
self.path = source.path
@@ -140,7 +140,7 @@ class MediaObject(CitationBase, NoteBase, DateBase, AttributeBase,
:returns: Returns a struct containing the data of the object.
:rtype: dict
"""
- return {"handle": self.handle,
+ return {"handle": Handle("Media", self.handle),
"gramps_id": self.gramps_id,
"path": self.path,
"mime": self.mime,
diff --git a/gramps/gen/lib/nameorigintype.py b/gramps/gen/lib/nameorigintype.py
index 407d8baf6..d511ca4ef 100644
--- a/gramps/gen/lib/nameorigintype.py
+++ b/gramps/gen/lib/nameorigintype.py
@@ -29,7 +29,8 @@ Name types.
# Python modules
#
#-------------------------------------------------------------------------
-from ..ggettext import sgettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/lib/nametype.py b/gramps/gen/lib/nametype.py
index b3b421d86..4df805381 100644
--- a/gramps/gen/lib/nametype.py
+++ b/gramps/gen/lib/nametype.py
@@ -29,7 +29,8 @@ Name types.
# Python modules
#
#-------------------------------------------------------------------------
-from ..ggettext import gettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/lib/note.py b/gramps/gen/lib/note.py
index 36ce336a5..1d25dc19a 100644
--- a/gramps/gen/lib/note.py
+++ b/gramps/gen/lib/note.py
@@ -36,13 +36,14 @@ from .tagbase import TagBase
from .notetype import NoteType
from .styledtext import StyledText
from ..constfunc import cuni
+from .handle import Handle
#-------------------------------------------------------------------------
#
# Class for notes used throughout the majority of GRAMPS objects
#
#-------------------------------------------------------------------------
-class Note(BasicPrimaryObject, TagBase):
+class Note(BasicPrimaryObject):
"""Define a text note.
Starting from GRAMPS 3.1 Note object stores the text in :class:`gen.lib.styledtext.StyledText`
@@ -82,7 +83,6 @@ class Note(BasicPrimaryObject, TagBase):
def __init__(self, text=""):
"""Create a new Note object, initializing from the passed string."""
BasicPrimaryObject.__init__(self)
- TagBase.__init__(self)
self.text = StyledText(text)
self.format = Note.FLOWED
self.type = NoteType()
@@ -118,7 +118,7 @@ class Note(BasicPrimaryObject, TagBase):
:returns: Returns a struct containing the data of the object.
:rtype: dict
"""
- return {"handle": self.handle,
+ return {"handle": Handle("Note", self.handle),
"gramps_id": self.gramps_id,
"text": self.text.to_struct(),
"format": self.format,
diff --git a/gramps/gen/lib/notebase.py b/gramps/gen/lib/notebase.py
index 6ce3324c6..efaee269d 100644
--- a/gramps/gen/lib/notebase.py
+++ b/gramps/gen/lib/notebase.py
@@ -25,6 +25,8 @@
NoteBase class for GRAMPS.
"""
+from .handle import Handle
+
#-------------------------------------------------------------------------
#
# NoteBase class
@@ -73,7 +75,7 @@ class NoteBase(object):
:returns: Returns a struct containing the data of the object.
:rtype: list
"""
- return self.note_list
+ return [Handle("Note", n) for n in self.note_list]
def unserialize(self, data):
"""
diff --git a/gramps/gen/lib/notetype.py b/gramps/gen/lib/notetype.py
index 6ef68327f..b9211a6bb 100644
--- a/gramps/gen/lib/notetype.py
+++ b/gramps/gen/lib/notetype.py
@@ -29,7 +29,8 @@ Note types.
# standard python modules
#
#-------------------------------------------------------------------------
-from ..ggettext import gettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
@@ -69,6 +70,7 @@ class NoteType(GrampsType):
REPORT_TEXT = 23 # this is used for notes used for reports
# indicate a note is html code
HTML_CODE = 24
+ TODO = 25
_CUSTOM = CUSTOM
_DEFAULT = GENERAL
@@ -84,6 +86,7 @@ class NoteType(GrampsType):
(CITATION, _('Citation'), "Citation"),
(REPORT_TEXT, _("Report"), "Report"),
(HTML_CODE, _("Html code"), "Html code"),
+ (TODO, _("To Do"), "To Do"),
]
_DATAMAPIGNORE = [
diff --git a/gramps/gen/lib/person.py b/gramps/gen/lib/person.py
index b0af41d24..018dbc1ee 100644
--- a/gramps/gen/lib/person.py
+++ b/gramps/gen/lib/person.py
@@ -49,8 +49,10 @@ from .attrtype import AttributeType
from .eventroletype import EventRoleType
from .attribute import Attribute
from .const import IDENTICAL, EQUAL, DIFFERENT
-from ..ggettext import gettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from ..constfunc import STRTYPE
+from .handle import Handle
#-------------------------------------------------------------------------
#
@@ -58,7 +60,7 @@ from ..constfunc import STRTYPE
#
#-------------------------------------------------------------------------
class Person(CitationBase, NoteBase, AttributeBase, MediaBase,
- AddressBase, UrlBase, LdsOrdBase, TagBase, PrimaryObject):
+ AddressBase, UrlBase, LdsOrdBase, PrimaryObject):
"""
The Person record is the GRAMPS in-memory representation of an
individual person. It contains all the information related to
@@ -96,7 +98,6 @@ class Person(CitationBase, NoteBase, AttributeBase, MediaBase,
AddressBase.__init__(self)
UrlBase.__init__(self)
LdsOrdBase.__init__(self)
- TagBase.__init__(self)
self.primary_name = Name()
self.event_ref_list = []
self.family_list = []
@@ -182,7 +183,7 @@ class Person(CitationBase, NoteBase, AttributeBase, MediaBase,
:rtype: dict
"""
return {
- "handle": self.handle, # 0
+ "handle": Handle("Person", self.handle), # 0
"gramps_id": self.gramps_id, # 1
"gender": self.gender, # 2
"primary_name": self.primary_name.to_struct(), # 3
@@ -192,8 +193,10 @@ class Person(CitationBase, NoteBase, AttributeBase, MediaBase,
"birth_ref_index": self.birth_ref_index, # 6
"event_ref_list": [er.to_struct()
for er in self.event_ref_list], # 7
- "family_list": self.family_list, # 8
- "parent_family_list": self.parent_family_list, # 9
+ "family_list": [Handle("Family", f) for f in
+ self.family_list], # 8
+ "parent_family_list": [Handle("Family", f) for f in
+ self.parent_family_list], # 9
"media_list": MediaBase.to_struct(self), # 10
"address_list": AddressBase.to_struct(self), # 11
"attribute_list": AttributeBase.to_struct(self), # 12
@@ -439,7 +442,8 @@ class Person(CitationBase, NoteBase, AttributeBase, MediaBase,
self.address_list +
self.attribute_list +
self.lds_ord_list +
- self.person_ref_list
+ self.person_ref_list +
+ self.event_ref_list
)
def get_note_child_list(self):
diff --git a/gramps/gen/lib/place.py b/gramps/gen/lib/place.py
index c6113c406..f8c48d44a 100644
--- a/gramps/gen/lib/place.py
+++ b/gramps/gen/lib/place.py
@@ -37,7 +37,9 @@ from .citationbase import CitationBase
from .notebase import NoteBase
from .mediabase import MediaBase
from .urlbase import UrlBase
+from .tagbase import TagBase
from .location import Location
+from .handle import Handle
#-------------------------------------------------------------------------
#
@@ -96,7 +98,7 @@ class Place(CitationBase, NoteBase, MediaBase, UrlBase, PrimaryObject):
MediaBase.serialize(self),
CitationBase.serialize(self),
NoteBase.serialize(self),
- self.change, self.private)
+ self.change, TagBase.serialize(self), self.private)
def to_struct(self):
"""
@@ -123,7 +125,7 @@ class Place(CitationBase, NoteBase, MediaBase, UrlBase, PrimaryObject):
else:
main_loc = self.main_loc.to_struct()
- return {"handle": self.handle,
+ return {"handle": Handle("Place", self.handle),
"gramps_id": self.gramps_id,
"title": self.title,
"long": self.long,
@@ -135,6 +137,7 @@ class Place(CitationBase, NoteBase, MediaBase, UrlBase, PrimaryObject):
"citation_list": CitationBase.to_struct(self),
"note_list": NoteBase.to_struct(self),
"change": self.change,
+ "tag_list": TagBase.to_struct(self),
"private": self.private}
def unserialize(self, data):
@@ -149,12 +152,13 @@ class Place(CitationBase, NoteBase, MediaBase, UrlBase, PrimaryObject):
(self.handle, self.gramps_id, self.title,
self.main_loc, self.alt_loc,
urls, media_list, citation_list, note_list,
- self.change, self.private) = data
+ self.change, tag_list, self.private) = data
UrlBase.unserialize(self, urls)
MediaBase.unserialize(self, media_list)
CitationBase.unserialize(self, citation_list)
NoteBase.unserialize(self, note_list)
+ TagBase.unserialize(self, tag_list)
return self
def get_text_data_list(self):
@@ -230,9 +234,10 @@ class Place(CitationBase, NoteBase, MediaBase, UrlBase, PrimaryObject):
:returns: List of (classname, handle) tuples for referenced objects.
:rtype: list
"""
- return self.get_referenced_location_handles() + \
- self.get_referenced_note_handles() + \
- self.get_referenced_citation_handles()
+ return (self.get_referenced_location_handles() +
+ self.get_referenced_note_handles() +
+ self.get_referenced_citation_handles() +
+ self.get_referenced_tag_handles())
def merge(self, acquisition):
""" Merge the content of acquisition into this place.
@@ -246,6 +251,7 @@ class Place(CitationBase, NoteBase, MediaBase, UrlBase, PrimaryObject):
self._merge_url_list(acquisition)
self._merge_note_list(acquisition)
self._merge_citation_list(acquisition)
+ self._merge_tag_list(acquisition)
def set_title(self, title):
"""
diff --git a/gramps/gen/lib/primaryobj.py b/gramps/gen/lib/primaryobj.py
index c995c0b77..e21387ad3 100644
--- a/gramps/gen/lib/primaryobj.py
+++ b/gramps/gen/lib/primaryobj.py
@@ -34,13 +34,14 @@ from .tableobj import TableObject
from .privacybase import PrivacyBase
from .citationbase import CitationBase
from .mediabase import MediaBase
+from .tagbase import TagBase
#-------------------------------------------------------------------------
#
# Basic Primary Object class
#
#-------------------------------------------------------------------------
-class BasicPrimaryObject(TableObject, PrivacyBase):
+class BasicPrimaryObject(TableObject, PrivacyBase, TagBase):
"""
The BasicPrimaryObject is the base class for Note objects.
@@ -66,6 +67,7 @@ class BasicPrimaryObject(TableObject, PrivacyBase):
"""
TableObject.__init__(self, source)
PrivacyBase.__init__(self, source)
+ TagBase.__init__(self)
if source:
self.gramps_id = source.gramps_id
else:
diff --git a/gramps/gen/lib/refbase.py b/gramps/gen/lib/refbase.py
index 679698455..d1042e280 100644
--- a/gramps/gen/lib/refbase.py
+++ b/gramps/gen/lib/refbase.py
@@ -24,6 +24,8 @@
Base Reference class for GRAMPS.
"""
+from .handle import Handle
+
#-------------------------------------------------------------------------
#
# RefBase class
@@ -68,7 +70,7 @@ class RefBase(object):
:returns: Returns a struct containing the data of the object.
:rtype: str
"""
- return self.ref
+ return [Handle(*t) for t in self.get_referenced_handles()]
def unserialize(self, data):
"""
diff --git a/gramps/gen/lib/repo.py b/gramps/gen/lib/repo.py
index c6768679f..89dd5d0e4 100644
--- a/gramps/gen/lib/repo.py
+++ b/gramps/gen/lib/repo.py
@@ -35,8 +35,10 @@ from .primaryobj import PrimaryObject
from .notebase import NoteBase
from .addressbase import AddressBase
from .urlbase import UrlBase
+from .tagbase import TagBase
from .repotype import RepositoryType
from ..constfunc import cuni
+from .handle import Handle
#-------------------------------------------------------------------------
#
@@ -66,7 +68,7 @@ class Repository(NoteBase, AddressBase, UrlBase, PrimaryObject):
NoteBase.serialize(self),
AddressBase.serialize(self),
UrlBase.serialize(self),
- self.change, self.private)
+ self.change, TagBase.serialize(self), self.private)
def to_struct(self):
"""
@@ -88,7 +90,7 @@ class Repository(NoteBase, AddressBase, UrlBase, PrimaryObject):
:returns: Returns a struct containing the data of the object.
:rtype: dict
"""
- return {"handle": self.handle,
+ return {"handle": Handle("Repository", self.handle),
"gramps_id": self.gramps_id,
"type": self.type.to_struct(),
"name": cuni(self.name),
@@ -96,6 +98,7 @@ class Repository(NoteBase, AddressBase, UrlBase, PrimaryObject):
"address_list": AddressBase.to_struct(self),
"urls": UrlBase.to_struct(self),
"change": self.change,
+ "tag_list": TagBase.to_struct(self),
"private": self.private}
def unserialize(self, data):
@@ -104,13 +107,14 @@ class Repository(NoteBase, AddressBase, UrlBase, PrimaryObject):
back into the data in a Repository structure.
"""
(self.handle, self.gramps_id, the_type, self.name, note_list,
- address_list, urls, self.change, self.private) = data
+ address_list, urls, self.change, tag_list, self.private) = data
self.type = RepositoryType()
self.type.unserialize(the_type)
NoteBase.unserialize(self, note_list)
AddressBase.unserialize(self, address_list)
UrlBase.unserialize(self, urls)
+ TagBase.unserialize(self, tag_list)
return self
def get_text_data_list(self):
@@ -169,7 +173,8 @@ class Repository(NoteBase, AddressBase, UrlBase, PrimaryObject):
:returns: List of (classname, handle) tuples for referenced objects.
:rtype: list
"""
- return self.get_referenced_note_handles()
+ return (self.get_referenced_note_handles() +
+ self.get_referenced_tag_handles())
def has_citation_reference(self, citation_handle) :
"""
@@ -235,6 +240,7 @@ class Repository(NoteBase, AddressBase, UrlBase, PrimaryObject):
self._merge_address_list(acquisition)
self._merge_url_list(acquisition)
self._merge_note_list(acquisition)
+ self._merge_tag_list(acquisition)
def set_type(self, the_type):
"""
diff --git a/gramps/gen/lib/repotype.py b/gramps/gen/lib/repotype.py
index 0cc937021..0fc797fc9 100644
--- a/gramps/gen/lib/repotype.py
+++ b/gramps/gen/lib/repotype.py
@@ -29,7 +29,8 @@ Repository types.
# Python modules
#
#-------------------------------------------------------------------------
-from ..ggettext import gettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/lib/src.py b/gramps/gen/lib/src.py
index e6566769d..dde995b38 100644
--- a/gramps/gen/lib/src.py
+++ b/gramps/gen/lib/src.py
@@ -34,9 +34,11 @@ Source object for GRAMPS.
from .primaryobj import PrimaryObject
from .mediabase import MediaBase
from .notebase import NoteBase
+from .tagbase import TagBase
from .reporef import RepoRef
from .const import DIFFERENT, EQUAL, IDENTICAL
from ..constfunc import cuni
+from .handle import Handle
#-------------------------------------------------------------------------
#
@@ -68,7 +70,7 @@ class Source(MediaBase, NoteBase, PrimaryObject):
MediaBase.serialize(self), cuni(self.abbrev),
self.change, self.datamap,
[rr.serialize() for rr in self.reporef_list],
- self.private)
+ TagBase.serialize(self), self.private)
def to_struct(self):
"""
@@ -90,7 +92,7 @@ class Source(MediaBase, NoteBase, PrimaryObject):
:returns: Returns a struct containing the data of the object.
:rtype: dict
"""
- return {"handle": self.handle,
+ return {"handle": Handle("Source", self.handle),
"gramps_id": self.gramps_id,
"title": cuni(self.title),
"author": cuni(self.author),
@@ -101,6 +103,7 @@ class Source(MediaBase, NoteBase, PrimaryObject):
"change": self.change,
"datamap": {"dict": self.datamap},
"reporef_list": [rr.to_struct() for rr in self.reporef_list],
+ "tag_list": TagBase.to_struct(self),
"private": self.private}
def unserialize(self, data):
@@ -111,10 +114,11 @@ class Source(MediaBase, NoteBase, PrimaryObject):
(self.handle, self.gramps_id, self.title, self.author,
self.pubinfo, note_list, media_list,
self.abbrev, self.change, self.datamap, reporef_list,
- self.private) = data
+ tag_list, self.private) = data
NoteBase.unserialize(self, note_list)
MediaBase.unserialize(self, media_list)
+ TagBase.unserialize(self, tag_list)
self.reporef_list = [RepoRef().unserialize(item) for item in reporef_list]
return self
@@ -224,7 +228,8 @@ class Source(MediaBase, NoteBase, PrimaryObject):
:returns: List of (classname, handle) tuples for referenced objects.
:rtype: list
"""
- return self.get_referenced_note_handles()
+ return (self.get_referenced_note_handles() +
+ self.get_referenced_tag_handles())
def merge(self, acquisition):
"""
@@ -236,6 +241,7 @@ class Source(MediaBase, NoteBase, PrimaryObject):
self._merge_privacy(acquisition)
self._merge_note_list(acquisition)
self._merge_media_list(acquisition)
+ self._merge_tag_list(acquisition)
my_datamap = self.get_data_map()
acquisition_map = acquisition.get_data_map()
for key in acquisition.get_data_map():
diff --git a/gramps/gen/lib/srcmediatype.py b/gramps/gen/lib/srcmediatype.py
index 4d802497f..82b572808 100644
--- a/gramps/gen/lib/srcmediatype.py
+++ b/gramps/gen/lib/srcmediatype.py
@@ -28,7 +28,8 @@ SourceMedia types.
# Python modules
#
#-------------------------------------------------------------------------
-from ..ggettext import gettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/lib/styledtexttagtype.py b/gramps/gen/lib/styledtexttagtype.py
index ca813340c..f12bf7a47 100644
--- a/gramps/gen/lib/styledtexttagtype.py
+++ b/gramps/gen/lib/styledtexttagtype.py
@@ -27,7 +27,8 @@
# Python modules
#
#------------------------------------------------------------------------
-from ..ggettext import gettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/lib/surnamebase.py b/gramps/gen/lib/surnamebase.py
index 2c1c85665..abedac5f7 100644
--- a/gramps/gen/lib/surnamebase.py
+++ b/gramps/gen/lib/surnamebase.py
@@ -24,7 +24,8 @@
SurnameBase class for GRAMPS.
"""
-from ..ggettext import gettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/lib/tag.py b/gramps/gen/lib/tag.py
index 6f094c4b3..1054117be 100644
--- a/gramps/gen/lib/tag.py
+++ b/gramps/gen/lib/tag.py
@@ -30,6 +30,7 @@ Tag object for GRAMPS.
#
#-------------------------------------------------------------------------
from .tableobj import TableObject
+from .handle import Handle
#-------------------------------------------------------------------------
#
@@ -219,7 +220,7 @@ class Tag(TableObject):
:returns: Returns a struct containing the data of the object.
:rtype: dict
"""
- return {"handle": self.handle,
+ return {"handle": Handle("Tag", self.handle),
"name": self.__name,
"color": self.__color,
"priority": self.__priority,
diff --git a/gramps/gen/lib/tagbase.py b/gramps/gen/lib/tagbase.py
index e5af60e48..f4aef89ad 100644
--- a/gramps/gen/lib/tagbase.py
+++ b/gramps/gen/lib/tagbase.py
@@ -23,6 +23,9 @@
"""
TagBase class for Gramps.
"""
+
+from .handle import Handle
+
#-------------------------------------------------------------------------
#
# TagBase class
@@ -74,7 +77,7 @@ class TagBase(object):
:returns: Returns a struct containing the data of the object.
:rtype: list
"""
- return self.tag_list
+ return [Handle('Tag', t) for t in self.tag_list]
def unserialize(self, data):
"""
diff --git a/gramps/gen/lib/urltype.py b/gramps/gen/lib/urltype.py
index e9fa17ea5..e81268ed3 100644
--- a/gramps/gen/lib/urltype.py
+++ b/gramps/gen/lib/urltype.py
@@ -29,7 +29,8 @@ URL types
# Python modules
#
#-------------------------------------------------------------------------
-from ..ggettext import gettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/merge/diff.py b/gramps/gen/merge/diff.py
index 46541baa2..84e010269 100644
--- a/gramps/gen/merge/diff.py
+++ b/gramps/gen/merge/diff.py
@@ -23,7 +23,6 @@
"""
This package implements an object difference engine.
"""
-from __future__ import print_function
import os
@@ -32,12 +31,14 @@ from ..dbstate import DbState
from gramps.cli.grampscli import CLIManager
from ..plug import BasePluginManager
from ..db.dictionary import DictionaryDb
+from gramps.gen.lib.handle import Handle
-def import_as_dict(filename):
+def import_as_dict(filename, user=None):
"""
Import the filename into a DictionaryDb and return it.
"""
- user = User()
+ if user is None:
+ user = User()
db = DictionaryDb()
dbstate = DbState()
climanager = CLIManager(dbstate, False) # do not load db_loader
@@ -54,9 +55,9 @@ def import_as_dict(filename):
name, error_tuple, pdata = item
# (filename, (exception-type, exception, traceback), pdata)
etype, exception, traceback = error_tuple
- print("ERROR:", name, exception)
+ #print("ERROR:", name, exception)
return False
- retval = import_function = getattr(mod, pdata.import_function)
+ import_function = getattr(mod, pdata.import_function)
import_function(db, filename, user)
return db
return None
@@ -65,8 +66,8 @@ def diff_dates(json1, json2):
"""
Compare two json date objects. Returns True if different.
"""
- if json1 == json2:
- return False
+ if json1 == json2: # if same, then Not Different
+ return False # else, they still might be Not Different
elif isinstance(json1, dict) and isinstance(json2, dict):
if json1["dateval"] == json2["dateval"] and json2["dateval"] != 0:
return False
@@ -83,43 +84,43 @@ def diff_items(path, json1, json2):
"""
if json1 == json2:
return False
+ elif isinstance(json1, Handle) and isinstance(json2, Handle):
+ return not (json1.classname == json2.classname and
+ json1.handle == json2.handle)
+ elif isinstance(json1, list) and isinstance(json2, list):
+ if len(json1) != len(json2):
+ return True
+ else:
+ pos = 0
+ for v1, v2 in zip(json1, json2):
+ result = diff_items(path + ("[%d]" % pos), v1, v2)
+ if result:
+ return True
+ pos += 1
+ return False
elif isinstance(json1, dict) and isinstance(json2, dict):
- retval = False
for key in json1.keys():
if key == "change":
continue # don't care about time differences, only data changes
elif key == "date":
result = diff_dates(json1["date"], json2["date"])
if result:
- retval = result
+ #print("different dates", path)
+ #print(" old:", json1["date"])
+ #print(" new:", json2["date"])
+ return True
else:
- value1 = json1[key]
- value2 = json2[key]
- if isinstance(value1, dict) and isinstance(value2, dict):
- result = diff_items(path + "." + key, value1, value2)
- if result:
- retval = True
- elif isinstance(value1, list) and isinstance(value2, list):
- pos = 0
- for v1, v2 in zip(value1, value2):
- result = diff_items(path + "." + key + ("[%d]" % pos),
- v1, v2)
- if result:
- retval = True
- pos += 1
- elif value1 != value2:
- print("different parts", path + "." + key)
- print(" old:", value1)
- print(" new:", value2)
- retval = True
- return retval
+ result = diff_items(path + "." + key, json1[key], json2[key])
+ if result:
+ return True
+ return False
else:
- print("different values", path)
- print(" old:", json1)
- print(" new:", json2)
+ #print("different values", path)
+ #print(" old:", json1)
+ #print(" new:", json2)
return True
-def diff_dbs(db1, db2):
+def diff_dbs(db1, db2, user=None):
"""
1. new objects => mark for insert
2. deleted objects, no change locally after delete date => mark
@@ -129,11 +130,16 @@ def diff_dbs(db1, db2):
4. updated objects => do a diff on differences, mark origin
values as new data
"""
+ if user is None:
+ user = User()
missing_from_old = []
missing_from_new = []
diffs = []
+ user.begin_progress(_('Family Tree Differences'),
+ _('Searching...'), 10)
for item in ['Person', 'Family', 'Source', 'Citation', 'Event', 'Media',
'Place', 'Repository', 'Note', 'Tag']:
+ user.step_progress()
handles1 = sorted(db1._tables[item]["handles_func"]())
handles2 = sorted(db2._tables[item]["handles_func"]())
p1 = 0
@@ -164,12 +170,15 @@ def diff_dbs(db1, db2):
item2 = db2._tables[item]["handle_func"](handles2[p2])
missing_from_old += [(item, item2)]
p2 += 1
+ user.end_progress()
return diffs, missing_from_old, missing_from_new
-def diff_db_to_file(old_db, filename):
+def diff_db_to_file(old_db, filename, user=None):
+ if user is None:
+ user = User()
# First, get data as a DictionaryDb
- new_db = import_as_dict(filename)
+ new_db = import_as_dict(filename, user, user)
# Next get differences:
- diffs, m_old, m_new = diff_dbs(old_db, new_db)
+ diffs, m_old, m_new = diff_dbs(old_db, new_db, user)
return diffs, m_old, m_new
diff --git a/gramps/gen/merge/mergecitationquery.py b/gramps/gen/merge/mergecitationquery.py
index b5158245d..9148fe972 100644
--- a/gramps/gen/merge/mergecitationquery.py
+++ b/gramps/gen/merge/mergecitationquery.py
@@ -32,7 +32,8 @@ Provide merge capabilities for citations.
#-------------------------------------------------------------------------
from ..lib import (Person, Family, Event, Place, MediaObject, Repository)
from ..db import DbTxn
-from ..ggettext import sgettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from ..errors import MergeError
#-------------------------------------------------------------------------
diff --git a/gramps/gen/merge/mergeeventquery.py b/gramps/gen/merge/mergeeventquery.py
index fb86da3c5..a501fde70 100644
--- a/gramps/gen/merge/mergeeventquery.py
+++ b/gramps/gen/merge/mergeeventquery.py
@@ -31,7 +31,8 @@ Provide merge capabilities for events.
#-------------------------------------------------------------------------
from ..lib import Person, Family
from ..db import DbTxn
-from ..ggettext import sgettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from ..errors import MergeError
#-------------------------------------------------------------------------
diff --git a/gramps/gen/merge/mergefamilyquery.py b/gramps/gen/merge/mergefamilyquery.py
index b27212dce..28fb05161 100644
--- a/gramps/gen/merge/mergefamilyquery.py
+++ b/gramps/gen/merge/mergefamilyquery.py
@@ -30,7 +30,8 @@ Provide merge capabilities for families.
#
#-------------------------------------------------------------------------
from ..db import DbTxn
-from ..ggettext import sgettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from ..errors import MergeError
from . import MergePersonQuery
diff --git a/gramps/gen/merge/mergemediaquery.py b/gramps/gen/merge/mergemediaquery.py
index d021a1c64..2ecb95872 100644
--- a/gramps/gen/merge/mergemediaquery.py
+++ b/gramps/gen/merge/mergemediaquery.py
@@ -31,7 +31,8 @@ Provide merge capabilities for media objects.
#-------------------------------------------------------------------------
from ..lib import Person, Family, Event, Source, Citation, Place
from ..db import DbTxn
-from ..ggettext import sgettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from ..errors import MergeError
#-------------------------------------------------------------------------
diff --git a/gramps/gen/merge/mergenotequery.py b/gramps/gen/merge/mergenotequery.py
index ddb6f1228..a8edc9cb5 100644
--- a/gramps/gen/merge/mergenotequery.py
+++ b/gramps/gen/merge/mergenotequery.py
@@ -32,7 +32,8 @@ Provide merge capabilities for notes.
from ..lib import (Person, Family, Event, Place, Source, Citation, Repository,
MediaObject)
from ..db import DbTxn
-from ..ggettext import sgettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from ..errors import MergeError
#-------------------------------------------------------------------------
diff --git a/gramps/gen/merge/mergepersonquery.py b/gramps/gen/merge/mergepersonquery.py
index e05d6f812..8cff0a20a 100644
--- a/gramps/gen/merge/mergepersonquery.py
+++ b/gramps/gen/merge/mergepersonquery.py
@@ -32,7 +32,8 @@ Provide merge capabilities for persons.
#
#-------------------------------------------------------------------------
from ..db import DbTxn
-from ..ggettext import sgettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from ..errors import MergeError
#-------------------------------------------------------------------------
diff --git a/gramps/gen/merge/mergeplacequery.py b/gramps/gen/merge/mergeplacequery.py
index 4a115dab0..a79480c74 100644
--- a/gramps/gen/merge/mergeplacequery.py
+++ b/gramps/gen/merge/mergeplacequery.py
@@ -32,7 +32,8 @@ Provide merge capabilities for places.
#-------------------------------------------------------------------------
from ..lib import Person, Family, Event
from ..db import DbTxn
-from ..ggettext import sgettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from ..errors import MergeError
#-------------------------------------------------------------------------
diff --git a/gramps/gen/merge/mergerepositoryquery.py b/gramps/gen/merge/mergerepositoryquery.py
index 3e9b47cb4..d99ca3ce7 100644
--- a/gramps/gen/merge/mergerepositoryquery.py
+++ b/gramps/gen/merge/mergerepositoryquery.py
@@ -31,7 +31,8 @@ Provide merge capabilities for repositories.
#-------------------------------------------------------------------------
from ..lib import Source
from ..db import DbTxn
-from ..ggettext import sgettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from ..errors import MergeError
#-------------------------------------------------------------------------
diff --git a/gramps/gen/merge/mergesourcequery.py b/gramps/gen/merge/mergesourcequery.py
index 200a6ae88..bacb0fc53 100644
--- a/gramps/gen/merge/mergesourcequery.py
+++ b/gramps/gen/merge/mergesourcequery.py
@@ -34,7 +34,8 @@ Provide merge capabilities for sources.
from ..lib import (Person, Family, Event, Place, Source, Repository,
MediaObject, Citation)
from ..db import DbTxn
-from ..ggettext import sgettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from ..errors import MergeError
#-------------------------------------------------------------------------
diff --git a/gramps/gen/merge/test/merge_ref_test.py b/gramps/gen/merge/test/merge_ref_test.py
index 86fc729e5..0a974bfc1 100644
--- a/gramps/gen/merge/test/merge_ref_test.py
+++ b/gramps/gen/merge/test/merge_ref_test.py
@@ -39,7 +39,8 @@ import libxslt
from libgrampsxml import GRAMPS_XML_VERSION
from ...const import ROOT_DIR, VERSION, USER_PLUGINS
from ...lib import Name, Surname
-from ...ggettext import sgettext as _
+from ...const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
class CopiedDoc(object):
"""Context manager that creates a deep copy of an libxml-xml document."""
diff --git a/gramps/gen/mime/__init__.py b/gramps/gen/mime/__init__.py
index a91368b7c..94aab1a0f 100644
--- a/gramps/gen/mime/__init__.py
+++ b/gramps/gen/mime/__init__.py
@@ -22,12 +22,9 @@
#
try:
- from ._gnomemime import get_description, get_type, mime_type_is_defined
+ from ._winmime import get_description, get_type, mime_type_is_defined
except:
- try:
- from ._winmime import get_description, get_type, mime_type_is_defined
- except:
- from ._pythonmime import get_description, get_type, mime_type_is_defined
+ from ._pythonmime import get_description, get_type, mime_type_is_defined
def base_type(val):
return val.split('/')[0]
diff --git a/gramps/gen/mime/_gnomemime.py b/gramps/gen/mime/_gnomemime.py
deleted file mode 100644
index 3e3040d5e..000000000
--- a/gramps/gen/mime/_gnomemime.py
+++ /dev/null
@@ -1,71 +0,0 @@
-#
-# Gramps - a GTK+/GNOME based genealogy program
-#
-# Copyright (C) 2000-2006 Donald N. Allingham
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-
-# $Id$
-
-from gi.repository import Gtk
-
-try:
- from gnomevfs import mime_get_short_list_applications, \
- mime_get_description, get_mime_type, mime_get_default_application
-except:
- from gnome.vfs import mime_get_short_list_applications, \
- mime_get_description, get_mime_type, mime_get_default_application
-
-from ..ggettext import gettext as _
-
-def get_description(type):
- """Return the description of the specified mime type."""
- try:
- return mime_get_description(type)
- except:
- return _("unknown")
-
-def get_type(file):
- """Return the mime type of the specified file."""
- try:
- return get_mime_type(file)
- except:
- return _('unknown')
-
-def mime_type_is_defined(type):
- """
- Return True if a description for a mime type exists.
- """
- try:
- mime_get_description(type)
- return True
- except:
- return False
-
- #-------------------------------------------------------------------------
-#
-# private functions
-#
-#-------------------------------------------------------------------------
-def _is_good_command(cmd):
- """
- We don't know what to do with certain substitution values.
- If we find one, skip the command.
- """
- for sub in [ "%m", "%i", "%c" ]:
- if cmd.find(sub) != -1:
- return False
- return True
diff --git a/gramps/gen/mime/_pythonmime.py b/gramps/gen/mime/_pythonmime.py
index a06ac353b..a91b8e3eb 100644
--- a/gramps/gen/mime/_pythonmime.py
+++ b/gramps/gen/mime/_pythonmime.py
@@ -22,7 +22,8 @@
#
import mimetypes
-from ..ggettext import gettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
_type_map = {
'application/x-gramps' : 'Gramps database',
diff --git a/gramps/gen/mime/_winmime.py b/gramps/gen/mime/_winmime.py
index bea477af1..eaa2cfc96 100644
--- a/gramps/gen/mime/_winmime.py
+++ b/gramps/gen/mime/_winmime.py
@@ -43,7 +43,8 @@ else:
#
#-------------------------------------------------------------------------
from . import _pythonmime
-from ..ggettext import gettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
def get_description(mime_type):
"""Return the description of the specfied mime type"""
diff --git a/gramps/gen/plug/_gramplet.py b/gramps/gen/plug/_gramplet.py
index f2c48eb82..51d0003ee 100644
--- a/gramps/gen/plug/_gramplet.py
+++ b/gramps/gen/plug/_gramplet.py
@@ -30,7 +30,8 @@ if config.get('preferences.use-bsddb3') or sys.version_info[0] >= 3:
else:
import bsddb
import types
-from ..ggettext import gettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import logging
LOG = logging.getLogger(".Gramplets")
@@ -368,7 +369,7 @@ class Gramplet(object):
"""
from gi.repository import GObject
self._pause = True
- if self._idle_id == 0:
+ if self._idle_id != 0:
GObject.source_remove(self._idle_id)
self._idle_id = 0
diff --git a/gramps/gen/plug/_manager.py b/gramps/gen/plug/_manager.py
index f97f816db..5f350da47 100644
--- a/gramps/gen/plug/_manager.py
+++ b/gramps/gen/plug/_manager.py
@@ -41,7 +41,8 @@ from __future__ import print_function
import os
import sys
import re
-from ..ggettext import gettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
@@ -231,7 +232,7 @@ class BasePluginManager(object):
return _module
except:
import traceback
- print(traceback.print_exc())
+ traceback.print_exc()
self.__failmsg_list.append((filename, sys.exc_info(), pdata))
return None
@@ -314,11 +315,13 @@ class BasePluginManager(object):
Reloads modules that might not be in the path.
"""
try:
- if sys.version_info[0] < 3:
- reload(module)
- else:
- import imp
- imp.reload(module)
+ import imp
+ fp, pathname, description = imp.find_module(pdata.mod_name, [pdata.fpath])
+ try:
+ module = imp.load_module(pdata.mod_name, fp, pathname,description)
+ finally:
+ if fp:
+ fp.close()
except:
if pdata.mod_name in sys.modules:
del sys.modules[pdata.mod_name]
diff --git a/gramps/gen/plug/_options.py b/gramps/gen/plug/_options.py
index c7c5f4667..c04810698 100644
--- a/gramps/gen/plug/_options.py
+++ b/gramps/gen/plug/_options.py
@@ -58,7 +58,8 @@ from ..utils.cast import get_type_converter
from .menu import Menu
from ..plug import BasePluginManager
PLUGMAN = BasePluginManager.get_instance()
-
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
# List of options for a single module
diff --git a/gramps/gen/plug/_pluginreg.py b/gramps/gen/plug/_pluginreg.py
index 450465899..bb7d2fabb 100644
--- a/gramps/gen/plug/_pluginreg.py
+++ b/gramps/gen/plug/_pluginreg.py
@@ -36,6 +36,7 @@ import os
import sys
import re
import traceback
+import io
#-------------------------------------------------------------------------
#
@@ -44,8 +45,8 @@ import traceback
#-------------------------------------------------------------------------
from ..const import VERSION as GRAMPSVERSION, VERSION_TUPLE
from ..const import IMAGE_DIR
-from ..utils.trans import get_addon_translator
-from ..ggettext import gettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from ..constfunc import STRTYPE
#-------------------------------------------------------------------------
@@ -836,8 +837,9 @@ class PluginData(object):
def _set_gramplet_title(self, gramplet_title):
if not self._ptype == GRAMPLET:
raise ValueError('gramplet_title may only be set for GRAMPLET plugins')
- if not isinstance(gramplet_title, str):
- raise ValueError('Plugin must have a string as gramplet_title')
+ if not (sys.version_info[0] < 3 and isinstance(gramplet_title, unicode)
+ or isinstance(gramplet_title, str)):
+ raise ValueError('gramplet_title is type %s, string or unicode required' % type(gramplet_title))
self._gramplet_title = gramplet_title
def _get_gramplet_title(self):
@@ -1090,13 +1092,17 @@ class PluginRegister(object):
lenpd = len(self.__plugindata)
full_filename = os.path.join(dir, filename)
if sys.version_info[0] < 3:
- full_filename = full_filename.encode(sys.getfilesystemencoding())
- local_gettext = get_addon_translator(full_filename).gettext
+ full_filename = full_filename.encode(glocale.getfilesystemencoding())
+ fd = open(full_filename, "r")
+ else:
+ fd = io.open(full_filename, 'r', encoding = 'utf-8')
+ stream = fd.read()
+ fd.close()
+ local_gettext = glocale.get_addon_translator(full_filename).gettext
try:
#execfile(full_filename,
- exec(compile(open(full_filename).read(), full_filename, 'exec'),
- make_environment(_=local_gettext),
- {})
+ exec (compile(stream, full_filename, 'exec'),
+ make_environment(_=local_gettext), {})
except ValueError as msg:
print(_('ERROR: Failed reading plugin registration %(filename)s') % \
{'filename' : filename})
diff --git a/gramps/gen/plug/docbackend/docbackend.py b/gramps/gen/plug/docbackend/docbackend.py
index a93136f1c..00b626c2b 100644
--- a/gramps/gen/plug/docbackend/docbackend.py
+++ b/gramps/gen/plug/docbackend/docbackend.py
@@ -30,7 +30,8 @@
#------------------------------------------------------------------------
from __future__ import print_function
-from ...ggettext import gettext as _
+from ...const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/plug/docgen/graphdoc.py b/gramps/gen/plug/docgen/graphdoc.py
index bcf616a92..55361a5bd 100644
--- a/gramps/gen/plug/docgen/graphdoc.py
+++ b/gramps/gen/plug/docgen/graphdoc.py
@@ -37,7 +37,7 @@ import sys
if sys.version_info[0] < 3:
from StringIO import StringIO
else:
- from io import StringIO
+ from io import BytesIO
import tempfile
from subprocess import Popen, PIPE
import sys
@@ -47,7 +47,8 @@ import sys
# GRAMPS modules
#
#-------------------------------------------------------------------------------
-from ...ggettext import gettext as _
+from ...const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from ...utils.file import search_for
from . import BaseDoc
from ..menu import NumberOption, TextOption, EnumeratedListOption, \
@@ -369,7 +370,10 @@ class GVDocBase(BaseDoc, GVDoc):
BaseDoc.__init__(self, None, paper_style)
self._filename = None
- self._dot = StringIO()
+ if sys.version_info[0] < 3:
+ self._dot = StringIO()
+ else:
+ self._dot = BytesIO()
self._paper = paper_style
get_option_by_name = options.menu.get_option_by_name
@@ -595,7 +599,10 @@ class GVDotDoc(GVDocBase):
if self._filename[-3:] != ".gv":
self._filename += ".gv"
- dotfile = open(self._filename, "w")
+ if sys.version_info[0] < 3:
+ dotfile = open(self._filename, "w")
+ else:
+ dotfile = open(self._filename, "wb")
dotfile.write(self._dot.getvalue())
dotfile.close()
@@ -630,7 +637,10 @@ class GVPsDoc(GVDocBase):
# Create a temporary dot file
(handle, tmp_dot) = tempfile.mkstemp(".gv" )
- dotfile = os.fdopen(handle,"w")
+ if sys.version_info[0] < 3:
+ dotfile = os.fdopen(handle, "w")
+ else:
+ dotfile = os.fdopen(handle, "wb")
dotfile.write(self._dot.getvalue())
dotfile.close()
@@ -647,10 +657,13 @@ class GVPsDoc(GVDocBase):
# See bug tracker issue 2815
# :cairo does not work with Graphviz 2.26.3 and later See issue 4164
# Covert filename to str using file system encoding.
- fname = self._filename.encode(sys.getfilesystemencoding())
+ if sys.version_info[0] < 3:
+ fname = self._filename.encode(glocale.getfilesystemencoding())
+ else:
+ fname = self._filename
command = 'dot -Tps:cairo -o"%s" "%s"' % (fname, tmp_dot)
- dotversion = Popen(['dot', '-V'], stderr=PIPE).communicate(input=None)[1]
+ dotversion = str(Popen(['dot', '-V'], stderr=PIPE).communicate(input=None)[1])
# Problem with dot 2.26.3 and later and multiple pages, which gives "cairo: out of
# memory" If the :cairo is skipped for these cases it gives acceptable
# result.
@@ -685,11 +698,17 @@ class GVSvgDoc(GVDocBase):
# Create a temporary dot file
(handle, tmp_dot) = tempfile.mkstemp(".gv" )
- dotfile = os.fdopen(handle,"w")
+ if sys.version_info[0] < 3:
+ dotfile = os.fdopen(handle, "w")
+ else:
+ dotfile = os.fdopen(handle, "wb")
dotfile.write(self._dot.getvalue())
dotfile.close()
# Covert filename to str using file system encoding.
- fname = self._filename.encode(sys.getfilesystemencoding())
+ if sys.version_info[0] < 3:
+ fname = self._filename.encode(glocale.getfilesystemencoding())
+ else:
+ fname = self._filename
# Generate the SVG file.
os.system( 'dot -Tsvg -o"%s" "%s"' % (fname, tmp_dot) )
@@ -722,11 +741,17 @@ class GVSvgzDoc(GVDocBase):
# Create a temporary dot file
(handle, tmp_dot) = tempfile.mkstemp(".gv" )
- dotfile = os.fdopen(handle,"w")
+ if sys.version_info[0] < 3:
+ dotfile = os.fdopen(handle, "w")
+ else:
+ dotfile = os.fdopen(handle, "wb")
dotfile.write(self._dot.getvalue())
dotfile.close()
# Covert filename to str using file system encoding.
- fname = self._filename.encode(sys.getfilesystemencoding())
+ if sys.version_info[0] < 3:
+ fname = self._filename.encode(glocale.getfilesystemencoding())
+ else:
+ fname = self._filename
# Generate the SVGZ file.
os.system( 'dot -Tsvgz -o"%s" "%s"' % (fname, tmp_dot) )
@@ -759,11 +784,17 @@ class GVPngDoc(GVDocBase):
# Create a temporary dot file
(handle, tmp_dot) = tempfile.mkstemp(".gv" )
- dotfile = os.fdopen(handle,"w")
+ if sys.version_info[0] < 3:
+ dotfile = os.fdopen(handle, "w")
+ else:
+ dotfile = os.fdopen(handle, "wb")
dotfile.write(self._dot.getvalue())
dotfile.close()
# Covert filename to str using file system encoding.
- fname = self._filename.encode(sys.getfilesystemencoding())
+ if sys.version_info[0] < 3:
+ fname = self._filename.encode(glocale.getfilesystemencoding())
+ else:
+ fname = self._filename
# Generate the PNG file.
os.system( 'dot -Tpng -o"%s" "%s"' % (fname, tmp_dot) )
@@ -796,11 +827,17 @@ class GVJpegDoc(GVDocBase):
# Create a temporary dot file
(handle, tmp_dot) = tempfile.mkstemp(".gv" )
- dotfile = os.fdopen(handle,"w")
+ if sys.version_info[0] < 3:
+ dotfile = os.fdopen(handle, "w")
+ else:
+ dotfile = os.fdopen(handle, "wb")
dotfile.write(self._dot.getvalue())
dotfile.close()
# Covert filename to str using file system encoding.
- fname = self._filename.encode(sys.getfilesystemencoding())
+ if sys.version_info[0] < 3:
+ fname = self._filename.encode(glocale.getfilesystemencoding())
+ else:
+ fname = self._filename
# Generate the JPEG file.
os.system( 'dot -Tjpg -o"%s" "%s"' % (fname, tmp_dot) )
@@ -833,11 +870,17 @@ class GVGifDoc(GVDocBase):
# Create a temporary dot file
(handle, tmp_dot) = tempfile.mkstemp(".gv" )
- dotfile = os.fdopen(handle,"w")
+ if sys.version_info[0] < 3:
+ dotfile = os.fdopen(handle, "w")
+ else:
+ dotfile = os.fdopen(handle, "wb")
dotfile.write(self._dot.getvalue())
dotfile.close()
# Covert filename to str using file system encoding.
- fname = self._filename.encode(sys.getfilesystemencoding())
+ if sys.version_info[0] < 3:
+ fname = self._filename.encode(glocale.getfilesystemencoding())
+ else:
+ fname = self._filename
# Generate the GIF file.
os.system( 'dot -Tgif -o"%s" "%s"' % (fname, tmp_dot) )
@@ -873,11 +916,17 @@ class GVPdfGvDoc(GVDocBase):
# Create a temporary dot file
(handle, tmp_dot) = tempfile.mkstemp(".gv" )
- dotfile = os.fdopen(handle,"w")
+ if sys.version_info[0] < 3:
+ dotfile = os.fdopen(handle, "w")
+ else:
+ dotfile = os.fdopen(handle, "wb")
dotfile.write(self._dot.getvalue())
dotfile.close()
- # Covert filename to str using file system encoding.
- fname = self._filename.encode(sys.getfilesystemencoding())
+ # Convert filename to str using file system encoding.
+ if sys.version_info[0] < 3:
+ fname = self._filename.encode(glocale.getfilesystemencoding())
+ else:
+ fname = self._filename
# Generate the PDF file.
os.system( 'dot -Tpdf -o"%s" "%s"' % (fname, tmp_dot) )
@@ -908,7 +957,10 @@ class GVPdfGsDoc(GVDocBase):
# Create a temporary dot file
(handle, tmp_dot) = tempfile.mkstemp(".gv" )
- dotfile = os.fdopen(handle,"w")
+ if sys.version_info[0] < 3:
+ dotfile = os.fdopen(handle, "w")
+ else:
+ dotfile = os.fdopen(handle, "wb")
dotfile.write(self._dot.getvalue())
dotfile.close()
@@ -922,7 +974,7 @@ class GVPdfGsDoc(GVDocBase):
# :cairo does not work with Graphviz 2.26.3 and later See issue 4164
command = 'dot -Tps:cairo -o"%s" "%s"' % ( tmp_ps, tmp_dot )
- dotversion = Popen(['dot', '-V'], stderr=PIPE).communicate(input=None)[1]
+ dotversion = str(Popen(['dot', '-V'], stderr=PIPE).communicate(input=None)[1])
# Problem with dot 2.26.3 and later and multiple pages, which gives "cairo: out
# of memory". If the :cairo is skipped for these cases it gives
# acceptable result.
@@ -936,7 +988,10 @@ class GVPdfGsDoc(GVDocBase):
height_pt = int( (paper_size.get_height_inches() * 72) + 0.5 )
# Convert to PDF using ghostscript
- fname = self._filename.encode(sys.getfilesystemencoding())
+ if sys.version_info[0] < 3:
+ fname = self._filename.encode(glocale.getfilesystemencoding())
+ else:
+ fname = self._filename
command = '%s -q -sDEVICE=pdfwrite -dNOPAUSE -dDEVICEWIDTHPOINTS=%d' \
' -dDEVICEHEIGHTPOINTS=%d -sOutputFile="%s" "%s" -c quit' \
% ( _GS_CMD, width_pt, height_pt, fname, tmp_ps )
diff --git a/gramps/gen/plug/report/_bibliography.py b/gramps/gen/plug/report/_bibliography.py
index 981e66d56..da3d7dabe 100644
--- a/gramps/gen/plug/report/_bibliography.py
+++ b/gramps/gen/plug/report/_bibliography.py
@@ -109,7 +109,8 @@ class Bibliography(object):
MODE_PAGE = 2**1
MODE_CONF = 2**2
MODE_NOTE = 2**3
- MODE_ALL = MODE_DATE | MODE_PAGE | MODE_CONF | MODE_NOTE
+ MODE_MEDIA = 2**4
+ MODE_ALL = MODE_DATE | MODE_PAGE | MODE_CONF | MODE_NOTE | MODE_MEDIA
def __init__(self, mode=MODE_ALL):
"""
@@ -123,6 +124,7 @@ class Bibliography(object):
MODE_PAGE
MODE_CONF
MODE_NOTE
+ MODE_MEDIA
MODE_ALL
If you only care about pages, set "mode=MODE_PAGE".
@@ -218,6 +220,9 @@ class Bibliography(object):
if ( self.mode & self.MODE_NOTE ) == self.MODE_NOTE:
if len(source_ref.get_note_list()) != 0:
return True
+ if ( self.mode & self.MODE_MEDIA ) == self.MODE_MEDIA:
+ if len(source_ref.get_media_list()) != 0:
+ return True
# Can't find anything interesting.
return False
@@ -258,5 +263,13 @@ class Bibliography(object):
for notehandle in nl1:
if notehandle not in nl2:
return False
+ if ( self.mode & self.MODE_MEDIA ) == self.MODE_MEDIA:
+ nl1 = source_ref1.get_media_list()
+ nl2 = source_ref2.get_media_list()
+ if len(nl1) != len(nl2):
+ return False
+ for mediahandle in nl1:
+ if mediahandle not in nl2:
+ return False
# Can't find anything different. They must be equal.
return True
diff --git a/gramps/gen/plug/report/_book.py b/gramps/gen/plug/report/_book.py
index 74620eca2..bbc798e00 100644
--- a/gramps/gen/plug/report/_book.py
+++ b/gramps/gen/plug/report/_book.py
@@ -31,7 +31,8 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
-from ...ggettext import gettext as _
+from ...const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#------------------------------------------------------------------------
#
@@ -448,11 +449,11 @@ class BookParser(handler.ContentHandler):
# Functions
#
#-------------------------------------------------------------------------
-def create_style_sheet(item):
+def create_style_sheet(item, previous_style=None):
"""
- Create a style sheet for a book item.
+ Create a style sheet for a book item, appending any previous_style.
"""
- selected_style = StyleSheet()
+ selected_style = StyleSheet(previous_style)
handler = item.option_class.handler
diff --git a/gramps/gen/plug/report/_constants.py b/gramps/gen/plug/report/_constants.py
index f822f6720..cabb171d4 100644
--- a/gramps/gen/plug/report/_constants.py
+++ b/gramps/gen/plug/report/_constants.py
@@ -29,7 +29,8 @@
# standard python modules
#
#-------------------------------------------------------------------------
-from ...ggettext import gettext as _
+from ...const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import os
#-------------------------------------------------------------------------
@@ -43,14 +44,13 @@ from .. import (CATEGORY_TEXT, CATEGORY_DRAW, CATEGORY_CODE, CATEGORY_WEB,
CATEGORY_BOOK, CATEGORY_GRAPHVIZ)
standalone_categories = {
- CATEGORY_TEXT : _("Text Reports"),
- CATEGORY_DRAW : _("Graphical Reports"),
- CATEGORY_CODE : _("Code Generators"),
- CATEGORY_WEB : _("Web Pages"),
- CATEGORY_BOOK : _("Books"),
- CATEGORY_GRAPHVIZ : _("Graphs"),
+ CATEGORY_TEXT : ("RepText", _("Text Reports")),
+ CATEGORY_DRAW : ("RepGraph", _("Graphical Reports")),
+ CATEGORY_CODE : ("RepCode", _("Code Generators")),
+ CATEGORY_WEB : ("RepWeb", _("Web Pages")),
+ CATEGORY_BOOK : ("RepBook", _("Books")),
+ CATEGORY_GRAPHVIZ : ("Graphs", _("Graphs")),
}
-
book_categories = {
CATEGORY_TEXT : _("Text"),
CATEGORY_DRAW : _("Graphics"),
diff --git a/gramps/gen/plug/report/_options.py b/gramps/gen/plug/report/_options.py
index be084cb40..7f13996f0 100644
--- a/gramps/gen/plug/report/_options.py
+++ b/gramps/gen/plug/report/_options.py
@@ -908,7 +908,7 @@ class DocOptionHandler(_options.OptionHandler):
# First we set options_dict values based on the saved options
options = self.saved_option_list.get_options()
docgen_names = self.option_list_collection.docgen_names
- for option_name, option_data in options.iteritems():
+ for option_name, option_data in options.items():
if ( option_name in self.options_dict and
isinstance(option_data, list) and
option_data and
diff --git a/gramps/gen/plug/report/_paper.py b/gramps/gen/plug/report/_paper.py
index 5513674fb..b9ae07f82 100644
--- a/gramps/gen/plug/report/_paper.py
+++ b/gramps/gen/plug/report/_paper.py
@@ -26,7 +26,8 @@
# Python modules
#
#-------------------------------------------------------------------------
-from ...ggettext import sgettext as _
+from ...const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/plug/report/endnotes.py b/gramps/gen/plug/report/endnotes.py
index 692fe97f3..524bdcda9 100644
--- a/gramps/gen/plug/report/endnotes.py
+++ b/gramps/gen/plug/report/endnotes.py
@@ -28,7 +28,8 @@ Provide utilities for printing endnotes in text reports.
"""
from ..docgen import FontStyle, ParagraphStyle, FONT_SANS_SERIF
from ...lib import NoteType, Citation
-from ...ggettext import gettext as _
+from ...const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from ...utils.string import confidence
from ...datehandler import displayer
diff --git a/gramps/gen/plug/report/utils.py b/gramps/gen/plug/report/utils.py
index 8b6ba4fd4..f711f403e 100644
--- a/gramps/gen/plug/report/utils.py
+++ b/gramps/gen/plug/report/utils.py
@@ -34,7 +34,8 @@ A collection of utilities to aid in the generation of reports.
#
#-------------------------------------------------------------------------
import os
-from ...ggettext import gettext as _
+from ...const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#------------------------------------------------------------------------
#
diff --git a/gramps/gen/plug/utils.py b/gramps/gen/plug/utils.py
index 7a352155d..0e8ca6b47 100644
--- a/gramps/gen/plug/utils.py
+++ b/gramps/gen/plug/utils.py
@@ -35,7 +35,7 @@ import os
if sys.version_info[0] < 3:
from StringIO import StringIO
else:
- from io import StringIO
+ from io import StringIO, BytesIO
#-------------------------------------------------------------------------
#
@@ -45,7 +45,8 @@ else:
from ._pluginreg import make_environment
from ..const import USER_PLUGINS, VERSION_TUPLE
from ..utils.file import get_unicode_path_from_file_chooser
-from ..ggettext import gettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
@@ -219,7 +220,11 @@ def load_addon_file(path, callback=None):
callback(_("Unable to open '%s'") % path)
return
try:
- buffer = StringIO(fp.read())
+ content = fp.read()
+ if sys.version_info[0] < 3:
+ buffer = StringIO(content)
+ else:
+ buffer = BytesIO(content)
except:
if callback:
callback(_("Error in reading '%s'") % path)
diff --git a/gramps/gen/proxy/private.py b/gramps/gen/proxy/private.py
index 1a204d48f..5b2e5df6e 100644
--- a/gramps/gen/proxy/private.py
+++ b/gramps/gen/proxy/private.py
@@ -31,7 +31,8 @@ Proxy class for the GRAMPS databases. Filter out all data marked private.
# Python libraries
#
#-------------------------------------------------------------------------
-from ..ggettext import gettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import logging
LOG = logging.getLogger(".citation")
diff --git a/gramps/gen/recentfiles.py b/gramps/gen/recentfiles.py
index 19f1d5f25..4be2a8754 100644
--- a/gramps/gen/recentfiles.py
+++ b/gramps/gen/recentfiles.py
@@ -29,6 +29,9 @@
#-------------------------------------------------------------------------
import os
import time
+import io
+import sys
+import logging
from xml.parsers.expat import ParserCreate
try:
@@ -181,7 +184,8 @@ class RecentFiles(object):
"""
Saves the current GRAMPS RecentFiles collection to the associated file.
"""
- xml_file = file(os.path.expanduser(GRAMPS_FILENAME),'w')
+ xml_file = open(os.path.expanduser(GRAMPS_FILENAME),'w')
+
if use_lock:
fcntl.lockf(xml_file,fcntl.LOCK_EX)
xml_file.write("\n")
@@ -214,8 +218,14 @@ class RecentParser(object):
def __init__(self):
self.recent_files = []
+#Python3's expat wants bytes, Python2's wants a string.
+ xml_file = None
try:
- xml_file = open(os.path.expanduser(GRAMPS_FILENAME))
+ if sys.version_info[0] < 3:
+ xml_file = open(os.path.expanduser(GRAMPS_FILENAME), "r")
+ else:
+ xml_file = open(os.path.expanduser(GRAMPS_FILENAME), "rb")
+
if use_lock:
fcntl.lockf(xml_file,fcntl.LOCK_SH)
@@ -228,8 +238,13 @@ class RecentParser(object):
if use_lock:
fcntl.lockf(xml_file,fcntl.LOCK_UN)
xml_file.close()
- except:
- pass
+ except IOError as err:
+ logging.warning("Unable to open recent file %s because %s",
+ os.path.expanduser(GRAMPS_FILENAME), str(err))
+ except Exception as err:
+ logging.error("Recent file parse error %s", str(err))
+ if xml_file:
+ xml_file.close()
def get(self):
return self.recent_files
diff --git a/gramps/gen/relationship.py b/gramps/gen/relationship.py
index 0debae95c..b3fa2218c 100644
--- a/gramps/gen/relationship.py
+++ b/gramps/gen/relationship.py
@@ -30,6 +30,9 @@ Classes for relationships.
from __future__ import print_function
import os
+import logging
+LOG = logging.getLogger("gen.relationship")
+LOG.addHandler(logging.StreamHandler())
#-------------------------------------------------------------------------
#
@@ -41,9 +44,9 @@ from .lib import Person, ChildRefType, EventType, FamilyRelType
MALE = Person.MALE
FEMALE = Person.FEMALE
UNKNOWN = Person.UNKNOWN
-from .ggettext import sgettext as _
+from .const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from .plug import PluginRegister, BasePluginManager
-
#-------------------------------------------------------------------------
#
#
@@ -1015,7 +1018,7 @@ class RelationshipCalculator(object):
pmap, depth, stoprecursemap)
except:
import traceback
- print(traceback.print_exc())
+ traceback.print_exc()
return
def collapse_relations(self, relations):
@@ -1791,49 +1794,15 @@ def get_relationship_calculator(reinit=False):
global __RELCALC_CLASS
if __RELCALC_CLASS is None or reinit:
- lang = ' '
- try:
- lang = os.environ["LANG"]
- lang_set = True
- except:
- # if LANG is not set
- import locale
- lang = locale.getlocale()[0]
- if not lang:
- # if lang is empty/None
- lang = locale.getdefaultlocale()[0]
- lang_set = False
+ lang = glocale.get_translation().language()
__RELCALC_CLASS = RelationshipCalculator
# If lang not set default to English relationship calulator
- if not lang:
- return __RELCALC_CLASS()
# See if lang begins with en_, English_ or english_
# If so return standard relationship calculator.
- enlang = lang.split('_')[0].lower()
- if enlang in ('en', 'english', 'c'):
+ if lang.startswith("en"):
return __RELCALC_CLASS()
- # set correct non English relationship calculator based on LANG
- # or on locale.getlocale() or if that fails locale.getdeafultlocale()
+ # set correct non English relationship calculator based on lang
relation_translation_found = False
- for plugin in PluginRegister.get_instance().relcalc_plugins():
- if lang in plugin.lang_list:
- pmgr = BasePluginManager.get_instance()
- # the loaded module is put in variable mod
- mod = pmgr.load_plugin(plugin)
- if mod:
- __RELCALC_CLASS = eval('mod.' + plugin.relcalcclass)
- relation_translation_found = True
- break
- if not relation_translation_found:
- # LANG set but with non recognizable language info. Try getlocale
- import locale
- lang = locale.getlocale()[0]
- if not lang:
- # if lang is empty/None
- try:
- lang = locale.getdefaultlocale()[0]
- except:
- pass
for plugin in PluginRegister.get_instance().relcalc_plugins():
if lang in plugin.lang_list:
pmgr = BasePluginManager.get_instance()
@@ -1845,8 +1814,8 @@ def get_relationship_calculator(reinit=False):
break
if not relation_translation_found and \
len(PluginRegister.get_instance().relcalc_plugins()):
- print((("No translation available for language '%s'. " +
- "Using 'english' instead.") % enlang))
+ LOG.debug(_("No translation available for language '%s'. " +
+ "Using 'english' instead.") % lang)
return __RELCALC_CLASS()
#-------------------------------------------------------------------------
diff --git a/gramps/gen/simple/_simpleaccess.py b/gramps/gen/simple/_simpleaccess.py
index d26a0b4f4..7acb41a6b 100644
--- a/gramps/gen/simple/_simpleaccess.py
+++ b/gramps/gen/simple/_simpleaccess.py
@@ -28,7 +28,7 @@ Provide a simplified database access interface to the GRAMPS database.
from __future__ import with_statement, unicode_literals
from ..lib import (Person, Family, Event, Source, Place, Citation,
- MediaObject, Repository, Note, Date)
+ MediaObject, Repository, Note, Date, Tag)
from ..datehandler import displayer
from ..utils.string import gender as gender_map
from ..utils.db import get_birth_or_fallback, get_death_or_fallback
@@ -37,7 +37,8 @@ from ..plug.report.utils import place_name
from ..display.name import displayer as name_displayer
from ..lib import EventType
from ..config import config
-from ..ggettext import gettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from ..constfunc import STRTYPE
#-------------------------------------------------------------------------
@@ -937,6 +938,9 @@ class SimpleAccess(object):
return "%s: %s [%s]" % (_(object_class),
obj.type,
self.gid(obj))
+ elif isinstance(obj, Tag):
+ return "%s: [%s]" % (_(object_class),
+ obj.name)
else:
return "Error: incorrect object class: '%s'" % type(obj)
else:
@@ -944,40 +948,42 @@ class SimpleAccess(object):
else:
return "Error: invalid object class: '%s'" % object_class
- def describe(self, obj):
+ def describe(self, obj, prop=None, value=None):
"""
Given a object, return a string describing the object.
"""
+ if prop and value:
+ obj = self.dbase.get_table_metadata(obj)[prop + "_func"](value)
if isinstance(obj, Person):
- return self.name(obj)
+ return "%s [%s]" % (self.name(obj),
+ self.gid(obj))
elif isinstance(obj, Event):
- return self.event_type(obj)
+ return "%s [%s]" % (self.event_type(obj),
+ self.gid(obj))
elif isinstance(obj, Family):
- father = self.father(obj)
- mother = self.mother(obj)
- if father:
- father_text = self.name(father)
- else:
- father_text = _("Unknown father")
- if mother:
- mother_text = self.name(mother)
- else:
- mother_text = _("Unknown mother")
- return "%s and %s" % (mother_text, father_text)
+ return "%s/%s [%s]" % (self.name(self.mother(obj)),
+ self.name(self.father(obj)),
+ self.gid(obj))
elif isinstance(obj, MediaObject):
- return obj.desc
- elif isinstance(obj, Citation):
- return obj.gramps_id
+ return "%s [%s]" % (obj.desc,
+ self.gid(obj))
elif isinstance(obj, Source):
- return self.title(obj)
+ return "%s [%s]" % (self.title(obj),
+ self.gid(obj))
+ elif isinstance(obj, Citation):
+ return "[%s]" % (self.gid(obj))
elif isinstance(obj, Place):
- return place_name(self.dbase, obj.handle)
+ return "%s [%s]" % (place_name(self.dbase,
+ obj.handle),
+ self.gid(obj))
elif isinstance(obj, Repository):
- return obj.gramps_id
+ return "%s [%s]" % (obj.type,
+ self.gid(obj))
elif isinstance(obj, Note):
- return obj.gramps_id
- elif obj is None:
- return ""
+ return "%s [%s]" % (obj.type,
+ self.gid(obj))
+ elif isinstance(obj, Tag):
+ return "[%s]" % (obj.name)
else:
return "Error: incorrect object class: '%s'" % type(obj)
diff --git a/gramps/gen/simple/_simpletable.py b/gramps/gen/simple/_simpletable.py
index 748f77504..05cec4265 100644
--- a/gramps/gen/simple/_simpletable.py
+++ b/gramps/gen/simple/_simpletable.py
@@ -27,7 +27,8 @@ Provide a simplified table creation interface
"""
import cgi
-from ..ggettext import sgettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from ..lib import (Person, Family, Event, Source, Place, Citation,
Repository, MediaObject, Note, Date, Span)
from ..config import config
diff --git a/gramps/gen/sort.py b/gramps/gen/sort.py
index 14dd635f4..ceb3f9e2b 100644
--- a/gramps/gen/sort.py
+++ b/gramps/gen/sort.py
@@ -32,7 +32,6 @@ to make sure these remain in sync with the rest of the design.
# Standard python modules
#
#-------------------------------------------------------------------------
-import locale
#-------------------------------------------------------------------------
#
@@ -42,6 +41,7 @@ import locale
from .lib import Date
from .utils.db import get_birth_or_fallback
from .display.name import displayer as _nd
+from .const import GRAMPS_LOCALE as glocale
#-------------------------------------------------------------------------
#
@@ -70,11 +70,11 @@ class Sort(object):
## ffn = name1.get_first_name()
## sfn = name2.get_first_name()
## if ffn == sfn:
-## return locale.strcoll(name1.get_suffix(), name2.get_suffix())
+## return glocale.strcoll(name1.get_suffix(), name2.get_suffix())
## else:
-## return locale.strcoll(ffn, sfn)
+## return glocale.strcoll(ffn, sfn)
## else:
-## return locale.strcoll(fsn, ssn)
+## return glocale.strcoll(fsn, ssn)
def by_last_name_key(self, first_id):
"""Sort routine for comparing two last names. If last names are equal,
@@ -86,7 +86,7 @@ class Sort(object):
fsn = name1.get_surname()
ffn = name1.get_first_name()
fsu = name1.get_suffix()
- return locale.strxfrm(fsn + ffn + fsu)
+ return glocale.sort_key(fsn + ffn + fsu)
## def by_sorted_name(self, first_id, second_id):
## """
@@ -99,7 +99,7 @@ class Sort(object):
## name1 = _nd.sorted(first)
## name2 = _nd.sorted(second)
##
-## return locale.strcoll(name1, name2)
+## return glocale.strcoll(name1, name2)
def by_sorted_name_key(self, first_id):
"""
@@ -110,7 +110,7 @@ class Sort(object):
name1 = _nd.sorted(first)
- return locale.strxfrm(name1)
+ return glocale.sort_key(name1)
## def by_birthdate(self, first_id, second_id):
## """Sort routine for comparing two people by birth dates. If the birth dates
@@ -175,14 +175,14 @@ class Sort(object):
## return 0
## a_obj = self.database.get_place_from_handle(a_id)
## b_obj = self.database.get_place_from_handle(b_id)
-## return locale.strcoll(a_obj.title, b_obj.title)
+## return glocale.strcoll(a_obj.title, b_obj.title)
def by_place_title_key(self, a_id):
"""Sort routine for comparing two places. """
if not a_id:
return 0
a_obj = self.database.get_place_from_handle(a_id)
- return locale.strxfrm(a_obj.title)
+ return glocale.sort_key(a_obj.title)
## def by_event_place(self, a_id, b_id):
## """Sort routine for comparing two events by their places. """
@@ -198,7 +198,7 @@ class Sort(object):
## plc_a_title = plc_a.title
## if plc_b:
## plc_b_title = plc_b.title
-## return locale.strcoll(plc_a_title, plc_b_title)
+## return glocale.strcoll(plc_a_title, plc_b_title)
def by_event_place_key(self, a_id):
"""Sort routine for comparing two events by their places. """
@@ -207,7 +207,7 @@ class Sort(object):
evt_a = self.database.get_event_from_handle(a_id)
plc_a = self.database.get_place_from_handle(evt_a.get_place_handle())
plc_a_title = plc_a.title if plc_a else ""
- return locale.strxfrm(plc_a_title)
+ return glocale.sort_key(plc_a_title)
## def by_event_description(self, a_id, b_id):
## """Sort routine for comparing two events by their descriptions. """
@@ -215,14 +215,14 @@ class Sort(object):
## return 0
## evt_a = self.database.get_event_from_handle(a_id)
## evt_b = self.database.get_event_from_handle(b_id)
-## return locale.strcoll(evt_a.get_description(), evt_b.get_description())
+## return glocale.strcoll(evt_a.get_description(), evt_b.get_description())
def by_event_description_key(self, a_id):
"""Sort routine for comparing two events by their descriptions. """
if not a_id:
return 0
evt_a = self.database.get_event_from_handle(a_id)
- return locale.strxfrm(evt_a.get_description())
+ return glocale.sort_key(evt_a.get_description())
## def by_event_id(self, a_id, b_id):
## """Sort routine for comparing two events by their ID. """
@@ -230,14 +230,14 @@ class Sort(object):
## return 0
## evt_a = self.database.get_event_from_handle(a_id)
## evt_b = self.database.get_event_from_handle(b_id)
-## return locale.strcoll(evt_a.get_gramps_id(), evt_b.get_gramps_id())
+## return glocale.strcoll(evt_a.get_gramps_id(), evt_b.get_gramps_id())
def by_event_id_key(self, a_id):
"""Sort routine for comparing two events by their ID. """
if not a_id:
return 0
evt_a = self.database.get_event_from_handle(a_id)
- return locale.strxfrm(evt_a.get_gramps_id())
+ return glocale.sort_key(evt_a.get_gramps_id())
## def by_event_type(self, a_id, b_id):
## """Sort routine for comparing two events by their type. """
@@ -245,14 +245,14 @@ class Sort(object):
## return 0
## evt_a = self.database.get_event_from_handle(a_id)
## evt_b = self.database.get_event_from_handle(b_id)
-## return locale.strcoll(str(evt_a.get_type()), str(evt_b.get_type()))
+## return glocale.strcoll(str(evt_a.get_type()), str(evt_b.get_type()))
def by_event_type_key(self, a_id):
"""Sort routine for comparing two events by their type. """
if not a_id:
return 0
evt_a = self.database.get_event_from_handle(a_id)
- return locale.strxfrm(str(evt_a.get_type()))
+ return glocale.sort_key(str(evt_a.get_type()))
## def by_media_title(self,a_id,b_id):
## """Sort routine for comparing two media objects by their title. """
@@ -260,11 +260,11 @@ class Sort(object):
## return False
## a = self.database.get_object_from_handle(a_id)
## b = self.database.get_object_from_handle(b_id)
-## return locale.strcoll(a.desc, b.desc)
+## return glocale.strcoll(a.desc, b.desc)
def by_media_title_key(self, a_id):
"""Sort routine for comparing two media objects by their title. """
if not a_id:
return False
a = self.database.get_object_from_handle(a_id)
- return locale.strxfrm(a.desc)
+ return glocale.sort_key(a.desc)
diff --git a/gramps/gen/soundex.py b/gramps/gen/soundex.py
index 412cd9f4c..6040b8f14 100644
--- a/gramps/gen/soundex.py
+++ b/gramps/gen/soundex.py
@@ -29,17 +29,23 @@ Provide soundex calculation
# Standard python modules
#
#-------------------------------------------------------------------------
-import string
+import sys
import unicodedata
+if sys.version_info[0] < 3:
+ import string
#-------------------------------------------------------------------------
#
-# constants
+# constants
#
#-------------------------------------------------------------------------
IGNORE = "HW~!@#$%^&*()_+=-`[]\|;:'/?.,<>\" \t\f\v"
-TABLE = string.maketrans('ABCDEFGIJKLMNOPQRSTUVXYZ',
- '012301202245501262301202')
+if sys.version_info[0] < 3:
+ TABLE = string.maketrans('ABCDEFGIJKLMNOPQRSTUVXYZ',
+ '012301202245501262301202')
+else:
+ TABLE = bytes.maketrans(b'ABCDEFGIJKLMNOPQRSTUVXYZ',
+ b'012301202245501262301202')
from .constfunc import conv_to_unicode_direct
@@ -55,9 +61,14 @@ def soundex(strval):
conv_to_unicode_direct(strval.upper().strip())).encode('ASCII', 'ignore')
if not strval:
return "Z000"
- strval = strval.encode('iso-8859-1')
- str2 = strval[0]
- strval = strval.translate(TABLE, IGNORE)
+ if sys.version_info[0] < 3:
+ strval = strval.encode('iso-8859-1') # Really?
+ str2 = strval[0]
+ strval = strval.translate(TABLE, IGNORE)
+ else:
+ strval = strval.decode('ASCII', 'ignore')
+ str2 = strval[0]
+ strval = strval.translate(TABLE)
if not strval:
return "Z000"
prev = strval[0]
diff --git a/gramps/gen/svn_revision.py b/gramps/gen/svn_revision.py
new file mode 100644
index 000000000..3fba46a54
--- /dev/null
+++ b/gramps/gen/svn_revision.py
@@ -0,0 +1,56 @@
+#
+# Gramps - a GTK+/GNOME based genealogy program
+#
+# Copyright (C) 2012 Doug Blank
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+# $Id$
+
+import sys
+import subprocess
+
+if sys.version_info[0] < 3:
+ cuni = unicode
+else:
+ def to_utf8(s):
+ return s.decode("utf-8", errors = 'replace')
+ cuni = to_utf8
+
+def get_svn_revision(path=""):
+ stdout = ""
+ try:
+ p = subprocess.Popen("svnversion -n \"%s\"" % path, shell=True,
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ (stdout, stderr) = p.communicate()
+ except:
+ return "" # subprocess failed
+ # subprocess worked
+ if stdout: # has output
+ stdout = cuni(stdout) # get a proper string
+ if (" " in stdout) or (stdout == "exported"):
+ # one of svnversion's 1.7 non-version responses:
+ # 'Unversioned directory'
+ # 'Unversioned file'
+ # 'Uncommitted local addition, copy or move'
+ # svnversion's 1.6 non-version response:
+ # 'exported'
+ return ""
+ else:
+ return "-r" + stdout
+ else: # no output from svnversion
+ return ""
+
diff --git a/gramps/gen/updatecallback.py b/gramps/gen/updatecallback.py
index b53b353fa..16308feb7 100644
--- a/gramps/gen/updatecallback.py
+++ b/gramps/gen/updatecallback.py
@@ -35,7 +35,8 @@ from __future__ import division
#-------------------------------------------------------------------------
import time
import collections
-
+import logging
+_LOG = logging.getLogger(".gen")
#-------------------------------------------------------------------------
#
# Callback updater
@@ -71,6 +72,9 @@ class UpdateCallback(object):
def set_total(self, total):
self.total = total
+ if self.total == 0:
+ _LOG.warning('UpdateCallback with total == 0 created')
+ self.total = 1
def update_empty(self, count=None):
pass
diff --git a/gramps/gen/utils/alive.py b/gramps/gen/utils/alive.py
index 8408bddc0..9151bddb7 100644
--- a/gramps/gen/utils/alive.py
+++ b/gramps/gen/utils/alive.py
@@ -43,7 +43,8 @@ LOG = logging.getLogger(".gen.utils.alive")
from ..display.name import displayer as name_displayer
from ..lib.date import Date, Today
from ..errors import DatabaseError
-from ..ggettext import sgettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
#-------------------------------------------------------------------------
#
@@ -101,13 +102,16 @@ class ProbablyAlive(object):
death_date = None
birth_date = None
explain = ""
- # If the recorded death year is before current year then
- # things are simple.
+
if death_ref and death_ref.get_role().is_primary():
if death_ref:
death = self.db.get_event_from_handle(death_ref.ref)
- if death and death.get_date_object().get_start_date() != Date.EMPTY:
+ if death and death.get_date_object().is_valid():
death_date = death.get_date_object()
+ elif death: # has a death event, but it is no valid:
+ death_date = Today() # before today
+ death_date.set_modifier(Date.MOD_BEFORE)
+ explain = _("death event without date")
# Look for Cause Of Death, Burial or Cremation events.
# These are fairly good indications that someone's not alive.
@@ -117,7 +121,12 @@ class ProbablyAlive(object):
ev = self.db.get_event_from_handle(ev_ref.ref)
if ev and ev.type.is_death_fallback():
death_date = ev.get_date_object()
- explain = _("death-related evidence")
+ if death_date.is_valid():
+ explain = _("death-related evidence")
+ else:
+ death_date = Today() # before today
+ death_date.set_modifier(Date.MOD_BEFORE)
+ explain = _("death-related evidence without date")
# If they were born within X years before current year then
# assume they are alive (we already know they are not dead).
@@ -226,13 +235,25 @@ class ProbablyAlive(object):
if mother_handle == person.handle and father_handle:
father = self.db.get_person_from_handle(father_handle)
date1, date2, explain, other = self.probably_alive_range(father, is_spouse=True)
- if date1 and date2:
- return date1, date2, _("a spouse, ") + explain, other
+ if date1 and date1.get_year() != 0:
+ return (Date().copy_ymd(date1.get_year() - self.AVG_GENERATION_GAP),
+ Date().copy_ymd(date1.get_year() - self.AVG_GENERATION_GAP + self.MAX_AGE_PROB_ALIVE),
+ _("a spouse's birth-related date, ") + explain, other)
+ elif date2 and date2.get_year() != 0:
+ return (Date().copy_ymd(date2.get_year() + self.AVG_GENERATION_GAP - self.MAX_AGE_PROB_ALIVE),
+ Date().copy_ymd(date2.get_year() + self.AVG_GENERATION_GAP),
+ _("a spouse's death-related date, ") + explain, other)
elif father_handle == person.handle and mother_handle:
mother = self.db.get_person_from_handle(mother_handle)
date1, date2, explain, other = self.probably_alive_range(mother, is_spouse=True)
- if date1 and date2:
- return date1, date2, _("a spouse, ") + explain, other
+ if date1 and date1.get_year() != 0:
+ return (Date().copy_ymd(date1.get_year() - self.AVG_GENERATION_GAP),
+ Date().copy_ymd(date1.get_year() - self.AVG_GENERATION_GAP + self.MAX_AGE_PROB_ALIVE),
+ _("a spouse's birth-related date, ") + explain, other)
+ elif date2 and date2.get_year() != 0:
+ return (Date().copy_ymd(date2.get_year() + self.AVG_GENERATION_GAP - self.MAX_AGE_PROB_ALIVE),
+ Date().copy_ymd(date2.get_year() + self.AVG_GENERATION_GAP),
+ _("a spouse's death-related date, ") + explain, other)
# Let's check the family events and see if we find something
for ref in family.get_event_ref_list():
if ref:
@@ -483,7 +504,7 @@ def probably_alive(person, db,
death += limit # add these years to death
# Finally, check to see if current_date is between dates
result = (current_date.match(birth, ">=") and
- current_date.match(death, "<="))
+ current_date.match(death, "<<"))
if return_range:
return (result, birth, death, explain, relative)
else:
diff --git a/gramps/gen/utils/cast.py b/gramps/gen/utils/cast.py
index 1f7d19416..75c5f2a9f 100644
--- a/gramps/gen/utils/cast.py
+++ b/gramps/gen/utils/cast.py
@@ -31,9 +31,11 @@ Utility functions to cast types
# Python modules
#
#-------------------------------------------------------------------------
+import os
import locale
import sys
-
+import logging
+LOG = logging.getLogger(".")
#-------------------------------------------------------------------------
#
# Gramps modules
@@ -42,27 +44,6 @@ import sys
from ..datehandler import codeset
from ..constfunc import conv_to_unicode, conv_to_unicode_direct, UNITYPE, STRTYPE
-"""
-strxfrm needs it's unicode argument correctly cast before used.
-"""
-if sys.version_info[0] < 3:
- conv_unicode_tosrtkey = lambda x: locale.strxfrm(x.encode(codeset, 'replace'))
-else:
- conv_unicode_tosrtkey = lambda x: locale.strxfrm(x)
-
-if codeset == 'UTF-8':
- conv_str_tosrtkey = lambda x: locale.strxfrm(x)
-else:
- conv_str_tosrtkey = lambda x: locale.strxfrm(
- conv_to_unicode(x,'UTF-8').encode(codeset, 'replace'))
-
-def conv_tosrtkey(value):
- if isinstance(value, UNITYPE):
- return conv_unicode_tosrtkey(value)
- elif not isinstance(value, STRTYPE):
- return conv_str_tosrtkey(str(value))
- return conv_str_tosrtkey(value)
-
#strings in database are utf-8
conv_dbstr_to_unicode = lambda x: conv_to_unicode(x, 'UTF-8')
diff --git a/gramps/gen/utils/configmanager.py b/gramps/gen/utils/configmanager.py
index 403ffacf8..3d8f12edf 100644
--- a/gramps/gen/utils/configmanager.py
+++ b/gramps/gen/utils/configmanager.py
@@ -42,9 +42,11 @@ else:
import errno
import copy
import logging
+import io
from ..constfunc import STRTYPE
-
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
def safe_eval(exp):
# restrict eval to empty environment
return eval(exp, {})
@@ -302,11 +304,20 @@ class ConfigManager(object):
####################### Now, let's test and set:
if (name in self.default and
setting in self.default[name]):
+ if isinstance(self.default[name][setting], bool):
+ #make sure 0 and 1 are False and True
+ if value == 0:
+ value = False
+ elif value == 1:
+ value = True
if self.check_type(self.default[name][setting], value):
self.data[name][setting] = value
else:
logging.warning("WARNING: ignoring key with wrong type "
- "'%s.%s'" % (name, setting))
+ "'%s.%s' %s needed instead of %s" %
+ (name, setting,
+ type(self.data[name][setting]),
+ type(value)))
else:
# this could be a third-party setting; add it:
self.data[name][setting] = value
@@ -325,7 +336,7 @@ class ConfigManager(object):
except OSError as exp:
if exp.errno != errno.EEXIST:
raise
- key_file = open(filename, "w")
+ key_file = io.open(filename, "w", encoding = "utf-8")
key_file.write(";; Gramps key file\n")
key_file.write((";; Automatically created at %s" %
time.strftime("%Y/%m/%d %H:%M:%S")) + "\n\n")
diff --git a/gramps/gen/utils/db.py b/gramps/gen/utils/db.py
index c28ec1773..e54b3bdab 100644
--- a/gramps/gen/utils/db.py
+++ b/gramps/gen/utils/db.py
@@ -39,7 +39,8 @@ LOG = logging.getLogger(".gui.utils.db")
from ..lib.nameorigintype import NameOriginType
from ..lib.surname import Surname
from ..display.name import displayer as name_displayer
-from ..ggettext import sgettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from ..constfunc import cuni
#-------------------------------------------------------------------------
@@ -558,7 +559,6 @@ def get_referents(handle, db, primary_objects):
for primary in primary_objects:
primary_list = [item[1] for item in object_list if item[0] == primary]
the_lists = the_lists + (primary_list, )
-
return the_lists
def get_source_referents(source_handle, db):
diff --git a/gramps/gen/utils/docgen/__init__.py b/gramps/gen/utils/docgen/__init__.py
index 7af1d6f44..e2780abb4 100644
--- a/gramps/gen/utils/docgen/__init__.py
+++ b/gramps/gen/utils/docgen/__init__.py
@@ -20,6 +20,6 @@
# $Id$
-from .TabbedDoc import TabbedDoc
-from .ODSTab import ODSTab
-from .CSVTab import CSVTab
+from .tabbeddoc import TabbedDoc
+from .odstab import ODSTab
+from .csvtab import CSVTab
diff --git a/gramps/gen/utils/docgen/CSVTab.py b/gramps/gen/utils/docgen/csvtab.py
similarity index 98%
rename from gramps/gen/utils/docgen/CSVTab.py
rename to gramps/gen/utils/docgen/csvtab.py
index 6af1b40ec..dd9e3aced 100644
--- a/gramps/gen/utils/docgen/CSVTab.py
+++ b/gramps/gen/utils/docgen/csvtab.py
@@ -32,7 +32,7 @@ import csv
# gramps modules
#
#-------------------------------------------------------------------------
-from .TabbedDoc import *
+from .tabbeddoc import *
class CSVTab(TabbedDoc):
diff --git a/gramps/gen/utils/docgen/ODSTab.py b/gramps/gen/utils/docgen/odstab.py
similarity index 99%
rename from gramps/gen/utils/docgen/ODSTab.py
rename to gramps/gen/utils/docgen/odstab.py
index df7c8b872..cc2dae6d7 100644
--- a/gramps/gen/utils/docgen/ODSTab.py
+++ b/gramps/gen/utils/docgen/odstab.py
@@ -28,14 +28,15 @@
import os
import tempfile
import zipfile
-from ...ggettext import gettext as _
+from ...const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
# Gramps modules
#
#-------------------------------------------------------------------------
-from .TabbedDoc import *
+from .tabbeddoc import *
from ...const import PROGRAM_NAME, VERSION
from ...errors import ReportError
from ...constfunc import cuni
diff --git a/gramps/gen/utils/docgen/TabbedDoc.py b/gramps/gen/utils/docgen/tabbeddoc.py
similarity index 98%
rename from gramps/gen/utils/docgen/TabbedDoc.py
rename to gramps/gen/utils/docgen/tabbeddoc.py
index 20908f715..e713cee2f 100644
--- a/gramps/gen/utils/docgen/TabbedDoc.py
+++ b/gramps/gen/utils/docgen/tabbeddoc.py
@@ -17,7 +17,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# docgen/TabbedDoc.py
# $Id$
#
diff --git a/gramps/gen/utils/file.py b/gramps/gen/utils/file.py
index 19074c080..af5309536 100644
--- a/gramps/gen/utils/file.py
+++ b/gramps/gen/utils/file.py
@@ -62,32 +62,16 @@ def find_file( filename):
# try the filename we got
try:
fname = filename
- if os.path.isfile( filename):
- return( filename)
- except:
- pass
-
- # Build list of alternate encodings
- encodings = set()
- #Darwin returns "mac roman" for preferredencoding, but since it
- #returns "UTF-8" for filesystemencoding, and that's first, this
- #works.
- for enc in [sys.getfilesystemencoding, locale.getpreferredencoding]:
+ if os.path.isfile(filename):
+ return(filename)
+ except UnicodeError:
try:
- encodings.add(enc)
- except:
- pass
- encodings.add('UTF-8')
- encodings.add('ISO-8859-1')
-
- for enc in encodings:
- try:
- fname = filename.encode(enc)
- if os.path.isfile( fname):
+ fname = filename.encode(glocale.getfilesystemencoding())
+ if os.path.isfile(fname):
return fname
- except:
+ except UnicodeError:
pass
-
+
# not found
return ''
@@ -95,27 +79,16 @@ def find_folder( filename):
# try the filename we got
try:
fname = filename
- if os.path.isdir( filename):
- return( filename)
- except:
- pass
-
- # Build list of alternate encodings
- try:
- encodings = [sys.getfilesystemencoding(),
- locale.getpreferredencoding(),
- 'UTF-8', 'ISO-8859-1']
- except:
- encodings = [sys.getfilesystemencoding(), 'UTF-8', 'ISO-8859-1']
- encodings = list(set(encodings))
- for enc in encodings:
+ if os.path.isdir(filename):
+ return(filename)
+ except UnicodeError:
try:
- fname = filename.encode(enc)
- if os.path.isdir( fname):
+ fname = filename.encode(glocale.getfilesystemencoding())
+ if os.path.isdir(fname):
return fname
- except:
+ except UnicodeError:
pass
-
+
# not found
return ''
@@ -170,7 +143,7 @@ def get_unicode_path_from_env_var(path):
"""
# make only unicode of path of type 'str'
if not (isinstance(path, str)):
- return path
+ raise TypeError("path %s isn't a str" % str(path))
if win():
# In Windows path/filename returned from a environment variable is in filesystemencoding
@@ -312,10 +285,7 @@ def fix_encoding(value, errors='strict'):
return cuni(value)
except:
try:
- if mac():
- codeset = locale.getlocale()[1]
- else:
- codeset = locale.getpreferredencoding()
+ info = glocale.get_translation().info()["charset"]
except:
codeset = "UTF-8"
if sys.version_info[0] < 3:
diff --git a/gramps/gen/utils/grampslocale.py b/gramps/gen/utils/grampslocale.py
new file mode 100644
index 000000000..c73bc69e6
--- /dev/null
+++ b/gramps/gen/utils/grampslocale.py
@@ -0,0 +1,680 @@
+#
+# Gramps - a GTK+/GNOME based genealogy program
+#
+# Copyright (C) 2000-2006 Donald N. Allingham
+# Copyright (C) 2009 Brian G. Matherly
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+# $Id$
+
+#------------------------------------------------------------------------
+#
+# python modules
+#
+#------------------------------------------------------------------------
+import gettext
+import sys
+import os
+import locale
+import logging
+LOG = logging.getLogger("grampslocale")
+_hdlr = logging.StreamHandler()
+_hdlr.setFormatter(logging.Formatter(fmt="%(name)s.%(levelname)s: %(message)s"))
+LOG.addHandler(_hdlr)
+HAVE_ICU = False
+try:
+ from icu import Locale, Collator
+ HAVE_ICU = True
+except ImportError:
+ try:
+ from PyICU import Locale, Collator
+ HAVE_ICU = True
+ except ImportError as err:
+ LOG.warning("ICU is not installed because %s, localization will be impaired", str(err))
+#-------------------------------------------------------------------------
+#
+# gramps modules
+#
+#-------------------------------------------------------------------------
+from ..const import LOCALE_DIR
+from ..constfunc import mac, win, UNITYPE
+
+#------------------------------------------------------------------------
+#
+# GrampsLocale Class
+#
+#------------------------------------------------------------------------
+class GrampsLocale(object):
+ """
+ Encapsulate a locale. This class is a sort-of-singleton: The
+ first instance created will query the environment and OSX defaults
+ for missing parameters (precedence is parameters passed to the
+ constructor, environment variables LANG, LC_COLLATE, LC_TIME,
+ etc., and LANGUAGE, OSX defaults settings when that's the
+ platform). Subsequent calls to the constructor with no or
+ identical parameters will return the same Grampslocale
+ object. Construction with different parameters will result in a
+ new GrampsLocale instance with the specified parameters, but any
+ parameters left out will be filled in from the first instance.
+
+ @localedir: The full path to the top level directory containing
+ the translation files. Defaults to sys.prefix/share/locale.
+
+ @lang: A single locale value which is used for unset locale.LC_FOO
+ settings.
+
+ @domain: The name of the applicable translation file. The default is
+ "gramps", indicating files in LC_MESSAGES named gramps.mo.
+
+ @languages: A list of two or five character codes corresponding to
+ subidrectries in the localedir, e.g. "fr" or "zh_CN".
+ """
+ __first_instance = None
+ def __new__(cls, localedir=None, lang=None, domain=None, languages=None):
+ if not GrampsLocale.__first_instance:
+ cls.__first_instance = super(GrampsLocale, cls).__new__(cls)
+ cls.__first_instance.initialized = False
+ return cls.__first_instance
+
+ if not cls.__first_instance.initialized:
+ raise RuntimeError("Second GrampsLocale created before first one was initialized")
+ if ((lang is None or lang == cls.__first_instance.lang)
+ and (localedir is None or localedir == cls.__first_instance.localedir)
+ and (domain is None or domain == cls.__first_instance.localedomain)
+ and (languages is None or len(languages) == 0 or
+ languages == cls.__first_instance.languages)):
+ return cls.__first_instance
+
+ return super(GrampsLocale, cls).__new__(cls)
+
+ def __init_from_environment(self, lang=None, language=None):
+ if not lang:
+ lang = ' '
+ try:
+ lang = os.environ["LANG"]
+ except KeyError:
+ lang = locale.getlocale()[0]
+ if not lang:
+ try:
+ lang = locale.getdefaultlocale()[0] + '.UTF-8'
+ except TypeError:
+ LOG.warning('Unable to determine your Locale, using English')
+ lang = 'C.UTF-8'
+ self.lang = lang
+
+ if not language or len(language) == 0:
+ if "LANGUAGE" in os.environ:
+ avail = self.get_available_translations()
+ language = [l for l in os.environ["LANGUAGE"].split(":")
+ if l[:5] in avail or l[:2] in avail]
+ self.language = language
+ elif not lang == "C.UTF-8":
+ self.language = [lang]
+ else:
+ self.language = ["en"]
+
+ if "LC_MONETARY" not in os.environ:
+ self.currency = lang
+ else:
+ self.currency = os.environ["LC_MONETARY"]
+
+ if "LC_TIME" not in os.environ:
+ self.calendar = lang
+ else:
+ self.calendar = os.environ["LC_TIME"]
+
+ if "LC_COLLATE" not in os.environ:
+ self.collation = lang
+ else:
+ self.collation = os.environ["LC_COLLATE"]
+
+
+ def __init_first_instance(self, localedir=None, lang=None,
+ domain=None, language=None):
+
+ if localedir and os.path.exists(localedir):
+ self.localedir = localedir
+ else:
+ if ("GRAMPSI18N" in os.environ
+ and os.path.exists(os.environ["GRAMPSI18N"])):
+ self.localedir = os.environ["GRAMPSI18N"]
+ elif os.path.exists(LOCALE_DIR):
+ self.localedir = LOCALE_DIR
+ elif os.path.exists(os.path.join(sys.prefix, "share", "locale")):
+ self.localedir = os.path.join(sys.prefix, "share", "locale")
+ else:
+ if not lang:
+ lang = os.environ.get('LANG', 'en')
+ if lang and lang[:2] == 'en':
+ pass # No need to display warning, we're in English
+ else:
+ LOG.warning('Locale dir does not exist at %s', LOCALE_DIR)
+ LOG.warning('Running python setup.py install --prefix=YourPrefixDir might fix the problem')
+
+ if not self.localedir:
+#No localization files, no point in continuing
+ return
+ if domain:
+ self.localedomain = domain
+ else:
+ self.localedomain = 'gramps'
+
+ if not language or not isinstance(language, list):
+ language = []
+ else:
+ language = [l for l in languages
+ if l in self.get_available_translations()]
+
+ if mac():
+ from . import maclocale
+ maclocale.mac_setup_localization(self, lang, language)
+ else:
+ self.__init_from_environment(lang, language)
+
+#GtkBuilder depends on reading Glade files as UTF-8 and crashes if it
+#doesn't, so set $LANG to have a UTF-8 locale. NB: This does *not*
+#affect locale.getpreferredencoding() or sys.getfilesystemencoding()
+#which are set by python long before we get here.
+ check_lang = self.lang.split('.')
+ if len(check_lang) < 2 or check_lang[1] not in ["utf-8", "UTF-8"]:
+ self.lang = '.'.join((check_lang[0], 'UTF-8'))
+ os.environ["LANG"] = self.lang
+ # Set Gramps's translations
+ try:
+ # First try the environment to preserve individual variables
+ locale.setlocale(locale.LC_ALL, '')
+ try:
+ #Then set LC_MESSAGES to lang
+ locale.setlocale(locale.LC_MESSAGES, lang)
+ except locale.Error:
+ LOG.warning("Unable to set translations to %s, locale not found.", lang)
+ except locale.Error:
+ # That's not a valid locale -- on Linux, probably not installed.
+ try:
+ # First fallback is lang
+ locale.setlocale(locale.LC_ALL, self.lang)
+ LOG.warning("Setting locale to individual LC_ variables failed, falling back to %s.", lang)
+
+ except locale.Error:
+ # No good, set the default encoding to C.UTF-8. Don't
+ # mess with anything else.
+ try:
+ locale.setlocale(locale.LC_ALL, 'C.UTF-8')
+ except locale.Error:
+ locale.setlocale(locale.LC_ALL, "C")
+ LOG.warning("C.UTF-8 not available, GtkBuilder may have problems")
+ LOG.debug("Failed to set locale %s, falling back to English", lang)
+ # $LANGUAGE is what sets the Gtk+ translations
+ os.environ["LANGUAGE"] = ':'.join(self.language)
+ # GtkBuilder uses GLib's g_dgettext wrapper, which oddly is bound
+ # with locale instead of gettext.
+ locale.bindtextdomain(self.localedomain, self.localedir)
+
+ self.initialized = True
+
+
+ def __init__(self, lang=None, localedir=None, domain=None, languages=None):
+ """
+ Init a GrampsLocale. Run __init_first_instance() to set up the
+ environement if this is the first run. Return __first_instance
+ otherwise if called without arguments.
+ """
+ if self == self._GrampsLocale__first_instance:
+ if not self.initialized:
+ self._GrampsLocale__init_first_instance(lang, localedir,
+ domain, languages)
+ else:
+ return
+
+ else:
+ if domain:
+ self.localedomain = domain
+ else:
+ self.localedomain = self._GrampsLocale__first_instance.localedomain
+ if localedir:
+ self.localedir = localedir
+ else:
+ self.localedir = self._GrampsLocale__first_instance.localedir
+
+ self.language = []
+ if languages and len(languages) > 0:
+ self.language = [l for l in languages
+ if l in self.get_available_translations()]
+ if len(self.language) == 0:
+ self.language = self._GrampsLocale__first_instance.language
+
+ if lang:
+ self.lang = lang
+ else:
+ self.lang = self._GrampsLocale__first_instance.lang
+
+ self.collation = self.currency = self.calendar = self.lang
+
+ self.icu_locales = {}
+ self.collator = None
+ if HAVE_ICU:
+ self.icu_locales["default"] = Locale.createFromName(self.lang)
+ if self.collation != self.lang:
+ self.icu_locales["collation"] = Locale.createFromName(self.collation)
+ else:
+ self.icu_locales["collation"] = self.icu_locales["default"]
+ try:
+ self.collator = Collator.createInstance(self.icu_locales["collation"])
+ except ICUError as err:
+ LOG.warning("Unable to create collator: %s", str(err))
+ self.collator = None
+
+ self.translation = self._get_translation(self.localedomain,
+ self.localedir, self.language)
+ self._set_dictionaries()
+
+
+
+
+ def _get_translation(self, domain = None,
+ localedir = None,
+ languages=None):
+ """
+ Get a translation of one of our classes. Doesn't return the
+ singleton so that it can be used by get_addon_translation()
+ """
+ if not domain:
+ domain = self.localedomain
+ if not languages:
+ languages = self.language
+ if not localedir:
+ localedir = self.localedir
+
+ if gettext.find(domain, localedir, languages):
+ return gettext.translation(domain, localedir,
+ languages,
+ class_ = GrampsTranslations)
+ else:
+ if not languages == ["en"]:
+ LOG.debug("Unable to find translations for %s and %s in %s",
+ domain, languages, localedir)
+ return GrampsNullTranslations()
+
+ def _set_dictionaries(self):
+ """
+ Create a dictionary of language names localized to the
+ GrampsLocale's primary language, keyed by language and
+ country code.
+ """
+ _ = self.translation.gettext
+ self.lang_map = {
+ "bg" : _("Bulgarian"),
+ "ca" : _("Catalan"),
+ "cs" : _("Czech"),
+ "da" : _("Danish"),
+ "de" : _("German"),
+ "el" : _("Greek"),
+ "en" : _("English"),
+ "eo" : _("Esperanto"),
+ "es" : _("Spanish"),
+ "fi" : _("Finnish"),
+ "fr" : _("French"),
+ "he" : _("Hebrew"),
+ "hr" : _("Croatian"),
+ "hu" : _("Hungarian"),
+ "it" : _("Italian"),
+ "ja" : _("Japanese"),
+ "lt" : _("Lithuanian"),
+ "mk" : _("Macedonian"),
+ "nb" : _("Norwegian Bokmal"),
+ "nl" : _("Dutch"),
+ "nn" : _("Norwegian Nynorsk"),
+ "pl" : _("Polish"),
+ "pt" : _("Portuguese"),
+ "ro" : _("Romanian"),
+ "ru" : _("Russian"),
+ "sk" : _("Slovak"),
+ "sl" : _("Slovenian"),
+ "sq" : _("Albanian"),
+ "sv" : _("Swedish"),
+ "tr" : _("Turkish"),
+ "uk" : _("Ukrainian"),
+ "vi" : _("Vietnamese"),
+ "zh" : _("Chinese")
+ }
+
+ self.country_map = {
+ "BR" : _("Brazil"),
+ "CN" : _("China"),
+ "PT" : _("Portugal")
+ }
+
+ def _get_language_string(self, lang_code):
+ """
+ Given a language code of the form "lang_region", return a text string
+ representing that language.
+ """
+ code_parts = lang_code.rsplit("_")
+
+ lang = code_parts[0]
+ if lang in self.lang_map:
+ lang = self.lang_map[lang]
+
+ country = None
+ if len(code_parts) > 1:
+ country = code_parts[1]
+ if country in self.country_map:
+ country = self.country_map[country]
+ lang = "%(language)s (%(country)s)" % \
+ { 'language' : lang, 'country' : country }
+
+ return lang
+
+#-------------------------------------------------------------------------
+#
+# Public Functions
+#
+#-------------------------------------------------------------------------
+
+ def get_localedomain(self):
+ """
+ Get the LOCALEDOMAIN used for the Gramps application.
+ Required by gui/glade.py to pass to Gtk.Builder
+ """
+ return self.localedomain
+
+ def get_language_list(self):
+ """
+ Return the list of configured languages. Used by
+ ViewManager.check_for_updates to select the language for the
+ addons descriptions.
+ """
+ return self.language
+
+ def get_translation(self, domain = None, languages = None):
+ """
+ Get a translation object for a particular language.
+ See the gettext documentation for the available functions
+ >>> glocale = GrampsLocale()
+ >>> _ = glocale.get_translation('foo', 'French')
+ >>> _ = tr.gettext
+ """
+
+ if ((domain and not domain == self.localedomain)
+ or (languages and not languages == self.language)):
+ if not domain:
+ domain = self.localedomain
+ if not languages:
+ languages = self.language
+ fallback = False
+ if "en" in languages:
+ fallback = True
+ try:
+ # Don't use _get_translation because we want to fall
+ # back on the singleton rather than a NullTranslation
+ return gettext.translation(domain, self.localedir,
+ languages,
+ class_ = GrampsTranslations,
+ fallback = fallback)
+ except IOError:
+ LOG.warning("None of the requested languages (%s) were available, using %s instead", ', '.join(languages), self.lang)
+ return self.translation
+ else:
+ return self.translation
+
+ def get_addon_translator(self, filename, domain="addon",
+ languages=None):
+ """
+ Get a translator for an addon.
+
+ filename - filename of a file in directory with full path, or
+ None to get from running code
+ domain - the name of the .mo file under the LANG/LC_MESSAGES dir
+ languages - a list of languages to force
+ returns - a gettext.translation object
+
+ Example:
+ _ = glocale.get_addon_translator(languages=["fr_BE.utf8"]).gettext
+
+ See the python gettext documentation.
+ Assumes path/filename
+ path/locale/LANG/LC_MESSAGES/addon.mo.
+ """
+ path = self.localedir
+ # If get the path of the calling module's uncompiled file. This seems a remarkably bad idea.
+# if filename is None:
+# filename = sys._getframe(1).f_code.co_filename
+
+ gramps_translator = self._get_translation()
+
+ path = os.path.dirname(os.path.abspath(filename))
+ # Check if path is of type str. Do import and conversion if so.
+ # The import cannot be done at the top as that will conflict with the translation system.
+
+ if not isinstance(path, UNITYPE) == str:
+ from .file import get_unicode_path_from_env_var
+ path = get_unicode_path_from_env_var(path)
+ if languages:
+ addon_translator = self._get_translation(domain,
+ path,
+ languages=languages)
+ else:
+ addon_translator = self._get_translation(domain, path)
+ gramps_translator.add_fallback(addon_translator)
+ return gramps_translator # with a language fallback
+
+ def get_available_translations(self):
+ """
+ Get a list of available translations.
+
+ :returns: A list of translation languages.
+ :rtype: unicode[]
+
+ """
+ languages = ["en"]
+
+ if self.localedir is None:
+ return languages
+
+ for langdir in os.listdir(self.localedir):
+ mofilename = os.path.join(self.localedir, langdir,
+ "LC_MESSAGES",
+ "%s.mo" % self.localedomain )
+ if os.path.exists(mofilename):
+ languages.append(langdir)
+
+ languages.sort()
+
+ return languages
+
+ def get_language_dict(self):
+ '''
+ return a dictionary of language names : codes for use by language
+ pickers.
+ '''
+ langs = {}
+ for code in self.get_available_translations():
+ langs[self._get_language_string(code)] = code
+
+ return langs
+
+
+ def trans_objclass(self, objclass_str):
+ """
+ Translates objclass_str into "... %s", where objclass_str
+ is 'Person', 'person', 'Family', 'family', etc.
+ """
+ _ = self.translation.gettext
+ objclass = objclass_str.lower()
+ if objclass == "person":
+ return _("the person")
+ elif objclass == "family":
+ return _("the family")
+ elif objclass == "place":
+ return _("the place")
+ elif objclass == "event":
+ return _("the event")
+ elif objclass == "repository":
+ return _("the repository")
+ elif objclass == "note":
+ return _("the note")
+ elif objclass in ["media", "mediaobject"]:
+ return _("the media")
+ elif objclass == "source":
+ return _("the source")
+ elif objclass == "filter":
+ return _("the filter")
+ else:
+ return _("See details")
+
+ def getfilesystemencoding(self):
+ """
+ If the locale isn't configured correctly, this will return
+ 'ascii' or 'ANSI_X3.4-1968' or some other unfortunate
+ result. Current unix systems all encode filenames in utf-8,
+ and Microsoft Windows uses utf-16 (which they call mbcs). Make
+ sure we return the right value.
+ """
+ encoding = sys.getfilesystemencoding()
+
+ if encoding in ("utf-8", "UTF-8", "utf8", "UTF8", "mbcs", "MBCS"):
+ return encoding
+
+ return "utf-8"
+
+ def sort_key(self, string):
+ """
+ Return a value suitable to pass to the "key" parameter of sorted()
+ """
+
+ if HAVE_ICU and self.collator:
+ #ICU can digest strings and unicode
+ return self.collator.getCollationKey(string).getByteArray()
+ else:
+ base_locale = locale.getlocale(locale.LC_COLLATE)
+ locale.setlocale(locale.LC_COLLATE, self.collation)
+ #locale in Python2 can't.
+ if sys.version_info[0] < 3 and isinstance(string, unicode):
+ key = locale.strxfrm(string.encode("utf-8", "replace"))
+ else:
+ key = locale.strxfrm(string)
+
+ locale.setlocale(locale.LC_COLLATE, base_locale)
+ return key
+
+ def strcoll(self, string1, string2):
+ """
+ Given two localized strings, compare them and return -1 if
+ string1 would sort first, 1 if string2 would, and 0 if
+ they are the same.
+ """
+ key1 = self.sort_key(string1)
+ key2 = self.sort_key(string2)
+ return (-1 if key1 < key2 else (1 if key1 > key2 else 0))
+
+#-------------------------------------------------------------------------
+#
+# Translations Classes
+#
+#-------------------------------------------------------------------------
+class GrampsTranslations(gettext.GNUTranslations):
+ """
+ Overrides and extends gettext.GNUTranslations. See the Python gettext
+ "Class API" documentation for how to use this.
+ """
+ def language(self):
+ """
+ Return the target languge of this translations object.
+ """
+ return self.info()["language"]
+
+ def gettext(self, msgid):
+ """
+ Obtain translation of gettext, return a unicode object
+ :param msgid: The string to translated.
+ :type msgid: unicode
+ :returns: Translation or the original.
+ :rtype: unicode
+ """
+ # If msgid =="" then gettext will return po file header
+ # and that's not what we want.
+ if len(msgid.strip()) == 0:
+ return msgid
+ if sys.version_info[0] < 3:
+ return gettext.GNUTranslations.ugettext(self, msgid)
+ else:
+ return gettext.GNUTranslations.gettext(self, msgid)
+
+ def ngettext(self, singular, plural, num):
+ """
+ The translation of singular/plural is returned unless the translation is
+ not available and the singular contains the separator. In that case,
+ the returned value is the singular.
+
+ :param singular: The singular form of the string to be translated.
+ may contain a context seperator
+ :type singular: unicode
+ :param plural: The plural form of the string to be translated.
+ :type plural: unicode
+ :param num: the amount for which to decide the translation
+ :type num: int
+ :returns: Translation or the original.
+ :rtype: unicode
+ """
+ if sys.version_info[0] < 3:
+ return gettext.GNUTranslations.ungettext(self, singular,
+ plural, num)
+ else:
+ return gettext.GNUTranslations.ngettext(self, singular,
+ plural, num)
+
+ def sgettext(self, msgid, sep='|'):
+ """
+ Strip the context used for resolving translation ambiguities.
+
+ The translation of msgid is returned unless the translation is
+ not available and the msgid contains the separator. In that case,
+ the returned value is the portion of msgid following the last
+ separator. Default separator is '|'.
+
+ :param msgid: The string to translated.
+ :type msgid: unicode
+ :param sep: The separator marking the context.
+ :type sep: unicode
+ :returns: Translation or the original with context stripped.
+ :rtype: unicode
+ """
+ msgval = self.gettext(msgid)
+ if msgval == msgid:
+ sep_idx = msgid.rfind(sep)
+ msgval = msgid[sep_idx+1:]
+ return msgval
+
+class GrampsNullTranslations(gettext.NullTranslations):
+ """
+ Extends gettext.NullTranslations to provide the sgettext method.
+
+ Note that it's necessary for msgid to be unicode. If it's not,
+ neither will be the returned string.
+ """
+ def sgettext(self, msgid, sep='|'):
+ msgval = self.gettext(msgid)
+ if msgval == msgid:
+ sep_idx = msgid.rfind(sep)
+ msgval = msgid[sep_idx+1:]
+ return msgval
+
+ def language(self):
+ """
+ The null translation returns the raw msgids, which are in English
+ """
+ return "en"
diff --git a/gramps/gen/utils/keyword.py b/gramps/gen/utils/keyword.py
index 696d89dfd..27681920b 100644
--- a/gramps/gen/utils/keyword.py
+++ b/gramps/gen/utils/keyword.py
@@ -50,8 +50,8 @@ Keyword translation interface
# 'n' : nickname = nick name
# 'g' : familynick = family nick name
-import gettext
-_ = gettext.gettext
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
KEYWORDS = [("title", "t", _("Person|Title"), _("Person|TITLE")),
("given", "f", _("Given"), _("GIVEN")),
diff --git a/gramps/gen/utils/lds.py b/gramps/gen/utils/lds.py
index 7dca98c83..ed009bb70 100644
--- a/gramps/gen/utils/lds.py
+++ b/gramps/gen/utils/lds.py
@@ -30,7 +30,8 @@ import sys
import logging
from xml.parsers.expat import ParserCreate
-from ..ggettext import gettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
LOG = logging.getLogger(".")
diff --git a/gramps/gen/utils/mactrans.py b/gramps/gen/utils/maclocale.py
similarity index 68%
rename from gramps/gen/utils/mactrans.py
rename to gramps/gen/utils/maclocale.py
index da9fa77fc..4610faef0 100644
--- a/gramps/gen/utils/mactrans.py
+++ b/gramps/gen/utils/maclocale.py
@@ -71,55 +71,45 @@ locale, leaving $LANGUAGE unset (which is the same as setting it to
"""
-import os, subprocess
+import sys, os, subprocess
-def get_available_translations(dir, domain):
+def mac_setup_localization(glocale, lang, language):
"""
- Get a list of available translations.
-
- :returns: A list of translation languages.
- :rtype: unicode[]
-
+ Set up the localization parameters from OSX's "defaults" system,
+ permitting environment variables to override the settings.
"""
- languages = ["en"]
-
- if dir is None:
- return languages
-
- for langdir in os.listdir(dir):
- mofilename = os.path.join( dir, langdir,
- "LC_MESSAGES", "%s.mo" % domain )
- if os.path.exists(mofilename):
- languages.append(langdir)
-
- languages.sort()
-
- return languages
-
-def mac_setup_localization(dir, domain):
defaults = "/usr/bin/defaults"
find = "/usr/bin/find"
locale_dir = "/usr/share/locale"
- available = get_available_translations(dir, domain)
+ if glocale:
+ available = glocale.get_available_translations()
+ else:
+ available = ['en']
def mac_language_list():
+ """
+ Extract the languages list from defaults.
+ """
languages = []
try:
languages = subprocess.Popen(
[defaults, "read", "-app", "Gramps", "AppleLanguages"],
stderr=open("/dev/null"),
- stdout=subprocess.PIPE).communicate()[0].strip("()\n").split(",\n")
+ stdout=subprocess.PIPE).communicate()[0]
+ if not sys.version_info[0] < 3:
+ languages = languages.decode("utf-8")
+ languages = languages.strip("()\n").split(",\n")
except OSError:
pass
if len(languages) == 0 or (len(languages) == 1 and languages[0] == ""):
-# try:
languages = subprocess.Popen(
[defaults, "read", "-g", "AppleLanguages"],
stderr=open("/dev/null"),
- stdout=subprocess.PIPE).communicate()[0].strip("()\n").split(",\n")
-# except OSError:
-# pass
+ stdout=subprocess.PIPE).communicate()[0]
+ if not sys.version_info[0] < 3:
+ languages = languages.decode("utf-8")
+ languages = languages.strip("()\n").split(",\n")
usable = []
for lang in languages:
lang = lang.strip().strip('"').replace("-", "_", 1)
@@ -137,6 +127,9 @@ def mac_setup_localization(dir, domain):
return usable
def mac_get_locale():
+ """
+ Get the locale and specifiers from defaults.
+ """
locale = ""
calendar = ""
currency = ""
@@ -157,7 +150,7 @@ def mac_setup_localization(dir, domain):
except OSError:
return (locale, calendar, currency)
- div = default_locale.split("@")
+ div = default_locale.split(b"@")
locale = div[0]
if len(div) > 1:
div = div[1].split(";")
@@ -174,6 +167,9 @@ def mac_setup_localization(dir, domain):
return (locale, calendar, currency)
def mac_get_collation():
+ """
+ Extract the collation (sort order) locale from the defaults string.
+ """
collation = ""
try:
collation = subprocess.Popen(
@@ -193,11 +189,13 @@ def mac_setup_localization(dir, domain):
return collation
-# Locale.setlocale() will throw if any LC_* environment variable isn't
-# a fully qualified one present in
-# /usr/share/locale. mac_resolve_locale ensures that a locale meets
-# that requirement.
def mac_resolve_locale(loc):
+ """
+ Locale.setlocale() will throw if any LC_* environment variable
+ isn't a fully qualified one present in
+ /usr/share/locale. mac_resolve_locale ensures that a locale
+ meets that requirement.
+ """
if len(loc) < 2:
return None
if len(loc) >= 5 and os.path.exists(os.path.join(locale_dir, loc[:5])):
@@ -205,17 +203,16 @@ def mac_setup_localization(dir, domain):
if len(loc) > 2:
loc = loc[:2]
# First see if it matches lang
- if (lang.startswith(loc)
+ if (lang and lang.startswith(loc)
and os.path.exists(os.path.join(locale_dir, lang[:5]))):
return lang[:5]
else:
# OK, no, look through the translation list, but that's not likely
# to be 5 letters long either
- for l in translations:
- if (l.startswith(loc) and len(l) >= 5
- and os.path.exists(os.path.join(locale_dir, l[:5]))):
- return l[:5]
- break
+ for _la in translations:
+ if (_la.startswith(loc) and len(_la) >= 5
+ and os.path.exists(os.path.join(locale_dir, _la[:5]))):
+ return _la[:5]
else:
# so as a last resort, pick the first one for that language.
@@ -231,33 +228,65 @@ def mac_setup_localization(dir, domain):
# The action starts here
(loc, currency, calendar) = mac_get_locale()
- collation = mac_get_collation()
translations = mac_language_list()
+ if "LC_COLLATE" in os.environ:
+ collation = os.environ["LC_COLLATE"]
+ else:
+ collation = mac_get_collation()
- if "LANGUAGE" not in os.environ:
- if len(translations) > 0:
- if "MULTI_TRANSLATION" in os.environ:
- os.environ["LANGUAGE"] = ":".join(translations)
- else:
- os.environ["LANGUAGE"] = translations[0]
- elif (len(loc) > 0 and loc in available
- and not locale.starts_with("en")):
- os.environ["LANGUAGE"] = locale
- elif (len(collation) > 0 and collation in available
- and not collation.starts_with("en")):
- os.environ["LANGUAGE"] = collation
+ if not lang:
+ if "LANG" in os.environ:
+ lang = os.environ["LANG"]
+ else:
+ lang = "en_US"
+ loc = mac_resolve_locale(loc)
+ if loc != None:
+ lang = loc
+ if not lang and collation != None:
+ lang = mac_resolve_locale(collation)
+
+ glocale.lang = lang
+
+ if not language or len(language) == 0:
+ if "LANGUAGE" in os.environ:
+ language = [l for l in os.environ["LANGUAGE"].split(":")
+ if l[:5] in available or l[:2] in available]
+ elif lang != "en_US":
+ language = [lang]
+ else:
+ if len(translations) > 0:
+ language = translations
+ elif (len(loc) > 0 and loc in available
+ and not loc.startswith("en")):
+ language = [loc]
+ elif (len(collation) > 0 and collation in available
+ and not collation.startswith("en")):
+ language = [collation]
+
+ glocale.language = language
+
+ if currency and "LC_MONETARY" not in os.environ:
+ glocale.currency = currency
+ os.environ["LC_MONETARY"] = currency
+ elif "LC_MONETARY" in os.environ:
+ glocale.currency = os.environ[LC_MONETARY]
+ else:
+ glocale.currency = lang
+
+ if calendar and "LC_TIME" not in os.environ:
+ glocale.calendar = calendar
+ os.environ["LC_TIME"] = calendar
+ elif "LC_TIME" in os.environ:
+ glocale.calendar = os.environ["LC_TIME"]
+ else:
+ glocale.calendar = lang
+
+ if collation and "LC_COLLATION" not in os.environ:
+ glocale.collation = collation
+ os.environ["LC_COLLATION"] = calendar
+ elif "LC_COLLATION" in os.environ:
+ glocale.collation = os.environ["LC_COLLATION"]
+ else:
+ glocale.collation = lang
- if "LANG" not in os.environ:
- lang = "en_US"
- loc = mac_resolve_locale(loc)
- if loc != None:
- lang = loc
- collation = mac_resolve_locale(collation)
- if "LC_COLLATE" not in os.environ and collation != None:
- os.environ["LC_COLLATE"] = collation
- elif len(collation) > 0:
- lang = mac_resolve_locale(collation)
- if lang != None:
- os.environ["LANG"] = lang
- os.environ["LC_CTYPE"] = lang + ".UTF-8"
diff --git a/gramps/gen/utils/place.py b/gramps/gen/utils/place.py
index e2fe89af1..cf5bfa942 100644
--- a/gramps/gen/utils/place.py
+++ b/gramps/gen/utils/place.py
@@ -31,7 +31,8 @@
#-------------------------------------------------------------------------
from __future__ import print_function, unicode_literals
-from ..ggettext import gettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import math
#-------------------------------------------------------------------------
diff --git a/gramps/gen/utils/string.py b/gramps/gen/utils/string.py
index c8e738bc3..27a1479f9 100644
--- a/gramps/gen/utils/string.py
+++ b/gramps/gen/utils/string.py
@@ -32,7 +32,8 @@ String mappings for constants
#
#-------------------------------------------------------------------------
from ..lib import Person, Citation, FamilyRelType
-from ..ggettext import sgettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gen/utils/svn.py b/gramps/gen/utils/svn.py
deleted file mode 100644
index d837da48f..000000000
--- a/gramps/gen/utils/svn.py
+++ /dev/null
@@ -1,67 +0,0 @@
-#
-# Gramps - a GTK+/GNOME based genealogy program
-#
-# Copyright (C) 2012 Doug Blank
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-
-# $Id$
-
-"""
-Based on the version from Django, a Python ORM.
-"""
-
-import re
-import os
-
-from ..constfunc import cuni
-
-def get_svn_revision(path=None):
- """
- Returns the SVN revision in the form SVN-XXXX,
- where XXXX is the revision number.
-
- Returns "" if anything goes wrong, such as an unexpected
- format of internal SVN files.
-
- If path is provided, it should be a directory whose SVN info you
- want to inspect. If it's not provided, this will use the directory
- where this file resides.
- """
- rev = None
- if path is None:
- path = os.path.dirname(__file__)
- entries_path = '%s/.svn/entries' % path
- try:
- entries = open(entries_path, 'r').read()
- except IOError:
- pass
- else:
- # Versions >= 7 of the entries file are flat text. The first line is
- # the version number. The next set of digits after 'dir' is the revision
- if re.match('(\d+)', entries):
- rev_match = re.search('\d+\s+dir\s+(\d+)', entries)
- if rev_match:
- rev = rev_match.groups()[0]
- # Older XML versions of the file specify revision as an attribute of
- # the first entries node.
- else:
- from xml.dom import minidom
- dom = minidom.parse(entries_path)
- rev = dom.getElementsByTagName('entry')[0].getAttribute('revision')
- if rev:
- return cuni('SVN-%s' % rev)
- return cuni('')
diff --git a/gramps/gen/utils/trans.py b/gramps/gen/utils/trans.py
deleted file mode 100644
index 9f0aa39a5..000000000
--- a/gramps/gen/utils/trans.py
+++ /dev/null
@@ -1,334 +0,0 @@
-#
-# Gramps - a GTK+/GNOME based genealogy program
-#
-# Copyright (C) 2000-2006 Donald N. Allingham
-# Copyright (C) 2009 Brian G. Matherly
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-
-# $Id$
-
-"""
-Provide translation assistance
-"""
-
-#------------------------------------------------------------------------
-#
-# python modules
-#
-#------------------------------------------------------------------------
-import gettext
-import sys
-import os
-import locale
-import logging
-
-#-------------------------------------------------------------------------
-#
-# gramps modules
-#
-#-------------------------------------------------------------------------
-from ..const import PREFIXDIR, ROOT_DIR
-from ..constfunc import mac, UNITYPE
-#-------------------------------------------------------------------------
-#
-# Public Constants
-#
-#-------------------------------------------------------------------------
-if "GRAMPSI18N" in os.environ:
- if os.path.exists(os.environ["GRAMPSI18N"]):
- LOCALEDIR = os.environ["GRAMPSI18N"]
- else:
- LOCALEDIR = None
-elif os.path.exists( os.path.join(ROOT_DIR, "lang") ):
- LOCALEDIR = os.path.join(ROOT_DIR, "lang")
-elif os.path.exists(os.path.join(PREFIXDIR, "share/locale")):
- LOCALEDIR = os.path.join(PREFIXDIR, "share/locale")
-else:
- lang = os.environ.get('LANG', 'en')
- if lang and lang[:2] == 'en':
- pass # No need to display warning, we're in English
- else:
- logging.warning('Locale dir does not exist at ' +
- os.path.join(PREFIXDIR, "share/locale"))
- logging.warning('Running python setup.py install --prefix=YourPrefixDir might fix the problem')
- LOCALEDIR = None
-
-LOCALEDOMAIN = 'gramps'
-
-if mac():
- from . import mactrans
- mactrans.mac_setup_localization(LOCALEDIR, LOCALEDOMAIN)
-else:
- lang = ' '
- try:
- lang = os.environ["LANG"]
- except KeyError:
- lang = locale.getlocale()[0]
- if not lang:
- try:
- lang = locale.getdefaultlocale()[0] + '.UTF-8'
- except TypeError:
- logging.warning('Unable to determine your Locale, using English')
- lang = 'en.UTF-8'
-
- os.environ["LANG"] = lang
- os.environ["LANGUAGE"] = lang
-
-#-------------------------------------------------------------------------
-#
-# Public Functions
-#
-#-------------------------------------------------------------------------
-def setup_gettext():
- """
- Setup the gettext environment.
-
- :returns: Nothing.
-
- """
- gettext.bindtextdomain(LOCALEDOMAIN, LOCALEDIR)
- gettext.textdomain(LOCALEDOMAIN)
- try:
- locale.bindtextdomain(LOCALEDOMAIN, LOCALEDIR)
- except ValueError:
- logging.warning('Failed to bind text domain, Gtk.Builder() has no translation')
-
- #following installs _ as a python function, we avoid this as this module is
- #used sometimes:
- #gettext.install(LOCALEDOMAIN, LOCALEDIR, unicode=1)
-
-def find_intl(fname):
- """
- Routine for finding if fname is in path
- Returns path to fname or None
- """
- os_path = os.environ['PATH']
- for subpath in os_path.split(';'):
- path2file = subpath + '\\' + fname
- if os.path.isfile(path2file):
- return path2file
- return None
-
-def test_trans(str2trans,libintl):
- """
- Routine to see if translation works
- Returns translated string
- """
- transstr = libintl.gettext(str2trans, LOCALEDOMAIN)
- return transstr
-
-def init_windows_gettext(intl_path):
- """
- Help routine for loading and setting up libintl attributes
- Returns libintl
- """
- import ctypes
- libintl = ctypes.cdll.LoadLibrary(intl_path)
- libintl.bindtextdomain(LOCALEDOMAIN,
- LOCALEDIR.encode(sys.getfilesystemencoding()))
- libintl.textdomain(LOCALEDOMAIN)
- libintl.bind_textdomain_codeset(LOCALEDOMAIN, "UTF-8")
- libintl.gettext.restype = ctypes.c_char_p
- return libintl
-
-def setup_windows_gettext():
- """
- Windows specific function for migrating from LibGlade to GtkBuilder
- Glade had a Gtk.glade.bindtextdomain() function to define the directory
- where to look for translations (.mo-files). It is now replaced with call
- to locale.bindtextdomain() which exposes the C librarys gettext
- interface on systems that provide this interface.
- As MS Standard Runtime C library have not such interface call to
- Python's locale.bindtextdomain() is not supported on Windows systems.
- To get translation to work we must use gettext runtime library directly
- using ctypes.
-
- SEE: https://bugzilla.gnome.org/show_bug.cgi?id=574520
-
- NOTE: officially GTK is built in a way that allows deployment without
- gettext runtime library in addition to that for historic reason and
- compability libraries are built with MS name style convention like
- "intl.dll" but private builds may use posix/ld-linker tradition like
- "libintlX-X.dll" which in recent gettext version would be libintl-8.dll
- """
-
- # 0. See if there is a libintl-8.dll in working directory
- intl_path = os.path.join(os.getcwd(), 'libintl-8.dll')
- if os.path.isfile(intl_path) and not LOCALEDIR is None:
- libintl = init_windows_gettext(intl_path)
- return
-
- str2translate = "Family Trees - Gramps"
- translated = ""
-
- # 1. See if there is a intl.dll in Windows/system
- os_path = os.environ['PATH']
- intl_path = 'c:\\WINDOWS\\system\\intl.dll'
- if os.path.isfile(intl_path) and not LOCALEDIR is None:
- libintl = init_windows_gettext(intl_path)
- # Now check for translation.
- translated = test_trans(str2translate,libintl)
- if str2translate != translated:
- #Translation complete
- return
-
- #2. See if there is a libintl-8.dll in the current path
- intl_path = find_intl('\\libintl-8.dll')
- if intl_path and not LOCALEDIR is None:
- libintl = init_windows_gettext(intl_path)
- # Now check for translation.
- translated = test_trans(str2translate,libintl)
- if str2translate != translated:
- #Translation complete
- return
-
- #3. See if there is another intl.dll in current path
- intl_path = find_intl('\\intl.dll')
- if intl_path and not LOCALEDIR is None:
- libintl = init_windows_gettext(intl_path)
- # Now check for translation.
- translated = test_trans(str2translate,libintl)
- if str2translate != translated:
- #Translation complete
- return
-
- # 4. If strings are equal, see if we have English as language
- lang = ' '
- try:
- lang = os.environ["LANG"]
- except KeyError:
- # if LANG is not set
- lang = locale.getlocale()[0]
- if not lang:
- # if lang is empty/None
- lang = locale.getdefaultlocale()[0]
- # See if lang begins with en_, English_ or english_
- enlang = lang.split('_')[0].lower()
- if enlang in ('en', 'english', 'c'):
- return
-
- # No complete/working translation found
- logging.warning("Translation might not be complete, "
- "not working for your locale")
-
-
-def get_localedomain():
- """
- Get the LOCALEDOMAIN used for the Gramps application.
- """
- return LOCALEDOMAIN
-
-def get_addon_translator(filename=None, domain="addon", languages=None):
- """
- Get a translator for an addon.
-
- filename - filename of a file in directory with full path, or
- None to get from running code
- domain - the name of the .mo file under the LANG/LC_MESSAGES dir
- languages - a list of languages to force
- returns - a gettext.translation object
-
- Example:
- _ = get_addon_translator(languages=["fr_BE.utf8"]).gettext
-
- The return object has the following properties and methods:
- .gettext
- .info
- .lgettext
- .lngettext
- .ngettext
- .output_charset
- .plural
- .set_output_charset
- .ugettext
- .ungettext
-
- Assumes path/filename
- path/locale/LANG/LC_MESSAGES/addon.mo.
- """
- if filename is None:
- filename = sys._getframe(1).f_code.co_filename
- gramps_translator = gettext.translation(LOCALEDOMAIN, LOCALEDIR,
- fallback=True)
- path = os.path.dirname(os.path.abspath(filename))
- # Check if path is of type str. Do import and conversion if so.
- # The import cannot be done at the top as that will conflict with the translation system.
- if not isinstance(path, UNITYPE) == str:
- from .file import get_unicode_path_from_env_var
- path = get_unicode_path_from_env_var(path)
- if languages:
- addon_translator = gettext.translation(domain,
- os.path.join(path, "locale"),
- languages=languages,
- fallback=True)
- else:
- addon_translator = gettext.translation(domain,
- os.path.join(path, "locale"),
- fallback=True)
- gramps_translator.add_fallback(addon_translator)
- return gramps_translator # with a language fallback
-
-def get_available_translations():
- """
- Get a list of available translations.
-
- :returns: A list of translation languages.
- :rtype: unicode[]
-
- """
- languages = ["en"]
-
- if LOCALEDIR is None:
- return languages
-
- for langdir in os.listdir(LOCALEDIR):
- mofilename = os.path.join( LOCALEDIR, langdir,
- "LC_MESSAGES", "%s.mo" % LOCALEDOMAIN )
- if os.path.exists(mofilename):
- languages.append(langdir)
-
- languages.sort()
-
- return languages
-
-def trans_objclass(objclass_str):
- """
- Translates objclass_str into "... %s", where objclass_str
- is 'Person', 'person', 'Family', 'family', etc.
- """
- from ..ggettext import gettext as _
- objclass = objclass_str.lower()
- if objclass == "person":
- return _("the person")
- elif objclass == "family":
- return _("the family")
- elif objclass == "place":
- return _("the place")
- elif objclass == "event":
- return _("the event")
- elif objclass == "repository":
- return _("the repository")
- elif objclass == "note":
- return _("the note")
- elif objclass in ["media", "mediaobject"]:
- return _("the media")
- elif objclass == "source":
- return _("the source")
- elif objclass == "filter":
- return _("the filter")
- else:
- return _("See details")
diff --git a/gramps/gen/utils/unknown.py b/gramps/gen/utils/unknown.py
index 56d6fe927..b565e535d 100644
--- a/gramps/gen/utils/unknown.py
+++ b/gramps/gen/utils/unknown.py
@@ -45,7 +45,8 @@ from ..lib import (Person, Surname, Name, NameType, Family, FamilyRelType,
ChildRef, ChildRefType)
from .id import create_id
from ..const import IMAGE_DIR
-from ..ggettext import sgettext as _
+from ..const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/grampsapp.py b/gramps/grampsapp.py
index 2835ee55a..4e54e7dc8 100644
--- a/gramps/grampsapp.py
+++ b/gramps/grampsapp.py
@@ -39,8 +39,7 @@ if sys.version_info[0] < 3:
##
import os
import signal
-import gettext
-_ = gettext.gettext
+
import locale
import logging
@@ -55,6 +54,7 @@ from subprocess import Popen, PIPE
#-------------------------------------------------------------------------
from .gen.const import APP_GRAMPS, USER_DIRLIST, HOME_DIR, VERSION_TUPLE
from .gen.constfunc import win
+
#-------------------------------------------------------------------------
#
# Setup logging
@@ -68,7 +68,9 @@ from .gen.constfunc import win
"""Setup basic logging support."""
# Setup a formatter
-form = logging.Formatter(fmt="%(relativeCreated)d: %(levelname)s: %(filename)s: line %(lineno)d: %(message)s")
+form = logging.Formatter(fmt="%(asctime)s.%(msecs).03d: %(levelname)s: "
+ "%(filename)s: line %(lineno)d: %(message)s",
+ datefmt='%Y-%m-%d %H:%M:%S')
# Create the log handlers
if win():
@@ -87,7 +89,7 @@ if win():
pass # ok
elif not os.path.isdir(HOME_DIR):
os.makedirs(HOME_DIR)
- sys.stdout = sys.stderr = open(logfile, "w")
+ sys.stdout = sys.stderr = io.open(logfile, "w", encoding='utf-8')
stderrh = logging.StreamHandler(sys.stderr)
stderrh.setFormatter(form)
stderrh.setLevel(logging.DEBUG)
@@ -113,62 +115,15 @@ def exc_hook(type, value, tb):
sys.excepthook = exc_hook
from .gen.mime import mime_type_is_defined
-from .gen.utils.trans import LOCALEDOMAIN, LOCALEDIR, setup_windows_gettext
+
#-------------------------------------------------------------------------
#
-# Load internationalization setup
+# Instantiate Localization
#
#-------------------------------------------------------------------------
-#the order in which bindtextdomain on gettext and on locale is called
-#appears important, so we refrain from doing first all gettext.
-#
-#setup_gettext()
-gettext.bindtextdomain(LOCALEDOMAIN, LOCALEDIR)
-try:
- locale.setlocale(locale.LC_ALL,'')
-except:
- logging.warning(_("WARNING: Setting locale failed. Please fix the "
- "LC_* and/or the LANG environment variables to prevent this error"))
- try:
- # It is probably not necessary to set the locale to 'C'
- # because the locale will just stay at whatever it was,
- # which at startup is "C".
- # however this is done here just to make sure that the locale
- # functions are working
- locale.setlocale(locale.LC_ALL,'C')
- except:
- logging.warning(_("ERROR: Setting the 'C' locale didn't work either"))
- # FIXME: This should propagate the exception,
- # if that doesn't break Gramps under Windows
- # raise
-
-gettext.textdomain(LOCALEDOMAIN)
-if sys.version_info[0] < 3:
- gettext.install(LOCALEDOMAIN, localedir=None, unicode=1) #None is sys default locale
-else:
- gettext.install(LOCALEDOMAIN, localedir=None) #None is sys default locale
-
-if hasattr(os, "uname"):
- operating_system = os.uname()[0]
-else:
- operating_system = sys.platform
-
-if win(): # Windows
- setup_windows_gettext()
-elif operating_system == 'FreeBSD':
- try:
- gettext.bindtextdomain(LOCALEDOMAIN, LOCALEDIR)
- except locale.Error:
- logging.warning('No translation in some Gtk.Builder strings, ')
-elif operating_system == 'OpenBSD':
- pass
-else: # normal case
- try:
- locale.bindtextdomain(LOCALEDOMAIN, LOCALEDIR)
- #locale.textdomain(LOCALEDOMAIN)
- except locale.Error:
- logging.warning('No translation in some Gtk.Builder strings, ')
+from .gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
@@ -187,6 +142,16 @@ if not sys.version_info >= MIN_PYTHON_VERSION :
'v3': MIN_PYTHON_VERSION[2]})
sys.exit(1)
+if sys.version_info[0] >= 3:
+ #check if bsddb3 is installed
+ try:
+ import bsddb3
+ except ImportError:
+ logging.warning(_("\nYou don't have the python bsddb3 package installed."
+ " This package is needed to start Gramps.\n\n"
+ "Gramps will terminate now."))
+ sys.exit(1)
+
#-------------------------------------------------------------------------
#
# gramps libraries
@@ -229,21 +194,34 @@ def show_settings():
try:
from gi.repository import GObject
try:
- gobjectver_str = '%d.%d.%d' % GObject.pygobject_version
+ pygobjectver_str = '%d.%d.%d' % GObject.pygobject_version
except :# any failure to 'get' the version
- gobjectver_str = 'unknown version'
+ pygobjectver_str = 'unknown version'
except ImportError:
- gobjectver_str = 'not found'
+ pygobjectver_str = 'not found'
+
+ try:
+ from gi.repository import Pango
+ try:
+ pangover_str = Pango.version_string()
+ except :# any failure to 'get' the version
+ pangover_str = 'unknown version'
+
+ except ImportError:
+ pangover_str = 'not found'
try:
import cairo
try:
- cairover_str = '%d.%d.%d' % cairo.version_info
+ pycairover_str = '%d.%d.%d' % cairo.version_info
+ cairover_str = cairo.cairo_version_string()
except :# any failure to 'get' the version
+ pycairover_str = 'unknown version'
cairover_str = 'unknown version'
except ImportError:
+ pycairover_str = 'not found'
cairover_str = 'not found'
try:
@@ -279,7 +257,8 @@ def show_settings():
else:
import bsddb
bsddb_str = bsddb.__version__
- bsddb_db_str = str(bsddb.db.version())
+ bsddb_db_str = str(bsddb.db.version()).replace(', ', '.')\
+ .replace('(', '').replace(')', '')
except:
bsddb_str = 'not found'
bsddb_db_str = 'not found'
@@ -303,8 +282,10 @@ def show_settings():
try:
dotversion_str = Popen(['dot', '-V'], stderr=PIPE).communicate(input=None)[1]
+ if isinstance(dotversion_str, bytes):
+ dotversion_str = dotversion_str.decode(sys.stdin.encoding)
if dotversion_str:
- dotversion_str = dotversion_str.replace('\n','')
+ dotversion_str = dotversion_str.replace('\n','')[23:27]
except:
dotversion_str = 'Graphviz not in system PATH'
@@ -313,6 +294,8 @@ def show_settings():
gsversion_str = Popen(['gswin32c', '--version'], stdout=PIPE).communicate(input=None)[0]
else:
gsversion_str = Popen(['gs', '--version'], stdout=PIPE).communicate(input=None)[0]
+ if isinstance(gsversion_str, bytes):
+ gsversion_str = gsversion_str.decode(sys.stdin.encoding)
if gsversion_str:
gsversion_str = gsversion_str.replace('\n', '')
except:
@@ -326,7 +309,8 @@ def show_settings():
print (' python : %s' % py_str)
print (' gramps : %s' % gramps_str)
print (' gtk++ : %s' % gtkver_str)
- print (' gobject : %s' % gobjectver_str)
+ print (' pygobject : %s' % pygobjectver_str)
+ print (' pango : %s' % pangover_str)
if usebsddb3:
print (' Using bsddb3')
else:
@@ -334,9 +318,10 @@ def show_settings():
print (' bsddb : %s' % bsddb_str)
print (' bsddb.db : %s' % bsddb_db_str)
print (' cairo : %s' % cairover_str)
+ print (' pycairo : %s' % pycairover_str)
print (' osmgpsmap : %s' % osmgpsmap_str)
print (' pyexiv2 : %s' % pyexiv2_str)
- print (' o.s. : %s' % operating_system)
+ print (' o.s. : %s' % sys.platform)
if kernel:
print (' kernel : %s' % kernel)
print ('')
@@ -463,4 +448,4 @@ def main():
logging.warning(error[0] + error[1])
if __name__ == '__main__':
- main()
\ No newline at end of file
+ main()
diff --git a/gramps/gui/aboutdialog.py b/gramps/gui/aboutdialog.py
index 71614105c..868dfc466 100644
--- a/gramps/gui/aboutdialog.py
+++ b/gramps/gui/aboutdialog.py
@@ -27,7 +27,8 @@
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import os
import sys
diff --git a/gramps/gui/autocomp.py b/gramps/gui/autocomp.py
index 7dacdd6ca..200d3ccbb 100644
--- a/gramps/gui/autocomp.py
+++ b/gramps/gui/autocomp.py
@@ -31,8 +31,6 @@ Provide autocompletion functionality.
#-------------------------------------------------------------------------
from __future__ import print_function
-import locale
-
#-------------------------------------------------------------------------
#
# GNOME modules
@@ -41,8 +39,8 @@ import locale
from gi.repository import Gtk
from gi.repository import GObject
-
from gramps.gen.constfunc import STRTYPE
+from gramps.gen.const import GRAMPS_LOCALE as glocale
def fill_combo(combo, data_list):
"""
@@ -194,7 +192,7 @@ class StandardCustomSelector(object):
"""
Method for sorting keys based on the values.
"""
- return locale.strxfrm(self.mapping[val])
+ return glocale.sort_key(self.mapping[val])
def get_values(self):
"""
diff --git a/gramps/gui/basesidebar.py b/gramps/gui/basesidebar.py
index 14bc7394e..1b2bce7ff 100644
--- a/gramps/gui/basesidebar.py
+++ b/gramps/gui/basesidebar.py
@@ -42,3 +42,15 @@ class BaseSidebar(object):
Called when the active view is changed.
"""
raise NotImplementedError
+
+ def active(self, cat_num, view_num):
+ """
+ Called when the sidebar is made visible.
+ """
+ pass
+
+ def inactive(self):
+ """
+ Called when the sidebar is hidden.
+ """
+ pass
diff --git a/gramps/gui/clipboard.py b/gramps/gui/clipboard.py
index 0c692720c..303fd3880 100644
--- a/gramps/gui/clipboard.py
+++ b/gramps/gui/clipboard.py
@@ -50,14 +50,14 @@ from gi.repository import GdkPixbuf
# gramps modules
#
#-------------------------------------------------------------------------
-from gramps.gen.const import IMAGE_DIR, URL_MANUAL_PAGE
+from gramps.gen.const import IMAGE_DIR, URL_MANUAL_PAGE, GRAMPS_LOCALE as glocale
from gramps.gen.config import config
from gramps.gen.lib import NoteType
from gramps.gen.datehandler import get_date
from .display import display_help
from .managedwindow import ManagedWindow
-from gramps.gen.ggettext import sgettext as _
-from gramps.gen.utils.trans import trans_objclass
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gen.constfunc import mac
from .glade import Glade
from .ddtargets import DdTargets
@@ -1163,7 +1163,10 @@ class ClipboardListView(object):
def object_drag_data_get(self, widget, context, sel_data, info, time):
tree_selection = widget.get_selection()
model, paths = tree_selection.get_selected_rows()
- tgs = context.list_targets()
+ if hasattr(context, "targets"):
+ tgs = context.targets
+ else:
+ tgs = context.list_targets()
if len(paths) == 1:
path = paths[0]
node = model.get_iter(path)
@@ -1181,7 +1184,10 @@ class ClipboardListView(object):
time, title=None, value=None, dbid=None,
dbname=None):
model = widget.get_model()
- sel_data = selection.get_data()
+ if hasattr(selection, "data"):
+ sel_data = selection.data
+ else:
+ sel_data = selection.get_data() # GtkSelectionData
# In Windows time is always zero. Until that is fixed, use the seconds
# of the local time to filter out double drops.
realTime = strftime("%S")
@@ -1212,7 +1218,10 @@ class ClipboardListView(object):
if dragtype in self._target_type_to_wrapper_class_map:
possible_wrappers = [dragtype]
else:
- tgs = [atm.name() for atm in context.list_targets()]
+ if hasattr(context, "targets"):
+ tgs = context.targets
+ else:
+ tgs = [atm.name() for atm in context.list_targets()]
possible_wrappers = [target for target in tgs
if target in self._target_type_to_wrapper_class_map]
@@ -1246,7 +1255,8 @@ class ClipboardListView(object):
data = [o.__class__.DRAG_TARGET.drag_type, o, None,
o._type, o._value, o._dbid, o._dbname]
contains = model_contains(model, data)
- if context.get_actions() != Gdk.DragAction.MOVE and contains:
+ if ((context.action if hasattr(context, "action") else context.get_actions())
+ != Gdk.DragAction.MOVE) and contains:
continue
drop_info = widget.get_dest_row_at_pos(x, y)
if drop_info:
@@ -1263,7 +1273,8 @@ class ClipboardListView(object):
# FIXME: there is one bug here: if you multi-select and drop
# on self, then it moves the first, and copies the rest.
- if context.get_actions() == Gdk.DragAction.MOVE:
+ if ((context.action if hasattr(context, "action") else context.get_actions()) ==
+ Gdk.DragAction.MOVE):
context.finish(True, True, time)
# remember time for double drop workaround.
@@ -1459,13 +1470,13 @@ class MultiTreeView(Gtk.TreeView):
objclass, handle = None, None
if objclass in ['Person', 'Event', 'Media', 'Source',
'Repository', 'Family', 'Note', 'Place']:
- menu_item = Gtk.MenuItem(label=_("the object|See %s details") % trans_objclass(objclass))
+ menu_item = Gtk.MenuItem(label=_("the object|See %s details") % glocale.trans_objclass(objclass))
menu_item.connect("activate",
lambda widget: self.edit_obj(objclass, handle))
popup.append(menu_item)
menu_item.show()
# ---------------------------
- menu_item = Gtk.MenuItem(label=_("the object|Make %s active") % trans_objclass(objclass))
+ menu_item = Gtk.MenuItem(label=_("the object|Make %s active") % glocale.trans_objclass(objclass))
menu_item.connect("activate",
lambda widget: self.uistate.set_active(handle, objclass))
popup.append(menu_item)
@@ -1481,7 +1492,7 @@ class MultiTreeView(Gtk.TreeView):
obj = self.dbstate.db.get_table_metadata(objclass)["handle_func"](my_handle)
if obj:
gids.add(obj.gramps_id)
- menu_item = Gtk.MenuItem(label=_("the object|Create Filter from %s selected...") % trans_objclass(objclass))
+ menu_item = Gtk.MenuItem(label=_("the object|Create Filter from %s selected...") % glocale.trans_objclass(objclass))
menu_item.connect("activate",
lambda widget: make_filter(self.dbstate, self.uistate,
objclass, gids, title=self.title))
diff --git a/gramps/gui/columnorder.py b/gramps/gui/columnorder.py
index 57894487a..2b533f235 100644
--- a/gramps/gui/columnorder.py
+++ b/gramps/gui/columnorder.py
@@ -32,7 +32,8 @@ Handle the column ordering
# python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import logging
#-------------------------------------------------------------------------
diff --git a/gramps/gui/configure.py b/gramps/gui/configure.py
index a04d3a8ee..292711353 100644
--- a/gramps/gui/configure.py
+++ b/gramps/gui/configure.py
@@ -5,6 +5,7 @@
# Copyright (C) 2008 Raphael Ackermann
# Copyright (C) 2010 Benny Malengier
# Copyright (C) 2010 Nick Hall
+# Copyright (C) 2012 Doug Blank
#
# 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
@@ -31,7 +32,8 @@
from __future__ import print_function
import random
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import os
from xml.sax.saxutils import escape
import collections
@@ -278,7 +280,7 @@ class ConfigureDialog(ManagedWindow):
config=None):
if not config:
config = self.__config
- radiobox = Gtk.RadioButton(group,label)
+ radiobox = Gtk.RadioButton.new_with_mnemonic_from_widget(group, label)
if config.get(constant) == True:
radiobox.set_active(True)
radiobox.connect('toggled', self.update_radiobox, constant)
@@ -321,18 +323,23 @@ class ConfigureDialog(ManagedWindow):
table.attach(hbox, 2, 3, index, index+1, yoptions=0)
def add_entry(self, table, label, index, constant, callback=None,
- config=None):
+ config=None, col_attach=0):
if not config:
config = self.__config
if not callback:
callback = self.update_entry
- lwidget = BasicLabel("%s: " % label)
+ if label:
+ lwidget = BasicLabel("%s: " % label)
entry = Gtk.Entry()
entry.set_text(config.get(constant))
entry.connect('changed', callback, constant)
- table.attach(lwidget, 0, 1, index, index+1, yoptions=0,
- xoptions=Gtk.AttachOptions.FILL)
- table.attach(entry, 1, 2, index, index+1, yoptions=0)
+ if label:
+ table.attach(lwidget, col_attach, col_attach+1, index, index+1, yoptions=0,
+ xoptions=Gtk.AttachOptions.FILL)
+ table.attach(entry, col_attach+1, col_attach+2, index, index+1, yoptions=0)
+ else:
+ table.attach(entry, col_attach, col_attach+1, index, index+1, yoptions=0)
+ return entry
def add_pos_int_entry(self, table, label, index, constant, callback=None,
config=None, col_attach=1):
@@ -887,6 +894,12 @@ class GrampsPreferences(ConfigureDialog):
self.dbstate.db.name_formats = _nd.get_name_format(only_custom=True,
only_active=False)
+ def cb_grampletbar_close(self, obj):
+ """
+ Gramplet bar close button preference callback
+ """
+ self.uistate.emit('grampletbar-close-changed')
+
def add_formats_panel(self, configdialog):
row = 0
table = Gtk.Table(4, 4)
@@ -1052,6 +1065,13 @@ class GrampsPreferences(ConfigureDialog):
_("Show text in sidebar buttons (requires restart)"),
row, 'interface.sidebar-text', stop=3)
row += 1
+
+ # Gramplet bar close buttons:
+ self.add_checkbox(table,
+ _("Show close button in gramplet bar tabs"),
+ row, 'interface.grampletbar-close', stop=3,
+ extra_callback=self.cb_grampletbar_close)
+ row += 1
return _('Display'), table
def add_text_panel(self, configdialog):
@@ -1100,6 +1120,11 @@ class GrampsPreferences(ConfigureDialog):
config.set('behavior.do-not-show-previously-seen-updates',
bool(active))
+ def toggle_tag_on_import(self, obj):
+ active = obj.get_active()
+ config.set('preferences.tag-on-import', bool(active))
+ self.tag_format_entry.set_sensitive(bool(active))
+
def check_for_updates_changed(self, obj):
active = obj.get_active()
config.set('behavior.check-for-updates', active)
@@ -1147,32 +1172,54 @@ class GrampsPreferences(ConfigureDialog):
return _('Dates'), table
def add_behavior_panel(self, configdialog):
- table = Gtk.Table(3, 6)
+ table = Gtk.Table(2, 8)
table.set_border_width(12)
table.set_col_spacings(6)
table.set_row_spacings(6)
+ current_line = 0
self.add_checkbox(table,
- _('Add default source on import'),
- 0, 'preferences.default-source')
+ _('Add default source on GEDCOM import'),
+ current_line, 'preferences.default-source')
+
+ current_line += 1
+ checkbutton = Gtk.CheckButton(_("Add tag on import"))
+ checkbutton.set_active(config.get('preferences.tag-on-import'))
+ checkbutton.connect("toggled", self.toggle_tag_on_import)
+ table.attach(checkbutton, 1, 2, current_line, current_line+1, yoptions=0)
+ self.tag_format_entry = self.add_entry(table, None, current_line,
+ 'preferences.tag-on-import-format',
+ col_attach=2)
+ self.tag_format_entry.set_sensitive(config.get('preferences.tag-on-import'))
+
+ current_line += 1
self.add_checkbox(table,
_('Enable spelling checker'),
- 1, 'behavior.spellcheck')
+ current_line, 'behavior.spellcheck')
+
+ current_line += 1
self.add_checkbox(table,
_('Display Tip of the Day'),
- 2, 'behavior.use-tips')
+ current_line, 'behavior.use-tips')
+
+ current_line += 1
self.add_checkbox(table,
_('Remember last view displayed'),
- 3, 'preferences.use-last-view')
+ current_line, 'preferences.use-last-view')
+
+ current_line += 1
self.add_spinner(table,
_('Max generations for relationships'),
- 4, 'behavior.generation-depth', (5, 50), self.update_gendepth)
+ current_line, 'behavior.generation-depth', (5, 50), self.update_gendepth)
+
+ current_line += 1
self.path_entry = Gtk.Entry()
self.add_path_box(table,
_('Base path for relative media paths'),
- 5, self.path_entry, self.dbstate.db.get_mediapath(),
+ current_line, self.path_entry, self.dbstate.db.get_mediapath(),
self.set_mediapath, self.select_mediapath)
+ current_line += 1
# Check for updates:
obox = Gtk.ComboBoxText()
formats = [_("Never"),
@@ -1185,9 +1232,10 @@ class GrampsPreferences(ConfigureDialog):
obox.set_active(active)
obox.connect('changed', self.check_for_updates_changed)
lwidget = BasicLabel("%s: " % _('Check for updates'))
- table.attach(lwidget, 1, 2, 6, 7, yoptions=0)
- table.attach(obox, 2, 3, 6, 7, yoptions=0)
+ table.attach(lwidget, 1, 2, current_line, current_line+1, yoptions=0)
+ table.attach(obox, 2, 3, current_line, current_line+1, yoptions=0)
+ current_line += 1
self.whattype_box = Gtk.ComboBoxText()
formats = [_("Updated addons only"),
_("New addons only"),
@@ -1202,19 +1250,23 @@ class GrampsPreferences(ConfigureDialog):
self.whattype_box.set_active(0)
self.whattype_box.connect('changed', self.check_for_type_changed)
lwidget = BasicLabel("%s: " % _('What to check'))
- table.attach(lwidget, 1, 2, 7, 8, yoptions=0)
- table.attach(self.whattype_box, 2, 3, 7, 8, yoptions=0)
+ table.attach(lwidget, 1, 2, current_line, current_line+1, yoptions=0)
+ table.attach(self.whattype_box, 2, 3, current_line, current_line+1, yoptions=0)
+ current_line += 1
+ self.add_entry(table, _('Where to check'), current_line, 'behavior.addons-url', col_attach=1)
+
+ current_line += 1
checkbutton = Gtk.CheckButton(
_("Do not ask about previously notified addons"))
checkbutton.set_active(config.get('behavior.do-not-show-previously-seen-updates'))
checkbutton.connect("toggled", self.toggle_hide_previous_addons)
- table.attach(checkbutton, 0, 3, 8, 9, yoptions=0)
+ table.attach(checkbutton, 0, 3, current_line, current_line+1, yoptions=0)
button = Gtk.Button(_("Check now"))
button.connect("clicked", lambda obj: \
self.uistate.viewmanager.check_for_updates(force=True))
- table.attach(button, 3, 4, 8, 9, yoptions=0)
+ table.attach(button, 3, 4, current_line, current_line+1, yoptions=0)
return _('General'), table
diff --git a/gramps/gui/dbloader.py b/gramps/gui/dbloader.py
index 9397a31d5..b889b2fd3 100644
--- a/gramps/gui/dbloader.py
+++ b/gramps/gui/dbloader.py
@@ -31,7 +31,6 @@ Handling of loading new/existing databases.
#
#-------------------------------------------------------------------------
import os
-from gramps.gen.ggettext import gettext as _
import logging
#-------------------------------------------------------------------------
@@ -54,6 +53,8 @@ from gi.repository import GObject
# GRAMPS modules
#
#-------------------------------------------------------------------------
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.cli.grampscli import CLIDbLoader
from gramps.gen.config import config
from gramps.gen.db import DbBsddb
diff --git a/gramps/gui/dbman.py b/gramps/gui/dbman.py
index d6d44bfb2..2b873fef2 100644
--- a/gramps/gui/dbman.py
+++ b/gramps/gui/dbman.py
@@ -50,7 +50,7 @@ else:
import logging
LOG = logging.getLogger(".DbManager")
-from gramps.gen.constfunc import win
+from gramps.gen.constfunc import win, UNITYPE
if win():
_RCS_FOUND = os.system("rcs -V >nul 2>nul") == 0
if _RCS_FOUND and "TZ" not in os.environ:
@@ -73,7 +73,8 @@ from gi.repository import Pango
# gramps modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from .user import User
from .dialog import ErrorDialog, QuestionDialog, QuestionDialog2
from gramps.gen.db import DbBsddb
@@ -798,6 +799,9 @@ def find_revisions(name):
get_next = False
if os.path.isfile(name):
for line in proc.stdout:
+ if sys.version_info[0] >= 3 and not isinstance(line, UNITYPE):
+ # we assume utf-8 ...
+ line = line.decode('utf-8')
match = rev.match(line)
if match:
rev_str = copy.copy(match.groups()[0])
diff --git a/gramps/gui/dialog.py b/gramps/gui/dialog.py
index f510401bb..a9f79efa3 100644
--- a/gramps/gui/dialog.py
+++ b/gramps/gui/dialog.py
@@ -46,7 +46,8 @@ from gi.repository import GdkPixbuf
from gramps.gen.const import ICON
from gramps.gen.config import config
from .glade import Glade
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.constfunc import cuni
try:
@@ -181,10 +182,10 @@ class ErrorDialog(Gtk.MessageDialog):
flags=Gtk.DialogFlags.MODAL,
type=Gtk.MessageType.ERROR,
buttons=Gtk.ButtonsType.CLOSE)
- self.set_markup('%s ' % msg1)
+ self.set_markup('%s ' % str(msg1))
self.format_secondary_text(msg2)
self.set_icon(ICON)
- self.set_title("%s - Gramps" % msg1)
+ self.set_title("%s - Gramps" % str(msg1))
self.show()
self.run()
self.destroy()
@@ -192,7 +193,7 @@ class ErrorDialog(Gtk.MessageDialog):
class RunDatabaseRepair(ErrorDialog):
def __init__(self, msg, parent=None):
if sys.version_info[0] < 3:
- msg = cuni(str(msg).decode(sys.getfilesystemencoding()))
+ msg = cuni(str(msg).decode(glocale.getfilesystemencoding()))
else:
msg = str(msg)
ErrorDialog.__init__(
@@ -207,7 +208,7 @@ class RunDatabaseRepair(ErrorDialog):
class DBErrorDialog(ErrorDialog):
def __init__(self, msg, parent=None):
if sys.version_info[0] < 3:
- msg = cuni(str(msg).decode(sys.getfilesystemencoding()))
+ msg = cuni(str(msg).decode(glocale.getfilesystemencoding()))
else:
msg = str(msg)
ErrorDialog.__init__(
diff --git a/gramps/gui/display.py b/gramps/gui/display.py
index 401f2f724..f4ae0e964 100644
--- a/gramps/gui/display.py
+++ b/gramps/gui/display.py
@@ -23,7 +23,7 @@
from gramps.gen.const import URL_MANUAL_PAGE, URL_WIKISTRING
from gramps.gen.constfunc import is_quartz
from gramps.gen.config import config
-import locale
+from gramps.gen.const import GRAMPS_LOCALE as glocale
import os
#list of manuals on wiki, map locale code to wiki extension, add language codes
@@ -40,28 +40,11 @@ MANUALS = {
}
#first, determine language code, so nl_BE --> wiki /nl
-LANG = locale.getlocale()[0]
-if not LANG:
- LANG = 'C'
-#support environment overrule:
-try:
- if not os.environ['LANGUAGE'] or \
- os.environ['LANGUAGE'].split(':')[0] == LANG:
- pass
- else:
- LANG = os.environ['LANGUAGE'].split(':')[0]
-except:
- pass
-EXTENSION = ''
-try:
- EXTENSION = MANUALS[LANG]
-except KeyError:
- pass
-try:
- if not EXTENSION :
- EXTENSION = MANUALS[LANG.split('_')[0]]
-except KeyError:
- pass
+lang = glocale.get_translation().language()
+if lang in MANUALS:
+ EXTENSION = MANUALS[lang]
+else:
+ EXTENSION = ''
def display_help(webpage='', section=''):
"""
diff --git a/gramps/gui/displaystate.py b/gramps/gui/displaystate.py
index b6900b36c..d7d202b94 100644
--- a/gramps/gui/displaystate.py
+++ b/gramps/gui/displaystate.py
@@ -34,7 +34,8 @@ if sys.version_info[0] < 3:
from StringIO import StringIO
else:
from io import StringIO
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
@@ -369,6 +370,7 @@ class DisplayState(Callback):
'filters-changed' : (str, ),
'filter-name-changed' : (str, UNITYPE, UNITYPE),
'nameformat-changed' : None,
+ 'grampletbar-close-changed' : None,
}
#nav_type to message
diff --git a/gramps/gui/editors/addmedia.py b/gramps/gui/editors/addmedia.py
index 566d61e67..cbdc524be 100644
--- a/gramps/gui/editors/addmedia.py
+++ b/gramps/gui/editors/addmedia.py
@@ -36,7 +36,8 @@ import os
# internationalization
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.constfunc import cuni
#-------------------------------------------------------------------------
diff --git a/gramps/gui/editors/displaytabs/addrembedlist.py b/gramps/gui/editors/displaytabs/addrembedlist.py
index 585b9f248..9e2eb4847 100644
--- a/gramps/gui/editors/displaytabs/addrembedlist.py
+++ b/gramps/gui/editors/displaytabs/addrembedlist.py
@@ -29,7 +29,8 @@ Address List display tab.
# Python classes
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gi.repository import GObject
#-------------------------------------------------------------------------
diff --git a/gramps/gui/editors/displaytabs/attrembedlist.py b/gramps/gui/editors/displaytabs/attrembedlist.py
index b17c16e08..d51e60da7 100644
--- a/gramps/gui/editors/displaytabs/attrembedlist.py
+++ b/gramps/gui/editors/displaytabs/attrembedlist.py
@@ -25,7 +25,8 @@
# Python classes
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gi.repository import GObject
#-------------------------------------------------------------------------
diff --git a/gramps/gui/editors/displaytabs/backreflist.py b/gramps/gui/editors/displaytabs/backreflist.py
index fff85e940..e5cde3880 100644
--- a/gramps/gui/editors/displaytabs/backreflist.py
+++ b/gramps/gui/editors/displaytabs/backreflist.py
@@ -27,7 +27,8 @@
# Python classes
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
@@ -178,7 +179,7 @@ class BackRefList(EmbeddedList):
"editor and open an editor for the citation "
"alone")
- from QuestionDialog import WarningDialog
+ from gramps.gui.dialog import WarningDialog
WarningDialog(_("Cannot open new citation editor"),
blocked_text)
elif reftype == 'Place':
diff --git a/gramps/gui/editors/displaytabs/backrefmodel.py b/gramps/gui/editors/displaytabs/backrefmodel.py
index 84dc3e760..651ff8c70 100644
--- a/gramps/gui/editors/displaytabs/backrefmodel.py
+++ b/gramps/gui/editors/displaytabs/backrefmodel.py
@@ -31,7 +31,8 @@ import sys
from gi.repository import GObject
from gi.repository import Gtk
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gui/editors/displaytabs/buttontab.py b/gramps/gui/editors/displaytabs/buttontab.py
index d6f055f4e..3d4917d67 100644
--- a/gramps/gui/editors/displaytabs/buttontab.py
+++ b/gramps/gui/editors/displaytabs/buttontab.py
@@ -28,7 +28,8 @@
#-------------------------------------------------------------------------
from __future__ import print_function
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gui/editors/displaytabs/citationembedlist.py b/gramps/gui/editors/displaytabs/citationembedlist.py
index 8b2b27f39..5b8b87879 100644
--- a/gramps/gui/editors/displaytabs/citationembedlist.py
+++ b/gramps/gui/editors/displaytabs/citationembedlist.py
@@ -26,7 +26,8 @@
# Python classes
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import logging
LOG = logging.getLogger(".citation")
diff --git a/gramps/gui/editors/displaytabs/dataembedlist.py b/gramps/gui/editors/displaytabs/dataembedlist.py
index 7293baaed..6c3b57b17 100644
--- a/gramps/gui/editors/displaytabs/dataembedlist.py
+++ b/gramps/gui/editors/displaytabs/dataembedlist.py
@@ -25,7 +25,8 @@
# Python classes
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gui/editors/displaytabs/embeddedlist.py b/gramps/gui/editors/displaytabs/embeddedlist.py
index 52a6000aa..635537bbf 100644
--- a/gramps/gui/editors/displaytabs/embeddedlist.py
+++ b/gramps/gui/editors/displaytabs/embeddedlist.py
@@ -26,7 +26,8 @@
# python
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import sys
if sys.version_info[0] < 3:
import cPickle as pickle
@@ -81,6 +82,7 @@ class EmbeddedList(ButtonTab):
self.build_model = build_model
# handle the selection
+ self.tree.set_hover_selection(True)
self.selection = self.tree.get_selection()
self.selection.connect('changed', self._selection_changed)
self.track_ref_for_deletion("selection")
@@ -104,13 +106,24 @@ class EmbeddedList(ButtonTab):
Handle button press, not double-click, that is done in init_interface
"""
if is_right_click(event):
- ref = self.get_selected()
- if ref:
- self.right_click(obj, event)
+ #ref = self.get_selected()
+ #if ref:
+ self.right_click(obj, event)
+ return True
elif event.type == Gdk.EventType.BUTTON_PRESS and event.button == 2:
fun = self.get_middle_click()
if fun:
fun()
+ return True
+ elif event.type == Gdk.EventType.BUTTON_PRESS and event.button == 1:
+ if self.tree.get_hover_selection():
+ self.tree.set_hover_selection(False)
+ return True
+ else:
+ self.tree.set_hover_selection(True)
+ #let code for single click still select the current row:
+ return False
+ return False
def get_popup_menu_items(self):
"""
@@ -146,20 +159,18 @@ class EmbeddedList(ButtonTab):
On right click show a popup menu.
This is populated with get_popup_menu_items
"""
- menu = Gtk.Menu()
+ self.__store_menu = Gtk.Menu() #need to keep reference or menu disappears
+ menu = self.__store_menu
for (needs_write_access, image, title, func) in self.get_popup_menu_items():
if image:
if isinstance(title, tuple):
img_stock, txt = title
- item = Gtk.ImageMenuItem(txt)
+ item = Gtk.ImageMenuItem.new_with_label(txt)
img = Gtk.Image()
img.set_from_stock(img_stock, Gtk.IconSize.MENU)
item.set_image(img)
else:
- item = Gtk.ImageMenuItem('')
- img = Gtk.Image()
- img.set_from_stock(title, Gtk.IconSize.MENU)
- item.set_image(img)
+ item = Gtk.ImageMenuItem.new_from_stock(title, None)
else:
item = Gtk.MenuItem(label=title)
item.connect('activate', func)
diff --git a/gramps/gui/editors/displaytabs/eventembedlist.py b/gramps/gui/editors/displaytabs/eventembedlist.py
index 5c22173ce..76556c111 100644
--- a/gramps/gui/editors/displaytabs/eventembedlist.py
+++ b/gramps/gui/editors/displaytabs/eventembedlist.py
@@ -26,7 +26,8 @@
# Python classes
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gi.repository import Gtk
from gi.repository import GObject
diff --git a/gramps/gui/editors/displaytabs/eventrefmodel.py b/gramps/gui/editors/displaytabs/eventrefmodel.py
index 413920f90..221759f9b 100644
--- a/gramps/gui/editors/displaytabs/eventrefmodel.py
+++ b/gramps/gui/editors/displaytabs/eventrefmodel.py
@@ -26,7 +26,8 @@
# python
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gui/editors/displaytabs/familyldsembedlist.py b/gramps/gui/editors/displaytabs/familyldsembedlist.py
index 91c76af60..14e7c6bed 100644
--- a/gramps/gui/editors/displaytabs/familyldsembedlist.py
+++ b/gramps/gui/editors/displaytabs/familyldsembedlist.py
@@ -25,7 +25,8 @@
# Python classes
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gui/editors/displaytabs/gallerytab.py b/gramps/gui/editors/displaytabs/gallerytab.py
index f369348d8..ee152ca1f 100644
--- a/gramps/gui/editors/displaytabs/gallerytab.py
+++ b/gramps/gui/editors/displaytabs/gallerytab.py
@@ -26,7 +26,8 @@
# Python classes
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import os
import sys
if sys.version_info[0] < 3:
@@ -219,7 +220,7 @@ class GalleryTab(ButtonTab, DbGUIElement):
self.iconlist.set_selection_mode(Gtk.SelectionMode.SINGLE)
# connect the signals
- self.iconlist.connect('selection-changed', self._selection_changed)
+ self.__id_connect_sel = self.iconlist.connect('selection-changed', self._selection_changed)
self.iconlist.connect('button_press_event', self.double_click)
self.iconlist.connect('key_press_event', self.key_pressed)
self._connect_icon_model()
@@ -519,7 +520,7 @@ class GalleryTab(ButtonTab, DbGUIElement):
if protocol == "file":
name = fix_encoding(mfile)
name = cuni(url2pathname(
- name.encode(sys.getfilesystemencoding())))
+ name.encode(glocale.getfilesystemencoding())))
mime = get_type(name)
if not is_valid_type(mime):
return
@@ -563,3 +564,7 @@ class GalleryTab(ButtonTab, DbGUIElement):
returns the index of the object within the associated data
"""
return self.get_data().index(obj)
+
+ def clean_up(self):
+ self.iconlist.disconnect(self.__id_connect_sel)
+ super(ButtonTab, self).clean_up()
diff --git a/gramps/gui/editors/displaytabs/groupembeddedlist.py b/gramps/gui/editors/displaytabs/groupembeddedlist.py
index 1231290e7..35370257e 100644
--- a/gramps/gui/editors/displaytabs/groupembeddedlist.py
+++ b/gramps/gui/editors/displaytabs/groupembeddedlist.py
@@ -113,10 +113,21 @@ class GroupEmbeddedList(EmbeddedList):
if obj and obj[1]:
self._tmpgroup = obj[0]
self.right_click(obj[1], event)
+ return True
elif event.type == Gdk.EventType.BUTTON_PRESS and event.button == 2:
fun = self.get_middle_click()
if fun:
fun()
+ return True
+ elif event.type == Gdk.EventType.BUTTON_PRESS and event.button == 1:
+ if self.tree.get_hover_selection():
+ self.tree.set_hover_selection(False)
+ return True
+ else:
+ self.tree.set_hover_selection(True)
+ #let code for single click still select the current row:
+ return False
+ return False
def is_empty(self):
"""
diff --git a/gramps/gui/editors/displaytabs/ldsembedlist.py b/gramps/gui/editors/displaytabs/ldsembedlist.py
index ce78f25da..105c4a8f1 100644
--- a/gramps/gui/editors/displaytabs/ldsembedlist.py
+++ b/gramps/gui/editors/displaytabs/ldsembedlist.py
@@ -25,7 +25,8 @@
# Python classes
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gi.repository import GObject
#-------------------------------------------------------------------------
diff --git a/gramps/gui/editors/displaytabs/locationembedlist.py b/gramps/gui/editors/displaytabs/locationembedlist.py
index dadad8033..c894d3673 100644
--- a/gramps/gui/editors/displaytabs/locationembedlist.py
+++ b/gramps/gui/editors/displaytabs/locationembedlist.py
@@ -25,7 +25,8 @@
# Python classes
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gi.repository import GObject
#-------------------------------------------------------------------------
diff --git a/gramps/gui/editors/displaytabs/nameembedlist.py b/gramps/gui/editors/displaytabs/nameembedlist.py
index e0ba6159f..09e6dfdaa 100644
--- a/gramps/gui/editors/displaytabs/nameembedlist.py
+++ b/gramps/gui/editors/displaytabs/nameembedlist.py
@@ -34,7 +34,8 @@ from gi.repository import GObject
# Python classes
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gui/editors/displaytabs/namemodel.py b/gramps/gui/editors/displaytabs/namemodel.py
index b7c826c01..50c71e0e2 100644
--- a/gramps/gui/editors/displaytabs/namemodel.py
+++ b/gramps/gui/editors/displaytabs/namemodel.py
@@ -27,7 +27,8 @@
# python libraries
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gui/editors/displaytabs/notetab.py b/gramps/gui/editors/displaytabs/notetab.py
index e28c56caf..8c72c361b 100644
--- a/gramps/gui/editors/displaytabs/notetab.py
+++ b/gramps/gui/editors/displaytabs/notetab.py
@@ -25,7 +25,8 @@
# Python classes
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gui/editors/displaytabs/personeventembedlist.py b/gramps/gui/editors/displaytabs/personeventembedlist.py
index 5136bc983..8a2b714ae 100644
--- a/gramps/gui/editors/displaytabs/personeventembedlist.py
+++ b/gramps/gui/editors/displaytabs/personeventembedlist.py
@@ -26,7 +26,8 @@
# python
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gi.repository import GObject
#-------------------------------------------------------------------------
diff --git a/gramps/gui/editors/displaytabs/personrefembedlist.py b/gramps/gui/editors/displaytabs/personrefembedlist.py
index f40dba553..cd3371820 100644
--- a/gramps/gui/editors/displaytabs/personrefembedlist.py
+++ b/gramps/gui/editors/displaytabs/personrefembedlist.py
@@ -25,7 +25,8 @@
# Python classes
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gi.repository import GObject
#-------------------------------------------------------------------------
diff --git a/gramps/gui/editors/displaytabs/repoembedlist.py b/gramps/gui/editors/displaytabs/repoembedlist.py
index 3de12f992..33e3964d0 100644
--- a/gramps/gui/editors/displaytabs/repoembedlist.py
+++ b/gramps/gui/editors/displaytabs/repoembedlist.py
@@ -25,7 +25,8 @@
# Python classes
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gi.repository import GObject
#-------------------------------------------------------------------------
diff --git a/gramps/gui/editors/displaytabs/surnametab.py b/gramps/gui/editors/displaytabs/surnametab.py
index 2b30b20ca..93da8fd99 100644
--- a/gramps/gui/editors/displaytabs/surnametab.py
+++ b/gramps/gui/editors/displaytabs/surnametab.py
@@ -26,8 +26,8 @@
# Python classes
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import sgettext as _
-import locale
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
#-------------------------------------------------------------------------
#
@@ -115,7 +115,7 @@ class SurnameTab(EmbeddedList):
self.cmborig = Gtk.ListStore(GObject.TYPE_INT, GObject.TYPE_STRING)
self.cmborigmap = no.get_map().copy()
#sort the keys based on the value
- keys = sorted(self.cmborigmap, key=lambda x: locale.strxfrm(self.cmborigmap[x]))
+ keys = sorted(self.cmborigmap, key=lambda x: glocale.sort_key(self.cmborigmap[x]))
for key in keys:
if key != no.get_custom():
self.cmborig.append(row=[key, self.cmborigmap[key]])
@@ -161,7 +161,7 @@ class SurnameTab(EmbeddedList):
## """
## fvalue = self.cmborigmap[first]
## svalue = self.cmborigmap[second]
-## return locale.strcoll(fvalue, svalue)
+## return glocale.strcoll(fvalue, svalue)
def get_data(self):
return self.obj.get_surname_list()
diff --git a/gramps/gui/editors/displaytabs/webembedlist.py b/gramps/gui/editors/displaytabs/webembedlist.py
index 7bf582aa7..e60fdab52 100644
--- a/gramps/gui/editors/displaytabs/webembedlist.py
+++ b/gramps/gui/editors/displaytabs/webembedlist.py
@@ -25,7 +25,8 @@
# Python classes
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gi.repository import Gtk
from gi.repository import GObject
diff --git a/gramps/gui/editors/editaddress.py b/gramps/gui/editors/editaddress.py
index 921d790a9..1e7622d5d 100644
--- a/gramps/gui/editors/editaddress.py
+++ b/gramps/gui/editors/editaddress.py
@@ -33,7 +33,8 @@ mechanism for the user to edit address information.
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gui/editors/editattribute.py b/gramps/gui/editors/editattribute.py
index b5ec7f66b..4f0b98b21 100644
--- a/gramps/gui/editors/editattribute.py
+++ b/gramps/gui/editors/editattribute.py
@@ -32,7 +32,8 @@ mechanism for the user to edit attribute information.
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gui/editors/editchildref.py b/gramps/gui/editors/editchildref.py
index 375d440af..86970c15d 100644
--- a/gramps/gui/editors/editchildref.py
+++ b/gramps/gui/editors/editchildref.py
@@ -32,7 +32,8 @@ mechanism for the user to edit address information.
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gui/editors/editcitation.py b/gramps/gui/editors/editcitation.py
index afe51c30a..32d9a07e4 100644
--- a/gramps/gui/editors/editcitation.py
+++ b/gramps/gui/editors/editcitation.py
@@ -31,7 +31,8 @@ EditCitation class for GRAMPS.
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import logging
LOG = logging.getLogger(".citation")
@@ -45,9 +46,9 @@ from gramps.gen.db import DbTxn
from .editprimary import EditPrimary
from .displaytabs import (NoteTab, GalleryTab, DataEmbedList,
- SourceBackRefList, RepoEmbedList, CitationBackRefList)
+ SourceBackRefList, RepoEmbedList, CitationBackRefList)
from ..widgets import (MonitoredEntry, PrivacyButton, MonitoredMenu,
- MonitoredDate)
+ MonitoredDate, MonitoredTagList)
from ..dialog import ErrorDialog
from .editreference import RefTab
from ..glade import Glade
@@ -276,6 +277,15 @@ class EditCitation(EditPrimary):
(_('Very High'), Citation.CONF_VERY_HIGH)],
self.db.readonly)
+ self.tags2 = MonitoredTagList(
+ self.glade.get_object("tag_label2"),
+ self.glade.get_object("tag_button2"),
+ self.obj.set_tag_list,
+ self.obj.get_tag_list,
+ self.db,
+ self.uistate, self.track,
+ self.db.readonly)
+
self.ref_privacy = PrivacyButton(
self.glade.get_object('privacy'), self.obj, self.db.readonly)
@@ -295,6 +305,15 @@ class EditCitation(EditPrimary):
self.glade.get_object('gid'), self.source.set_gramps_id,
self.source.get_gramps_id,self.db.readonly)
+ self.tags = MonitoredTagList(
+ self.glade.get_object("tag_label"),
+ self.glade.get_object("tag_button"),
+ self.source.set_tag_list,
+ self.source.get_tag_list,
+ self.db,
+ self.uistate, self.track,
+ self.db.readonly)
+
self.source_privacy = PrivacyButton(
self.glade.get_object("private"),
self.source, self.db.readonly)
diff --git a/gramps/gui/editors/editdate.py b/gramps/gui/editors/editdate.py
index 5ea2fde6c..1dcd2e089 100644
--- a/gramps/gui/editors/editdate.py
+++ b/gramps/gui/editors/editdate.py
@@ -61,7 +61,8 @@ from gi.repository import Gtk
# gramps modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gen.lib.date import Date
from gramps.gen.datehandler import displayer
from gramps.gen.const import URL_MANUAL_PAGE
diff --git a/gramps/gui/editors/editevent.py b/gramps/gui/editors/editevent.py
index cd6cc1b20..19e4e6f34 100644
--- a/gramps/gui/editors/editevent.py
+++ b/gramps/gui/editors/editevent.py
@@ -27,7 +27,8 @@
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
#-------------------------------------------------------------------------
#
@@ -50,9 +51,9 @@ from .objectentries import PlaceEntry
from ..glade import Glade
from ..dialog import ErrorDialog
from .displaytabs import (CitationEmbedList, NoteTab, GalleryTab,
- EventBackRefList, AttrEmbedList)
-from ..widgets import (MonitoredEntry, PrivacyButton,
- MonitoredDataType, MonitoredDate)
+ EventBackRefList, AttrEmbedList)
+from ..widgets import (MonitoredEntry, PrivacyButton, MonitoredDataType,
+ MonitoredDate, MonitoredTagList)
from gramps.gen.utils.db import get_participant_from_event
#-------------------------------------------------------------------------
@@ -152,8 +153,16 @@ class EditEvent(EditPrimary):
self.obj.set_gramps_id,
self.obj.get_gramps_id, self.db.readonly)
- self.priv = PrivacyButton( self.top.get_object("private"),
- self.obj, self.db.readonly)
+ self.tags = MonitoredTagList(self.top.get_object("tag_label"),
+ self.top.get_object("tag_button"),
+ self.obj.set_tag_list,
+ self.obj.get_tag_list,
+ self.db,
+ self.uistate, self.track,
+ self.db.readonly)
+
+ self.priv = PrivacyButton(self.top.get_object("private"),
+ self.obj, self.db.readonly)
self.event_menu = MonitoredDataType(self.top.get_object("personal_events"),
self.obj.set_type,
diff --git a/gramps/gui/editors/editeventref.py b/gramps/gui/editors/editeventref.py
index 82dd50353..894cc3886 100644
--- a/gramps/gui/editors/editeventref.py
+++ b/gramps/gui/editors/editeventref.py
@@ -28,7 +28,8 @@
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gui/editors/editfamily.py b/gramps/gui/editors/editfamily.py
index 9334820e8..357ed5769 100644
--- a/gramps/gui/editors/editfamily.py
+++ b/gramps/gui/editors/editfamily.py
@@ -53,7 +53,8 @@ log = logging.getLogger(".")
# GTK/Gnome modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from ..ddtargets import DdTargets
from gi.repository import Gtk
from gi.repository import Gdk
diff --git a/gramps/gui/editors/editldsord.py b/gramps/gui/editors/editldsord.py
index 6ecfccbf7..b7847271f 100644
--- a/gramps/gui/editors/editldsord.py
+++ b/gramps/gui/editors/editldsord.py
@@ -31,7 +31,8 @@ mechanism for the user to edit personal LDS information.
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gui/editors/editlink.py b/gramps/gui/editors/editlink.py
index e5d1c8b5e..227e57c56 100644
--- a/gramps/gui/editors/editlink.py
+++ b/gramps/gui/editors/editlink.py
@@ -33,7 +33,8 @@ import re
# gramps modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from ..managedwindow import ManagedWindow
from ..display import display_help
from ..glade import Glade
diff --git a/gramps/gui/editors/editlocation.py b/gramps/gui/editors/editlocation.py
index 2595860dd..c061a5df6 100644
--- a/gramps/gui/editors/editlocation.py
+++ b/gramps/gui/editors/editlocation.py
@@ -33,7 +33,8 @@ from ..glade import Glade
from gramps.gen.errors import ValidationError
from gramps.gen.utils.place import conv_lat_lon
from ..widgets import MonitoredEntry, LocationEntry
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from ..selectors import SelectorFactory
from ..dialog import ErrorDialog
diff --git a/gramps/gui/editors/editmedia.py b/gramps/gui/editors/editmedia.py
index 21837114b..47820a652 100644
--- a/gramps/gui/editors/editmedia.py
+++ b/gramps/gui/editors/editmedia.py
@@ -28,7 +28,8 @@
# Standard python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gui/editors/editmediaref.py b/gramps/gui/editors/editmediaref.py
index 6d14f330c..6a33cbecf 100644
--- a/gramps/gui/editors/editmediaref.py
+++ b/gramps/gui/editors/editmediaref.py
@@ -29,7 +29,8 @@
# Standard python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gui/editors/editname.py b/gramps/gui/editors/editname.py
index 91afd035f..69b3ed971 100644
--- a/gramps/gui/editors/editname.py
+++ b/gramps/gui/editors/editname.py
@@ -30,7 +30,8 @@
#
#-------------------------------------------------------------------------
from gi.repository import GObject
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from copy import copy
#-------------------------------------------------------------------------
diff --git a/gramps/gui/editors/editnote.py b/gramps/gui/editors/editnote.py
index 33cf623ff..1696d22c6 100644
--- a/gramps/gui/editors/editnote.py
+++ b/gramps/gui/editors/editnote.py
@@ -29,7 +29,8 @@
# Python classes
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import logging
_LOG = logging.getLogger(".gui.editors.EditNote")
diff --git a/gramps/gui/editors/editperson.py b/gramps/gui/editors/editperson.py
index 636f7914f..c35eee579 100644
--- a/gramps/gui/editors/editperson.py
+++ b/gramps/gui/editors/editperson.py
@@ -34,7 +34,8 @@ to edit information about a particular Person.
#
#-------------------------------------------------------------------------
from copy import copy
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gui/editors/editpersonref.py b/gramps/gui/editors/editpersonref.py
index dbbb53a75..88b907653 100644
--- a/gramps/gui/editors/editpersonref.py
+++ b/gramps/gui/editors/editpersonref.py
@@ -32,7 +32,8 @@ mechanism for the user to edit address information.
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gui/editors/editplace.py b/gramps/gui/editors/editplace.py
index 7a71b9bb3..9a9b2275d 100644
--- a/gramps/gui/editors/editplace.py
+++ b/gramps/gui/editors/editplace.py
@@ -28,7 +28,8 @@
# python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import logging
log = logging.getLogger(".")
@@ -48,8 +49,11 @@ from gramps.gen.lib import NoteType, Place, Location
from gramps.gen.db import DbTxn
from .editprimary import EditPrimary
from .displaytabs import (GrampsTab, LocationEmbedList, CitationEmbedList,
- GalleryTab, NoteTab, WebEmbedList, PlaceBackRefList)
-from ..widgets import MonitoredEntry, PrivacyButton, LocationEntry
+ GalleryTab, NoteTab, WebEmbedList, PlaceBackRefList)
+from ..widgets import (MonitoredEntry, PrivacyButton, MonitoredTagList,
+ LocationEntry)
+from gramps.gen.errors import ValidationError
+from gramps.gen.utils.place import conv_lat_lon
from ..dialog import ErrorDialog
from ..glade import Glade
@@ -159,6 +163,14 @@ class EditPlace(EditPrimary):
self.obj.set_gramps_id,
self.obj.get_gramps_id, self.db.readonly)
+ self.tags = MonitoredTagList(self.top.get_object("tag_label"),
+ self.top.get_object("tag_button"),
+ self.obj.set_tag_list,
+ self.obj.get_tag_list,
+ self.db,
+ self.uistate, self.track,
+ self.db.readonly)
+
self.privacy = PrivacyButton(self.top.get_object("private"), self.obj,
self.db.readonly)
diff --git a/gramps/gui/editors/editprimary.py b/gramps/gui/editors/editprimary.py
index 3d2d0ba64..b96cce2c5 100644
--- a/gramps/gui/editors/editprimary.py
+++ b/gramps/gui/editors/editprimary.py
@@ -26,7 +26,8 @@
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gui/editors/editreporef.py b/gramps/gui/editors/editreporef.py
index f9d28b432..9553345bf 100644
--- a/gramps/gui/editors/editreporef.py
+++ b/gramps/gui/editors/editreporef.py
@@ -26,7 +26,8 @@
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gui/editors/editrepository.py b/gramps/gui/editors/editrepository.py
index a3c0b23bd..9b599cc04 100644
--- a/gramps/gui/editors/editrepository.py
+++ b/gramps/gui/editors/editrepository.py
@@ -26,7 +26,8 @@
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
@@ -43,7 +44,8 @@ from gi.repository import Gtk
from gramps.gen.lib import NoteType, Repository
from gramps.gen.db import DbTxn
-from ..widgets import MonitoredEntry, MonitoredDataType, PrivacyButton
+from ..widgets import (MonitoredEntry, MonitoredDataType, PrivacyButton,
+ MonitoredTagList)
from .displaytabs import AddrEmbedList, WebEmbedList, NoteTab, SourceBackRefList
from .editprimary import EditPrimary
from ..dialog import ErrorDialog
@@ -92,14 +94,21 @@ class EditRepository(EditPrimary):
self.type = MonitoredDataType(self.glade.get_object("repository_type"),
self.obj.set_type, self.obj.get_type,
self.db.readonly,
- self.db.get_repository_types(),
- )
+ self.db.get_repository_types())
self.call_number = MonitoredEntry(self.glade.get_object('gid'),
self.obj.set_gramps_id,
self.obj.get_gramps_id,
self.db.readonly)
+ self.tags = MonitoredTagList(self.glade.get_object("tag_label"),
+ self.glade.get_object("tag_button"),
+ self.obj.set_tag_list,
+ self.obj.get_tag_list,
+ self.db,
+ self.uistate, self.track,
+ self.db.readonly)
+
self.privacy = PrivacyButton(self.glade.get_object("private"),
self.obj, self.db.readonly)
diff --git a/gramps/gui/editors/editsource.py b/gramps/gui/editors/editsource.py
index 55fa571d3..8f88f3905 100644
--- a/gramps/gui/editors/editsource.py
+++ b/gramps/gui/editors/editsource.py
@@ -27,7 +27,8 @@
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import logging
log = logging.getLogger(".")
LOG = logging.getLogger(".citation")
@@ -49,8 +50,8 @@ from gramps.gen.db import DbTxn
from .editprimary import EditPrimary
from .displaytabs import (NoteTab, GalleryTab, DataEmbedList,
- CitationBackRefList, RepoEmbedList)
-from ..widgets import MonitoredEntry, PrivacyButton
+ CitationBackRefList, RepoEmbedList)
+from ..widgets import MonitoredEntry, PrivacyButton, MonitoredTagList
from ..dialog import ErrorDialog
from ..glade import Glade
@@ -115,6 +116,14 @@ class EditSource(EditPrimary):
self.obj.set_gramps_id,
self.obj.get_gramps_id, self.db.readonly)
+ self.tags = MonitoredTagList(self.glade.get_object("tag_label"),
+ self.glade.get_object("tag_button"),
+ self.obj.set_tag_list,
+ self.obj.get_tag_list,
+ self.db,
+ self.uistate, self.track,
+ self.db.readonly)
+
self.priv = PrivacyButton(self.glade.get_object("private"), self.obj,
self.db.readonly)
diff --git a/gramps/gui/editors/edittaglist.py b/gramps/gui/editors/edittaglist.py
index 99d2ca65d..0d517ca42 100644
--- a/gramps/gui/editors/edittaglist.py
+++ b/gramps/gui/editors/edittaglist.py
@@ -33,7 +33,8 @@ from gi.repository import Gtk
# Gramps modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from ..managedwindow import ManagedWindow
from gramps.gen.const import URL_MANUAL_PAGE
from ..display import display_help
diff --git a/gramps/gui/editors/editurl.py b/gramps/gui/editors/editurl.py
index 3a126d461..277581166 100644
--- a/gramps/gui/editors/editurl.py
+++ b/gramps/gui/editors/editurl.py
@@ -26,7 +26,8 @@
# python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gui/editors/filtereditor.py b/gramps/gui/editors/filtereditor.py
index 03ad6a2c4..cd7f5638b 100644
--- a/gramps/gui/editors/filtereditor.py
+++ b/gramps/gui/editors/filtereditor.py
@@ -30,7 +30,6 @@ Custom Filter Editor tool.
# Python modules
#
#-------------------------------------------------------------------------
-import locale
#------------------------------------------------------------------------
#
@@ -63,7 +62,8 @@ from ..dialog import QuestionDialog
from gramps.gen.const import RULE_GLADE, URL_MANUAL_PAGE
from ..display import display_help
from gramps.gen.errors import WindowActiveError
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gen.lib import AttributeType, EventType, FamilyRelType, NameOriginType, NameType, NoteType
from gramps.gen.filters import rules
from ..autocomp import StandardCustomSelector, fill_entry
@@ -923,7 +923,7 @@ class ShowResults(ManagedWindow):
new_list = sorted(
(self.sort_val_from_handle(h) for h in handle_list),
- key=lambda x: locale.strxfrm(x[0])
+ key=lambda x: glocale.sort_key(x[0])
)
for s_, handle in new_list:
diff --git a/gramps/gui/editors/objectentries.py b/gramps/gui/editors/objectentries.py
index 04aa902fc..79cb81ff8 100644
--- a/gramps/gui/editors/objectentries.py
+++ b/gramps/gui/editors/objectentries.py
@@ -25,7 +25,8 @@
# Standard python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import sys
if sys.version_info[0] < 3:
import cPickle as pickle
diff --git a/gramps/gui/filters/_filterstore.py b/gramps/gui/filters/_filterstore.py
index ea7e0c193..f7972cbfd 100644
--- a/gramps/gui/filters/_filterstore.py
+++ b/gramps/gui/filters/_filterstore.py
@@ -30,7 +30,8 @@ Package providing filtering framework for GRAMPS.
#
#-------------------------------------------------------------------------
from gi.repository import Gtk
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gui/filters/_searchbar.py b/gramps/gui/filters/_searchbar.py
index 3ff2a712f..61963da7c 100644
--- a/gramps/gui/filters/_searchbar.py
+++ b/gramps/gui/filters/_searchbar.py
@@ -32,7 +32,8 @@ Package providing filtering framework for GRAMPS.
#-------------------------------------------------------------------------
from gi.repository import Gdk
from gi.repository import Gtk
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.constfunc import cuni
diff --git a/gramps/gui/filters/sidebar/_citationsidebarfilter.py b/gramps/gui/filters/sidebar/_citationsidebarfilter.py
index 522f02b5c..9ed332d94 100644
--- a/gramps/gui/filters/sidebar/_citationsidebarfilter.py
+++ b/gramps/gui/filters/sidebar/_citationsidebarfilter.py
@@ -26,7 +26,8 @@
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
@@ -48,7 +49,7 @@ from gramps.gen.constfunc import cuni
from gramps.gen.filters import GenericFilterFactory, rules
from gramps.gen.filters.rules.citation import (RegExpIdOf, HasIdOf, HasCitation,
HasNoteMatchingSubstringOf,
- HasNoteRegexp, MatchesFilter)
+ HasNoteRegexp, MatchesFilter, HasTag)
from gramps.gen.utils.string import confidence
GenericCitationFilter = GenericFilterFactory('Citation')
#-------------------------------------------------------------------------
@@ -75,6 +76,7 @@ class CitationSidebarFilter(SidebarFilter):
self.filter_regex = Gtk.CheckButton(_('Use regular expressions'))
+ self.tag = Gtk.ComboBox()
self.generic = Gtk.ComboBox()
SidebarFilter.__init__(self, dbstate, uistate, "Citation")
@@ -93,11 +95,18 @@ class CitationSidebarFilter(SidebarFilter):
self.filter_conf.pack_start(cell, True)
self.filter_conf.add_attribute(cell, 'text', 0)
+ cell = Gtk.CellRendererText()
+ cell.set_property('width', self._FILTER_WIDTH)
+ cell.set_property('ellipsize', self._FILTER_ELLIPSIZE)
+ self.tag.pack_start(cell, True)
+ self.tag.add_attribute(cell, 'text', 0)
+
self.add_text_entry(_('ID'), self.filter_id)
self.add_text_entry(_('Volume/Page'), self.filter_page)
self.add_text_entry(_('Date'), self.filter_date)
self.add_entry(_('Confidence'), self.filter_conf)
self.add_text_entry(_('Note'), self.filter_note)
+ self.add_entry(_('Tag'), self.tag)
self.add_filter_entry(_('Custom filter'), self.generic)
self.add_entry(None, self.filter_regex)
@@ -107,6 +116,7 @@ class CitationSidebarFilter(SidebarFilter):
self.filter_date.set_text('')
self.filter_conf.set_active(2)
self.filter_note.set_text('')
+ self.tag.set_active(0)
self.generic.set_active(0)
def get_filter(self):
@@ -124,9 +134,10 @@ class CitationSidebarFilter(SidebarFilter):
# conf = self.citn.get_confidence_level()
note = cuni(self.filter_note.get_text()).strip()
regex = self.filter_regex.get_active()
+ tag = self.tag.get_active() > 0
gen = self.generic.get_active() > 0
- empty = not (gid or page or date or conf or note or regex or gen)
+ empty = not (gid or page or date or conf or note or regex or tag or gen)
if empty:
generic_filter = None
else:
@@ -148,12 +159,20 @@ class CitationSidebarFilter(SidebarFilter):
rule = HasNoteMatchingSubstringOf([note])
generic_filter.add_rule(rule)
- if self.generic.get_active() != 0:
- model = self.generic.get_model()
- node = self.generic.get_active_iter()
- obj = cuni(model.get_value(node, 0))
- rule = MatchesFilter([obj])
- generic_filter.add_rule(rule)
+ # check the Tag
+ if tag:
+ model = self.tag.get_model()
+ node = self.tag.get_active_iter()
+ attr = model.get_value(node, 0)
+ rule = HasTag([attr])
+ generic_filter.add_rule(rule)
+
+ if self.generic.get_active() != 0:
+ model = self.generic.get_model()
+ node = self.generic.get_active_iter()
+ obj = cuni(model.get_value(node, 0))
+ rule = MatchesFilter([obj])
+ generic_filter.add_rule(rule)
return generic_filter
@@ -164,3 +183,14 @@ class CitationSidebarFilter(SidebarFilter):
all_filter.add_rule(rules.citation.AllCitations([]))
self.generic.set_model(build_filter_model('Citation', [all_filter]))
self.generic.set_active(0)
+
+ def on_tags_changed(self, tag_list):
+ """
+ Update the list of tags in the tag filter.
+ """
+ model = Gtk.ListStore(str)
+ model.append(('',))
+ for tag_name in tag_list:
+ model.append((tag_name,))
+ self.tag.set_model(model)
+ self.tag.set_active(0)
diff --git a/gramps/gui/filters/sidebar/_eventsidebarfilter.py b/gramps/gui/filters/sidebar/_eventsidebarfilter.py
index afa67df94..a5179d2df 100644
--- a/gramps/gui/filters/sidebar/_eventsidebarfilter.py
+++ b/gramps/gui/filters/sidebar/_eventsidebarfilter.py
@@ -25,7 +25,8 @@
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
@@ -47,7 +48,7 @@ from gramps.gen.constfunc import cuni
from gramps.gen.filters import GenericFilterFactory, rules
from gramps.gen.filters.rules.event import (RegExpIdOf, HasIdOf, HasNoteRegexp,
HasNoteMatchingSubstringOf, MatchesFilter,
- HasEvent)
+ HasEvent, HasTag)
GenericEventFilter = GenericFilterFactory('Event')
#-------------------------------------------------------------------------
@@ -77,6 +78,7 @@ class EventSidebarFilter(SidebarFilter):
self.filter_regex = Gtk.CheckButton(_('Use regular expressions'))
+ self.tag = Gtk.ComboBox()
self.generic = Gtk.ComboBox()
SidebarFilter.__init__(self, dbstate, uistate, "Event")
@@ -89,6 +91,12 @@ class EventSidebarFilter(SidebarFilter):
self.generic.add_attribute(cell, 'text', 0)
self.on_filters_changed('Event')
+ cell = Gtk.CellRendererText()
+ cell.set_property('width', self._FILTER_WIDTH)
+ cell.set_property('ellipsize', self._FILTER_ELLIPSIZE)
+ self.tag.pack_start(cell, True)
+ self.tag.add_attribute(cell, 'text', 0)
+
self.etype.get_child().set_width_chars(5)
self.add_text_entry(_('ID'), self.filter_id)
@@ -98,6 +106,7 @@ class EventSidebarFilter(SidebarFilter):
self.add_text_entry(_('Date'), self.filter_date)
self.add_text_entry(_('Place'), self.filter_place)
self.add_text_entry(_('Note'), self.filter_note)
+ self.add_entry(_('Tag'), self.tag)
self.add_filter_entry(_('Custom filter'), self.generic)
self.add_regex_entry(self.filter_regex)
@@ -109,6 +118,7 @@ class EventSidebarFilter(SidebarFilter):
self.filter_place.set_text('')
self.filter_note.set_text('')
self.etype.get_child().set_text('')
+ self.tag.set_active(0)
self.generic.set_active(0)
def get_filter(self):
@@ -119,11 +129,12 @@ class EventSidebarFilter(SidebarFilter):
place = cuni(self.filter_place.get_text()).strip()
note = cuni(self.filter_note.get_text()).strip()
regex = self.filter_regex.get_active()
+ tag = self.tag.get_active() > 0
generic = self.generic.get_active() > 0
etype = self.filter_event.get_type().xml_str()
empty = not (gid or desc or mainparts or date or place or note
- or etype or regex or generic)
+ or etype or regex or tag or generic)
if empty:
generic_filter = None
else:
@@ -146,12 +157,20 @@ class EventSidebarFilter(SidebarFilter):
rule = HasNoteMatchingSubstringOf([note])
generic_filter.add_rule(rule)
- if self.generic.get_active() != 0:
- model = self.generic.get_model()
- node = self.generic.get_active_iter()
- obj = cuni(model.get_value(node, 0))
- rule = MatchesFilter([obj])
- generic_filter.add_rule(rule)
+ # check the Tag
+ if tag:
+ model = self.tag.get_model()
+ node = self.tag.get_active_iter()
+ attr = model.get_value(node, 0)
+ rule = HasTag([attr])
+ generic_filter.add_rule(rule)
+
+ if self.generic.get_active() != 0:
+ model = self.generic.get_model()
+ node = self.generic.get_active_iter()
+ obj = cuni(model.get_value(node, 0))
+ rule = MatchesFilter([obj])
+ generic_filter.add_rule(rule)
return generic_filter
@@ -162,3 +181,14 @@ class EventSidebarFilter(SidebarFilter):
all_filter.add_rule(rules.event.AllEvents([]))
self.generic.set_model(build_filter_model('Event', [all_filter]))
self.generic.set_active(0)
+
+ def on_tags_changed(self, tag_list):
+ """
+ Update the list of tags in the tag filter.
+ """
+ model = Gtk.ListStore(str)
+ model.append(('',))
+ for tag_name in tag_list:
+ model.append((tag_name,))
+ self.tag.set_model(model)
+ self.tag.set_active(0)
diff --git a/gramps/gui/filters/sidebar/_familysidebarfilter.py b/gramps/gui/filters/sidebar/_familysidebarfilter.py
index 12b475ba9..329c9e45b 100644
--- a/gramps/gui/filters/sidebar/_familysidebarfilter.py
+++ b/gramps/gui/filters/sidebar/_familysidebarfilter.py
@@ -26,7 +26,8 @@
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gui/filters/sidebar/_mediasidebarfilter.py b/gramps/gui/filters/sidebar/_mediasidebarfilter.py
index 9d33bbc17..dfb7d0330 100644
--- a/gramps/gui/filters/sidebar/_mediasidebarfilter.py
+++ b/gramps/gui/filters/sidebar/_mediasidebarfilter.py
@@ -26,7 +26,8 @@
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gui/filters/sidebar/_notesidebarfilter.py b/gramps/gui/filters/sidebar/_notesidebarfilter.py
index a365691dc..f2cb706ec 100644
--- a/gramps/gui/filters/sidebar/_notesidebarfilter.py
+++ b/gramps/gui/filters/sidebar/_notesidebarfilter.py
@@ -26,7 +26,8 @@
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gui/filters/sidebar/_personsidebarfilter.py b/gramps/gui/filters/sidebar/_personsidebarfilter.py
index b7f5586cd..366b2fe2f 100644
--- a/gramps/gui/filters/sidebar/_personsidebarfilter.py
+++ b/gramps/gui/filters/sidebar/_personsidebarfilter.py
@@ -26,7 +26,8 @@
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import locale
#-------------------------------------------------------------------------
diff --git a/gramps/gui/filters/sidebar/_placesidebarfilter.py b/gramps/gui/filters/sidebar/_placesidebarfilter.py
index 458a23449..bd2823503 100644
--- a/gramps/gui/filters/sidebar/_placesidebarfilter.py
+++ b/gramps/gui/filters/sidebar/_placesidebarfilter.py
@@ -27,7 +27,8 @@
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
@@ -48,7 +49,7 @@ from gramps.gen.constfunc import cuni
from gramps.gen.filters import GenericFilterFactory, rules
from gramps.gen.filters.rules.place import (RegExpIdOf, HasIdOf, HasLocation,
HasNoteRegexp, HasNoteMatchingSubstringOf,
- MatchesFilter)
+ MatchesFilter, HasTag)
GenericPlaceFilter = GenericFilterFactory('Place')
#-------------------------------------------------------------------------
@@ -67,6 +68,7 @@ class PlaceSidebarFilter(SidebarFilter):
self.filter_note = widgets.BasicEntry()
self.filter_regex = Gtk.CheckButton(_('Use regular expressions'))
+ self.tag = Gtk.ComboBox()
self.generic = Gtk.ComboBox()
SidebarFilter.__init__(self, dbstate, uistate, "Place")
@@ -79,11 +81,17 @@ class PlaceSidebarFilter(SidebarFilter):
self.generic.add_attribute(cell, 'text', 0)
self.on_filters_changed('Place')
+ cell = Gtk.CellRendererText()
+ cell.set_property('width', self._FILTER_WIDTH)
+ cell.set_property('ellipsize', self._FILTER_ELLIPSIZE)
+ self.tag.pack_start(cell, True)
+ self.tag.add_attribute(cell, 'text', 0)
+
self.add_text_entry(_('ID'), self.filter_id)
self.add_text_entry(_('Place Name'), self.filter_title)
self.add_text_entry(_('Location'), self.filter_location)
self.add_text_entry(_('Note'), self.filter_note)
-
+ self.add_entry(_('Tag'), self.tag)
self.add_filter_entry(_('Custom filter'), self.generic)
self.add_regex_entry(self.filter_regex)
@@ -92,6 +100,7 @@ class PlaceSidebarFilter(SidebarFilter):
self.filter_title.set_text('')
self.filter_location.set_text('')
self.filter_note.set_text('')
+ self.tag.set_active(0)
self.generic.set_active(0)
def get_filter(self):
@@ -100,9 +109,11 @@ class PlaceSidebarFilter(SidebarFilter):
location = self.filter_location.get_handle()
note = cuni(self.filter_note.get_text()).strip()
regex = self.filter_regex.get_active()
+ tag = self.tag.get_active() > 0
gen = self.generic.get_active() > 0
- empty = not (gid or title or location or note or regex or gen)
+ empty = not (gid or title or location or note or regex or tag
+ or gen)
if empty:
generic_filter = None
else:
@@ -125,6 +136,14 @@ class PlaceSidebarFilter(SidebarFilter):
rule = HasNoteMatchingSubstringOf([note])
generic_filter.add_rule(rule)
+ # check the Tag
+ if tag:
+ model = self.tag.get_model()
+ node = self.tag.get_active_iter()
+ attr = model.get_value(node, 0)
+ rule = HasTag([attr])
+ generic_filter.add_rule(rule)
+
if self.generic.get_active() != 0:
model = self.generic.get_model()
node = self.generic.get_active_iter()
@@ -141,3 +160,14 @@ class PlaceSidebarFilter(SidebarFilter):
all_filter.add_rule(rules.place.AllPlaces([]))
self.generic.set_model(build_filter_model('Place', [all_filter]))
self.generic.set_active(0)
+
+ def on_tags_changed(self, tag_list):
+ """
+ Update the list of tags in the tag filter.
+ """
+ model = Gtk.ListStore(str)
+ model.append(('',))
+ for tag_name in tag_list:
+ model.append((tag_name,))
+ self.tag.set_model(model)
+ self.tag.set_active(0)
diff --git a/gramps/gui/filters/sidebar/_reposidebarfilter.py b/gramps/gui/filters/sidebar/_reposidebarfilter.py
index 985406a3c..c5add6d63 100644
--- a/gramps/gui/filters/sidebar/_reposidebarfilter.py
+++ b/gramps/gui/filters/sidebar/_reposidebarfilter.py
@@ -25,7 +25,8 @@
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
@@ -47,7 +48,7 @@ from gramps.gen.constfunc import cuni
from gramps.gen.filters import GenericFilterFactory, rules
from gramps.gen.filters.rules.repository import (RegExpIdOf, HasIdOf, HasRepo,
HasNoteRegexp, MatchesFilter,
- HasNoteMatchingSubstringOf)
+ HasNoteMatchingSubstringOf, HasTag)
GenericRepoFilter = GenericFilterFactory('Repository')
#-------------------------------------------------------------------------
@@ -76,6 +77,7 @@ class RepoSidebarFilter(SidebarFilter):
self.filter_regex = Gtk.CheckButton(_('Use regular expressions'))
+ self.tag = Gtk.ComboBox()
self.generic = Gtk.ComboBox()
SidebarFilter.__init__(self, dbstate, uistate, "Repository")
@@ -88,6 +90,12 @@ class RepoSidebarFilter(SidebarFilter):
self.generic.add_attribute(cell, 'text', 0)
self.on_filters_changed('Repository')
+ cell = Gtk.CellRendererText()
+ cell.set_property('width', self._FILTER_WIDTH)
+ cell.set_property('ellipsize', self._FILTER_ELLIPSIZE)
+ self.tag.pack_start(cell, True)
+ self.tag.add_attribute(cell, 'text', 0)
+
self.rtype.get_child().set_width_chars(5)
self.add_text_entry(_('ID'), self.filter_id)
@@ -96,6 +104,7 @@ class RepoSidebarFilter(SidebarFilter):
self.add_text_entry(_('Address'), self.filter_address)
self.add_text_entry(_('URL'), self.filter_url)
self.add_text_entry(_('Note'), self.filter_note)
+ self.add_entry(_('Tag'), self.tag)
self.add_filter_entry(_('Custom filter'), self.generic)
self.add_regex_entry(self.filter_regex)
@@ -106,6 +115,7 @@ class RepoSidebarFilter(SidebarFilter):
self.filter_url.set_text('')
self.rtype.get_child().set_text('')
self.filter_note.set_text('')
+ self.tag.set_active(0)
self.generic.set_active(0)
def get_filter(self):
@@ -116,10 +126,11 @@ class RepoSidebarFilter(SidebarFilter):
rtype = self.repo.get_type().xml_str()
note = cuni(self.filter_note.get_text()).strip()
regex = self.filter_regex.get_active()
+ tag = self.tag.get_active() > 0
gen = self.generic.get_active() > 0
empty = not (gid or title or address or url or rtype
- or note or regex or gen)
+ or note or regex or tag or gen)
if empty:
generic_filter = None
else:
@@ -141,12 +152,20 @@ class RepoSidebarFilter(SidebarFilter):
rule = HasNoteMatchingSubstringOf([note])
generic_filter.add_rule(rule)
- if self.generic.get_active() != 0:
- model = self.generic.get_model()
- node = self.generic.get_active_iter()
- obj = cuni(model.get_value(node, 0))
- rule = MatchesFilter([obj])
- generic_filter.add_rule(rule)
+ # check the Tag
+ if tag:
+ model = self.tag.get_model()
+ node = self.tag.get_active_iter()
+ attr = model.get_value(node, 0)
+ rule = HasTag([attr])
+ generic_filter.add_rule(rule)
+
+ if self.generic.get_active() != 0:
+ model = self.generic.get_model()
+ node = self.generic.get_active_iter()
+ obj = cuni(model.get_value(node, 0))
+ rule = MatchesFilter([obj])
+ generic_filter.add_rule(rule)
return generic_filter
@@ -158,3 +177,14 @@ class RepoSidebarFilter(SidebarFilter):
self.generic.set_model(build_filter_model('Repository',
[all_filter]))
self.generic.set_active(0)
+
+ def on_tags_changed(self, tag_list):
+ """
+ Update the list of tags in the tag filter.
+ """
+ model = Gtk.ListStore(str)
+ model.append(('',))
+ for tag_name in tag_list:
+ model.append((tag_name,))
+ self.tag.set_model(model)
+ self.tag.set_active(0)
diff --git a/gramps/gui/filters/sidebar/_sidebarfilter.py b/gramps/gui/filters/sidebar/_sidebarfilter.py
index c016f4f6d..f14bdff9a 100644
--- a/gramps/gui/filters/sidebar/_sidebarfilter.py
+++ b/gramps/gui/filters/sidebar/_sidebarfilter.py
@@ -21,7 +21,8 @@
# $Id$
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from bisect import insort_left
from gi.repository import Gdk
from gi.repository import Gtk
diff --git a/gramps/gui/filters/sidebar/_sourcesidebarfilter.py b/gramps/gui/filters/sidebar/_sourcesidebarfilter.py
index 5987c4121..578ad0e49 100644
--- a/gramps/gui/filters/sidebar/_sourcesidebarfilter.py
+++ b/gramps/gui/filters/sidebar/_sourcesidebarfilter.py
@@ -25,7 +25,8 @@
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
@@ -46,7 +47,7 @@ from gramps.gen.constfunc import cuni
from gramps.gen.filters import GenericFilterFactory, rules
from gramps.gen.filters.rules.source import (RegExpIdOf, HasIdOf, HasSource,
HasNoteMatchingSubstringOf,
- HasNoteRegexp, MatchesFilter)
+ HasNoteRegexp, MatchesFilter, HasTag)
GenericSourceFilter = GenericFilterFactory('Source')
#-------------------------------------------------------------------------
@@ -67,6 +68,7 @@ class SourceSidebarFilter(SidebarFilter):
self.filter_regex = Gtk.CheckButton(_('Use regular expressions'))
+ self.tag = Gtk.ComboBox()
self.generic = Gtk.ComboBox()
SidebarFilter.__init__(self, dbstate, uistate, "Source")
@@ -79,12 +81,19 @@ class SourceSidebarFilter(SidebarFilter):
self.generic.add_attribute(cell, 'text', 0)
self.on_filters_changed('Source')
+ cell = Gtk.CellRendererText()
+ cell.set_property('width', self._FILTER_WIDTH)
+ cell.set_property('ellipsize', self._FILTER_ELLIPSIZE)
+ self.tag.pack_start(cell, True)
+ self.tag.add_attribute(cell, 'text', 0)
+
self.add_text_entry(_('ID'), self.filter_id)
self.add_text_entry(_('Title'), self.filter_title)
self.add_text_entry(_('Author'), self.filter_author)
self.add_text_entry(_('Abbreviation'), self.filter_abbr)
self.add_text_entry(_('Publication'), self.filter_pub)
self.add_text_entry(_('Note'), self.filter_note)
+ self.add_entry(_('Tag'), self.tag)
self.add_filter_entry(_('Custom filter'), self.generic)
self.add_regex_entry(self.filter_regex)
@@ -95,6 +104,7 @@ class SourceSidebarFilter(SidebarFilter):
self.filter_abbr.set_text('')
self.filter_pub.set_text('')
self.filter_note.set_text('')
+ self.tag.set_active(0)
self.generic.set_active(0)
def get_filter(self):
@@ -105,10 +115,11 @@ class SourceSidebarFilter(SidebarFilter):
pub = cuni(self.filter_pub.get_text()).strip()
note = cuni(self.filter_note.get_text()).strip()
regex = self.filter_regex.get_active()
+ tag = self.tag.get_active() > 0
gen = self.generic.get_active() > 0
- empty = not (gid or title or author or abbr or pub or note or regex or
- gen)
+ empty = not (gid or title or author or abbr or pub or note or regex
+ or tag or gen)
if empty:
generic_filter = None
else:
@@ -130,12 +141,20 @@ class SourceSidebarFilter(SidebarFilter):
rule = HasNoteMatchingSubstringOf([note])
generic_filter.add_rule(rule)
- if self.generic.get_active() != 0:
- model = self.generic.get_model()
- node = self.generic.get_active_iter()
- obj = cuni(model.get_value(node, 0))
- rule = MatchesFilter([obj])
- generic_filter.add_rule(rule)
+ # check the Tag
+ if tag:
+ model = self.tag.get_model()
+ node = self.tag.get_active_iter()
+ attr = model.get_value(node, 0)
+ rule = HasTag([attr])
+ generic_filter.add_rule(rule)
+
+ if self.generic.get_active() != 0:
+ model = self.generic.get_model()
+ node = self.generic.get_active_iter()
+ obj = cuni(model.get_value(node, 0))
+ rule = MatchesFilter([obj])
+ generic_filter.add_rule(rule)
return generic_filter
@@ -146,3 +165,14 @@ class SourceSidebarFilter(SidebarFilter):
all_filter.add_rule(rules.source.AllSources([]))
self.generic.set_model(build_filter_model('Source', [all_filter]))
self.generic.set_active(0)
+
+ def on_tags_changed(self, tag_list):
+ """
+ Update the list of tags in the tag filter.
+ """
+ model = Gtk.ListStore(str)
+ model.append(('',))
+ for tag_name in tag_list:
+ model.append((tag_name,))
+ self.tag.set_model(model)
+ self.tag.set_active(0)
diff --git a/gramps/gui/glade.py b/gramps/gui/glade.py
index 742884cf4..bcb1b2bb8 100644
--- a/gramps/gui/glade.py
+++ b/gramps/gui/glade.py
@@ -48,8 +48,7 @@ from gi.repository import Gtk
# gramps modules
#
#------------------------------------------------------------------------
-from gramps.gen.const import GLADE_DIR
-from gramps.gen.utils.trans import LOCALEDOMAIN
+from gramps.gen.const import GLADE_DIR, GRAMPS_LOCALE as glocale
from gramps.gen.constfunc import STRTYPE
#------------------------------------------------------------------------
@@ -82,7 +81,7 @@ class Glade(Gtk.Builder):
:returns: reference to the newly-created Glade instance
"""
GObject.GObject.__init__(self)
- self.set_translation_domain(LOCALEDOMAIN)
+ self.set_translation_domain(glocale.get_localedomain())
filename_given = filename is not None
dirname_given = dirname is not None
diff --git a/gramps/gui/glade/addmedia.glade b/gramps/gui/glade/addmedia.glade
index f5c32334e..5d1dfcb9e 100644
--- a/gramps/gui/glade/addmedia.glade
+++ b/gramps/gui/glade/addmedia.glade
@@ -132,16 +132,18 @@
True
False
- <b>Preview</b>
- True
+ Preview
+
+
+
1
2
-
-
+
+
@@ -175,7 +177,7 @@
GTK_FILL
-
+
@@ -187,7 +189,7 @@
1
2
-
+
@@ -208,7 +210,7 @@
1
2
GTK_FILL
-
+
diff --git a/gramps/gui/glade/catalog/README b/gramps/gui/glade/catalog/README
index f99e7db27..b5413e2f1 100644
--- a/gramps/gui/glade/catalog/README
+++ b/gramps/gui/glade/catalog/README
@@ -3,7 +3,7 @@ in glade.
Assuming you are in the root svn directory do:
-GLADE_CATALOG_SEARCH_PATH=src/gui/glade/catalog GLADE_MODULE_SEARCH_PATH=src/gui/glade/catalog/ glade
+GLADE_CATALOG_SEARCH_PATH=gramps/gui/glade/catalog GLADE_MODULE_SEARCH_PATH=gramps/gui/glade/catalog/ glade
However, this does no longer work for python modules (since 3.8), so the gramps widgets are not in the catalog at this moment.
As project settings:
diff --git a/gramps/gui/glade/catalog/grampswidgets.xml b/gramps/gui/glade/catalog/grampswidgets.xml
index 439aaf6ae..e0ce02131 100644
--- a/gramps/gui/glade/catalog/grampswidgets.xml
+++ b/gramps/gui/glade/catalog/grampswidgets.xml
@@ -1,6 +1,6 @@
+ domain="glade-3" depends="gtk+">
glade_python_init
True
False
0
- <b>Version description</b>
- True
+ Version description
+
+
+
3
GTK_FILL
-
+
@@ -80,7 +82,7 @@
3
1
2
-
+
diff --git a/gramps/gui/glade/editcitation.glade b/gramps/gui/glade/editcitation.glade
index 96173c944..5e74ed572 100644
--- a/gramps/gui/glade/editcitation.glade
+++ b/gramps/gui/glade/editcitation.glade
@@ -86,10 +86,12 @@
0
6
3
- <b>Citation information</b>
- True
+ Citation information
True
center
+
+
+
False
@@ -114,12 +116,6 @@
-
-
-
-
-
-
True
@@ -132,7 +128,7 @@
GTK_FILL
-
+
@@ -168,7 +164,7 @@
2
3
GTK_FILL
-
+
@@ -181,9 +177,9 @@
1
2
- 2
- 3
-
+ 1
+ 2
+
@@ -197,10 +193,10 @@
volume
- 2
- 3
+ 1
+ 2
GTK_FILL
-
+
@@ -214,10 +210,10 @@
confidence
- 3
- 4
+ 2
+ 3
GTK_FILL
-
+
@@ -240,10 +236,10 @@ Very High =Direct and primary evidence used, or by dominance of the evidence
1
2
- 3
- 4
+ 2
+ 3
GTK_FILL
-
+
@@ -256,7 +252,7 @@ Very High =Direct and primary evidence used, or by dominance of the evidence
1
2
-
+
@@ -301,68 +297,62 @@ Very High =Direct and primary evidence used, or by dominance of the evidence 4
5
GTK_EXPAND | GTK_SHRINK | GTK_FILL
-
+
True
False
- 12
+ 6
+ 75
True
True
A unique ID to identify the citation
•
+ 6
- True
+ False
True
0
-
- False
+
True
- True
- True
- False
- none
-
-
-
- Private
-
-
-
-
- True
- False
- gtk-dialog-authentication
-
-
- Privacy
-
-
-
-
+ False
+ 0
+ Tags:
False
- False
+ True
1
+
+
+ True
+ False
+ 0
+
+
+ True
+ True
+ 2
+
+
1
2
- 1
- 2
+ 3
+ 4
GTK_FILL
-
+
@@ -375,10 +365,65 @@ Very High =Direct and primary evidence used, or by dominance of the evidence gid2
- 1
- 2
+ 3
+ 4
GTK_FILL
-
+
+
+
+
+
+ False
+ True
+ True
+ True
+ False
+ none
+
+
+
+ Private
+
+
+
+
+ True
+ False
+ gtk-dialog-authentication
+
+
+ Privacy
+
+
+
+
+
+
+ 2
+ 3
+ 2
+ 3
+
+
+
+
+
+
+ False
+ True
+ True
+ True
+ False
+ True
+ 0
+
+
+ 2
+ 3
+ 3
+ 4
+
+
@@ -387,8 +432,10 @@ Very High =Direct and primary evidence used, or by dominance of the evidence
True
False
- <b>General</b>
- True
+ General
+
+
+
False
@@ -419,7 +466,7 @@ Very High =Direct and primary evidence used, or by dominance of the evidence False
12
6
- 2
+ 3
12
6
@@ -434,7 +481,7 @@ Very High =Direct and primary evidence used, or by dominance of the evidence
GTK_FILL
-
+
@@ -451,7 +498,7 @@ Very High =Direct and primary evidence used, or by dominance of the evidence 1
2
GTK_FILL
-
+
@@ -469,7 +516,7 @@ Very High =Direct and primary evidence used, or by dominance of the evidence 3
4
GTK_FILL
-
+
@@ -483,10 +530,10 @@ Very High =Direct and primary evidence used, or by dominance of the evidence pub_info
- 4
- 5
+ 2
+ 3
GTK_FILL
-
+
@@ -498,10 +545,10 @@ Very High =Direct and primary evidence used, or by dominance of the evidence
1
- 2
+ 3
1
2
-
+
@@ -542,11 +589,11 @@ Very High =Direct and primary evidence used, or by dominance of the evidence
- 2
+ 3
5
6
GTK_EXPAND | GTK_SHRINK | GTK_FILL
-
+
@@ -561,7 +608,7 @@ Very High =Direct and primary evidence used, or by dominance of the evidence 2
3
4
-
+
@@ -573,10 +620,10 @@ Very High =Direct and primary evidence used, or by dominance of the evidence
1
- 2
- 4
- 5
-
+ 3
+ 2
+ 3
+
@@ -589,10 +636,10 @@ Very High =Direct and primary evidence used, or by dominance of the evidence gid
- 2
- 3
+ 4
+ 5
GTK_FILL
-
+
@@ -601,47 +648,54 @@ Very High =Direct and primary evidence used, or by dominance of the evidence False
12
-
+
True
- True
- A unique ID to identify the source
- ●
+ False
+ 6
+
+
+ 75
+ True
+ True
+ A unique ID to identify the source
+ ●
+ 6
+
+
+ False
+ True
+ 0
+
+
+
+
+ True
+ False
+ 0
+ Tags:
+
+
+ False
+ True
+ 1
+
+
+
+
+ True
+ False
+ 0
+
+
+ True
+ True
+ 2
+
+
True
True
- 0
-
-
-
-
- False
- True
- True
- True
- False
- none
-
-
- Private
-
-
-
-
- True
- False
- gtk-dialog-authentication
-
-
- Privacy
-
-
-
-
-
-
- False
- False
1
@@ -649,10 +703,10 @@ Very High =Direct and primary evidence used, or by dominance of the evidence
1
2
- 2
- 3
+ 4
+ 5
GTK_FILL
-
+
@@ -664,8 +718,61 @@ Very High =Direct and primary evidence used, or by dominance of the evidence
1
- 2
-
+ 3
+
+
+
+
+
+ False
+ True
+ True
+ True
+ False
+ none
+
+
+ Private
+
+
+
+
+ True
+ False
+ gtk-dialog-authentication
+
+
+ Privacy
+
+
+
+
+
+
+ 2
+ 3
+ 3
+ 4
+
+
+
+
+
+
+ False
+ True
+ True
+ True
+ False
+ True
+
+
+ 2
+ 3
+ 4
+ 5
+
+
@@ -693,9 +800,11 @@ Very High =Direct and primary evidence used, or by dominance of the evidence
True
False
- <b>General</b>
- True
+ General
center
+
+
+
False
@@ -714,8 +823,10 @@ Very High =Direct and primary evidence used, or by dominance of the evidence
True
False
- <b>Shared source information</b>
- True
+ Shared source information
+
+
+
diff --git a/gramps/gui/glade/editdate.glade b/gramps/gui/glade/editdate.glade
index 43de3c435..2a3556b9e 100644
--- a/gramps/gui/glade/editdate.glade
+++ b/gramps/gui/glade/editdate.glade
@@ -45,10 +45,12 @@
gtk-help
+ False
True
True
True
False
+ False
True
@@ -60,10 +62,12 @@
gtk-cancel
+ False
True
True
True
False
+ False
True
@@ -75,10 +79,12 @@
gtk-ok
+ False
True
True
True
False
+ False
True
@@ -169,10 +175,12 @@
Dua_l dated
+ False
True
True
False
Old Style/New Style
+ False
True
0.5
True
@@ -251,22 +259,24 @@
False
0
6
- <b>Q_uality</b>
- True
+ Q_uality
True
quality_box
+
+
+
4
GTK_FILL
-
+
True
False
-
+
1
@@ -285,16 +295,18 @@
False
0
6
- <b>_Type</b>
- True
+ _Type
True
type_box
+
+
+
4
8
GTK_FILL
-
+
@@ -319,15 +331,17 @@
False
0
6
- <b>Date</b>
- True
+ Date
+
+
+
4
2
3
GTK_FILL
-
+
@@ -344,7 +358,7 @@
3
4
GTK_FILL
-
+
@@ -361,7 +375,7 @@
3
4
GTK_FILL
-
+
@@ -378,7 +392,7 @@
3
4
GTK_FILL
-
+
@@ -394,7 +408,7 @@
2
4
5
-
+
6
@@ -425,7 +439,7 @@
4
4
5
-
+
6
@@ -435,8 +449,10 @@
False
0
6
- <b>Second date</b>
- True
+ Second date
+
+
+
4
@@ -444,7 +460,7 @@
2
3
GTK_FILL
-
+
@@ -461,7 +477,7 @@
3
4
GTK_FILL
-
+
@@ -478,7 +494,7 @@
3
4
GTK_FILL
-
+
@@ -495,7 +511,7 @@
3
4
GTK_FILL
-
+
@@ -511,7 +527,7 @@
6
4
5
-
+
6
@@ -542,7 +558,7 @@
8
4
5
-
+
6
diff --git a/gramps/gui/glade/editevent.glade b/gramps/gui/glade/editevent.glade
index a2159849e..64011219e 100644
--- a/gramps/gui/glade/editevent.glade
+++ b/gramps/gui/glade/editevent.glade
@@ -17,7 +17,6 @@
gtk-cancel
- False
True
True
True
@@ -26,7 +25,6 @@
True
Close window without changes
Close window without changes
- False
True
@@ -38,7 +36,6 @@
gtk-ok
- False
True
True
True
@@ -46,7 +43,6 @@
True
Accept changes and close window
Accept changes and close window
- False
True
@@ -58,12 +54,10 @@
gtk-help
- False
True
True
True
True
- False
True
@@ -93,9 +87,6 @@
5
12
4
-
-
-
True
@@ -108,7 +99,7 @@
GTK_FILL
-
+
@@ -125,18 +116,16 @@
2
3
GTK_FILL
-
+
- False
True
True
True
True
Invoke date editor
- False
none
@@ -166,7 +155,7 @@
4
5
GTK_FILL
-
+
@@ -183,43 +172,7 @@
1
2
GTK_FILL
-
-
-
-
-
- False
- True
- True
- True
- False
- none
-
-
-
- Private
-
-
-
-
- True
- False
- gtk-dialog-authentication
-
-
- Privacy
-
-
-
-
-
-
- 4
- 5
- 2
- 3
- GTK_FILL
-
+
@@ -234,7 +187,7 @@
4
1
2
-
+
@@ -249,19 +202,17 @@
select_place
- 3
- 4
+ 2
+ 3
GTK_FILL
-
+
- False
True
True
True
- False
none
@@ -274,10 +225,10 @@
4
5
- 3
- 4
+ 2
+ 3
GTK_FILL
-
+
@@ -299,11 +250,9 @@
- False
True
True
True
- False
none
@@ -337,8 +286,8 @@
1
4
- 3
- 4
+ 2
+ 3
GTK_FILL
GTK_FILL
@@ -360,7 +309,7 @@
1
2
GTK_FILL
-
+
@@ -373,25 +322,10 @@
gid
- 2
- 3
+ 3
+ 4
GTK_FILL
-
-
-
-
-
- True
- True
- A unique ID to identify the event
- ●
-
-
- 1
- 4
- 2
- 3
-
+
@@ -405,7 +339,111 @@
3
4
-
+
+
+
+
+
+ True
+ True
+ True
+ none
+
+
+
+ Private
+
+
+
+
+ True
+ False
+ gtk-dialog-authentication
+
+
+ Privacy
+
+
+
+
+
+
+ 4
+ 5
+ 1
+ 2
+
+
+
+
+
+
+ True
+ False
+ 6
+
+
+ 75
+ True
+ True
+ A unique ID to identify the event
+ ●
+ 6
+
+
+ False
+ True
+ 0
+
+
+
+
+ True
+ False
+ 0
+ Tags:
+
+
+ False
+ True
+ 1
+
+
+
+
+ True
+ False
+ 0
+ 0.4699999988079071
+
+
+ True
+ True
+ 2
+
+
+
+
+ True
+ True
+ True
+ 1
+ True
+ right
+
+
+ False
+ False
+ 3
+
+
+
+
+ 1
+ 5
+ 3
+ 4
+ GTK_FILL
diff --git a/gramps/gui/glade/editeventref.glade b/gramps/gui/glade/editeventref.glade
index 2377a742c..eca70783e 100644
--- a/gramps/gui/glade/editeventref.glade
+++ b/gramps/gui/glade/editeventref.glade
@@ -80,10 +80,12 @@
0
6
3
- <b>Reference information</b>
- True
+ Reference information
True
center
+
+
+
False
@@ -117,7 +119,7 @@
GTK_FILL
-
+
@@ -152,7 +154,7 @@
3
4
GTK_FILL
-
+
@@ -170,7 +172,7 @@
1
3
-
+
@@ -179,8 +181,10 @@
True
False
- <b>General</b>
- True
+ General
+
+
+
False
@@ -238,7 +242,7 @@
GTK_FILL
-
+
@@ -255,7 +259,7 @@
1
2
GTK_FILL
-
+
@@ -272,7 +276,7 @@
4
5
GTK_FILL
-
+
@@ -290,7 +294,7 @@
3
4
GTK_FILL
-
+
@@ -306,7 +310,7 @@
2
3
GTK_FILL
-
+
@@ -353,7 +357,7 @@
3
4
GTK_FILL
-
+
@@ -377,7 +381,7 @@
3
4
GTK_FILL
-
+
@@ -418,7 +422,7 @@
1
2
GTK_FILL
-
+
@@ -454,7 +458,7 @@
1
4
GTK_FILL
-
+
@@ -488,7 +492,7 @@
2
2
3
-
+
@@ -502,7 +506,7 @@
2
4
5
-
+
@@ -564,7 +568,7 @@
2
1
2
-
+
@@ -594,9 +598,11 @@
True
False
- <b>General</b>
- True
+ General
center
+
+
+
False
@@ -615,8 +621,10 @@
True
False
- <b>Shared information</b>
- True
+ Shared information
+
+
+
diff --git a/gramps/gui/glade/editfamily.glade b/gramps/gui/glade/editfamily.glade
index 75889f5b8..4aac718a9 100644
--- a/gramps/gui/glade/editfamily.glade
+++ b/gramps/gui/glade/editfamily.glade
@@ -1,7 +1,6 @@
-
False
dialog
@@ -160,8 +159,10 @@
True
False
0
- <b>Father</b>
- True
+ Father/partner1
+
+
+
False
@@ -455,8 +456,10 @@
True
False
0
- <b>Mother</b>
- True
+ Mother/partner2
+
+
+
False
@@ -675,8 +678,10 @@
True
False
0
- <b>Relationship Information</b>
- True
+ Relationship Information
+
+
+
4
diff --git a/gramps/gui/glade/editmedia.glade b/gramps/gui/glade/editmedia.glade
index 1694c7b0a..46d6f5a25 100644
--- a/gramps/gui/glade/editmedia.glade
+++ b/gramps/gui/glade/editmedia.glade
@@ -105,7 +105,7 @@
1
2
GTK_FILL
-
+
@@ -121,7 +121,7 @@
1
2
GTK_FILL
-
+
@@ -139,7 +139,7 @@
2
3
GTK_FILL
-
+
@@ -158,7 +158,7 @@
3
4
GTK_FILL
-
+
@@ -171,7 +171,7 @@
4
5
GTK_FILL
-
+
@@ -202,8 +202,10 @@
True
False
- <b>Preview</b>
- True
+ Preview
+
+
+
@@ -226,7 +228,7 @@ Gramps does not store the media internally, it only stores the path! Set the 'Re
3
3
4
-
+
@@ -239,7 +241,7 @@ Gramps does not store the media internally, it only stores the path! Set the 'Re
2
4
-
+
@@ -280,7 +282,7 @@ Gramps does not store the media internally, it only stores the path! Set the 'Re
2
3
GTK_FILL
-
+
@@ -319,7 +321,7 @@ Gramps does not store the media internally, it only stores the path! Set the 'Re
3
4
GTK_FILL
-
+
@@ -334,7 +336,7 @@ Gramps does not store the media internally, it only stores the path! Set the 'Re
3
1
2
-
+
@@ -370,7 +372,7 @@ Gramps does not store the media internally, it only stores the path! Set the 'Re
1
2
GTK_FILL
-
+
@@ -385,7 +387,7 @@ Gramps does not store the media internally, it only stores the path! Set the 'Re
3
2
3
-
+
@@ -403,7 +405,7 @@ Gramps does not store the media internally, it only stores the path! Set the 'Re
4
5
GTK_FILL
-
+
@@ -449,7 +451,7 @@ Gramps does not store the media internally, it only stores the path! Set the 'Re
4
4
5
-
+
diff --git a/gramps/gui/glade/editmediaref.glade b/gramps/gui/glade/editmediaref.glade
index 235109bce..a7cc8d04e 100644
--- a/gramps/gui/glade/editmediaref.glade
+++ b/gramps/gui/glade/editmediaref.glade
@@ -165,8 +165,10 @@
True
False
0
- <b>Referenced Region</b>
- True
+ Referenced Region
+
+
+
5
@@ -240,8 +242,10 @@ Select a region with clicking and holding the mouse button on the top left corne
True
False
- <b>Preview</b>
- True
+ Preview
+
+
+
@@ -352,6 +356,9 @@ You can use the mouse on the picture to select a region, or use these spinbutton
+
+
+
True
@@ -430,6 +437,9 @@ You can use the mouse on the picture to select a region, or use these spinbutton
True
False
General
+
+
+
False
@@ -613,8 +623,10 @@ You can use the mouse on the picture to select a region, or use these spinbutton
True
False
- <b>Preview</b>
- True
+ Preview
+
+
+
@@ -884,8 +896,10 @@ You can use the mouse on the picture to select a region, or use these spinbutton
True
False
- <b>General</b>
- True
+ General
+
+
+
False
@@ -897,8 +911,10 @@ You can use the mouse on the picture to select a region, or use these spinbutton
True
False
- <b>Shared Information</b>
- True
+ Shared Information
+
+
+
diff --git a/gramps/gui/glade/editname.glade b/gramps/gui/glade/editname.glade
index 3f882199d..b3411a697 100644
--- a/gramps/gui/glade/editname.glade
+++ b/gramps/gui/glade/editname.glade
@@ -213,7 +213,7 @@
GTK_FILL
-
+
@@ -229,7 +229,7 @@
1
2
GTK_FILL
-
+
@@ -247,7 +247,7 @@
1
2
GTK_FILL
-
+
@@ -263,7 +263,7 @@
4
5
GTK_FILL
-
+
@@ -278,7 +278,7 @@
1
4
-
+
@@ -296,7 +296,7 @@
1
2
GTK_FILL
-
+
@@ -362,8 +362,10 @@
True
False
0
- <i>Given Name(s) </i>
- True
+ Given Name(s)
+
+
+
@@ -457,8 +459,10 @@
True
False
0
- <i>Family Names </i>
- True
+ Family Names
+
+
+
@@ -517,7 +521,7 @@
1
2
GTK_FILL
-
+
@@ -535,7 +539,7 @@
1
2
GTK_FILL
-
+
@@ -553,7 +557,7 @@
2
3
GTK_FILL
-
+
@@ -575,7 +579,7 @@ Here you can make sure this person is displayed according to a custom name forma
2
3
GTK_FILL
-
+
@@ -594,7 +598,7 @@ Here you can make sure this person is displayed according to a custom name forma
3
4
GTK_FILL
-
+
@@ -615,7 +619,7 @@ Here you can make sure this person is sorted according to a custom name format (
3
1
2
-
+
@@ -657,7 +661,7 @@ Here you can make sure this person is sorted according to a custom name format (
3
4
GTK_FILL
-
+
@@ -704,7 +708,7 @@ You will be asked if you want to group this person only, or all people with this
2
4
GTK_FILL
-
+
@@ -719,7 +723,7 @@ You will be asked if you want to group this person only, or all people with this
3
3
4
-
+
@@ -743,6 +747,9 @@ You will be asked if you want to group this person only, or all people with this
+
+
+
@@ -765,8 +772,10 @@ You will be asked if you want to group this person only, or all people with this
True
False
General
- True
center
+
+
+
False
diff --git a/gramps/gui/glade/editnote.glade b/gramps/gui/glade/editnote.glade
index 298d2e8a2..efa7a3e62 100644
--- a/gramps/gui/glade/editnote.glade
+++ b/gramps/gui/glade/editnote.glade
@@ -1,6 +1,5 @@
-
False
@@ -346,6 +345,15 @@ Use monospace font to keep preformatting.
+
+
+
+
+
+
+
+
+
False
@@ -359,8 +367,10 @@ Use monospace font to keep preformatting.
True
False
- <b>Note</b>
- True
+ Note
+
+
+
False
diff --git a/gramps/gui/glade/editperson.glade b/gramps/gui/glade/editperson.glade
index a181c754e..feae29ed0 100644
--- a/gramps/gui/glade/editperson.glade
+++ b/gramps/gui/glade/editperson.glade
@@ -307,8 +307,10 @@
True
False
- <b>Image</b>
- True
+ Image
+
+
+
@@ -424,8 +426,10 @@ Indicate that the surname consists of different parts. Every surname has its own
False
0
3
- <b>General</b>
- True
+ General
+
+
+
False
@@ -490,8 +494,10 @@ Indicate that the surname consists of different parts. Every surname has its own
False
0
3
- <b>Preferred Name </b>
- True
+ Preferred Name
+
+
+
True
diff --git a/gramps/gui/glade/editplace.glade b/gramps/gui/glade/editplace.glade
index ed839d499..9c3ea6574 100644
--- a/gramps/gui/glade/editplace.glade
+++ b/gramps/gui/glade/editplace.glade
@@ -77,7 +77,7 @@
False
12
2
- 4
+ 5
6
4
@@ -125,18 +125,57 @@
-
+
True
- True
- A unique ID to identify the place
- ●
+ False
+ 6
+
+
+ 75
+ True
+ True
+ A unique ID to identify the place
+ ●
+ 6
+
+
+ False
+ True
+ 0
+
+
+
+
+ True
+ False
+ 0
+ Tags:
+
+
+ False
+ True
+ 1
+
+
+
+
+ True
+ False
+ 0
+
+
+ True
+ True
+ 2
+
+
1
- 2
+ 4
1
2
-
+ GTK_FILL
@@ -152,12 +191,12 @@
-
+
True
False
gtk-dialog-authentication
-
+
Privacy
@@ -165,16 +204,27 @@
- 2
- 3
- 1
- 2
+ 4
+ 5
-
+
+ True
+ True
+ True
+ True
+
+
+ 4
+ 5
+ 1
+ 2
+
+
+
@@ -192,6 +242,8 @@
True
False
12
+ 5
+ 4
12
6
@@ -200,6 +252,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -223,9 +389,11 @@
True
False
- <b>Location</b>
- True
+ Location
center
+
+
+
False
diff --git a/gramps/gui/glade/editreporef.glade b/gramps/gui/glade/editreporef.glade
index 7baaf87ea..234dbe71c 100644
--- a/gramps/gui/glade/editreporef.glade
+++ b/gramps/gui/glade/editreporef.glade
@@ -91,10 +91,12 @@
0
6
3
- <b>Reference information</b>
- True
+ Reference information
True
center
+
+
+
False
@@ -128,7 +130,7 @@
GTK_FILL
-
+
@@ -145,7 +147,7 @@
1
2
GTK_FILL
-
+
@@ -164,7 +166,7 @@
1
2
-
+
@@ -216,7 +218,7 @@
3
1
2
-
+
@@ -225,8 +227,10 @@
True
False
- <b>General</b>
- True
+ General
+
+
+
False
@@ -270,7 +274,7 @@
GTK_FILL
-
+
@@ -287,7 +291,7 @@
1
2
GTK_FILL
-
+
@@ -300,7 +304,7 @@
1
2
-
+
@@ -360,7 +364,7 @@
2
3
GTK_FILL
-
+
@@ -454,8 +458,10 @@
True
False
- <b>General</b>
- True
+ General
+
+
+
False
@@ -467,8 +473,10 @@
True
False
- <b>Shared information</b>
- True
+ Shared information
+
+
+
diff --git a/gramps/gui/glade/editrepository.glade b/gramps/gui/glade/editrepository.glade
index add6e8b26..23c191176 100644
--- a/gramps/gui/glade/editrepository.glade
+++ b/gramps/gui/glade/editrepository.glade
@@ -17,7 +17,6 @@
gtk-cancel
- False
True
True
True
@@ -25,7 +24,6 @@
True
Abandon changes and close window
Abandon changes and close window
- False
True
@@ -37,7 +35,6 @@
gtk-ok
- False
True
True
True
@@ -46,7 +43,6 @@
True
Accept changes and close window
Accept changes and close window
- False
True
@@ -58,12 +54,10 @@
gtk-help
- False
True
True
True
True
- False
True
@@ -89,7 +83,7 @@
True
False
12
- 2
+ 3
2
4
4
@@ -97,7 +91,7 @@
True
False
- 1
+ 0
_Name:
True
center
@@ -192,14 +186,12 @@
- False
True
True
True
True
Indicates if the record is private
Indicates if the record is private
- False
none
@@ -236,6 +228,59 @@
GTK_FILL
+
+
+ True
+ False
+ 0
+ Tags:
+ right
+
+
+ 2
+ 3
+ GTK_FILL
+
+
+
+
+
+ True
+ False
+
+
+ True
+ False
+ 0
+
+
+ True
+ True
+ 0
+
+
+
+
+ True
+ True
+ True
+ True
+
+
+ False
+ True
+ 1
+
+
+
+
+ 1
+ 2
+ 2
+ 3
+ GTK_FILL
+
+
False
diff --git a/gramps/gui/glade/editsource.glade b/gramps/gui/glade/editsource.glade
index 5f7301128..94ee1fa76 100644
--- a/gramps/gui/glade/editsource.glade
+++ b/gramps/gui/glade/editsource.glade
@@ -18,13 +18,11 @@
gtk-cancel
- False
True
True
True
False
Abandon changes and close window
- False
True
@@ -37,14 +35,12 @@
gtk-ok
- False
True
True
True
True
False
Accept changes and close window
- False
True
@@ -57,12 +53,10 @@
gtk-help
- False
True
True
True
False
- False
True
@@ -90,7 +84,7 @@
False
12
5
- 2
+ 3
4
4
@@ -134,7 +128,7 @@
1
- 2
+ 3
@@ -146,7 +140,7 @@
1
- 2
+ 3
1
2
@@ -163,8 +157,8 @@
pubinfo
- 4
- 5
+ 2
+ 3
GTK_FILL
@@ -177,9 +171,9 @@
1
- 2
- 4
- 5
+ 3
+ 2
+ 3
@@ -214,6 +208,62 @@
+
+
+ True
+ False
+ 12
+
+
+ 75
+ True
+ True
+ A unique ID to identify the source
+ ●
+ 6
+
+
+ False
+ True
+ 0
+
+
+
+
+ True
+ False
+ 0
+ Tags:
+
+
+ False
+ True
+ 1
+
+
+
+
+ True
+ False
+ 0
+ 2
+
+
+ True
+ True
+ 2
+
+
+
+
+ 1
+ 2
+ 4
+ 5
+ GTK_FILL
+ GTK_FILL
+
+
True
@@ -224,72 +274,63 @@
gid
- 2
- 3
+ 4
+ 5
GTK_FILL
+ GTK_FILL
+
+
+
+
+ True
+ True
+ True
+ True
+ Indicates if the record is private
+ Indicates if the record is private
+ none
+
+
+
+ Private
+
+
+
+
+ True
+ False
+ gtk-dialog-authentication
+
+
+ Privacy
+
+
+
+
+
+
+ 2
+ 3
+ 3
+ 4
+
-
+
True
- False
- 12
-
-
- True
- True
- A unique ID to identify the source
- ●
-
-
- True
- True
- 0
-
-
-
-
- False
- True
- True
- False
- Indicates if the record is private
- False
- none
-
-
-
- Private
-
-
-
-
- True
- False
- gtk-dialog-authentication
-
-
- Privacy
-
-
-
-
-
-
- False
- False
- 1
-
-
+ True
+ True
+ True
- 1
- 2
- 2
- 3
- GTK_FILL
- GTK_FILL
+ 2
+ 3
+ 4
+ 5
+
+
diff --git a/gramps/gui/glade/editsourceref.glade b/gramps/gui/glade/editsourceref.glade
index 4c6eaafb2..8a7fa28d8 100644
--- a/gramps/gui/glade/editsourceref.glade
+++ b/gramps/gui/glade/editsourceref.glade
@@ -86,10 +86,12 @@
0
6
3
- <b>Reference information</b>
- True
+ Reference information
True
center
+
+
+
False
@@ -126,7 +128,7 @@
GTK_FILL
-
+
@@ -165,7 +167,7 @@
2
3
GTK_FILL
-
+
@@ -180,7 +182,7 @@
2
1
2
-
+
@@ -197,7 +199,7 @@
1
2
GTK_FILL
-
+
@@ -214,7 +216,7 @@
2
3
GTK_FILL
-
+
@@ -250,7 +252,7 @@
2
3
GTK_FILL
-
+
@@ -276,7 +278,7 @@ Very High =Direct and primary evidence used, or by dominance of the evidence 2
3
GTK_FILL
-
+
@@ -289,7 +291,7 @@ Very High =Direct and primary evidence used, or by dominance of the evidence
1
2
-
+
@@ -298,8 +300,10 @@ Very High =Direct and primary evidence used, or by dominance of the evidence
True
False
- <b>General</b>
- True
+ General
+
+
+
False
@@ -345,7 +349,7 @@ Very High =Direct and primary evidence used, or by dominance of the evidence
GTK_FILL
-
+
@@ -362,7 +366,7 @@ Very High =Direct and primary evidence used, or by dominance of the evidence 1
2
GTK_FILL
-
+
@@ -380,7 +384,7 @@ Very High =Direct and primary evidence used, or by dominance of the evidence 3
4
GTK_FILL
-
+
@@ -397,7 +401,7 @@ Very High =Direct and primary evidence used, or by dominance of the evidence 4
5
GTK_FILL
-
+
@@ -412,7 +416,7 @@ Very High =Direct and primary evidence used, or by dominance of the evidence 2
1
2
-
+
@@ -457,7 +461,7 @@ Very High =Direct and primary evidence used, or by dominance of the evidence 5
6
GTK_EXPAND | GTK_SHRINK | GTK_FILL
-
+
@@ -472,7 +476,7 @@ Very High =Direct and primary evidence used, or by dominance of the evidence 2
3
4
-
+
@@ -487,7 +491,7 @@ Very High =Direct and primary evidence used, or by dominance of the evidence 2
4
5
-
+
@@ -503,7 +507,7 @@ Very High =Direct and primary evidence used, or by dominance of the evidence 2
3
GTK_FILL
-
+
@@ -563,7 +567,7 @@ Very High =Direct and primary evidence used, or by dominance of the evidence 2
3
GTK_FILL
-
+
@@ -576,7 +580,7 @@ Very High =Direct and primary evidence used, or by dominance of the evidence
1
2
-
+
@@ -604,9 +608,11 @@ Very High =Direct and primary evidence used, or by dominance of the evidence
True
False
- <b>General</b>
- True
+ General
center
+
+
+
False
@@ -625,8 +631,10 @@ Very High =Direct and primary evidence used, or by dominance of the evidence
True
False
- <b>Shared source information</b>
- True
+ Shared source information
+
+
+
diff --git a/gramps/gui/glade/mergecitation.glade b/gramps/gui/glade/mergecitation.glade
index e088a6e33..26d1fe0c4 100644
--- a/gramps/gui/glade/mergecitation.glade
+++ b/gramps/gui/glade/mergecitation.glade
@@ -199,8 +199,10 @@ primary data for the merged citation.
True
False
- <b>Source 1</b>
- True
+ Source 1
+
+
+
GTK_FILL
@@ -211,8 +213,10 @@ primary data for the merged citation.
True
False
- <b>Source 2</b>
- True
+ Source 2
+
+
+
2
diff --git a/gramps/gui/glade/mergedata.glade b/gramps/gui/glade/mergedata.glade
index 80c4ed944..e49696f16 100644
--- a/gramps/gui/glade/mergedata.glade
+++ b/gramps/gui/glade/mergedata.glade
@@ -601,8 +601,10 @@
True
False
0
- <b>Title selection</b>
- True
+ Title selection
+
+
+
3
@@ -833,8 +835,10 @@
True
False
0
- <b>Source 1</b>
- True
+ Source 1
+
+
+
3
@@ -849,8 +853,10 @@
True
False
0
- <b>Source 2</b>
- True
+ Source 2
+
+
+
4
diff --git a/gramps/gui/glade/mergeevent.glade b/gramps/gui/glade/mergeevent.glade
index f8e8b258f..af4833dd6 100644
--- a/gramps/gui/glade/mergeevent.glade
+++ b/gramps/gui/glade/mergeevent.glade
@@ -187,8 +187,10 @@ primary data for the merged event.
True
False
- <b>Event 1</b>
- True
+ Event 1
+
+
+
GTK_FILL
@@ -199,8 +201,10 @@ primary data for the merged event.
True
False
- <b>Event 2</b>
- True
+ Event 2
+
+
+
2
diff --git a/gramps/gui/glade/mergefamily.glade b/gramps/gui/glade/mergefamily.glade
index 81ef61b43..4e1398a12 100644
--- a/gramps/gui/glade/mergefamily.glade
+++ b/gramps/gui/glade/mergefamily.glade
@@ -190,8 +190,10 @@ primary data for the merged family.
True
False
- <b>Family 1</b>
- True
+ Family 1
+
+
+
GTK_FILL
@@ -202,8 +204,10 @@ primary data for the merged family.
True
False
- <b>Family 2</b>
- True
+ Family 2
+
+
+
2
diff --git a/gramps/gui/glade/mergemedia.glade b/gramps/gui/glade/mergemedia.glade
index 9ac5be113..a766eb71a 100644
--- a/gramps/gui/glade/mergemedia.glade
+++ b/gramps/gui/glade/mergemedia.glade
@@ -187,8 +187,10 @@ primary data for the merged object.
True
False
- <b>Object 1</b>
- True
+ Object 1
+
+
+
GTK_FILL
@@ -199,8 +201,10 @@ primary data for the merged object.
True
False
- <b>Object 2</b>
- True
+ Object 2
+
+
+
2
diff --git a/gramps/gui/glade/mergenote.glade b/gramps/gui/glade/mergenote.glade
index b64912a44..e85271884 100644
--- a/gramps/gui/glade/mergenote.glade
+++ b/gramps/gui/glade/mergenote.glade
@@ -187,8 +187,10 @@ primary data for the merged note.
True
False
- <b>Note 1</b>
- True
+ Note 1
+
+
+
GTK_FILL
@@ -199,8 +201,10 @@ primary data for the merged note.
True
False
- <b>Note 2</b>
- True
+ Note 2
+
+
+
2
diff --git a/gramps/gui/glade/mergeperson.glade b/gramps/gui/glade/mergeperson.glade
index cbe3f50cf..695a39aa8 100644
--- a/gramps/gui/glade/mergeperson.glade
+++ b/gramps/gui/glade/mergeperson.glade
@@ -197,8 +197,10 @@ primary data for the merged person.
True
False
- <b>Person 1</b>
- True
+ Person 1
+
+
+
@@ -209,8 +211,10 @@ primary data for the merged person.
True
False
- <b>Person 2</b>
- True
+ Person 2
+
+
+
2
diff --git a/gramps/gui/glade/mergeplace.glade b/gramps/gui/glade/mergeplace.glade
index 9029e49a1..1b0417981 100644
--- a/gramps/gui/glade/mergeplace.glade
+++ b/gramps/gui/glade/mergeplace.glade
@@ -187,8 +187,10 @@ primary data for the merged place.
True
False
- <b>Place 1</b>
- True
+ Place 1
+
+
+
GTK_FILL
@@ -199,8 +201,10 @@ primary data for the merged place.
True
False
- <b>Place 2</b>
- True
+ Place 2
+
+
+
2
diff --git a/gramps/gui/glade/mergerepository.glade b/gramps/gui/glade/mergerepository.glade
index bfda575e1..c4a7077d2 100644
--- a/gramps/gui/glade/mergerepository.glade
+++ b/gramps/gui/glade/mergerepository.glade
@@ -187,8 +187,10 @@ primary data for the merged repository.
True
False
- <b>Repository 1</b>
- True
+ Repository 1
+
+
+
GTK_FILL
@@ -199,8 +201,10 @@ primary data for the merged repository.
True
False
- <b>Repository 2</b>
- True
+ Repository 2
+
+
+
2
diff --git a/gramps/gui/glade/mergesource.glade b/gramps/gui/glade/mergesource.glade
index 80a282b15..20c34c219 100644
--- a/gramps/gui/glade/mergesource.glade
+++ b/gramps/gui/glade/mergesource.glade
@@ -187,8 +187,10 @@ primary data for the merged source.
True
False
- <b>Source 1</b>
- True
+ Source 1
+
+
+
GTK_FILL
@@ -199,8 +201,10 @@ primary data for the merged source.
True
False
- <b>Source 2</b>
- True
+ Source 2
+
+
+
2
diff --git a/gramps/gui/glade/reorder.glade b/gramps/gui/glade/reorder.glade
index 429796266..0468ff3dc 100644
--- a/gramps/gui/glade/reorder.glade
+++ b/gramps/gui/glade/reorder.glade
@@ -87,12 +87,14 @@
True
False
0
- <b>Parent relationships</b>
- True
+ Parent relationships
+
+
+
3
-
+
@@ -201,15 +203,17 @@
True
False
0
- <b>Family relationships</b>
- True
+ Family relationships
+
+
+
3
3
4
GTK_FILL
-
+
diff --git a/gramps/gui/glade/rule.glade b/gramps/gui/glade/rule.glade
index 38defd83e..85fb854dc 100644
--- a/gramps/gui/glade/rule.glade
+++ b/gramps/gui/glade/rule.glade
@@ -257,8 +257,10 @@
True
False
6
- <i>Note: changes take effect only after this window is closed</i>
- True
+ Note: changes take effect only after this window is closed
+
+
+
False
@@ -554,8 +556,10 @@
True
False
0
- <b>Options</b>
- True
+ Options
+
+
+
4
@@ -570,8 +574,10 @@
True
False
0
- <b>Rule list</b>
- True
+ Rule list
+
+
+
4
@@ -586,8 +592,10 @@
True
False
0
- <b>Definition</b>
- True
+ Definition
+
+
+
4
@@ -879,8 +887,10 @@
True
False
0
- <b>Selected Rule</b>
- True
+ Selected Rule
+
+
+
False
@@ -909,8 +919,10 @@
True
False
0
- <b>Description</b>
- True
+ Description
+
+
+
False
@@ -940,8 +952,10 @@
True
False
0
- <b>Values</b>
- True
+ Values
+
+
+
False
diff --git a/gramps/gui/glade/styleeditor.glade b/gramps/gui/glade/styleeditor.glade
index 958260ed8..65bdfb1db 100644
--- a/gramps/gui/glade/styleeditor.glade
+++ b/gramps/gui/glade/styleeditor.glade
@@ -238,8 +238,10 @@
True
False
- <b>Description</b>
- True
+ Description
+
+
+
False
@@ -285,9 +287,11 @@
0
0
3
- <b>Type face</b>
- True
+ Type face
center
+
+
+
4
@@ -344,9 +348,11 @@
False
0
3
- <b>Size</b>
- True
+ Size
center
+
+
+
4
@@ -396,9 +402,11 @@
False
0
3
- <b>Color</b>
- True
+ Color
center
+
+
+
4
@@ -415,9 +423,11 @@
0
0
3
- <b>Options</b>
- True
+ Options
center
+
+
+
4
@@ -532,8 +542,10 @@
True
False
- <b>Font options</b>
- True
+ Font options
+
+
+
1
@@ -676,9 +688,11 @@
0
0
3
- <b>Alignment</b>
- True
+ Alignment
center
+
+
+
5
@@ -692,9 +706,11 @@
False
0
3
- <b>Background color</b>
- True
+ Background color
center
+
+
+
5
@@ -819,9 +835,11 @@
0
0
3
- <b>Spacing</b>
- True
+ Spacing
center
+
+
+
5
@@ -910,9 +928,11 @@
0
0
3
- <b>Borders</b>
- True
+ Borders
center
+
+
+
5
@@ -1165,8 +1185,10 @@
True
False
0
- <b>Indentation</b>
- True
+ Indentation
+
+
+
5
@@ -1202,8 +1224,10 @@
True
False
- <b>Paragraph options</b>
- True
+ Paragraph options
+
+
+
2
diff --git a/gramps/gui/glade/updateaddons.glade b/gramps/gui/glade/updateaddons.glade
index 0d88286e7..e584b530b 100644
--- a/gramps/gui/glade/updateaddons.glade
+++ b/gramps/gui/glade/updateaddons.glade
@@ -13,6 +13,7 @@
True
False
+ vertical
2
@@ -69,8 +70,10 @@
True
False
- <b>Available Gramps Updates for Addons</b>
- True
+ Available Gramps Updates for Addons
+
+
+
False
@@ -88,8 +91,8 @@
True
- True
- True
+ False
+ False
1
@@ -160,7 +163,7 @@
- False
+ True
True
end
2
diff --git a/gramps/gui/grampsgui.py b/gramps/gui/grampsgui.py
index 574bc208a..587248a66 100644
--- a/gramps/gui/grampsgui.py
+++ b/gramps/gui/grampsgui.py
@@ -30,47 +30,9 @@ from __future__ import print_function
import sys
import os
-from gramps.gen.ggettext import gettext as _
import logging
LOG = logging.getLogger(".grampsgui")
-#-------------------------------------------------------------------------
-#
-# Miscellaneous initialization
-#
-#-------------------------------------------------------------------------
-try:
- import gi
- gi.require_version('Gtk', '3.0')
- #It is important to import Pango before Gtk, or some things start to go
- #wrong in GTK3 !
- from gi.repository import Pango
- from gi.repository import Gtk, Gdk
-except (ImportError, ValueError):
- print((_("Gtk typelib not installed. Install Gnome Introspection, and "
- "pygobject version 3.3.2 or later.\n\n"
- "Gramps will terminate now.")))
- sys.exit(0)
-
-#-------------------------------------------------------------------------
-#
-# Miscellaneous initialization
-#
-#-------------------------------------------------------------------------
-from gi.repository import GObject
-
-MIN_PYGOBJECT_VERSION = (3, 3, 2)
-if not GObject.pygobject_version >= MIN_PYGOBJECT_VERSION :
- print((_("Your pygobject version does not meet the "
- "requirements. At least pygobject "
- "%(major)d.%(bug)d.%(minor)d is needed to"
- " start Gramps with a GUI.\n\n"
- "Gramps will terminate now.") %
- {'major':MIN_PYGOBJECT_VERSION[0],
- 'bug':MIN_PYGOBJECT_VERSION[1],
- 'minor':MIN_PYGOBJECT_VERSION[2]}))
- sys.exit(0)
-
#-------------------------------------------------------------------------
#
# GRAMPS Modules
@@ -79,6 +41,68 @@ if not GObject.pygobject_version >= MIN_PYGOBJECT_VERSION :
from gramps.gen.config import config
from gramps.gen.const import DATA_DIR, IMAGE_DIR
from gramps.gen.constfunc import has_display, win
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
+
+#-------------------------------------------------------------------------
+#
+# Miscellaneous initialization
+#
+#-------------------------------------------------------------------------
+
+MIN_PYGOBJECT_VERSION = (3, 3, 2)
+PYGOBJ_ERR = False
+
+try:
+ #import gnome introspection, part of pygobject
+ import gi
+ giversion = gi.require_version
+except:
+ print(_("Your version of gi (gnome-instrospection) seems to be too old. "
+ "You need a version which has the function 'require_version' "
+ "to start Gramps"))
+ sys.exit(0)
+
+if not PYGOBJ_ERR:
+ try:
+ from gi.repository import GObject
+ if not GObject.pygobject_version >= MIN_PYGOBJECT_VERSION :
+ PYGOBJ_ERR = True
+ except:
+ PYGOBJ_ERR = True
+
+if PYGOBJ_ERR:
+ print((_("Your pygobject version does not meet the "
+ "requirements. At least pygobject "
+ "%(major)d.%(feature)d.%(minor)d is needed to"
+ " start Gramps with a GUI.\n\n"
+ "Gramps will terminate now.") %
+ {'major':MIN_PYGOBJECT_VERSION[0],
+ 'feature':MIN_PYGOBJECT_VERSION[1],
+ 'minor':MIN_PYGOBJECT_VERSION[2]}))
+ sys.exit(0)
+
+try:
+ gi.require_version('Gtk', '3.0')
+ #It is important to import Pango before Gtk, or some things start to go
+ #wrong in GTK3 !
+ from gi.repository import Pango
+ from gi.repository import Gtk, Gdk
+except (ImportError, ValueError):
+ print((_("Gdk, Gtk or Pango typelib not installed.\n"
+ "Install Gnome Introspection, and "
+ "pygobject version 3.3.2 or later.\n"
+ "Install then instrospection data for Gdk, Gtk and Pango\n\n"
+ "Gramps will terminate now.")))
+ sys.exit(0)
+
+try:
+ import cairo
+except ImportError:
+ print((_("\ncairo python support not installed. Install cairo for your "
+ "version of python\n\n"
+ "Gramps will terminate now.")))
+ sys.exit(0)
#-------------------------------------------------------------------------
#
@@ -280,12 +304,14 @@ def __startgramps(errors, argparser):
from .dialog import ErrorDialog
#handle first existing errors in GUI fashion
if errors:
- ErrorDialog(errors[0], errors[1])
+ for error in errors:
+ ErrorDialog(error[0], error[1])
Gtk.main_quit()
sys.exit(1)
if argparser.errors:
- ErrorDialog(argparser.errors[0], argparser.errors[1])
+ for error in argparser.errors:
+ ErrorDialog(error[0], error[1])
Gtk.main_quit()
sys.exit(1)
diff --git a/gramps/gui/listmodel.py b/gramps/gui/listmodel.py
index a1462504c..d6da23304 100644
--- a/gramps/gui/listmodel.py
+++ b/gramps/gui/listmodel.py
@@ -29,9 +29,9 @@ Provide the basic functionality for a list view
# GTK
#
#-------------------------------------------------------------------------
+from gi.repository import Pango
from gi.repository import Gdk
from gi.repository import Gtk
-from gi.repository import Pango
from gramps.gen.const import THUMBSCALE
#-------------------------------------------------------------------------
diff --git a/gramps/gui/logger/_errorreportassistant.py b/gramps/gui/logger/_errorreportassistant.py
index 30ac5e2be..a3733585a 100644
--- a/gramps/gui/logger/_errorreportassistant.py
+++ b/gramps/gui/logger/_errorreportassistant.py
@@ -26,7 +26,8 @@
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gi.repository import Gdk
from gi.repository import Gtk
from gi.repository import GdkPixbuf
diff --git a/gramps/gui/logger/_errorview.py b/gramps/gui/logger/_errorview.py
index 1b8ed0751..f96ea9b23 100644
--- a/gramps/gui/logger/_errorview.py
+++ b/gramps/gui/logger/_errorview.py
@@ -33,7 +33,8 @@ from gi.repository import Gtk
#
#-------------------------------------------------------------------------
from gramps.gen.const import URL_MANUAL_PAGE
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from ._errorreportassistant import ErrorReportAssistant
from ..display import display_help
diff --git a/gramps/gui/makefilter.py b/gramps/gui/makefilter.py
index 4c0298c85..e8e1d85be 100644
--- a/gramps/gui/makefilter.py
+++ b/gramps/gui/makefilter.py
@@ -25,7 +25,8 @@ from .editors import EditFilter
from gramps.gen.const import CUSTOM_FILTERS
from gramps.gen.filters import (rules, FilterList, GenericFilterFactory,
reload_custom_filters)
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
import collections
def make_filter(dbstate, uistate, objclass, gramps_ids, title=None):
diff --git a/gramps/gui/merge/mergecitation.py b/gramps/gui/merge/mergecitation.py
index b57323123..50bacb3c6 100644
--- a/gramps/gui/merge/mergecitation.py
+++ b/gramps/gui/merge/mergecitation.py
@@ -30,7 +30,8 @@ Provide merge capabilities for citations.
# Gramps modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gen.const import URL_MANUAL_PAGE
from ..display import display_help
from ..managedwindow import ManagedWindow
diff --git a/gramps/gui/merge/mergeevent.py b/gramps/gui/merge/mergeevent.py
index 8b357a6fe..1a84a18ba 100644
--- a/gramps/gui/merge/mergeevent.py
+++ b/gramps/gui/merge/mergeevent.py
@@ -29,7 +29,8 @@ Provide merge capabilities for events.
# Gramps modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gen.const import URL_MANUAL_PAGE
from ..display import display_help
from ..managedwindow import ManagedWindow
diff --git a/gramps/gui/merge/mergefamily.py b/gramps/gui/merge/mergefamily.py
index 54d13a9df..3cc18c6d6 100644
--- a/gramps/gui/merge/mergefamily.py
+++ b/gramps/gui/merge/mergefamily.py
@@ -29,7 +29,8 @@ Provide merge capabilities for families.
# Gramps modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gen.display.name import displayer as name_displayer
from gramps.gen.const import URL_MANUAL_PAGE
from ..display import display_help
diff --git a/gramps/gui/merge/mergemedia.py b/gramps/gui/merge/mergemedia.py
index 15f7c18f4..4dca62f07 100644
--- a/gramps/gui/merge/mergemedia.py
+++ b/gramps/gui/merge/mergemedia.py
@@ -29,7 +29,8 @@ Provide merge capabilities for media objects.
# Gramps modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gen.const import URL_MANUAL_PAGE
from ..display import display_help
from ..managedwindow import ManagedWindow
diff --git a/gramps/gui/merge/mergenote.py b/gramps/gui/merge/mergenote.py
index f18087244..fee47aa2c 100644
--- a/gramps/gui/merge/mergenote.py
+++ b/gramps/gui/merge/mergenote.py
@@ -29,7 +29,8 @@ Provide merge capabilities for notes.
# Gramps modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gen.const import URL_MANUAL_PAGE
from ..display import display_help
from ..managedwindow import ManagedWindow
diff --git a/gramps/gui/merge/mergeperson.py b/gramps/gui/merge/mergeperson.py
index e3dc692bd..a2393818a 100644
--- a/gramps/gui/merge/mergeperson.py
+++ b/gramps/gui/merge/mergeperson.py
@@ -38,7 +38,8 @@ from gi.repository import Pango
# Gramps modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gen.plug.report import utils as ReportUtils
from gramps.gen.display.name import displayer as name_displayer
from gramps.gen.const import URL_MANUAL_PAGE
diff --git a/gramps/gui/merge/mergeplace.py b/gramps/gui/merge/mergeplace.py
index d19fab358..9050daea6 100644
--- a/gramps/gui/merge/mergeplace.py
+++ b/gramps/gui/merge/mergeplace.py
@@ -37,7 +37,8 @@ from gi.repository import Gtk
# Gramps modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gen.const import URL_MANUAL_PAGE
from ..display import display_help
from ..managedwindow import ManagedWindow
diff --git a/gramps/gui/merge/mergerepository.py b/gramps/gui/merge/mergerepository.py
index ffc76d070..238380fde 100644
--- a/gramps/gui/merge/mergerepository.py
+++ b/gramps/gui/merge/mergerepository.py
@@ -29,7 +29,8 @@ Provide merge capabilities for repositories.
# Gramps modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gen.const import URL_MANUAL_PAGE
from ..display import display_help
from ..managedwindow import ManagedWindow
diff --git a/gramps/gui/merge/mergesource.py b/gramps/gui/merge/mergesource.py
index e909d93a9..cd017d090 100644
--- a/gramps/gui/merge/mergesource.py
+++ b/gramps/gui/merge/mergesource.py
@@ -31,7 +31,8 @@ Provide merge capabilities for sources.
# Gramps modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gen.const import URL_MANUAL_PAGE
from ..display import display_help
from ..managedwindow import ManagedWindow
diff --git a/gramps/gui/navigator.py b/gramps/gui/navigator.py
index 96793b757..a79450b92 100644
--- a/gramps/gui/navigator.py
+++ b/gramps/gui/navigator.py
@@ -29,6 +29,7 @@ manage pages in the main Gramps window.
#
#-------------------------------------------------------------------------
from gi.repository import Gtk
+from gi.repository import Gdk
#-------------------------------------------------------------------------
#
@@ -36,6 +37,38 @@ from gi.repository import Gtk
#
#-------------------------------------------------------------------------
from gramps.gen.plug import (START, END)
+from .pluginmanager import GuiPluginManager
+
+#-------------------------------------------------------------------------
+#
+# Constants
+#
+#-------------------------------------------------------------------------
+UICATEGORY = '''
+
+
+ %s
+
+
+
+
+'''
+
+CATEGORY_ICON = {
+ 'Dashboard': 'gramps-gramplet',
+ 'People': 'gramps-person',
+ 'Relationships': 'gramps-relation',
+ 'Families': 'gramps-family',
+ 'Events': 'gramps-event',
+ 'Ancestry': 'gramps-pedigree',
+ 'Places': 'gramps-place',
+ 'Geography': 'gramps-geo',
+ 'Sources': 'gramps-source',
+ 'Repositories': 'gramps-repository',
+ 'Media': 'gramps-media',
+ 'Notes': 'gramps-notes',
+ 'Citations': 'gramps-citation',
+}
#-------------------------------------------------------------------------
#
@@ -50,6 +83,14 @@ class Navigator(object):
self.viewmanager = viewmanager
self.pages = []
+ self.active_cat = None
+ self.active_view = None
+
+ self.ui_category = {}
+ self.view_toggle_actions = {}
+ self.cat_view_group = None
+ self.merge_ids = []
+
self.top = Gtk.VBox()
frame = Gtk.Frame()
@@ -92,6 +133,59 @@ class Navigator(object):
self.top.show()
self.top.pack_start(self.notebook, True, True, 0)
+ def load_plugins(self, dbstate, uistate):
+ """
+ Load the sidebar plugins.
+ """
+ plugman = GuiPluginManager.get_instance()
+
+ categories = []
+ views = {}
+ for cat_num, cat_views in enumerate(self.viewmanager.get_views()):
+ uimenuitems = ''
+ self.view_toggle_actions[cat_num] = []
+ for view_num, page in enumerate(cat_views):
+
+ if view_num == 0:
+ views[cat_num] = []
+ cat_name = page[0].category[1]
+ cat_icon = CATEGORY_ICON.get(page[0].category[0])
+ if cat_icon is None:
+ cat_icon = 'gramps-view'
+ categories.append([cat_num, cat_name, cat_icon])
+
+ pageid = 'page_%i_%i' % (cat_num, view_num)
+ uimenuitems += '\n ' % pageid
+ # id, stock, button text, UI, tooltip, page
+ if view_num < 9:
+ modifier = "%d" % ((view_num % 9) + 1)
+ else:
+ modifier = ""
+
+ stock_icon = page[0].stock_icon
+ if stock_icon is None:
+ stock_icon = cat_icon
+ self.view_toggle_actions[cat_num].append((pageid,
+ stock_icon,
+ page[0].name, modifier, page[0].name, view_num))
+
+ views[cat_num].append((view_num, page[0].name, stock_icon))
+
+ if len(cat_views) > 1:
+ #allow for switching views in a category
+ self.ui_category[cat_num] = UICATEGORY % uimenuitems
+
+ for pdata in plugman.get_reg_sidebars():
+ module = plugman.load_plugin(pdata)
+ if not module:
+ print("Error loading sidebar '%s': skipping content"
+ % pdata.name)
+ continue
+
+ sidebar_class = getattr(module, pdata.sidebarclass)
+ sidebar_page = sidebar_class(dbstate, uistate, categories, views)
+ self.add(pdata.menu_label, sidebar_page, pdata.order)
+
def get_top(self):
"""
Return the top container widget for the GUI.
@@ -121,8 +215,37 @@ class Navigator(object):
"""
Called when a Gramps view is changed.
"""
- for page in self.pages:
- page[1].view_changed(cat_num, view_num)
+ self.active_cat = cat_num
+ self.active_view = view_num
+
+ # Add buttons to the menu for the different view in the category
+ uimanager = self.viewmanager.uimanager
+ if self.cat_view_group:
+ if self.cat_view_group in uimanager.get_action_groups():
+ uimanager.remove_action_group(self.cat_view_group)
+
+ list(map(uimanager.remove_ui, self.merge_ids))
+
+ if cat_num in self.ui_category:
+ self.cat_view_group = Gtk.ActionGroup('viewmenu')
+ self.cat_view_group.add_radio_actions(
+ self.view_toggle_actions[cat_num], value=view_num,
+ on_change=self.cb_view_clicked, user_data=cat_num)
+ self.cat_view_group.set_sensitive(True)
+ uimanager.insert_action_group(self.cat_view_group, 1)
+ mergeid = uimanager.add_ui_from_string(self.ui_category[cat_num])
+ self.merge_ids.append(mergeid)
+
+ # Call the view_changed method for the active sidebar
+ sidebar = self.pages[self.notebook.get_current_page()][1]
+ sidebar.view_changed(cat_num, view_num)
+
+ def cb_view_clicked(self, radioaction, current, cat_num):
+ """
+ Called when a view is selected from the menu.
+ """
+ view_num = radioaction.get_current_value()
+ self.viewmanager.goto_page(cat_num, view_num)
def __menu_button_pressed(self, button, event):
"""
@@ -145,8 +268,12 @@ class Navigator(object):
"""
Called when the user has switched to a new sidebar plugin page.
"""
- if self.pages:
- self.title_label.set_text(self.pages[index][0])
+ old_page = notebook.get_current_page()
+ if old_page != -1:
+ self.pages[old_page][1].inactive()
+ self.pages[index][1].active(self.active_cat, self.active_view)
+ self.pages[index][1].view_changed(self.active_cat, self.active_view)
+ self.title_label.set_text(self.pages[index][0])
def cb_close_clicked(self, button):
"""
@@ -164,9 +291,9 @@ def cb_menu_position(menu, button):
"""
Determine the position of the popup menu.
"""
- x_pos, y_pos = button.window.get_origin()
- x_pos += button.allocation.x
- y_pos += button.allocation.y + button.allocation.height
+ ret_val, x_pos, y_pos = button.get_window().get_origin()
+ x_pos += button.get_allocation().x
+ y_pos += button.get_allocation().y + button.get_allocation().height
return (x_pos, y_pos, False)
diff --git a/gramps/gui/plug/_dialogs.py b/gramps/gui/plug/_dialogs.py
index 52197a1ff..31c990dd4 100644
--- a/gramps/gui/plug/_dialogs.py
+++ b/gramps/gui/plug/_dialogs.py
@@ -33,7 +33,8 @@ from gi.repository import Gtk
# Standard Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from collections import defaultdict
#-------------------------------------------------------------------------
@@ -216,7 +217,7 @@ class PluginDialog(ManagedWindow):
for key in key_list:
data = item_hash[key]
node = self.store.insert_after(None, prev)
- self.store.set(node, 0, key)
+ self.store.set(node, 0, key[1])
next = None
data.sort(key=lambda k:k.name)
for item in data:
diff --git a/gramps/gui/plug/_guioptions.py b/gramps/gui/plug/_guioptions.py
index 56d7da438..4e881a623 100644
--- a/gramps/gui/plug/_guioptions.py
+++ b/gramps/gui/plug/_guioptions.py
@@ -35,7 +35,8 @@ from __future__ import unicode_literals
# python modules
#
#------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import os
import sys
diff --git a/gramps/gui/plug/_windows.py b/gramps/gui/plug/_windows.py
index 0f6f0a8f6..08e424764 100644
--- a/gramps/gui/plug/_windows.py
+++ b/gramps/gui/plug/_windows.py
@@ -52,7 +52,8 @@ from gi.repository import GObject
from ..managedwindow import ManagedWindow
from gramps.gen.errors import UnavailableError, WindowActiveError
from gramps.gen.plug import PluginRegister, PTYPE_STR, load_addon_file
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from ..utils import open_file_with_default_application
from ..pluginmanager import GuiPluginManager
from . import tool
@@ -483,7 +484,8 @@ class PluginStatus(ManagedWindow):
'%s ' % _('Fail'),
i[0], str(i[1][1]), i[1], pdata.id, hiddenstr])
- success_list = sorted(self.__pmgr.get_success_list())
+ success_list = sorted(self.__pmgr.get_success_list(),
+ key=lambda x: (x[0], x[2]._get_name()))
for i in success_list:
# i = (filename, module, pdata)
pdata = i[2]
diff --git a/gramps/gui/plug/export/_exportassistant.py b/gramps/gui/plug/export/_exportassistant.py
index 9457ceb1c..764b1d143 100644
--- a/gramps/gui/plug/export/_exportassistant.py
+++ b/gramps/gui/plug/export/_exportassistant.py
@@ -33,7 +33,8 @@
#-------------------------------------------------------------------------
import os
import sys
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
@@ -316,7 +317,8 @@ class ExportAssistant(Gtk.Assistant, ManagedWindow) :
filename = filechooser.get_filename()
folder = filechooser.get_current_folder()
#the file must be valid, not a folder, and folder must be valid
- if filename and filename.strip and find_folder(filename) == '' \
+ if filename and os.path.basename(filename.strip()) \
+ and find_folder(filename) == '' \
and folder and find_folder(folder):
#this page of the assistant is complete
self.set_page_complete(filechooser, True)
diff --git a/gramps/gui/plug/export/_exportoptions.py b/gramps/gui/plug/export/_exportoptions.py
index fb569aae6..56016b4ec 100644
--- a/gramps/gui/plug/export/_exportoptions.py
+++ b/gramps/gui/plug/export/_exportoptions.py
@@ -35,8 +35,9 @@
# GRAMPS modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
-from gramps.gen.ggettext import ngettext
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
+ngettext = glocale.get_translation().ngettext
from gramps.gen.config import config
from gramps.gen.display.name import displayer as name_displayer
from gramps.gen.filters import GenericFilter, rules
@@ -374,7 +375,7 @@ class WriterOptionBox(object):
# Now, we can't add something that we want hidden
for n in range(5):
self.vbox_n[n].pack_start(self.up_n[n], True, True, 0)
- self.vbox_n[n].pack_end(self.down_n[n])
+ self.vbox_n[n].pack_end(self.down_n[n], False, True, 0)
# some spacer buttons:
up = Gtk.Button()
up.set_sensitive(0)
diff --git a/gramps/gui/plug/quick/_quickreports.py b/gramps/gui/plug/quick/_quickreports.py
index f4a7036da..151efc880 100644
--- a/gramps/gui/plug/quick/_quickreports.py
+++ b/gramps/gui/plug/quick/_quickreports.py
@@ -33,7 +33,8 @@ This module provides the functions to build the quick report context menu's
#------------------------------------------------------------------------
from __future__ import print_function
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import sys
if sys.version_info[0] < 3:
from StringIO import StringIO
diff --git a/gramps/gui/plug/quick/_quicktable.py b/gramps/gui/plug/quick/_quicktable.py
index ad8277d82..c20605086 100644
--- a/gramps/gui/plug/quick/_quicktable.py
+++ b/gramps/gui/plug/quick/_quicktable.py
@@ -52,9 +52,10 @@ from gi.repository import Gtk
# Gramps modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gen.simple import SimpleTable
-from gramps.gen.utils.trans import trans_objclass
from gramps.gen.errors import WindowActiveError
from ...widgets.multitreeview import MultiTreeView
from ...ddtargets import DdTargets
@@ -127,7 +128,7 @@ class QuickTable(SimpleTable):
if (index is not None and self._link[index]):
# See details (edit, etc):
objclass, handle = self._link[index]
- menu_item = Gtk.MenuItem(label=_("the object|See %s details") % trans_objclass(objclass))
+ menu_item = Gtk.MenuItem(label=_("the object|See %s details") % glocale.trans_objclass(objclass))
menu_item.connect("activate",
lambda widget: self.on_table_doubleclick(treeview))
popup.append(menu_item)
@@ -137,7 +138,7 @@ class QuickTable(SimpleTable):
(index is not None and self._link[index])):
objclass, handle = self._link[index]
if objclass == 'Person':
- menu_item = Gtk.MenuItem(label=_("the object|Make %s active") % trans_objclass('Person'))
+ menu_item = Gtk.MenuItem(label=_("the object|Make %s active") % glocale.trans_objclass('Person'))
menu_item.connect("activate",
lambda widget: self.on_table_click(treeview))
popup.append(menu_item)
diff --git a/gramps/gui/plug/quick/_textbufdoc.py b/gramps/gui/plug/quick/_textbufdoc.py
index a99b4c9db..5a899f17f 100644
--- a/gramps/gui/plug/quick/_textbufdoc.py
+++ b/gramps/gui/plug/quick/_textbufdoc.py
@@ -26,7 +26,8 @@
# python modules
#
#------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gi.repository import Gtk
from gi.repository import Pango, PangoCairo
diff --git a/gramps/gui/plug/report/_bookdialog.py b/gramps/gui/plug/report/_bookdialog.py
index 9fa75c8cb..388cf435c 100644
--- a/gramps/gui/plug/report/_bookdialog.py
+++ b/gramps/gui/plug/report/_bookdialog.py
@@ -4,7 +4,8 @@
# Copyright (C) 2003-2007 Donald N. Allingham
# Copyright (C) 2007-2008 Brian G. Matherly
# Copyright (C) 2010 Jakim Friant
-# Copyright (C) 2011-2012 Paul Franklin
+# Copyright (C) 2012 Nick Hall
+# Copyright (C) 2011-2013 Paul Franklin
#
# 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
@@ -33,7 +34,8 @@
#-------------------------------------------------------------------------
from __future__ import print_function
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#------------------------------------------------------------------------
#
@@ -419,9 +421,8 @@ class BookSelector(ManagedWindow):
available_reports = []
for pdata in regbi:
- if not pdata.supported:
- category = _UNSUPPORTED
- else:
+ category = _UNSUPPORTED
+ if pdata.supported and pdata.category in book_categories:
category = book_categories[pdata.category]
available_reports.append([ pdata.name, category, pdata.id ])
for data in sorted(available_reports):
@@ -892,6 +893,7 @@ class BookDialog(DocReportDialog):
self.doc = self.format(None, pstyle)
user = User()
self.rptlist = []
+ self.global_style = None
for item in self.book.get_item_list():
item.option_class.set_document(self.doc)
report_class = item.get_write_item()
@@ -899,6 +901,13 @@ class BookDialog(DocReportDialog):
item.option_class, user)
style_sheet = create_style_sheet(item)
self.rptlist.append((obj, style_sheet))
+ if ( item.name == 'table_of_contents' or
+ item.name == 'alphabetical_index' ): # ugly hack: FIXME
+ if self.global_style is None:
+ self.global_style = style_sheet
+ else:
+ self.global_style = create_style_sheet(item,
+ self.global_style)
self.doc.open(self.target_path)
def make_book(self):
@@ -915,6 +924,8 @@ class BookDialog(DocReportDialog):
if rpt:
rpt.begin_report()
rpt.write_report()
+ if self.global_style:
+ self.doc.set_style_sheet(self.global_style)
self.doc.close()
if self.open_with_app.get_active():
diff --git a/gramps/gui/plug/report/_docreportdialog.py b/gramps/gui/plug/report/_docreportdialog.py
index 65bda2f63..4bb46fc55 100644
--- a/gramps/gui/plug/report/_docreportdialog.py
+++ b/gramps/gui/plug/report/_docreportdialog.py
@@ -28,7 +28,8 @@
#
#-------------------------------------------------------------------------
import os
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
@@ -66,6 +67,7 @@ class DocReportDialog(ReportDialog):
self.style_name = "default"
self.firstpage_added = False
self.CSS = PLUGMAN.process_plugin_data('WEBSTUFF')
+ self.dbname = dbstate.db.get_dbname()
ReportDialog.__init__(self, dbstate, uistate, option_class,
name, trans_name)
@@ -183,10 +185,12 @@ class DocReportDialog(ReportDialog):
ext = ""
else:
spath = self.get_default_directory()
+ default_name = self.dbname + "_" + \
+ "".join(x[0].upper() for x in self.raw_name.split("_"))
if self.options.get_output():
base = os.path.basename(self.options.get_output())
else:
- base = "%s.%s" % (self.report_name, ext)
+ base = "%s.%s" % (default_name, ext)
spath = os.path.normpath(os.path.join(spath, base))
self.target_fileentry.set_filename(spath)
diff --git a/gramps/gui/plug/report/_graphvizreportdialog.py b/gramps/gui/plug/report/_graphvizreportdialog.py
index 233496f4f..07e8d2deb 100644
--- a/gramps/gui/plug/report/_graphvizreportdialog.py
+++ b/gramps/gui/plug/report/_graphvizreportdialog.py
@@ -30,7 +30,8 @@
#
#------------------------------------------------------------------------
import os
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------------
#
@@ -115,6 +116,7 @@ class GraphvizReportDialog(ReportDialog):
more information."""
self.category = CATEGORY_GRAPHVIZ
self.__gvoptions = graphdoc.GVOptions()
+ self.dbname = dbstate.db.get_dbname()
ReportDialog.__init__(self, dbstate, uistate, opt,
name, translated_name)
@@ -164,10 +166,12 @@ class GraphvizReportDialog(ReportDialog):
ext = ""
else:
spath = self.get_default_directory()
+ default_name = self.dbname + "_" + \
+ "".join(x[0].upper() for x in self.raw_name.split("_"))
if self.options.get_output():
base = os.path.basename(self.options.get_output())
else:
- base = "%s%s" % (self.report_name, ext)
+ base = "%s%s" % (default_name, ext)
spath = os.path.normpath(os.path.join(spath, base))
self.target_fileentry.set_filename(spath)
diff --git a/gramps/gui/plug/report/_papermenu.py b/gramps/gui/plug/report/_papermenu.py
index 0e22b3844..6aab25b3f 100644
--- a/gramps/gui/plug/report/_papermenu.py
+++ b/gramps/gui/plug/report/_papermenu.py
@@ -26,7 +26,8 @@
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gui/plug/report/_reportdialog.py b/gramps/gui/plug/report/_reportdialog.py
index 1ec448aa0..7d5ad9a78 100644
--- a/gramps/gui/plug/report/_reportdialog.py
+++ b/gramps/gui/plug/report/_reportdialog.py
@@ -47,7 +47,8 @@ from gi.repository import Gtk
# GRAMPS modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.config import config
from gramps.gen.errors import DatabaseError, FilterError, ReportError, WindowActiveError
from ...utils import open_file_with_default_application
@@ -205,7 +206,7 @@ class ReportDialog(ManagedWindow):
def get_title(self):
"""The window title for this dialog"""
name = self.report_name
- category = standalone_categories[self.category]
+ category = standalone_categories[self.category][1]
return "%s - %s - Gramps" % (name, category)
#------------------------------------------------------------------------
@@ -644,7 +645,6 @@ def report(dbstate, uistate, person, report_class, options_class,
task be in the format of task that takes a database and a person as
its arguments.
"""
-
if require_active and not person:
ErrorDialog(
_('Active person has not been set'),
diff --git a/gramps/gui/plug/report/_stylecombobox.py b/gramps/gui/plug/report/_stylecombobox.py
index c7f78a08e..92a66f588 100644
--- a/gramps/gui/plug/report/_stylecombobox.py
+++ b/gramps/gui/plug/report/_stylecombobox.py
@@ -21,7 +21,8 @@
# $Id$
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gi.repository import Gtk
from gi.repository import GObject
diff --git a/gramps/gui/plug/report/_styleeditor.py b/gramps/gui/plug/report/_styleeditor.py
index 049d70aa8..37bd2079f 100644
--- a/gramps/gui/plug/report/_styleeditor.py
+++ b/gramps/gui/plug/report/_styleeditor.py
@@ -33,7 +33,8 @@ Paragraph/Font style editor
# Python modules
#
#------------------------------------------------------------------------
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
import logging
log = logging.getLogger(".")
import re
diff --git a/gramps/gui/plug/tool.py b/gramps/gui/plug/tool.py
index 50c984a07..8da3baf4a 100644
--- a/gramps/gui/plug/tool.py
+++ b/gramps/gui/plug/tool.py
@@ -31,7 +31,8 @@
#-------------------------------------------------------------------------
from __future__ import print_function
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import logging
log = logging.getLogger(".")
@@ -55,14 +56,13 @@ from gramps.gen.plug import (TOOL_DEBUG, TOOL_ANAL, TOOL_DBPROC, TOOL_DBFIX,
#-------------------------------------------------------------------------
tool_categories = {
- TOOL_DEBUG : _("Debug"),
- TOOL_ANAL : _("Analysis and Exploration"),
- TOOL_DBPROC : _("Family Tree Processing"),
- TOOL_DBFIX : _("Family Tree Repair"),
- TOOL_REVCTL : _("Revision Control"),
- TOOL_UTILS : _("Utilities"),
+ TOOL_DEBUG : ("ToolDebug", _("Debug")),
+ TOOL_ANAL : ("ToolAnExp", _("Analysis and Exploration")),
+ TOOL_DBPROC : ("ToolProc", _("Family Tree Processing")),
+ TOOL_DBFIX : ("ToolRep", _("Family Tree Repair")),
+ TOOL_REVCTL : ("ToolRev", _("Revision Control")),
+ TOOL_UTILS : ("ToolUtil", _("Utilities")),
}
-
#-------------------------------------------------------------------------
#
# Tool
diff --git a/gramps/gui/selectors/baseselector.py b/gramps/gui/selectors/baseselector.py
index fb0f22401..87733ea11 100644
--- a/gramps/gui/selectors/baseselector.py
+++ b/gramps/gui/selectors/baseselector.py
@@ -179,12 +179,19 @@ class BaseSelector(ManagedWindow):
def get_selected_ids(self):
mlist = []
- self.selection.selected_foreach(self.select_function,mlist)
+ self.selection.selected_foreach(self.select_function, mlist)
return mlist
- def select_function(self,store,path,iter,id_list):
- handle_column = self.get_handle_column()
- id_list.append(self.model.get_value(iter, handle_column))
+ def first_selected(self):
+ """ first selected entry in the Selector tree
+ """
+ mlist = []
+ self.selection.selected_foreach(self.select_function, mlist)
+ return mlist[0] if mlist else None
+
+ def select_function(self, store, path, iter_, id_list):
+ handle = store.get_handle_from_iter(iter_)
+ id_list.append(handle)
def run(self):
val = self.window.run()
@@ -230,10 +237,6 @@ class BaseSelector(ManagedWindow):
def get_from_handle_func2(self):
return None
- def get_handle_column(self):
- # return 3
- assert False, "Must be defined in the subclass"
-
def set_show_search_bar(self, value):
"""make the search bar at the top shown
"""
@@ -245,18 +248,6 @@ class BaseSelector(ManagedWindow):
else :
self.search_bar.hide()
- def begintree(self, store, path, node, sel_list):
- handle_column = self.get_handle_column()
- handle = store.get_value(node, handle_column)
- sel_list.append(handle)
-
- def first_selected(self):
- """ first selected entry in the Selector tree
- """
- mlist = []
- self.selection.selected_foreach(self.begintree, mlist)
- return mlist[0] if mlist else None
-
def column_order(self):
"""
returns a tuple indicating the column order of the model
diff --git a/gramps/gui/selectors/selectcitation.py b/gramps/gui/selectors/selectcitation.py
index af905812f..97354a31f 100644
--- a/gramps/gui/selectors/selectcitation.py
+++ b/gramps/gui/selectors/selectcitation.py
@@ -31,7 +31,8 @@ SelectCitation class for GRAMPS.
# internationalization
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
@@ -72,6 +73,3 @@ class SelectCitation(BaseSelector):
def get_from_handle_func2(self):
return self.db.get_citation_from_handle
-
- def get_handle_column(self):
- return 8
diff --git a/gramps/gui/selectors/selectevent.py b/gramps/gui/selectors/selectevent.py
index ffd5d425c..2e2bf7f8c 100644
--- a/gramps/gui/selectors/selectevent.py
+++ b/gramps/gui/selectors/selectevent.py
@@ -26,7 +26,8 @@
# internationalization
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
@@ -61,13 +62,10 @@ class SelectEvent(BaseSelector):
(_('Description'), 250, BaseSelector.TEXT, 0),
(_('ID'), 75, BaseSelector.TEXT, 1),
(_('Type'), 75, BaseSelector.TEXT, 2),
- (_('Main Participants'), 250, BaseSelector.TEXT, 6),
+ (_('Main Participants'), 250, BaseSelector.TEXT, 7),
(_('Date'), 150, BaseSelector.TEXT, 3),
(_('Place'), 150, BaseSelector.TEXT, 4)
]
def get_from_handle_func(self):
return self.db.get_event_from_handle
-
- def get_handle_column(self):
- return 7
diff --git a/gramps/gui/selectors/selectfamily.py b/gramps/gui/selectors/selectfamily.py
index b813594a5..3a8079178 100644
--- a/gramps/gui/selectors/selectfamily.py
+++ b/gramps/gui/selectors/selectfamily.py
@@ -26,7 +26,8 @@
# internationalization
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
@@ -65,6 +66,3 @@ class SelectFamily(BaseSelector):
def get_from_handle_func(self):
return self.db.get_family_from_handle
-
- def get_handle_column(self):
- return 7
diff --git a/gramps/gui/selectors/selectnote.py b/gramps/gui/selectors/selectnote.py
index 4fb39da53..a16f0c0f2 100644
--- a/gramps/gui/selectors/selectnote.py
+++ b/gramps/gui/selectors/selectnote.py
@@ -29,7 +29,8 @@
# Python Modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
@@ -66,11 +67,8 @@ class SelectNote(BaseSelector):
(_('Preview'), 350, BaseSelector.TEXT, 0),
(_('ID'), 75, BaseSelector.TEXT, 1),
(_('Type'), 100, BaseSelector.TEXT, 2),
- (_('Tags'), 100, BaseSelector.TEXT, 3)
+ (_('Tags'), 100, BaseSelector.TEXT, 4)
]
def get_from_handle_func(self):
return self.db.get_note_from_handle
-
- def get_handle_column(self):
- return 5
diff --git a/gramps/gui/selectors/selectobject.py b/gramps/gui/selectors/selectobject.py
index 5d01f2e17..12af0e965 100644
--- a/gramps/gui/selectors/selectobject.py
+++ b/gramps/gui/selectors/selectobject.py
@@ -30,7 +30,8 @@
#
#-------------------------------------------------------------------------
import gc
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
@@ -66,9 +67,6 @@ class SelectObject(BaseSelector):
def get_from_handle_func(self):
return self.db.get_object_from_handle
- def get_handle_column(self):
- return 7
-
def get_column_titles(self):
return [
(_('Title'), 350, BaseSelector.TEXT, 0),
diff --git a/gramps/gui/selectors/selectperson.py b/gramps/gui/selectors/selectperson.py
index ee76d857c..a8fd98c73 100644
--- a/gramps/gui/selectors/selectperson.py
+++ b/gramps/gui/selectors/selectperson.py
@@ -26,7 +26,8 @@
# internationalization
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gi.repository import Gdk
from gi.repository import Gtk
@@ -80,15 +81,12 @@ class SelectPerson(BaseSelector):
(_('Death Date'), 150, BaseSelector.MARKUP, 5),
(_('Death Place'), 150, BaseSelector.MARKUP, 6),
(_('Spouse'), 150, BaseSelector.TEXT, 7),
- (_('Last Change'), 150, BaseSelector.TEXT, 8)
+ (_('Last Change'), 150, BaseSelector.TEXT, 10)
]
def get_from_handle_func(self):
return self.db.get_person_from_handle
- def get_handle_column(self):
- return PeopleBaseModel.COLUMN_INT_ID
-
def exact_search(self):
"""
Returns a tuple indicating columns requiring an exact search
diff --git a/gramps/gui/selectors/selectplace.py b/gramps/gui/selectors/selectplace.py
index 42572fff2..ef6f38663 100644
--- a/gramps/gui/selectors/selectplace.py
+++ b/gramps/gui/selectors/selectplace.py
@@ -27,7 +27,8 @@
# internationalization
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
@@ -66,6 +67,3 @@ class SelectPlace(BaseSelector):
def get_from_handle_func(self):
return self.db.get_place_from_handle
-
- def get_handle_column(self):
- return PlaceListModel.HANDLE_COL
diff --git a/gramps/gui/selectors/selectrepository.py b/gramps/gui/selectors/selectrepository.py
index 5d86646dc..9c84cc9b5 100644
--- a/gramps/gui/selectors/selectrepository.py
+++ b/gramps/gui/selectors/selectrepository.py
@@ -26,7 +26,8 @@
# internationalization
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
@@ -62,8 +63,5 @@ class SelectRepository(BaseSelector):
(_('ID'), 75, BaseSelector.TEXT, 1)
]
- def get_handle_column(self):
- return 13
-
def get_from_handle_func(self):
return self.db.get_repository_from_handle
diff --git a/gramps/gui/selectors/selectsource.py b/gramps/gui/selectors/selectsource.py
index f92ecf9d8..047a14c9e 100644
--- a/gramps/gui/selectors/selectsource.py
+++ b/gramps/gui/selectors/selectsource.py
@@ -26,7 +26,8 @@
# internationalization
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
@@ -64,6 +65,3 @@ class SelectSource(BaseSelector):
def get_from_handle_func(self):
return self.db.get_source_from_handle
-
- def get_handle_column(self):
- return 6
diff --git a/gramps/gui/spell.py b/gramps/gui/spell.py
index cbb8b51e9..ebaac65b4 100644
--- a/gramps/gui/spell.py
+++ b/gramps/gui/spell.py
@@ -32,8 +32,6 @@ present, we default to no spell checking.
# Python classes
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
-import locale
#-------------------------------------------------------------------------
#
@@ -51,20 +49,23 @@ LOG = logging.getLogger(".Spell")
from gi.repository import Gtk
from gi import Repository
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
+
HAVE_GTKSPELL = False
# Attempting to import gtkspell gives an error dialog if gtkspell is not
# available so test first and log just a warning to the console instead.
repository = Repository.get_default()
-if repository.enumerate_versions("Gtkspell"):
+if repository.enumerate_versions("GtkSpell"):
try:
- from gi.repository import Gtkspell
+ from gi.repository import GtkSpell as Gtkspell
HAVE_GTKSPELL = True
except:
pass
-elif repository.enumerate_versions("GtkSpell"):
+elif repository.enumerate_versions("Gtkspell"):
try:
- from gi.repository import GtkSpell as Gtkspell
+ from gi.repository import Gtkspell
HAVE_GTKSPELL = True
except:
pass
diff --git a/gramps/gui/thumbnails.py b/gramps/gui/thumbnails.py
index c875baf7b..261f565b1 100644
--- a/gramps/gui/thumbnails.py
+++ b/gramps/gui/thumbnails.py
@@ -53,7 +53,7 @@ from gi.repository import GdkPixbuf
#-------------------------------------------------------------------------
from gramps.gen.const import (ICON, IMAGE_DIR, THUMB_LARGE, THUMB_NORMAL,
THUMBSCALE, THUMBSCALE_LARGE, USE_THUMBNAILER)
-from gramps.gen.constfunc import cuni
+from gramps.gen.constfunc import cuni, win
#-------------------------------------------------------------------------
#
diff --git a/gramps/gui/tipofday.py b/gramps/gui/tipofday.py
index ecc828200..5b746987b 100644
--- a/gramps/gui/tipofday.py
+++ b/gramps/gui/tipofday.py
@@ -31,7 +31,8 @@ Handles the Tip of the Day dialog
#-------------------------------------------------------------------------
from xml.parsers.expat import ParserCreate, ExpatError
from random import Random
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import os
import sys
diff --git a/gramps/gui/undohistory.py b/gramps/gui/undohistory.py
index a1ea2aabb..ea92676c1 100644
--- a/gramps/gui/undohistory.py
+++ b/gramps/gui/undohistory.py
@@ -28,7 +28,8 @@
#
#------------------------------------------------------------------------
import time
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from itertools import chain
#-------------------------------------------------------------------------
@@ -121,7 +122,7 @@ class UndoHistory(ManagedWindow):
(model, node) = self.selection.get_selected()
if not node or len(self.model) == 1:
return
- path = self.model.get_path(node)
+ path = self.model.get_path(node).get_indices()
start = min(path[0], self.undodb.undo_count)
end = max(path[0], self.undodb.undo_count)
@@ -158,7 +159,7 @@ class UndoHistory(ManagedWindow):
(model, node) = self.selection.get_selected()
if not node:
return
- path = self.model.get_path(node)
+ path = self.model.get_path(node).get_indices()
nsteps = path[0] - self.undodb.undo_count - 1
self._move(nsteps or -1)
@@ -167,7 +168,7 @@ class UndoHistory(ManagedWindow):
(model, node) = self.selection.get_selected()
if not node:
return
- path = self.model.get_path(node)
+ path = self.model.get_path(node).get_indices()
nsteps = path[0] - self.undodb.undo_count
self._move(nsteps or 1)
diff --git a/gramps/gui/utils.py b/gramps/gui/utils.py
index 541a4f61d..ee6bdf4eb 100644
--- a/gramps/gui/utils.py
+++ b/gramps/gui/utils.py
@@ -33,7 +33,8 @@ from __future__ import print_function, division
#-------------------------------------------------------------------------
import os
import sys
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
# gtk is not included here, because this file is currently imported
# by code that needs to run without the DISPLAY variable (eg, in
# the cli only).
diff --git a/gramps/gui/viewmanager.py b/gramps/gui/viewmanager.py
index 8894a38f4..8c1b45779 100644
--- a/gramps/gui/viewmanager.py
+++ b/gramps/gui/viewmanager.py
@@ -7,6 +7,7 @@
# Copyright (C) 2010 Nick Hall
# Copyright (C) 2010 Jakim Friant
# Copyright (C) 2012 Gary Burton
+# Copyright (C) 2012 Doug Blank
#
# 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
@@ -41,8 +42,6 @@ import os
import sys
import time
import datetime
-from gramps.gen.ggettext import sgettext as _
-from gramps.gen.ggettext import ngettext
if sys.version_info[0] < 3:
from cStringIO import StringIO
else:
@@ -69,6 +68,8 @@ from gi.repository import Gtk
# GRAMPS modules
#
#-------------------------------------------------------------------------
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.cli.grampscli import CLIManager
from .user import User
from .plug import tool
@@ -119,7 +120,7 @@ if is_quartz():
else:
_GTKOSXAPPLICATION = False
-_UNSUPPORTED = _("Unsupported")
+_UNSUPPORTED = ("Unsupported", _("Unsupported"))
UIDEFAULT = '''
@@ -237,7 +238,6 @@ UIDEFAULT = '''
WIKI_HELP_PAGE_FAQ = '%s_-_FAQ' % URL_MANUAL_PAGE
WIKI_HELP_PAGE_KEY = '%s_-_Keybindings' % URL_MANUAL_PAGE
WIKI_HELP_PAGE_MAN = '%s' % URL_MANUAL_PAGE
-ADDONS_URL = "http://gramps-addons.svn.sourceforge.net/viewvc/gramps-addons/trunk"
#-------------------------------------------------------------------------
#
@@ -250,7 +250,7 @@ def update_rows(model, path, iter, user_data):
"""
#path: (8,) iter:
#path: (8, 0) iter:
- if len(path) == 2:
+ if len(path.get_indices()) == 2:
row = model[path]
row[0] = user_data
model.row_changed(path, iter)
@@ -372,21 +372,15 @@ class ViewManager(CLIManager):
from urllib.request import urlopen
import locale
LOG.debug("Checking for updated addons...")
- langs = []
- lang = locale.getlocale()[0] # not None
- if lang:
- langs.append(lang)
- if "_" in lang:
- lang, variation = lang.split("_", 1)
- langs.append(lang)
+ langs = glocale.get_language_list()
langs.append("en")
# now we have a list of languages to try:
fp = None
for lang in langs:
- URL = "%s/listings/addons-%s.txt" % (ADDONS_URL, lang)
+ URL = "%s/listings/addons-%s.txt" % (config.get("behavior.addons-url"), lang)
LOG.debug(" trying: %s" % URL)
try:
- fp = urlopen(URL)
+ fp = urlopen(URL, timeout=10) # abort after 10 seconds
except: # some error
LOG.debug(" IOError!")
fp = None
@@ -397,13 +391,15 @@ class ViewManager(CLIManager):
lines = list(fp.readlines())
count = 0
for line in lines:
+ if sys.version_info[0] >= 3:
+ line = line.decode('utf-8').replace(": u'", ": '")
try:
plugin_dict = safe_eval(line)
if type(plugin_dict) != type({}):
raise TypeError("Line with addon metadata is not "
"a dictionary")
except:
- LOG.debug("Skipped a line in the addon listing: " +
+ LOG.warning("Skipped a line in the addon listing: " +
str(line))
continue
id = plugin_dict["i"]
@@ -420,7 +416,7 @@ class ViewManager(CLIManager):
plugin_dict["i"] not in config.get('behavior.previously-seen-updates')):
addon_update_list.append((_("Updated"),
"%s/download/%s" %
- (ADDONS_URL,
+ (config.get("behavior.addons-url"),
plugin_dict["z"]),
plugin_dict))
else:
@@ -432,14 +428,22 @@ class ViewManager(CLIManager):
plugin_dict["i"] not in config.get('behavior.previously-seen-updates')):
addon_update_list.append((_("New"),
"%s/download/%s" %
- (ADDONS_URL,
+ (config.get("behavior.addons-url"),
plugin_dict["z"]),
plugin_dict))
config.set("behavior.last-check-for-updates",
datetime.date.today().strftime("%Y/%m/%d"))
count += 1
- if fp:
- fp.close()
+ if fp:
+ fp.close()
+ else:
+ from .dialog import OkDialog
+ OkDialog(_("Checking Addons Failed"),
+ _("The addon repository appears to be unavailable. Please try again later."),
+ self.window)
+ if fp:
+ fp.close()
+ return
LOG.debug("Done checking!")
# List of translated strings used here
# Dead code for l10n
@@ -579,7 +583,7 @@ class ViewManager(CLIManager):
if count:
self.do_reg_plugins(self.dbstate, self.uistate)
OkDialog(_("Done downloading and installing addons"),
- "%s %s" % (ngettext("%d addon was installed.",
+ "%s %s" % (glocale.get_translation().ngettext("%d addon was installed.",
"%d addons were installed.",
count) % count,
_("You need to restart Gramps to see new views.")),
@@ -677,21 +681,6 @@ class ViewManager(CLIManager):
# But we need to realize it here to have Gdk.window handy
self.window.realize()
- def __load_sidebar_plugins(self):
- """
- Load the sidebar plugins.
- """
- for pdata in self._pmgr.get_reg_sidebars():
- module = self._pmgr.load_plugin(pdata)
- if not module:
- print("Error loading sidebar '%s': skipping content"
- % pdata.name)
- continue
-
- sidebar_class = getattr(module, pdata.sidebarclass)
- sidebar_page = sidebar_class(self.dbstate, self.uistate)
- self.navigator.add(pdata.menu_label, sidebar_page, pdata.order)
-
def __setup_statusbar(self):
"""
Create the statusbar that sits at the bottom of the window
@@ -872,7 +861,10 @@ class ViewManager(CLIManager):
"""
Run a book.
"""
- BookSelector(self.dbstate, self.uistate)
+ try:
+ BookSelector(self.dbstate, self.uistate)
+ except WindowActiveError:
+ return
def __keypress(self, action):
"""
@@ -946,7 +938,7 @@ class ViewManager(CLIManager):
config.get('preferences.use-last-view'))
self.current_views = defaults[2]
- self.__load_sidebar_plugins()
+ self.navigator.load_plugins(self.dbstate, self.uistate)
self.goto_page(defaults[0], defaults[1])
@@ -1373,7 +1365,7 @@ class ViewManager(CLIManager):
if value:
(filename, title) = value
if sys.version_info[0] < 3:
- filename = filename.encode(sys.getfilesystemencoding())
+ filename = filename.encode(glocale.getfilesystemencoding())
self.db_loader.read_file(filename)
self._post_load_newdb(filename, 'x-directory/normal', title)
@@ -1562,7 +1554,7 @@ class ViewManager(CLIManager):
hbox.pack_start(label, False, True, 0)
include = Gtk.RadioButton(None, "%s (%s %s)" % (_("Include"),
mbytes, _("Megabyte|MB")))
- exclude = Gtk.RadioButton(include, _("Exclude"))
+ exclude = Gtk.RadioButton.new_with_mnemonic_from_widget(include, _("Exclude"))
include.connect("toggled", lambda widget: self.media_toggle(widget, file_entry))
hbox.pack_start(include, False, True, 0)
hbox.pack_end(exclude, False, True, 0)
@@ -1575,7 +1567,7 @@ class ViewManager(CLIManager):
basefile = file_entry.get_text()
basefile = basefile.replace("/", r"-")
filename = os.path.join(path_entry.get_text(), basefile)
- filename = filename.encode(sys.getfilesystemencoding())
+ filename = filename.encode(glocale.getfilesystemencoding())
if os.path.exists(filename):
sfilename = get_unicode_path_from_env_var(filename)
question = QuestionDialog2(
@@ -1591,13 +1583,13 @@ class ViewManager(CLIManager):
self.uistate.progress.show()
self.uistate.push_message(self.dbstate, _("Making backup..."))
if include.get_active():
- from exportpkg import PackageWriter
+ from gramps.plugins.export.exportpkg import PackageWriter
writer = PackageWriter(self.dbstate.db, filename,
User(error=ErrorDialog,
callback=self.pulse_progressbar))
writer.export()
else:
- from exportxml import XmlWriter
+ from gramps.plugins.export.exportxml import XmlWriter
writer = XmlWriter(self.dbstate.db,
User(error=ErrorDialog,
callback=self.pulse_progressbar),
@@ -1796,9 +1788,9 @@ class ViewManager(CLIManager):
if item != _UNSUPPORTED)
for key in catlist:
- new_key = key.replace(' ', '-')
+ new_key = key[0].replace(' ', '-')
ofile.write('' % new_key)
- actions.append((new_key, None, key))
+ actions.append((new_key, None, key[1]))
pdatas = hash_data[key]
pdatas.sort(key=lambda x: x.name)
for pdata in pdatas:
@@ -1813,8 +1805,8 @@ class ViewManager(CLIManager):
# and the unsupported category at the end of the menu
if _UNSUPPORTED in hash_data:
ofile.write(' ')
- ofile.write('' % _UNSUPPORTED)
- actions.append((_UNSUPPORTED, None, _UNSUPPORTED))
+ ofile.write('' % _UNSUPPORTED[0])
+ actions.append((_UNSUPPORTED[0], None, _UNSUPPORTED[1]))
pdatas = hash_data[_UNSUPPORTED]
pdatas.sort(key=lambda x: x.name)
for pdata in pdatas:
diff --git a/gramps/gui/views/bookmarks.py b/gramps/gui/views/bookmarks.py
index 898042711..3d9d77e2e 100644
--- a/gramps/gui/views/bookmarks.py
+++ b/gramps/gui/views/bookmarks.py
@@ -58,7 +58,8 @@ from ..display import display_help
from ..listmodel import ListModel
from gramps.gen.utils.db import navigation_label
from gramps.gen.const import URL_MANUAL_PAGE
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
#-------------------------------------------------------------------------
#
@@ -82,7 +83,7 @@ DISABLED = -1
class Bookmarks :
"Handle the bookmarks interface for Gramps."
- def __init__(self, dbstate, uistate, bookmarks, callback=None):
+ def __init__(self, dbstate, uistate, callback=None):
"""
Create the bookmark editor.
@@ -92,7 +93,8 @@ class Bookmarks :
"""
self.dbstate = dbstate
self.uistate = uistate
- self.bookmarks = bookmarks
+ self.bookmarks = None
+ self.update_bookmarks()
self.active = DISABLED
self.action_group = Gtk.ActionGroup('Bookmarks')
self.connect_signals()
@@ -103,6 +105,7 @@ class Bookmarks :
Reconnect the signals on a database changed.
"""
self.connect_signals()
+ self.update_bookmarks()
def connect_signals(self):
"""
@@ -110,11 +113,17 @@ class Bookmarks :
"""
raise NotImplementedError
- def update_bookmarks(self, bookmarks):
+ def get_bookmarks(self):
+ """
+ Retrieve bookmarks from the database.
+ """
+ raise NotImplementedError
+
+ def update_bookmarks(self):
"""
Assign bookmarks
"""
- self.bookmarks = bookmarks
+ self.bookmarks = self.get_bookmarks()
def display(self):
"""
@@ -306,9 +315,9 @@ class Bookmarks :
class ListBookmarks(Bookmarks):
- def __init__(self, dbstate, uistate, bookmarks, goto_handle):
+ def __init__(self, dbstate, uistate, goto_handle):
self.goto_handle = goto_handle
- Bookmarks.__init__(self, dbstate, uistate, bookmarks)
+ Bookmarks.__init__(self, dbstate, uistate)
def callback(self, handle):
return make_callback(handle, self.do_callback)
@@ -319,9 +328,8 @@ class ListBookmarks(Bookmarks):
class PersonBookmarks(ListBookmarks) :
"Handle the bookmarks interface for Gramps."
- def __init__(self, dbstate, uistate, bookmarks, goto_handle):
- ListBookmarks.__init__(self, dbstate, uistate, bookmarks,
- goto_handle)
+ def __init__(self, dbstate, uistate, goto_handle):
+ ListBookmarks.__init__(self, dbstate, uistate, goto_handle)
def make_label(self, handle):
return navigation_label(self.dbstate.db, 'Person', handle)
@@ -329,12 +337,14 @@ class PersonBookmarks(ListBookmarks) :
def connect_signals(self):
self.dbstate.db.connect('person-delete', self.remove_handles)
+ def get_bookmarks(self):
+ return self.dbstate.db.get_bookmarks()
+
class FamilyBookmarks(ListBookmarks) :
"Handle the bookmarks interface for Gramps."
- def __init__(self, dbstate, uistate, bookmarks, goto_handle):
- ListBookmarks.__init__(self, dbstate, uistate, bookmarks,
- goto_handle)
+ def __init__(self, dbstate, uistate, goto_handle):
+ ListBookmarks.__init__(self, dbstate, uistate, goto_handle)
def make_label(self, handle):
return navigation_label(self.dbstate.db, 'Family', handle)
@@ -342,12 +352,14 @@ class FamilyBookmarks(ListBookmarks) :
def connect_signals(self):
self.dbstate.db.connect('family-delete', self.remove_handles)
+ def get_bookmarks(self):
+ return self.dbstate.db.get_family_bookmarks()
+
class EventBookmarks(ListBookmarks) :
"Handle the bookmarks interface for Gramps."
- def __init__(self, dbstate, uistate, bookmarks, goto_handle):
- ListBookmarks.__init__(self, dbstate, uistate, bookmarks,
- goto_handle)
+ def __init__(self, dbstate, uistate, goto_handle):
+ ListBookmarks.__init__(self, dbstate, uistate, goto_handle)
def make_label(self, handle):
return navigation_label(self.dbstate.db, 'Event', handle)
@@ -355,11 +367,14 @@ class EventBookmarks(ListBookmarks) :
def connect_signals(self):
self.dbstate.db.connect('event-delete', self.remove_handles)
+ def get_bookmarks(self):
+ return self.dbstate.db.get_event_bookmarks()
+
class SourceBookmarks(ListBookmarks) :
"Handle the bookmarks interface for Gramps."
- def __init__(self, dbstate, uistate, bookmarks, goto_handle):
- ListBookmarks.__init__(self, dbstate, uistate, bookmarks,
- goto_handle)
+
+ def __init__(self, dbstate, uistate, goto_handle):
+ ListBookmarks.__init__(self, dbstate, uistate, goto_handle)
def make_label(self, handle):
return navigation_label(self.dbstate.db, 'Source', handle)
@@ -367,11 +382,14 @@ class SourceBookmarks(ListBookmarks) :
def connect_signals(self):
self.dbstate.db.connect('source-delete', self.remove_handles)
+ def get_bookmarks(self):
+ return self.dbstate.db.get_source_bookmarks()
+
class CitationBookmarks(ListBookmarks) :
"Handle the bookmarks interface for Gramps."
- def __init__(self, dbstate, uistate, bookmarks, goto_handle):
- ListBookmarks.__init__(self, dbstate, uistate, bookmarks,
- goto_handle)
+
+ def __init__(self, dbstate, uistate, goto_handle):
+ ListBookmarks.__init__(self, dbstate, uistate, goto_handle)
def make_label(self, handle):
return navigation_label(self.dbstate.db, 'Citation', handle)
@@ -379,12 +397,14 @@ class CitationBookmarks(ListBookmarks) :
def connect_signals(self):
self.dbstate.db.connect('citation-delete', self.remove_handles)
+ def get_bookmarks(self):
+ return self.dbstate.db.get_citation_bookmarks()
+
class MediaBookmarks(ListBookmarks) :
"Handle the bookmarks interface for Gramps."
- def __init__(self, dbstate, uistate, bookmarks, goto_handle):
- ListBookmarks.__init__(self, dbstate, uistate, bookmarks,
- goto_handle)
+ def __init__(self, dbstate, uistate, goto_handle):
+ ListBookmarks.__init__(self, dbstate, uistate, goto_handle)
def make_label(self, handle):
return navigation_label(self.dbstate.db, 'Media', handle)
@@ -392,12 +412,14 @@ class MediaBookmarks(ListBookmarks) :
def connect_signals(self):
self.dbstate.db.connect('media-delete', self.remove_handles)
+ def get_bookmarks(self):
+ return self.dbstate.db.get_media_bookmarks()
+
class RepoBookmarks(ListBookmarks) :
"Handle the bookmarks interface for Gramps."
- def __init__(self, dbstate, uistate, bookmarks, goto_handle):
- ListBookmarks.__init__(self, dbstate, uistate, bookmarks,
- goto_handle)
+ def __init__(self, dbstate, uistate, goto_handle):
+ ListBookmarks.__init__(self, dbstate, uistate, goto_handle)
def make_label(self, handle):
return navigation_label(self.dbstate.db, 'Repository', handle)
@@ -405,12 +427,14 @@ class RepoBookmarks(ListBookmarks) :
def connect_signals(self):
self.dbstate.db.connect('repository-delete', self.remove_handles)
+ def get_bookmarks(self):
+ return self.dbstate.db.get_repo_bookmarks()
+
class PlaceBookmarks(ListBookmarks) :
"Handle the bookmarks interface for Gramps."
- def __init__(self, dbstate, uistate, bookmarks, goto_handle):
- ListBookmarks.__init__(self, dbstate, uistate, bookmarks,
- goto_handle)
+ def __init__(self, dbstate, uistate, goto_handle):
+ ListBookmarks.__init__(self, dbstate, uistate, goto_handle)
def make_label(self, handle):
return navigation_label(self.dbstate.db, 'Place', handle)
@@ -418,12 +442,14 @@ class PlaceBookmarks(ListBookmarks) :
def connect_signals(self):
self.dbstate.db.connect('place-delete', self.remove_handles)
+ def get_bookmarks(self):
+ return self.dbstate.db.get_place_bookmarks()
+
class NoteBookmarks(ListBookmarks) :
"Handle the bookmarks interface for Gramps."
- def __init__(self, dbstate, uistate, bookmarks, goto_handle):
- ListBookmarks.__init__(self, dbstate, uistate, bookmarks,
- goto_handle)
+ def __init__(self, dbstate, uistate, goto_handle):
+ ListBookmarks.__init__(self, dbstate, uistate, goto_handle)
def make_label(self, handle):
return navigation_label(self.dbstate.db, 'Note', handle)
@@ -431,6 +457,9 @@ class NoteBookmarks(ListBookmarks) :
def connect_signals(self):
self.dbstate.db.connect('note-delete', self.remove_handles)
+ def get_bookmarks(self):
+ return self.dbstate.db.get_note_bookmarks()
+
def make_callback(handle, function):
"""
Build a unique call to the function with the associated handle.
diff --git a/gramps/gui/views/listview.py b/gramps/gui/views/listview.py
index 97261acd4..68915c8d5 100644
--- a/gramps/gui/views/listview.py
+++ b/gramps/gui/views/listview.py
@@ -63,13 +63,14 @@ from gramps.gen.errors import WindowActiveError
from ..filters import SearchBar
from ..widgets.menuitem import add_menuitem
from gramps.gen.constfunc import UNITYPE
-from gramps.gen.const import CUSTOM_FILTERS, USE_TIPS
+from gramps.gen.const import CUSTOM_FILTERS
from gramps.gen.utils.debug import profile
from gramps.gen.utils.string import data_recover_msg
from gramps.gen.utils.file import get_unicode_path_from_file_chooser
from ..dialog import QuestionDialog, QuestionDialog2
from ..editors import FilterEditor
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from ..ddtargets import DdTargets
from ..plug.quick import create_quickreport_menu, create_web_connect_menu
from ..utils import is_right_click
@@ -79,8 +80,9 @@ from ..utils import is_right_click
# Constants
#
#----------------------------------------------------------------
-LISTFLAT = 0
-LISTTREE = 1
+TEXT = 1
+MARKUP = 2
+ICON = 3
#----------------------------------------------------------------
#
@@ -88,7 +90,7 @@ LISTTREE = 1
#
#----------------------------------------------------------------
class ListView(NavigationView):
- COLUMN_NAMES = []
+ COLUMNS = []
#listview config settings that are always present related to the columns
CONFIGSETTINGS = (
('columns.visible', []),
@@ -102,28 +104,26 @@ class ListView(NavigationView):
FILTER_TYPE = None # Set in inheriting class
QR_CATEGORY = -1
- def __init__(self, title, pdata, dbstate, uistate, columns, handle_col,
- make_model, signal_map, get_bookmarks, bm_type, nav_group,
- multiple=False, filter_class=None, markup=None):
+ def __init__(self, title, pdata, dbstate, uistate,
+ make_model, signal_map, bm_type, nav_group,
+ multiple=False, filter_class=None):
NavigationView.__init__(self, title, pdata, dbstate, uistate,
- get_bookmarks, bm_type, nav_group)
+ bm_type, nav_group)
#default is listviews keep themself in sync with database
self._dirty_on_change_inactive = False
self.filter_class = filter_class
+ self.pb_renderer = Gtk.CellRendererPixbuf()
self.renderer = Gtk.CellRendererText()
self.renderer.set_property('ellipsize', Pango.EllipsizeMode.END)
self.sort_col = 0
self.sort_order = Gtk.SortType.ASCENDING
self.columns = []
- self.colinfo = columns
- self.handle_col = handle_col
self.make_model = make_model
self.model = None
self.signal_map = signal_map
self.multiple_selection = multiple
self.generic_filter = None
- self.markup_columns = markup or []
dbstate.connect('database-changed', self.change_db)
self.connect_signals()
@@ -136,12 +136,6 @@ class ListView(NavigationView):
self.model = None
self.build_tree()
- def type_list(self):
- """
- set the listtype, this governs eg keybinding
- """
- return LISTFLAT
-
####################################################################
# Build interface
####################################################################
@@ -165,13 +159,8 @@ class ListView(NavigationView):
self.list.set_headers_clickable(True)
self.list.set_fixed_height_mode(True)
self.list.connect('button-press-event', self._button_press)
- if self.type_list() == LISTFLAT:
- # Flat list
- self.list.connect('key-press-event', self._key_press)
- else:
- # Tree
- self.list.connect('key-press-event', self._key_press_tree)
-
+ self.list.connect('key-press-event', self._key_press)
+
if self.drag_info():
self.list.connect('drag_data_get', self.drag_data_get)
self.list.connect('drag_begin', self.drag_begin)
@@ -189,7 +178,8 @@ class ListView(NavigationView):
self.list.drag_dest_set_target_list(tglist)
scrollwindow = Gtk.ScrolledWindow()
- scrollwindow.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
+ scrollwindow.set_policy(Gtk.PolicyType.AUTOMATIC,
+ Gtk.PolicyType.AUTOMATIC)
scrollwindow.set_shadow_type(Gtk.ShadowType.ETCHED_IN)
scrollwindow.add(self.list)
@@ -246,18 +236,28 @@ class ListView(NavigationView):
index = 0
for pair in self.column_order():
if not pair[0]: continue
- name = self.colinfo[pair[1]]
+ col_name, col_type, col_icon = self.COLUMNS[pair[1]]
- column = Gtk.TreeViewColumn(name, self.renderer)
+ if col_type == ICON:
+ column = Gtk.TreeViewColumn(col_name, self.pb_renderer)
+ column.set_cell_data_func(self.pb_renderer, self.icon, pair[1])
+ else:
+ column = Gtk.TreeViewColumn(col_name, self.renderer)
+ if col_type == MARKUP:
+ column.add_attribute(self.renderer, 'markup', pair[1])
+ else:
+ column.add_attribute(self.renderer, 'text', pair[1])
+
+ if col_icon is not None:
+ image = Gtk.Image()
+ image.set_from_stock(col_icon, Gtk.IconSize.MENU)
+ image.set_tooltip_text(col_name)
+ image.show()
+ column.set_widget(image)
if self.model and self.model.color_column() is not None:
column.set_cell_data_func(self.renderer, self.foreground_color)
- if pair[1] in self.markup_columns:
- column.add_attribute(self.renderer, 'markup', pair[1])
- else:
- column.add_attribute(self.renderer, 'text', pair[1])
-
column.connect('clicked', self.column_clicked, index)
column.set_resizable(True)
@@ -269,6 +269,16 @@ class ListView(NavigationView):
self.list.append_column(column)
index += 1
+ def icon(self, column, renderer, model, iter_, col_num):
+ '''
+ Set the stock icon property of the cell renderer. We use a cell data
+ function because there is a problem returning None from a model.
+ '''
+ stock_id = model.get_value(iter_, col_num)
+ if stock_id == '':
+ stock_id = None
+ renderer.set_property('stock_id', stock_id)
+
def foreground_color(self, column, renderer, model, iter_, data=None):
'''
Set the foreground color of the cell renderer. We use a cell data
@@ -278,11 +288,22 @@ class ListView(NavigationView):
renderer.set_property('foreground', fg_color)
def set_active(self):
+ """
+ Called when the page is displayed.
+ """
NavigationView.set_active(self)
+ self.uistate.viewmanager.tags.tag_enable()
self.uistate.show_filter_results(self.dbstate,
self.model.displayed(),
self.model.total())
+ def set_inactive(self):
+ """
+ Called when the page is no longer displayed.
+ """
+ NavigationView.set_inactive(self)
+ self.uistate.viewmanager.tags.tag_disable()
+
def __build_tree(self):
profile(self._build_tree)
@@ -317,9 +338,6 @@ class ListView(NavigationView):
self.__display_column_sort()
self.goto_active(None)
- if USE_TIPS and self.model.tooltip_column() is not None:
- self.list.set_tooltip_column(self.model.tooltip_column())
-
self.dirty = False
cput4 = time.clock()
self.uistate.show_filter_results(self.dbstate,
@@ -360,7 +378,7 @@ class ListView(NavigationView):
def setup_filter(self):
"""Build the default filters and add them to the filter menu."""
self.search_bar.setup_filter(
- [(self.colinfo[pair[1]], pair[1], pair[1] in self.exact_search())
+ [(self.COLUMNS[pair[1]][0], pair[1], pair[1] in self.exact_search())
for pair in self.column_order() if pair[0]])
def sidebar_toggled(self, active, data=None):
@@ -395,27 +413,21 @@ class ListView(NavigationView):
if not handle or handle in self.selected_handles():
return
- if self.type_list() == LISTFLAT:
- # Flat
- path = self.model.node_map.get_path_from_handle(handle)
- else:
- # Tree
- path = None
- node = self.model.get_node(handle)
- if node:
- iter = self.model.get_iter(node)
- has_parent, parent_iter = self.model.do_iter_parent(iter)
- if has_parent:
- parent_path = self.model.do_get_path(parent_iter)
- if parent_path:
- parent_path_list = parent_path.get_indices()
- for i in range(len(parent_path_list)):
- expand_path = Gtk.TreePath(
- tuple([x for x in parent_path_list[:i+1]]))
- self.list.expand_row(expand_path, False)
- path = self.model.do_get_path(iter)
+ iter_ = self.model.get_iter_from_handle(handle)
+ if iter_:
+ if not (self.model.get_flags() & Gtk.TreeModelFlags.LIST_ONLY):
+ # Expand tree
+ parent_iter = self.model.iter_parent(iter_)
+ if parent_iter:
+ parent_path = self.model.get_path(parent_iter)
+ parent_path_list = parent_path.get_indices()
+ for i in range(len(parent_path_list)):
+ expand_path = Gtk.TreePath(
+ tuple([x for x in parent_path_list[:i+1]]))
+ self.list.expand_row(expand_path, False)
- if path is not None:
+ # Select active object
+ path = self.model.get_path(iter_)
self.selection.unselect_all()
self.selection.select_path(path)
self.list.scroll_to_cell(path, None, 1, 0.5, 0)
@@ -559,15 +571,11 @@ class ListView(NavigationView):
if not prompt:
self.uistate.set_busy_cursor(False)
- def blist(self, store, path, iter, sel_list):
+ def blist(self, store, path, iter_, sel_list):
'''GtkTreeSelectionForeachFunc
construct a list sel_list with all selected handles
'''
- if store.do_get_flags() & Gtk.TreeModelFlags.LIST_ONLY:
- handle = store.node_map.get_handle(path.get_indices()[0])
- else:
- handle = store.get_handle(store.get_node_from_iter(iter))
-
+ handle = store.get_handle_from_iter(iter_)
if handle is not None:
sel_list.append(handle)
@@ -620,11 +628,16 @@ class ListView(NavigationView):
filter_info = (False, value, value[0] in self.exact_search())
if same_col:
- ##TODO GTK3 rows_reordered not exposed by gi, we need to reconnect
- ## model to obtain desired effect, but this collapses nodes ...
- self.list.set_model(None)
- self.model.reverse_order()
- self.list.set_model(self.model)
+ # activate when https://bugzilla.gnome.org/show_bug.cgi?id=684558
+ # is resolved
+ if False and (Gtk.get_major_version(), Gtk.get_minor_version()) >= (3,8):
+ self.model.reverse_order()
+ else:
+ ## GTK 3.6 rows_reordered not exposed by gi, we need to reconnect
+ ## model to obtain desired effect, but this collapses nodes ...
+ self.list.set_model(None)
+ self.model.reverse_order()
+ self.list.set_model(self.model)
else:
self.model = self.make_model(self.dbstate.db, self.sort_col,
self.sort_order,
@@ -658,7 +671,8 @@ class ListView(NavigationView):
"""
for sig in self.signal_map:
self.callman.add_db_signal(sig, self.signal_map[sig])
-
+ self.callman.add_db_signal('tag-update', self.tag_updated)
+
def change_db(self, db):
"""
Called when the database is changed.
@@ -667,7 +681,6 @@ class ListView(NavigationView):
self._change_db(db)
self.connect_signals()
- self.bookmarks.update_bookmarks(self.get_bookmarks())
if self.active:
#force rebuild of the model on build of tree
self.dirty = True
@@ -790,17 +803,16 @@ class ListView(NavigationView):
if not self.dbstate.open:
return False
if event.type == Gdk.EventType._2BUTTON_PRESS and event.button == 1:
- if self.type_list() == LISTFLAT:
+ if self.model.get_flags() & Gtk.TreeModelFlags.LIST_ONLY:
self.edit(obj)
return True
else:
# Tree
store, paths = self.selection.get_selected_rows()
if paths:
- firstsel = paths[0]
- firstnode = self.model.get_node_from_iter(
- self.model.do_get_iter(firstsel)[1])
- if len(paths)==1 and firstnode.handle is None:
+ firstsel = self.model.get_iter(paths[0])
+ handle = self.model.get_handle_from_iter(firstsel)
+ if len(paths)==1 and handle is None:
return self.expand_collapse_tree_branch()
else:
self.edit(obj)
@@ -847,14 +859,25 @@ class ListView(NavigationView):
menu.show()
else:
menu.hide()
-
+
def _key_press(self, obj, event):
+ """
+ Called when a key is pressed on a listview
+ """
+ if not self.dbstate.open:
+ return False
+ if self.model.get_flags() & Gtk.TreeModelFlags.LIST_ONLY:
+ # Flat list
+ self._key_press_flat(obj, event)
+ else:
+ # Tree
+ self._key_press_tree(obj, event)
+
+ def _key_press_flat(self, obj, event):
"""
Called when a key is pressed on a flat listview
ENTER --> edit selection
"""
- if not self.dbstate.open:
- return False
if event.keyval in (Gdk.KEY_Return, Gdk.KEY_KP_Enter):
self.edit(obj)
return True
@@ -866,30 +889,25 @@ class ListView(NavigationView):
ENTER --> edit selection or open group node
SHIFT+ENTER --> open group node and all children nodes
"""
- if not self.dbstate.open:
- return False
- elif event.get_state() & Gdk.ModifierType.SHIFT_MASK:
+ if event.get_state() & Gdk.ModifierType.SHIFT_MASK:
if event.keyval in (Gdk.KEY_Return, Gdk.KEY_KP_Enter):
store, paths = self.selection.get_selected_rows()
if paths:
- firstsel = paths[0]
- firstnode = self.model.get_node_from_iter(
- self.model.do_get_iter(firstsel)[1])
- if len(paths) == 1 and firstnode.handle is None:
+ iter_ = self.model.get_iter(paths[0])
+ handle = self.model.get_handle_from_iter(iter_)
+ if len(paths) == 1 and handle is None:
return self.expand_collapse_tree_branch()
else:
if event.keyval in (Gdk.KEY_Return, Gdk.KEY_KP_Enter):
store, paths = self.selection.get_selected_rows()
if paths:
- firstsel = paths[0]
- firstnode = self.model.get_node_from_iter(
- self.model.do_get_iter(firstsel)[1])
- if len(paths) == 1 and firstnode.handle is None:
+ iter_ = self.model.get_iter(paths[0])
+ handle = self.model.get_handle_from_iter(iter_)
+ if len(paths) == 1 and handle is None:
return self.expand_collapse_tree()
else:
self.edit(obj)
return True
-
return False
def expand_collapse_tree(self):
@@ -900,9 +918,9 @@ class ListView(NavigationView):
store, paths = self.selection.get_selected_rows()
if paths:
firstsel = paths[0]
- firstnode = self.model.get_node_from_iter(
- self.model.do_get_iter(firstsel)[1])
- if firstnode.handle:
+ iter_ = self.model.get_iter(firstsel)
+ handle = self.model.get_handle_from_iter(iter_)
+ if handle:
return False
if self.list.row_expanded(firstsel):
self.list.collapse_row(firstsel)
@@ -919,9 +937,9 @@ class ListView(NavigationView):
store, paths = self.selection.get_selected_rows()
if paths:
firstsel = paths[0]
- firstnode = self.model.get_node_from_iter(
- self.model.do_get_iter(firstsel)[1])
- if firstnode.handle:
+ iter_ = self.model.get_iter(firstsel)
+ handle = self.model.get_handle_from_iter(iter_)
+ if handle:
return False
if self.list.row_expanded(firstsel):
self.list.collapse_row(firstsel)
@@ -1011,7 +1029,7 @@ class ListView(NavigationView):
ofile = None
data_cols = [pair[1] for pair in self.column_order() if pair[0]]
- column_names = [self.colinfo[i] for i in data_cols]
+ column_names = [self.COLUMNS[i][0] for i in data_cols]
if type == 0:
ofile = CSVTab(len(column_names))
else:
@@ -1041,30 +1059,29 @@ class ListView(NavigationView):
ofile.end_row()
else:
# Tree model
- node = self.model.get_node_from_iter(self.model.do_get_iter((0,))[1])
- self.write_node(node, len(levels), [], ofile, data_cols)
+ iter_ = self.model.get_iter((0,))
+ if iter_:
+ self.write_node(iter_, len(levels), [], ofile, data_cols)
ofile.end_page()
ofile.close()
- def write_node(self, node, depth, level, ofile, data_cols):
- if node is None:
- return
- while node is not None:
- new_level = level + [self.model.do_get_value(node, 0)]
- if self.model.get_handle(node):
+ def write_node(self, iter_, depth, level, ofile, data_cols):
+
+ while iter_:
+ new_level = level + [self.model.get_value(iter_, 0)]
+ if self.model.get_handle_from_iter(iter_):
ofile.start_row()
padded_level = new_level + [''] * (depth - len(new_level))
list(map(ofile.write_cell, padded_level))
for index in data_cols:
- ofile.write_cell(self.model.do_get_value(node, index))
+ ofile.write_cell(self.model.get_value(iter_, index))
ofile.end_row()
- has_child, first_child = self.model.do_iter_children(node)
+ first_child = self.model.iter_children(iter_)
self.write_node(first_child, depth, new_level, ofile, data_cols)
- has_next = self.model.do_iter_next(node)
- if not has_next:
- node = None
+
+ iter_ = self.model.iter_next(iter_)
####################################################################
# Template functions
@@ -1177,8 +1194,10 @@ class ListView(NavigationView):
:return: list of functions
"""
def columnpage(configdialog):
- return _('Columns'), ColumnOrder(self._config, self.COLUMN_NAMES,
+ flat = self.model.get_flags() & Gtk.TreeModelFlags.LIST_ONLY
+ column_names = [col[0] for col in self.COLUMNS]
+ return _('Columns'), ColumnOrder(self._config, column_names,
self.get_column_widths(),
self.set_column_order,
- tree=self.type_list()==LISTTREE)
+ tree=not flat)
return [columnpage]
diff --git a/gramps/gui/views/navigationview.py b/gramps/gui/views/navigationview.py
index 2cfc2ec75..215ea7c65 100644
--- a/gramps/gui/views/navigationview.py
+++ b/gramps/gui/views/navigationview.py
@@ -48,7 +48,8 @@ from gi.repository import Gtk
#
#----------------------------------------------------------------
from .pageview import PageView
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gen.utils.db import navigation_label
from gramps.gen.constfunc import mod_key
@@ -80,10 +81,9 @@ class NavigationView(PageView):
should derive from this class.
"""
- def __init__(self, title, pdata, state, uistate, bookmarks, bm_type, nav_group):
+ def __init__(self, title, pdata, state, uistate, bm_type, nav_group):
PageView.__init__(self, title, pdata, state, uistate)
- self.bookmarks = bm_type(self.dbstate, self.uistate, bookmarks,
- self.goto_handle)
+ self.bookmarks = bm_type(self.dbstate, self.uistate, self.goto_handle)
self.fwd_action = None
self.back_action = None
@@ -334,7 +334,11 @@ class NavigationView(PageView):
else:
from ..dialog import WarningDialog
WarningDialog(_("No Home Person"),
- _("You need to set a 'default person' to go to."))
+ _("You need to set a 'default person' to go to. "
+ "Select the People View, select the person you want as "
+ "'Home Person', then confirm your choice "
+ "via the menu Edit ->Set Home Person."),
+ parent=self.uistate.window)
def jump(self):
"""
diff --git a/gramps/gui/views/pageview.py b/gramps/gui/views/pageview.py
index 9f2db2d2c..ceaf0804d 100644
--- a/gramps/gui/views/pageview.py
+++ b/gramps/gui/views/pageview.py
@@ -40,7 +40,8 @@ _LOG = logging.getLogger('.pageview')
#----------------------------------------------------------------
from gi.repository import Gtk
from gi.repository import Gdk
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#----------------------------------------------------------------
#
@@ -49,7 +50,7 @@ from gramps.gen.ggettext import gettext as _
#----------------------------------------------------------------
from gramps.gen.errors import WindowActiveError
from ..dbguielement import DbGUIElement
-from ..grampsbar import GrampsBar
+from ..widgets.grampletbar import GrampletBar
from ..configure import ConfigureDialog
from gramps.gen.config import config
@@ -147,12 +148,12 @@ class PageView(DbGUIElement):
Returns a gtk container widget.
"""
defaults = self.get_default_gramplets()
- self.sidebar = GrampsBar(self.dbstate, self.uistate, self,
+ self.sidebar = GrampletBar(self.dbstate, self.uistate, self,
self.ident + "_sidebar",
defaults[0])
- self.bottombar = GrampsBar(self.dbstate, self.uistate, self,
- self.ident + "_bottombar",
- defaults[1])
+ self.bottombar = GrampletBar(self.dbstate, self.uistate, self,
+ self.ident + "_bottombar",
+ defaults[1])
hpane = Gtk.HPaned()
vpane = Gtk.VPaned()
hpane.pack1(vpane, resize=True, shrink=False)
diff --git a/gramps/gui/views/tags.py b/gramps/gui/views/tags.py
index 96ca0000d..d1dec6fa7 100644
--- a/gramps/gui/views/tags.py
+++ b/gramps/gui/views/tags.py
@@ -42,7 +42,8 @@ from gi.repository import Gdk
# Gramps modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gen.lib import Tag
from gramps.gen.db import DbTxn
from ..dbguielement import DbGUIElement
@@ -265,7 +266,7 @@ class Tags(DbGUIElement):
# Make the dialog modal so that the user can't start another
# database transaction while the one setting tags is still running.
pmon = progressdlg.ProgressMonitor(progressdlg.GtkProgressDialog,
- ("", self.uistate.window, Gtk.DialogFlags.MODAL), popup_time=2)
+ ("", self.uistate.window, Gtk.DialogFlags.MODAL), popup_time=2)
status = progressdlg.LongOpStatus(msg=_("Adding Tags"),
total_steps=len(selected),
interval=len(selected)//20)
@@ -491,6 +492,8 @@ class OrganizeTagsDialog(object):
self.db.commit_place),
'Source': (self.db.get_source_from_handle,
self.db.commit_source),
+ 'Citation': (self.db.get_citation_from_handle,
+ self.db.commit_citation),
'Repository': (self.db.get_repository_from_handle,
self.db.commit_repository),
'MediaObject': (self.db.get_object_from_handle,
diff --git a/gramps/gui/views/treemodels/citationbasemodel.py b/gramps/gui/views/treemodels/citationbasemodel.py
index f62d9be12..0386d6651 100644
--- a/gramps/gui/views/treemodels/citationbasemodel.py
+++ b/gramps/gui/views/treemodels/citationbasemodel.py
@@ -44,6 +44,7 @@ from gramps.gen.lib import Citation
from gramps.gen.utils.string import confidence
from gramps.gen.config import config
from gramps.gen.constfunc import cuni
+from gramps.gen.const import GRAMPS_LOCALE as glocale
#-------------------------------------------------------------------------
#
@@ -59,6 +60,8 @@ COLUMN_PAGE = 3
COLUMN_CONFIDENCE = 4
COLUMN_SOURCE = 5
COLUMN_CHANGE = 9
+COLUMN_TAGS = 10
+COLUMN_PRIV = 11
# Data for the Source object
COLUMN2_HANDLE = 0
@@ -68,6 +71,8 @@ COLUMN2_AUTHOR = 3
COLUMN2_PUBINFO = 4
COLUMN2_ABBREV = 7
COLUMN2_CHANGE = 8
+COLUMN2_TAGS = 11
+COLUMN2_PRIV = 12
INVALID_DATE_FORMAT = config.get('preferences.invalid-date-format')
@@ -113,8 +118,34 @@ class CitationBaseModel(object):
def citation_confidence(self, data):
return cuni(confidence[data[COLUMN_CONFIDENCE]])
- def citation_handle(self, data):
- return cuni(data[COLUMN_HANDLE])
+ def citation_private(self, data):
+ if data[COLUMN_PRIV]:
+ return 'gramps-lock'
+ else:
+ # There is a problem returning None here.
+ return ''
+
+ def citation_tags(self, data):
+ """
+ Return the sorted list of tags.
+ """
+ tag_list = list(map(self.get_tag_name, data[COLUMN_TAGS]))
+ return ', '.join(sorted(tag_list, key=glocale.sort_key))
+
+ def citation_tag_color(self, data):
+ """
+ Return the tag color.
+ """
+ tag_color = "#000000000000"
+ tag_priority = None
+ for handle in data[COLUMN_TAGS]:
+ tag = self.db.get_tag_from_handle(handle)
+ if tag:
+ this_priority = tag.get_priority()
+ if tag_priority is None or this_priority < tag_priority:
+ tag_color = tag.get_color()
+ tag_priority = this_priority
+ return tag_color
def citation_change(self, data):
return format_time(data[COLUMN_CHANGE])
@@ -165,6 +196,27 @@ class CitationBaseModel(object):
except:
return ''
+ def citation_src_private(self, data):
+ source_handle = data[COLUMN_SOURCE]
+ try:
+ source = self.db.get_source_from_handle(source_handle)
+ if source.get_privacy():
+ return 'gramps-lock'
+ else:
+ # There is a problem returning None here.
+ return ''
+ except:
+ return ''
+
+ def citation_src_tags(self, data):
+ source_handle = data[COLUMN_SOURCE]
+ try:
+ source = self.db.get_source_from_handle(source_handle)
+ tag_list = list(map(self.get_tag_name, source.get_tag_list()))
+ return ', '.join(sorted(tag_list, key=glocale.sort_key))
+ except:
+ return ''
+
def citation_src_chan(self, data):
source_handle = data[COLUMN_SOURCE]
try:
@@ -173,14 +225,8 @@ class CitationBaseModel(object):
except:
return ''
- def citation_tooltip(self, data):
- return cuni('Citation tooltip')
-
# Fields access when 'data' is a Source
- def source_handle(self, data):
- return cuni(data[COLUMN2_HANDLE])
-
def source_src_title(self, data):
return cuni(data[COLUMN2_TITLE])
@@ -196,16 +242,47 @@ class CitationBaseModel(object):
def source_src_pinfo(self, data):
return cuni(data[COLUMN2_PUBINFO])
+ def source_src_private(self, data):
+ if data[COLUMN2_PRIV]:
+ return 'gramps-lock'
+ else:
+ # There is a problem returning None here.
+ return ''
+
+ def source_src_tags(self, data):
+ """
+ Return the sorted list of tags.
+ """
+ tag_list = list(map(self.get_tag_name, data[COLUMN2_TAGS]))
+ return ', '.join(sorted(tag_list, key=glocale.sort_key))
+
+ def source_src_tag_color(self, data):
+ """
+ Return the tag color.
+ """
+ tag_color = "#000000000000"
+ tag_priority = None
+ for handle in data[COLUMN2_TAGS]:
+ tag = self.db.get_tag_from_handle(handle)
+ if tag:
+ this_priority = tag.get_priority()
+ if tag_priority is None or this_priority < tag_priority:
+ tag_color = tag.get_color()
+ tag_priority = this_priority
+ return tag_color
+
def source_src_chan(self, data):
return format_time(data[COLUMN2_CHANGE])
def source_sort2_change(self, data):
return "%012x" % data[COLUMN2_CHANGE]
- def source_tooltip(self, data):
- return cuni('Source tooltip')
-
def dummy_sort_key(self, data):
# dummy sort key for columns that don't have data
return None
-
+
+ def get_tag_name(self, tag_handle):
+ """
+ Return the tag name from the given tag handle.
+ """
+ return self.db.get_tag_from_handle(tag_handle).get_name()
diff --git a/gramps/gui/views/treemodels/citationlistmodel.py b/gramps/gui/views/treemodels/citationlistmodel.py
index 4bcf89d66..808096dbc 100644
--- a/gramps/gui/views/treemodels/citationlistmodel.py
+++ b/gramps/gui/views/treemodels/citationlistmodel.py
@@ -66,33 +66,37 @@ class CitationListModel(CitationBaseModel, FlatBaseModel):
self.citation_id,
self.citation_date,
self.citation_confidence,
+ self.citation_private,
+ self.citation_tags,
self.citation_change,
self.citation_src_title,
self.citation_src_id,
self.citation_src_auth,
self.citation_src_abbr,
self.citation_src_pinfo,
+ self.citation_src_private,
self.citation_src_chan,
- self.citation_handle,
- self.citation_tooltip
+ self.citation_tag_color
]
self.smap = [
self.citation_page,
self.citation_id,
self.citation_sort_date,
self.citation_confidence,
+ self.citation_private,
+ self.citation_tags,
self.citation_sort_change,
self.citation_src_title,
self.citation_src_id,
self.citation_src_auth,
self.citation_src_abbr,
self.citation_src_pinfo,
+ self.citation_src_private,
self.citation_src_chan,
- self.citation_handle,
- self.citation_tooltip
+ self.citation_tag_color
]
- FlatBaseModel.__init__(self, db, scol, order, tooltip_column=12,
- search=search, skip=skip, sort_map=sort_map)
+ FlatBaseModel.__init__(self, db, scol, order, search=search, skip=skip,
+ sort_map=sort_map)
def destroy(self):
"""
@@ -105,5 +109,11 @@ class CitationListModel(CitationBaseModel, FlatBaseModel):
self.smap = None
FlatBaseModel.destroy(self)
+ def color_column(self):
+ """
+ Return the color column.
+ """
+ return 14
+
def do_get_n_columns(self):
return len(self.fmap)+1
diff --git a/gramps/gui/views/treemodels/citationtreemodel.py b/gramps/gui/views/treemodels/citationtreemodel.py
index 92dee35a7..3a69abf37 100644
--- a/gramps/gui/views/treemodels/citationtreemodel.py
+++ b/gramps/gui/views/treemodels/citationtreemodel.py
@@ -38,7 +38,8 @@ LOG = logging.getLogger(".citation")
# internationalization
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
@@ -78,31 +79,32 @@ class CitationTreeModel(CitationBaseModel, TreeBaseModel):
self.source_src_id, # COL_ID (both Source & Citation)
None, # COL_DATE (not for Source)
None, # COL_CONFIDENCE (not for Source)
+ self.source_src_private, # COL_PRIV (both Source & Citation)
+ self.source_src_tags, # COL_TAGS (both Source & Citation)
self.source_src_chan, # COL_CHAN (both Source & Citation)
self.source_src_auth, # COL_SRC_AUTH (Source only)
self.source_src_abbr, # COL_SRC_ABBR (Source only)
self.source_src_pinfo, # COL_SRC_PINFO (Source only)
- self.source_handle,
- self.source_tooltip
+ self.source_src_tag_color
]
self.smap = [
self.source_src_title,
self.source_src_id,
self.dummy_sort_key,
self.dummy_sort_key,
+ self.source_src_private,
+ self.source_src_tags,
self.source_sort2_change,
self.source_src_auth,
self.source_src_abbr,
self.source_src_pinfo,
- self.source_handle,
- self.source_tooltip
+ self.source_src_tag_color
]
TreeBaseModel.__init__(self, self.db, scol=scol, order=order,
- tooltip_column=9,
search=search, skip=skip, sort_map=sort_map,
- nrgroups = 1,
- group_can_have_handle = True,
+ nrgroups=1,
+ group_can_have_handle=True,
has_secondary=True)
def destroy(self):
@@ -134,26 +136,34 @@ class CitationTreeModel(CitationBaseModel, TreeBaseModel):
self.citation_id,
self.citation_date,
self.citation_confidence,
+ self.citation_private,
+ self.citation_tags,
self.citation_change,
None,
None,
None,
- self.citation_handle,
- self.citation_tooltip
+ self.citation_tag_color
]
self.smap2 = [
self.citation_page,
self.citation_id,
self.citation_sort_date,
self.citation_confidence,
+ self.citation_private,
+ self.citation_tags,
self.citation_sort_change,
self.dummy_sort_key,
self.dummy_sort_key,
self.dummy_sort_key,
- self.citation_handle,
- self.citation_tooltip
+ self.citation_tag_color
]
+ def color_column(self):
+ """
+ Return the color column.
+ """
+ return 10
+
def get_tree_levels(self):
"""
Return the headings of the levels in the hierarchy.
@@ -178,7 +188,7 @@ class CitationTreeModel(CitationBaseModel, TreeBaseModel):
data The object data.
"""
sort_key = self.sort_func2(data)
- if self.get_node(data[5]):
+ if self._get_node(data[5]):
self.add_node(data[5], handle, sort_key, handle, secondary=True)
def do_get_n_columns(self):
diff --git a/gramps/gui/views/treemodels/eventmodel.py b/gramps/gui/views/treemodels/eventmodel.py
index d4a24177e..ac92e5409 100644
--- a/gramps/gui/views/treemodels/eventmodel.py
+++ b/gramps/gui/views/treemodels/eventmodel.py
@@ -46,6 +46,7 @@ from gramps.gen.utils.db import get_participant_from_event
from gramps.gen.config import config
from gramps.gen.constfunc import cuni
from .flatbasemodel import FlatBaseModel
+from gramps.gen.const import GRAMPS_LOCALE as glocale
#-------------------------------------------------------------------------
#
@@ -59,6 +60,8 @@ COLUMN_DATE = 3
COLUMN_DESCRIPTION = 4
COLUMN_PLACE = 5
COLUMN_CHANGE = 10
+COLUMN_TAGS = 11
+COLUMN_PRIV = 12
INVALID_DATE_FORMAT = config.get('preferences.invalid-date-format')
@@ -80,10 +83,11 @@ class EventModel(FlatBaseModel):
self.column_type,
self.column_date,
self.column_place,
+ self.column_private,
+ self.column_tags,
self.column_change,
self.column_participant,
- self.column_handle,
- self.column_tooltip,
+ self.column_tag_color
]
self.smap = [
self.column_description,
@@ -91,13 +95,14 @@ class EventModel(FlatBaseModel):
self.column_type,
self.sort_date,
self.column_place,
+ self.column_private,
+ self.column_tags,
self.sort_change,
self.column_participant,
- self.column_handle,
- self.column_tooltip,
- ]
- FlatBaseModel.__init__(self, db, scol, order, tooltip_column=8,
- search=search, skip=skip, sort_map=sort_map)
+ self.column_tag_color
+ ]
+ FlatBaseModel.__init__(self, db, scol, order, search=search, skip=skip,
+ sort_map=sort_map)
def destroy(self):
"""
@@ -110,6 +115,12 @@ class EventModel(FlatBaseModel):
self.smap = None
FlatBaseModel.destroy(self)
+ def color_column(self):
+ """
+ Return the color column.
+ """
+ return 9
+
def do_get_n_columns(self):
return len(self.fmap)+1
@@ -156,14 +167,43 @@ class EventModel(FlatBaseModel):
return ''
- def column_handle(self,data):
- return cuni(data[COLUMN_HANDLE])
-
+ def column_private(self, data):
+ if data[COLUMN_PRIV]:
+ return 'gramps-lock'
+ else:
+ # There is a problem returning None here.
+ return ''
+
def sort_change(self,data):
return "%012x" % data[COLUMN_CHANGE]
def column_change(self,data):
return format_time(data[COLUMN_CHANGE])
- def column_tooltip(self,data):
- return cuni('Event tooltip')
+ def get_tag_name(self, tag_handle):
+ """
+ Return the tag name from the given tag handle.
+ """
+ return self.db.get_tag_from_handle(tag_handle).get_name()
+
+ def column_tag_color(self, data):
+ """
+ Return the tag color.
+ """
+ tag_color = "#000000000000"
+ tag_priority = None
+ for handle in data[COLUMN_TAGS]:
+ tag = self.db.get_tag_from_handle(handle)
+ if tag:
+ this_priority = tag.get_priority()
+ if tag_priority is None or this_priority < tag_priority:
+ tag_color = tag.get_color()
+ tag_priority = this_priority
+ return tag_color
+
+ def column_tags(self, data):
+ """
+ Return the sorted list of tags.
+ """
+ tag_list = list(map(self.get_tag_name, data[COLUMN_TAGS]))
+ return ', '.join(sorted(tag_list, key=glocale.sort_key))
diff --git a/gramps/gui/views/treemodels/familymodel.py b/gramps/gui/views/treemodels/familymodel.py
index 707b41e36..dcfa42d59 100644
--- a/gramps/gui/views/treemodels/familymodel.py
+++ b/gramps/gui/views/treemodels/familymodel.py
@@ -27,7 +27,6 @@
#-------------------------------------------------------------------------
import logging
log = logging.getLogger(".")
-import locale
#-------------------------------------------------------------------------
#
@@ -48,6 +47,7 @@ from .flatbasemodel import FlatBaseModel
from gramps.gen.utils.db import get_marriage_or_fallback
from gramps.gen.config import config
from gramps.gen.constfunc import cuni
+from gramps.gen.const import GRAMPS_LOCALE as glocale
invalid_date_format = config.get('preferences.invalid-date-format')
@@ -68,11 +68,10 @@ class FamilyModel(FlatBaseModel):
self.column_mother,
self.column_type,
self.column_marriage,
+ self.column_private,
self.column_tags,
self.column_change,
- self.column_handle,
self.column_tag_color,
- self.column_tooltip,
]
self.smap = [
self.column_id,
@@ -80,14 +79,13 @@ class FamilyModel(FlatBaseModel):
self.sort_mother,
self.column_type,
self.sort_marriage,
+ self.column_private,
self.column_tags,
self.sort_change,
- self.column_handle,
self.column_tag_color,
- self.column_tooltip,
]
- FlatBaseModel.__init__(self, db, scol, order, tooltip_column=9,
- search=search, skip=skip, sort_map=sort_map)
+ FlatBaseModel.__init__(self, db, scol, order, search=search, skip=skip,
+ sort_map=sort_map)
def destroy(self):
"""
@@ -109,9 +107,6 @@ class FamilyModel(FlatBaseModel):
def do_get_n_columns(self):
return len(self.fmap)+1
- def column_handle(self, data):
- return cuni(data[0])
-
def column_father(self, data):
if data[2]:
person = self.db.get_person_from_handle(data[2])
@@ -167,15 +162,19 @@ class FamilyModel(FlatBaseModel):
def column_id(self, data):
return cuni(data[1])
+ def column_private(self, data):
+ if data[14]:
+ return 'gramps-lock'
+ else:
+ # There is a problem returning None here.
+ return ''
+
def sort_change(self, data):
return "%012x" % data[12]
def column_change(self, data):
return format_time(data[12])
- def column_tooltip(self, data):
- return cuni('Family tooltip')
-
def get_tag_name(self, tag_handle):
"""
Return the tag name from the given tag handle.
@@ -201,4 +200,4 @@ class FamilyModel(FlatBaseModel):
Return the sorted list of tags.
"""
tag_list = list(map(self.get_tag_name, data[13]))
- return ', '.join(sorted(tag_list, key=locale.strxfrm))
+ return ', '.join(sorted(tag_list, key=glocale.sort_key))
diff --git a/gramps/gui/views/treemodels/flatbasemodel.py b/gramps/gui/views/treemodels/flatbasemodel.py
index ef371bc88..8551426d8 100644
--- a/gramps/gui/views/treemodels/flatbasemodel.py
+++ b/gramps/gui/views/treemodels/flatbasemodel.py
@@ -75,8 +75,8 @@ from gi.repository import Gtk
#
#-------------------------------------------------------------------------
from gramps.gen.filters import SearchFilter, ExactSearchFilter
-from gramps.gen.utils.cast import conv_unicode_tosrtkey, conv_tosrtkey
-from gramps.gen.constfunc import cuni, UNITYPE
+from gramps.gen.constfunc import cuni, UNITYPE, conv_to_unicode, handle2internal
+from gramps.gen.const import GRAMPS_LOCALE as glocale
#-------------------------------------------------------------------------
#
@@ -112,8 +112,8 @@ class FlatNodeMap(object):
the path, and a dictionary mapping hndl to index.
To obtain index given a path, method real_index() is available
- ..Note: If a string sortkey is used, apply conv_unicode_tosrtkey
- on it , so as to have localized sort
+ ..Note: glocale.sort_key is applied to the underlying sort key,
+ so as to have localized sort
"""
def __init__(self):
@@ -456,10 +456,12 @@ class FlatBaseModel(GObject.Object, Gtk.TreeModel):
"""
The base class for all flat treeview models.
It keeps a FlatNodeMap, and obtains data from database as needed
+ ..Note: glocale.sort_key is applied to the underlying sort key,
+ so as to have localized sort
"""
def __init__(self, db, scol=0, order=Gtk.SortType.ASCENDING,
- tooltip_column=None, search=None, skip=set(),
+ search=None, skip=set(),
sort_map=None):
cput = time.clock()
GObject.GObject.__init__(self)
@@ -478,9 +480,9 @@ class FlatBaseModel(GObject.Object, Gtk.TreeModel):
self.sort_map = [ f for f in sort_map if f[0]]
#we need the model col, that corresponds with scol
col = self.sort_map[scol][1]
- self.sort_func = self.smap[col]
else:
- self.sort_func = self.smap[scol]
+ col = scol
+ self.sort_func = lambda x: glocale.sort_key(self.smap[col](x))
self.sort_col = scol
self.skip = skip
self._in_build = False
@@ -489,7 +491,6 @@ class FlatBaseModel(GObject.Object, Gtk.TreeModel):
self.set_search(search)
self._reverse = (order == Gtk.SortType.DESCENDING)
- self._tooltip_column = tooltip_column
self.rebuild_data()
_LOG.debug(self.__class__.__name__ + ' __init__ ' +
@@ -527,7 +528,7 @@ class FlatBaseModel(GObject.Object, Gtk.TreeModel):
col = search[1][0]
text = search[1][1]
inv = search[1][2]
- func = lambda x: self.get_value_from_handle(x, col) or UEMPTY
+ func = lambda x: self._get_value(x, col) or UEMPTY
if search[2]:
self.search = ExactSearchFilter(func, text, inv)
else:
@@ -558,12 +559,6 @@ class FlatBaseModel(GObject.Object, Gtk.TreeModel):
self._reverse = not self._reverse
self.node_map.reverse_order()
- def tooltip_column(self):
- """
- Return the column for tooltips.
- """
- return self._tooltip_column
-
def color_column(self):
"""
Return the color column.
@@ -584,14 +579,11 @@ class FlatBaseModel(GObject.Object, Gtk.TreeModel):
Return the (sort_key, handle) list of all data that can maximally
be shown.
This list is sorted ascending, via localized string sort.
- conv_unicode_tosrtkey which uses strxfrm
"""
# use cursor as a context manager
with self.gen_cursor() as cursor:
- #loop over database and store the sort field, and the handle, and
- #allow for a third iter
- return sorted((list(map(conv_tosrtkey,
- self.sort_func(data))), key) for key, data in cursor)
+ #loop over database and store the sort field, and the handle
+ return sorted((self.sort_func(data), key) for key, data in cursor)
def _rebuild_search(self, ignore=None):
""" function called when view must be build, given a search text
@@ -657,11 +649,12 @@ class FlatBaseModel(GObject.Object, Gtk.TreeModel):
Add a row. This is called after object with handle is created.
Row is only added if search/filter data is such that it must be shown
"""
+ if sys.version_info[0] >= 3:
+ assert isinstance(handle, str)
if self.node_map.get_path_from_handle(handle) is not None:
return # row is already displayed
data = self.map(handle)
- insert_val = (list(map(conv_tosrtkey, self.sort_func(data))),
- handle)
+ insert_val = (self.sort_func(data), handle)
if not self.search or \
(self.search and self.search.match(handle, self.db)):
#row needs to be added to the model
@@ -677,6 +670,8 @@ class FlatBaseModel(GObject.Object, Gtk.TreeModel):
"""
Delete a row, called after the object with handle is deleted
"""
+ if sys.version_info[0] >= 3:
+ assert isinstance(handle, str)
if self.node_map.get_path_from_handle(handle) is None:
return # row is not currently displayed
self.clear_cache(handle)
@@ -694,8 +689,7 @@ class FlatBaseModel(GObject.Object, Gtk.TreeModel):
return # row is not currently displayed
self.clear_cache(handle)
oldsortkey = self.node_map.get_sortkey(handle)
- newsortkey = list(map(conv_tosrtkey, self.sort_func(self.map(
- handle))))
+ newsortkey = self.sort_func(self.map(handle))
if oldsortkey is None or oldsortkey != newsortkey:
#or the changed object is not present in the view due to filtering
#or the order of the object must change.
@@ -707,12 +701,22 @@ class FlatBaseModel(GObject.Object, Gtk.TreeModel):
node = self.do_get_iter(path)[1]
self.row_changed(path, node)
- def handle2path(self, handle):
+ def get_iter_from_handle(self, handle):
"""
- Obtain from a handle, a path.
- Part of common api with flat/treebasemodel
+ Get the iter for a gramps handle.
"""
- return self.on_get_path_from_handle(handle)
+ if self.node_map.get_path_from_handle(handle) is None:
+ return None
+ return self.node_map.new_iter(handle)
+
+ def get_handle_from_iter(self, iter):
+ """
+ Get the gramps handle for an iter.
+ """
+ index = self.node_map.real_index(iter.user_data)
+ return self.node_map.get_handle(index)
+
+ # The following implement the public interface of Gtk.TreeModel
def do_get_flags(self):
"""
@@ -744,8 +748,6 @@ class FlatBaseModel(GObject.Object, Gtk.TreeModel):
See Gtk.TreeModel
"""
#print 'do_get_col_type'
- if index == self._tooltip_column:
- return object
return str
def do_get_iter_first(self):
@@ -764,7 +766,7 @@ class FlatBaseModel(GObject.Object, Gtk.TreeModel):
except IndexError:
return False, Gtk.TreeIter()
- def get_value_from_handle(self, handle, col):
+ def _get_value(self, handle, col):
"""
Given handle and column, return unicode value in the column
We need this to search in the column in the GUI
@@ -785,17 +787,15 @@ class FlatBaseModel(GObject.Object, Gtk.TreeModel):
"""
#print 'do_get_val', iter, iter.user_data, col
handle = self.node_map._index2hndl[iter.user_data][1]
- val = self.get_value_from_handle(handle, col)
+ val = self._get_value(handle, col)
#print 'val is', val, type(val)
- if col == self._tooltip_column:
- return val
+
+ #GTK 3 should convert unicode objects automatically, but this
+ # gives wrong column values, so we convert for python 2.7
+ if not isinstance(val, str):
+ return val.encode('utf-8')
else:
- #GTK 3 should convert unicode objects automatically, but this
- # gives wrong column values, so we convert for python 2.7
- if not isinstance(val, str):
- return val.encode('utf-8')
- else:
- return val
+ return val
def do_iter_previous(self, iter):
#print 'do_iter_previous'
diff --git a/gramps/gui/views/treemodels/locationmodel.py b/gramps/gui/views/treemodels/locationmodel.py
index 06797be45..587a6650d 100644
--- a/gramps/gui/views/treemodels/locationmodel.py
+++ b/gramps/gui/views/treemodels/locationmodel.py
@@ -73,8 +73,6 @@ LOCATIONTYPES = [_('Country'), _('State'), _('County'), _('City'),
#-------------------------------------------------------------------------
class LocationBaseModel(object):
- HANDLE_COL = 5
-
def __init__(self, db):
self.gen_cursor = db.get_location_cursor
self.map = db.get_raw_location_data
@@ -178,11 +176,10 @@ class LocationTreeModel(LocationBaseModel, TreeBaseModel):
LocationBaseModel.__init__(self, db)
TreeBaseModel.__init__(self, db, scol=scol, order=order,
- tooltip_column=15,
- search=search, skip=skip, sort_map=sort_map,
- nrgroups = 3,
- group_can_have_handle = True,
- has_secondary=False)
+ search=search, skip=skip, sort_map=sort_map,
+ nrgroups = 3,
+ group_can_have_handle = True,
+ has_secondary=False)
def destroy(self):
"""
@@ -232,7 +229,7 @@ class LocationTreeModel(LocationBaseModel, TreeBaseModel):
# Add the node as a root node if the parent is not in the tree. This
# will happen when the view is filtered.
- if not self.get_node(parent):
+ if not self._get_node(parent):
parent = None
self.add_node(parent, handle, sort_key, handle, add_parent=False)
@@ -247,6 +244,6 @@ class LocationTreeModel(LocationBaseModel, TreeBaseModel):
sort_key = self.sort_func2(data)
parent = data[5]
- if self.get_node(parent):
+ if self._get_node(parent):
self.add_node(parent, handle, sort_key, handle, add_parent=False,
secondary=True)
diff --git a/gramps/gui/views/treemodels/mediamodel.py b/gramps/gui/views/treemodels/mediamodel.py
index 0c4e7ca0e..a7e0306a9 100644
--- a/gramps/gui/views/treemodels/mediamodel.py
+++ b/gramps/gui/views/treemodels/mediamodel.py
@@ -25,10 +25,10 @@
# python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import logging
log = logging.getLogger(".")
-import locale
#-------------------------------------------------------------------------
#
@@ -45,6 +45,7 @@ from gi.repository import Gtk
from gramps.gen.datehandler import displayer, format_time
from gramps.gen.lib import Date, MediaObject
from gramps.gen.constfunc import cuni, conv_to_unicode, UNITYPE
+from gramps.gen.const import GRAMPS_LOCALE as glocale
from .flatbasemodel import FlatBaseModel
#-------------------------------------------------------------------------
@@ -65,11 +66,10 @@ class MediaModel(FlatBaseModel):
self.column_mime,
self.column_path,
self.column_date,
+ self.column_private,
self.column_tags,
self.column_change,
- self.column_handle,
self.column_tag_color,
- self.column_tooltip
]
self.smap = [
@@ -78,14 +78,13 @@ class MediaModel(FlatBaseModel):
self.column_mime,
self.column_path,
self.sort_date,
+ self.column_private,
self.column_tags,
self.sort_change,
- self.column_handle,
self.column_tag_color,
- self.column_tooltip
]
- FlatBaseModel.__init__(self, db, scol, order, tooltip_column=9,
- search=search, skip=skip, sort_map=sort_map)
+ FlatBaseModel.__init__(self, db, scol, order, search=search, skip=skip,
+ sort_map=sort_map)
def destroy(self):
"""
@@ -156,6 +155,13 @@ class MediaModel(FlatBaseModel):
def column_handle(self,data):
return cuni(data[0])
+ def column_private(self, data):
+ if data[11]:
+ return 'gramps-lock'
+ else:
+ # There is a problem returning None here.
+ return ''
+
def sort_change(self,data):
return "%012x" % data[8]
@@ -190,4 +196,4 @@ class MediaModel(FlatBaseModel):
Return the sorted list of tags.
"""
tag_list = list(map(self.get_tag_name, data[10]))
- return ', '.join(sorted(tag_list, key=locale.strxfrm))
+ return ', '.join(sorted(tag_list, key=glocale.sort_key))
diff --git a/gramps/gui/views/treemodels/notemodel.py b/gramps/gui/views/treemodels/notemodel.py
index fb1cbec5d..0188beb29 100644
--- a/gramps/gui/views/treemodels/notemodel.py
+++ b/gramps/gui/views/treemodels/notemodel.py
@@ -27,7 +27,6 @@
#-------------------------------------------------------------------------
import logging
_LOG = logging.getLogger(".gui.notemodel")
-import locale
#-------------------------------------------------------------------------
#
@@ -43,6 +42,7 @@ from gi.repository import Gtk
#-------------------------------------------------------------------------
from gramps.gen.datehandler import format_time
from gramps.gen.constfunc import cuni
+from gramps.gen.const import GRAMPS_LOCALE as glocale
from .flatbasemodel import FlatBaseModel
from gramps.gen.lib import (Note, NoteType, StyledText)
@@ -63,22 +63,22 @@ class NoteModel(FlatBaseModel):
self.column_preview,
self.column_id,
self.column_type,
+ self.column_private,
self.column_tags,
self.column_change,
- self.column_handle,
self.column_tag_color
]
self.smap = [
self.column_preview,
self.column_id,
self.column_type,
+ self.column_private,
self.column_tags,
self.sort_change,
- self.column_handle,
self.column_tag_color
]
- FlatBaseModel.__init__(self, db, scol, order, search=search,
- skip=skip, sort_map=sort_map)
+ FlatBaseModel.__init__(self, db, scol, order, search=search, skip=skip,
+ sort_map=sort_map)
def destroy(self):
"""
@@ -101,10 +101,6 @@ class NoteModel(FlatBaseModel):
"""Return the column number of the Note tab."""
return len(self.fmap) + 1
- def column_handle(self, data):
- """Return the handle of the Note."""
- return data[Note.POS_HANDLE]
-
def column_id(self, data):
"""Return the id of the Note."""
return cuni(data[Note.POS_ID])
@@ -126,6 +122,13 @@ class NoteModel(FlatBaseModel):
else:
return note
+ def column_private(self, data):
+ if data[Note.POS_PRIVATE]:
+ return 'gramps-lock'
+ else:
+ # There is a problem returning None here.
+ return ''
+
def sort_change(self, data):
return "%012x" % data[Note.POS_CHANGE]
@@ -146,10 +149,11 @@ class NoteModel(FlatBaseModel):
tag_priority = None
for handle in data[Note.POS_TAGS]:
tag = self.db.get_tag_from_handle(handle)
- this_priority = tag.get_priority()
- if tag_priority is None or this_priority < tag_priority:
- tag_color = tag.get_color()
- tag_priority = this_priority
+ if tag:
+ this_priority = tag.get_priority()
+ if tag_priority is None or this_priority < tag_priority:
+ tag_color = tag.get_color()
+ tag_priority = this_priority
return tag_color
def column_tags(self, data):
@@ -157,4 +161,4 @@ class NoteModel(FlatBaseModel):
Return the sorted list of tags.
"""
tag_list = list(map(self.get_tag_name, data[Note.POS_TAGS]))
- return ', '.join(sorted(tag_list, key=locale.strxfrm))
+ return ', '.join(sorted(tag_list, key=glocale.sort_key))
diff --git a/gramps/gui/views/treemodels/peoplemodel.py b/gramps/gui/views/treemodels/peoplemodel.py
index b652b1c14..1948312be 100644
--- a/gramps/gui/views/treemodels/peoplemodel.py
+++ b/gramps/gui/views/treemodels/peoplemodel.py
@@ -32,9 +32,7 @@ TreeModel for the GRAMPS Person tree.
# Standard python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
import cgi
-import locale
#-------------------------------------------------------------------------
#
@@ -56,6 +54,8 @@ _LOG = logging.getLogger(".")
# GRAMPS modules
#
#-------------------------------------------------------------------------
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.lib import Name, EventRef, EventType, EventRoleType
from gramps.gen.display.name import displayer as name_displayer
from gramps.gen.datehandler import format_time, get_date, get_date_valid
@@ -64,6 +64,7 @@ from .flatbasemodel import FlatBaseModel
from .treebasemodel import TreeBaseModel
from gramps.gen.config import config
from gramps.gen.constfunc import cuni, UNITYPE
+from gramps.gen.const import GRAMPS_LOCALE as glocale
#-------------------------------------------------------------------------
#
@@ -79,6 +80,7 @@ COLUMN_EVENT = 7
COLUMN_FAMILY = 8
COLUMN_CHANGE = 17
COLUMN_TAGS = 18
+COLUMN_PRIV = 19
invalid_date_format = config.get('preferences.invalid-date-format')
@@ -93,8 +95,6 @@ class PeopleBaseModel(object):
"""
_GENDER = [ _('female'), _('male'), _('unknown') ]
- # The following is accessed from the Person Selector
- COLUMN_INT_ID = 10 # dynamic calculation of column indices
# LRU cache size
_CACHE_SIZE = 250
@@ -115,11 +115,10 @@ class PeopleBaseModel(object):
self.column_death_day,
self.column_death_place,
self.column_spouse,
+ self.column_private,
self.column_tags,
self.column_change,
- self.column_int_id,
self.column_tag_color,
- self.column_tooltip,
]
self.smap = [
self.sort_name,
@@ -130,11 +129,10 @@ class PeopleBaseModel(object):
self.sort_death_day,
self.column_death_place,
self.column_spouse,
+ self.column_private,
self.column_tags,
self.sort_change,
- self.column_int_id,
self.column_tag_color,
- self.column_tooltip,
]
#columns are accessed on every mouse over, so it is worthwhile to
@@ -220,6 +218,13 @@ class PeopleBaseModel(object):
if not self._in_build:
self.lru_spouse[handle] = value
return value
+
+ def column_private(self, data):
+ if data[COLUMN_PRIV]:
+ return 'gramps-lock'
+ else:
+ # There is a problem returning None here.
+ return ''
def _get_spouse_data(self, data):
spouses_names = ""
@@ -430,12 +435,6 @@ class PeopleBaseModel(object):
return "" + cgi.escape(place_title) + " "
return ""
- def column_tooltip(self, data):
- return 'Person tooltip'
-
- def column_int_id(self, data):
- return data[0]
-
def get_tag_name(self, tag_handle):
"""
Return the tag name from the given tag handle.
@@ -461,7 +460,7 @@ class PeopleBaseModel(object):
Return the sorted list of tags.
"""
tag_list = list(map(self.get_tag_name, data[COLUMN_TAGS]))
- return ', '.join(sorted(tag_list, key=locale.strxfrm))
+ return ', '.join(sorted(tag_list, key=glocale.sort_key))
class PersonListModel(PeopleBaseModel, FlatBaseModel):
"""
@@ -470,9 +469,8 @@ class PersonListModel(PeopleBaseModel, FlatBaseModel):
def __init__(self, db, scol=0, order=Gtk.SortType.ASCENDING, search=None,
skip=set(), sort_map=None):
PeopleBaseModel.__init__(self, db)
- FlatBaseModel.__init__(self, db, search=search, skip=skip,
- tooltip_column=12,
- scol=scol, order=order, sort_map=sort_map)
+ FlatBaseModel.__init__(self, db, search=search, skip=skip, scol=scol,
+ order=order, sort_map=sort_map)
def clear_cache(self, handle=None):
""" Clear the LRU cache """
@@ -493,8 +491,8 @@ class PersonTreeModel(PeopleBaseModel, TreeBaseModel):
skip=set(), sort_map=None):
PeopleBaseModel.__init__(self, db)
- TreeBaseModel.__init__(self, db, 12, search=search, skip=skip,
- scol=scol, order=order, sort_map=sort_map)
+ TreeBaseModel.__init__(self, db, search=search, skip=skip, scol=scol,
+ order=order, sort_map=sort_map)
def destroy(self):
"""
diff --git a/gramps/gui/views/treemodels/placemodel.py b/gramps/gui/views/treemodels/placemodel.py
index 06910cb85..a60364efd 100644
--- a/gramps/gui/views/treemodels/placemodel.py
+++ b/gramps/gui/views/treemodels/placemodel.py
@@ -57,7 +57,8 @@ from .treebasemodel import TreeBaseModel
# internationalization
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
@@ -76,8 +77,6 @@ COUNTRYLEVELS = {
#-------------------------------------------------------------------------
class PlaceBaseModel(object):
- HANDLE_COL = 5
-
def __init__(self, db):
self.gen_cursor = db.get_place_cursor
self.map = db.get_raw_place_data
@@ -85,18 +84,21 @@ class PlaceBaseModel(object):
self.column_name,
self.column_id,
self.column_location,
+ self.column_private,
+ self.column_tags,
self.column_change,
self.column_place_name,
- self.column_handle,
- self.column_tooltip
+ self.column_tag_color
]
self.smap = [
self.column_name,
self.column_id,
self.column_location,
+ self.column_private,
+ self.column_tags,
self.sort_change,
self.column_place_name,
- self.column_handle,
+ self.column_tag_color
]
def destroy(self):
@@ -109,12 +111,15 @@ class PlaceBaseModel(object):
self.fmap = None
self.smap = None
+ def color_column(self):
+ """
+ Return the color column.
+ """
+ return 7
+
def do_get_n_columns(self):
return len(self.fmap)+1
- def column_handle(self, data):
- return cuni(data[0])
-
def column_place_name(self, data):
return cuni(data[2])
@@ -132,14 +137,46 @@ class PlaceBaseModel(object):
except:
return u''
+ def column_private(self, data):
+ if data[11]:
+ return 'gramps-lock'
+ else:
+ # There is a problem returning None here.
+ return ''
+
def sort_change(self, data):
return "%012x" % data[9]
def column_change(self, data):
return format_time(data[9])
- def column_tooltip(self, data):
- return u'Place tooltip'
+ def get_tag_name(self, tag_handle):
+ """
+ Return the tag name from the given tag handle.
+ """
+ return self.db.get_tag_from_handle(tag_handle).get_name()
+
+ def column_tag_color(self, data):
+ """
+ Return the tag color.
+ """
+ tag_color = "#000000000000"
+ tag_priority = None
+ for handle in data[10]:
+ tag = self.db.get_tag_from_handle(handle)
+ if tag:
+ this_priority = tag.get_priority()
+ if tag_priority is None or this_priority < tag_priority:
+ tag_color = tag.get_color()
+ tag_priority = this_priority
+ return tag_color
+
+ def column_tags(self, data):
+ """
+ Return the sorted list of tags.
+ """
+ tag_list = list(map(self.get_tag_name, data[10]))
+ return ', '.join(sorted(tag_list, key=glocale.sort_key))
#-------------------------------------------------------------------------
#
@@ -154,8 +191,8 @@ class PlaceListModel(PlaceBaseModel, FlatBaseModel):
skip=set(), sort_map=None):
PlaceBaseModel.__init__(self, db)
- FlatBaseModel.__init__(self, db, scol, order, tooltip_column=15,
- search=search, skip=skip, sort_map=sort_map)
+ FlatBaseModel.__init__(self, db, scol, order, search=search, skip=skip,
+ sort_map=sort_map)
def destroy(self):
"""
@@ -181,10 +218,9 @@ class PlaceTreeModel(PlaceBaseModel, TreeBaseModel):
PlaceBaseModel.__init__(self, db)
TreeBaseModel.__init__(self, db, scol=scol, order=order,
- tooltip_column=15,
- search=search, skip=skip, sort_map=sort_map,
- nrgroups = 3,
- group_can_have_handle = True)
+ search=search, skip=skip, sort_map=sort_map,
+ nrgroups=3,
+ group_can_have_handle=True)
def destroy(self):
"""
@@ -274,7 +310,7 @@ class PlaceTreeModel(PlaceBaseModel, TreeBaseModel):
if node.name:
return '%s ' % cgi.escape(node.name)
else:
- level = len(self.do_get_path(self.get_iter(node)).get_indices())
+ level = len(self.do_get_path(self._get_iter(node)).get_indices())
heading = '%s ' % cgi.escape(COUNTRYLEVELS['default'][level])
# This causes a problem with Gtk3 unless we cast to str.
return str(heading)
diff --git a/gramps/gui/views/treemodels/repomodel.py b/gramps/gui/views/treemodels/repomodel.py
index 7fba738a0..27fbf8a72 100644
--- a/gramps/gui/views/treemodels/repomodel.py
+++ b/gramps/gui/views/treemodels/repomodel.py
@@ -43,7 +43,7 @@ from gramps.gen.lib import Address, RepositoryType, Url, UrlType
from gramps.gen.datehandler import format_time
from gramps.gen.constfunc import cuni
from .flatbasemodel import FlatBaseModel
-
+from gramps.gen.const import GRAMPS_LOCALE as glocale
#-------------------------------------------------------------------------
#
# RepositoryModel
@@ -69,9 +69,10 @@ class RepositoryModel(FlatBaseModel):
self.column_postal_code,
self.column_email,
self.column_search_url,
+ self.column_private,
+ self.column_tags,
self.column_change,
- self.column_handle,
- self.column_tooltip
+ self.column_tag_color
]
self.smap = [
@@ -87,12 +88,14 @@ class RepositoryModel(FlatBaseModel):
self.column_postal_code,
self.column_email,
self.column_search_url,
+ self.column_private,
+ self.column_tags,
self.sort_change,
- self.column_handle,
+ self.column_tag_color
]
- FlatBaseModel.__init__(self, db, scol, order, tooltip_column=14,
- search=search, skip=skip, sort_map=sort_map)
+ FlatBaseModel.__init__(self, db, scol, order, search=search, skip=skip,
+ sort_map=sort_map)
def destroy(self):
"""
@@ -106,12 +109,15 @@ class RepositoryModel(FlatBaseModel):
self.smap = None
FlatBaseModel.destroy(self)
+ def color_column(self):
+ """
+ Return the color column.
+ """
+ return 15
+
def do_get_n_columns(self):
return len(self.fmap)+1
- def column_handle(self,data):
- return cuni(data[0])
-
def column_id(self,data):
return cuni(data[1])
@@ -218,11 +224,43 @@ class RepositoryModel(FlatBaseModel):
return cuni(url.path)
return ""
- def column_tooltip(self,data):
- return cuni('Repository tooltip')
+ def column_private(self, data):
+ if data[9]:
+ return 'gramps-lock'
+ else:
+ # There is a problem returning None here.
+ return ''
def sort_change(self,data):
return "%012x" % data[7]
def column_change(self,data):
return format_time(data[7])
+
+ def get_tag_name(self, tag_handle):
+ """
+ Return the tag name from the given tag handle.
+ """
+ return self.db.get_tag_from_handle(tag_handle).get_name()
+
+ def column_tag_color(self, data):
+ """
+ Return the tag color.
+ """
+ tag_color = "#000000000000"
+ tag_priority = None
+ for handle in data[8]:
+ tag = self.db.get_tag_from_handle(handle)
+ if tag:
+ this_priority = tag.get_priority()
+ if tag_priority is None or this_priority < tag_priority:
+ tag_color = tag.get_color()
+ tag_priority = this_priority
+ return tag_color
+
+ def column_tags(self, data):
+ """
+ Return the sorted list of tags.
+ """
+ tag_list = list(map(self.get_tag_name, data[8]))
+ return ', '.join(sorted(tag_list, key=glocale.sort_key))
diff --git a/gramps/gui/views/treemodels/sourcemodel.py b/gramps/gui/views/treemodels/sourcemodel.py
index 1182a722c..569cfebf0 100644
--- a/gramps/gui/views/treemodels/sourcemodel.py
+++ b/gramps/gui/views/treemodels/sourcemodel.py
@@ -42,6 +42,7 @@ from gi.repository import Gtk
from gramps.gen.datehandler import format_time
from gramps.gen.constfunc import cuni
from .flatbasemodel import FlatBaseModel
+from gramps.gen.const import GRAMPS_LOCALE as glocale
#-------------------------------------------------------------------------
#
@@ -50,7 +51,7 @@ from .flatbasemodel import FlatBaseModel
#-------------------------------------------------------------------------
class SourceModel(FlatBaseModel):
- def __init__(self,db,scol=0, order=Gtk.SortType.ASCENDING,search=None,
+ def __init__(self, db, scol=0, order=Gtk.SortType.ASCENDING, search=None,
skip=set(), sort_map=None):
self.map = db.get_raw_source_data
self.gen_cursor = db.get_source_cursor
@@ -60,9 +61,10 @@ class SourceModel(FlatBaseModel):
self.column_author,
self.column_abbrev,
self.column_pubinfo,
+ self.column_private,
+ self.column_tags,
self.column_change,
- self.column_handle,
- self.column_tooltip
+ self.column_tag_color
]
self.smap = [
self.column_title,
@@ -70,10 +72,13 @@ class SourceModel(FlatBaseModel):
self.column_author,
self.column_abbrev,
self.column_pubinfo,
+ self.column_private,
+ self.column_tags,
self.sort_change,
+ self.column_tag_color
]
- FlatBaseModel.__init__(self,db,scol, order,tooltip_column=7,search=search,
- skip=skip, sort_map=sort_map)
+ FlatBaseModel.__init__(self, db, scol, order, search=search, skip=skip,
+ sort_map=sort_map)
def destroy(self):
"""
@@ -86,15 +91,18 @@ class SourceModel(FlatBaseModel):
self.smap = None
FlatBaseModel.destroy(self)
+ def color_column(self):
+ """
+ Return the color column.
+ """
+ return 8
+
def do_get_n_columns(self):
return len(self.fmap)+1
def column_title(self,data):
return cuni(data[2])
- def column_handle(self,data):
- return cuni(data[0])
-
def column_author(self,data):
return cuni(data[3])
@@ -107,11 +115,43 @@ class SourceModel(FlatBaseModel):
def column_pubinfo(self,data):
return cuni(data[4])
+ def column_private(self, data):
+ if data[12]:
+ return 'gramps-lock'
+ else:
+ # There is a problem returning None here.
+ return ''
+
def column_change(self,data):
return format_time(data[8])
def sort_change(self,data):
return "%012x" % data[8]
- def column_tooltip(self,data):
- return cuni('Source tooltip')
+ def get_tag_name(self, tag_handle):
+ """
+ Return the tag name from the given tag handle.
+ """
+ return self.db.get_tag_from_handle(tag_handle).get_name()
+
+ def column_tag_color(self, data):
+ """
+ Return the tag color.
+ """
+ tag_color = "#000000000000"
+ tag_priority = None
+ for handle in data[11]:
+ tag = self.db.get_tag_from_handle(handle)
+ if tag:
+ this_priority = tag.get_priority()
+ if tag_priority is None or this_priority < tag_priority:
+ tag_color = tag.get_color()
+ tag_priority = this_priority
+ return tag_color
+
+ def column_tags(self, data):
+ """
+ Return the sorted list of tags.
+ """
+ tag_list = list(map(self.get_tag_name, data[11]))
+ return ', '.join(sorted(tag_list, key=glocale.sort_key))
diff --git a/gramps/gui/views/treemodels/treebasemodel.py b/gramps/gui/views/treemodels/treebasemodel.py
index 8ec76dede..71db3b19a 100644
--- a/gramps/gui/views/treemodels/treebasemodel.py
+++ b/gramps/gui/views/treemodels/treebasemodel.py
@@ -38,7 +38,8 @@ This module provides the model that is used for all hierarchical treeviews.
import time
import locale
import sys
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import logging
_LOG = logging.getLogger(".gui.treebasemodel")
@@ -56,7 +57,7 @@ from gi.repository import Gtk
# GRAMPS modules
#
#-------------------------------------------------------------------------
-from gramps.gen.utils.cast import conv_str_tosrtkey, conv_unicode_tosrtkey
+from gramps.gen.const import GRAMPS_LOCALE as glocale
import gramps.gui.widgets.progressdialog as progressdlg
from gramps.gen.constfunc import cuni, UNITYPE
from .lru import LRU
@@ -90,17 +91,9 @@ class Node(object):
def __init__(self, ref, parent, sortkey, handle, secondary):
if sortkey:
- if isinstance(sortkey, UNITYPE):
- self.name = sortkey
- #sortkey must be localized sort, so
- self.sortkey = conv_unicode_tosrtkey(sortkey)
- else:
- self.name = sortkey.decode('utf-8')
- #sortkey must be localized sort, so
- if sys.version_info[0] < 3:
- self.sortkey = conv_str_tosrtkey(sortkey)
- else:
- self.sortkey = conv_unicode_tosrtkey(self.name)
+ self.name = sortkey
+ #sortkey must be localized sort, so
+ self.sortkey = glocale.sort_key(sortkey)
else:
self.name = ''
self.sortkey = ''
@@ -267,7 +260,6 @@ class TreeBaseModel(GObject.Object, Gtk.TreeModel):
Creation:
db : the database
- tooltip_column : column number of tooltip
search : the search that must be shown
skip : values not to show
scol : column on which to sort
@@ -290,7 +282,7 @@ class TreeBaseModel(GObject.Object, Gtk.TreeModel):
# LRU cache size
_CACHE_SIZE = 250
- def __init__(self, db, tooltip_column,
+ def __init__(self, db,
search=None, skip=set(),
scol=0, order=Gtk.SortType.ASCENDING, sort_map=None,
nrgroups = 1,
@@ -347,8 +339,6 @@ class TreeBaseModel(GObject.Object, Gtk.TreeModel):
self.lru_data = LRU(TreeBaseModel._CACHE_SIZE)
- self._tooltip_column = tooltip_column
-
self.__total = 0
self.__displayed = 0
@@ -414,12 +404,6 @@ class TreeBaseModel(GObject.Object, Gtk.TreeModel):
"""
return self.__total
- def tooltip_column(self):
- """
- Return the tooltip column.
- """
- return self._tooltip_column
-
def color_column(self):
"""
Return the color column.
@@ -536,6 +520,9 @@ class TreeBaseModel(GObject.Object, Gtk.TreeModel):
pmon.add_op(status)
with gen_cursor() as cursor:
for handle, data in cursor:
+ # for python3 this returns a byte object, so conversion needed
+ if not isinstance(handle, UNITYPE):
+ handle = handle.decode('utf-8')
status.heartbeat()
if status.should_cancel():
break
@@ -581,6 +568,9 @@ class TreeBaseModel(GObject.Object, Gtk.TreeModel):
def beat(key):
status_ppl.heartbeat()
+ # for python3 this returns a byte object, so conversion needed
+ if not isinstance(key, UNITYPE):
+ key = key.decode('utf-8')
return key
with gen_cursor() as cursor:
@@ -646,7 +636,7 @@ class TreeBaseModel(GObject.Object, Gtk.TreeModel):
if not self._in_build:
# emit row_inserted signal
- iternode = self.get_iter(child_node)
+ iternode = self._get_iter(child_node)
path = self.do_get_path(iternode)
self.row_inserted(path, iternode)
if handle:
@@ -683,7 +673,7 @@ class TreeBaseModel(GObject.Object, Gtk.TreeModel):
self.__displayed -= 1
self.__total -= 1
elif node.parent: # don't remove the hidden root node
- iternode = self.get_iter(node)
+ iternode = self._get_iter(node)
path = self.do_get_path(iternode)
self.nodemap.node(node.parent).remove_child(node, self.nodemap)
del self.tree[node.ref]
@@ -699,10 +689,11 @@ class TreeBaseModel(GObject.Object, Gtk.TreeModel):
def reverse_order(self):
"""
- Reverse the order of the map. This does not signal rows_reordered,
- so to propagate the change to the view, you need to reattach the
- model to the view.
+ Reverse the order of the map. Only for Gtk 3.9+ does this signal
+ rows_reordered, so to propagate the change to the view, you need to
+ reattach the model to the view.
"""
+ self.GTK38PLUS = (Gtk.get_major_version(), Gtk.get_minor_version()) >= (3,8)
self.__reverse = not self.__reverse
top_node = self.tree[None]
self._reverse_level(top_node)
@@ -720,10 +711,13 @@ class TreeBaseModel(GObject.Object, Gtk.TreeModel):
if node.parent is None:
path = iter = None
else:
- iternode = self.get_iter(node)
+ iternode = self._get_iter(node)
path = self.do_get_path(iternode)
- ##TODO GTK3: rows_reordered is not exposed in gi
- #self.rows_reordered(path, iter, rows)
+ # activate when https://bugzilla.gnome.org/show_bug.cgi?id=684558
+ # is resolved
+ if False and self.GTK38PLUS:
+ ##rows_reordered is only exposed in gi starting GTK 3.8
+ self.rows_reordered(path, iter, rows)
if self.nrgroups > 1:
for child in node.children:
self._reverse_level(self.nodemap.node(child[1]))
@@ -745,7 +739,9 @@ class TreeBaseModel(GObject.Object, Gtk.TreeModel):
"""
Add a row to the model.
"""
- if self.get_node(handle) is not None:
+ if sys.version_info[0] >= 3:
+ assert isinstance(handle, str)
+ if self._get_node(handle) is not None:
return # row already exists
cput = time.clock()
if not self.search or \
@@ -766,8 +762,10 @@ class TreeBaseModel(GObject.Object, Gtk.TreeModel):
"""
Delete a row from the model.
"""
+ if sys.version_info[0] >= 3:
+ assert isinstance(handle, str)
cput = time.clock()
- node = self.get_node(handle)
+ node = self._get_node(handle)
if node is None:
return # row not currently displayed
@@ -780,7 +778,7 @@ class TreeBaseModel(GObject.Object, Gtk.TreeModel):
if not parent.children:
if parent.handle:
# emit row_has_child_toggled signal
- iternode = self.get_iter(parent)
+ iternode = self._get_iter(parent)
path = self.do_get_path(iternode)
self.row_has_child_toggled(path, iternode)
else:
@@ -796,7 +794,9 @@ class TreeBaseModel(GObject.Object, Gtk.TreeModel):
"""
Update a row in the model.
"""
- if self.get_node(handle) is None:
+ if sys.version_info[0] >= 3:
+ assert isinstance(handle, str)
+ if self._get_node(handle) is None:
return # row not currently displayed
self.delete_row_by_handle(handle)
@@ -805,7 +805,7 @@ class TreeBaseModel(GObject.Object, Gtk.TreeModel):
# If the node hasn't moved, all we need is to call row_changed.
#self.row_changed(path, node)
- def new_iter(self, nodeid):
+ def _new_iter(self, nodeid):
"""
Return a new iter containing the nodeid in the nodemap
"""
@@ -816,7 +816,7 @@ class TreeBaseModel(GObject.Object, Gtk.TreeModel):
iter.user_data = nodeid
return iter
- def get_iter(self, node):
+ def _get_iter(self, node):
"""
Return an iter from the node.
iters are always created afresh
@@ -827,31 +827,31 @@ class TreeBaseModel(GObject.Object, Gtk.TreeModel):
:param path: node as it appears in the treeview
:type path: Node
"""
- iter = self.new_iter(id(node))
+ iter = self._new_iter(id(node))
return iter
- def get_handle(self, node):
- """
- Get the gramps handle for a node. Return None if the node does
- not correspond to a gramps object.
- """
- handle = node.handle
- if handle and not isinstance(handle, UNITYPE):
- handle = handle.decode('utf-8')
- return handle
-
- def get_node(self, handle):
+ def _get_node(self, handle):
"""
Get the node for a handle.
"""
return self.handle2node.get(handle)
- def handle2path(self, handle):
+ def get_iter_from_handle(self, handle):
"""
- Obtain from a handle, a path.
- Part of common api with flat/treebasemodel
+ Get the iter for a gramps handle.
"""
- return self.do_get_path(self.get_iter(self.get_node(handle)))
+ return self._get_iter(self._get_node(handle))
+
+ def get_handle_from_iter(self, iter):
+ """
+ Get the gramps handle for an iter. Return None if the iter does
+ not correspond to a gramps object.
+ """
+ node = self.get_node_from_iter(iter)
+ handle = node.handle
+ if handle and not isinstance(handle, UNITYPE):
+ handle = handle.decode('utf-8')
+ return handle
# The following implement the public interface of Gtk.TreeModel
@@ -872,8 +872,6 @@ class TreeBaseModel(GObject.Object, Gtk.TreeModel):
"""
See Gtk.TreeModel
"""
- if index == self._tooltip_column:
- return object
return str
def do_get_value(self, iter, col):
@@ -899,7 +897,7 @@ class TreeBaseModel(GObject.Object, Gtk.TreeModel):
# according to column_defs table
val = self._get_value(node.handle, col, node.secondary)
#GTK 3 should convert unicode objects automatically, but this
- # gives wrong column values, so we convert, so we convert for python 2.7
+ # gives wrong column values, so convert for python 2.7
if not isinstance(val, str):
return val.encode('utf-8')
else:
@@ -934,11 +932,14 @@ class TreeBaseModel(GObject.Object, Gtk.TreeModel):
if not self.tree or not self.tree[None].children:
return False, Gtk.TreeIter()
node = self.tree[None]
- pathlist = path.get_indices()
+ if isinstance(path, tuple):
+ pathlist = path
+ else:
+ pathlist = path.get_indices()
for index in pathlist:
_index = (-index - 1) if self.__reverse else index
node = self.nodemap.node(node.children[_index][1])
- return True, self.get_iter(node)
+ return True, self._get_iter(node)
def get_node_from_iter(self, iter):
if iter and iter.user_data:
@@ -998,7 +999,7 @@ class TreeBaseModel(GObject.Object, Gtk.TreeModel):
nodeid = nodeparent.children[-1 if self.__reverse else 0][1]
else:
return False, None
- return True, self.new_iter(nodeid)
+ return True, self._new_iter(nodeid)
def do_iter_has_child(self, iter):
"""
@@ -1028,7 +1029,7 @@ class TreeBaseModel(GObject.Object, Gtk.TreeModel):
if node.children:
if len(node.children) > index:
_index = (-index - 1) if self.__reverse else index
- return True, self.new_iter(node.children[_index][1])
+ return True, self._new_iter(node.children[_index][1])
else:
return False, None
else:
@@ -1040,6 +1041,6 @@ class TreeBaseModel(GObject.Object, Gtk.TreeModel):
"""
node = self.get_node_from_iter(iterchild)
if node.parent:
- return True, self.new_iter(node.parent)
+ return True, self._new_iter(node.parent)
else:
return False, None
diff --git a/gramps/gui/widgets/buttons.py b/gramps/gui/widgets/buttons.py
index ce1aea243..c4953e254 100644
--- a/gramps/gui/widgets/buttons.py
+++ b/gramps/gui/widgets/buttons.py
@@ -27,7 +27,8 @@ __all__ = ["IconButton", "WarnButton", "SimpleButton", "PrivacyButton"]
# Standard python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import logging
_LOG = logging.getLogger(".widgets.buttons")
diff --git a/gramps/gui/widgets/expandcollapsearrow.py b/gramps/gui/widgets/expandcollapsearrow.py
index c856767aa..f040fa59d 100644
--- a/gramps/gui/widgets/expandcollapsearrow.py
+++ b/gramps/gui/widgets/expandcollapsearrow.py
@@ -27,7 +27,8 @@ __all__ = ["ExpandCollapseArrow"]
# Standard python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import logging
_LOG = logging.getLogger(".widgets.expandcollapsearrow")
diff --git a/gramps/gui/widgets/fanchart.py b/gramps/gui/widgets/fanchart.py
index b6a8ac79a..28fad531e 100644
--- a/gramps/gui/widgets/fanchart.py
+++ b/gramps/gui/widgets/fanchart.py
@@ -70,7 +70,8 @@ from gramps.gen.utils.alive import probably_alive
from gramps.gen.utils.libformatting import FormattingHelper
from gramps.gen.utils.db import (find_children, find_parents, find_witnessed_people,
get_age, get_timeperiod, preset_name)
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gui/widgets/fanchartdesc.py b/gramps/gui/widgets/fanchartdesc.py
index fe62c6b09..33459768f 100644
--- a/gramps/gui/widgets/fanchartdesc.py
+++ b/gramps/gui/widgets/fanchartdesc.py
@@ -348,8 +348,12 @@ class FanChartDescWidget(FanChartBaseWidget):
for data in self.gen2people[gen]:
#obtain start and stop of family this is child of
parentfamdata = self.gen2fam[gen-1][data[5]]
- nrdescfam = self.famhandle2desc[parentfamdata[0].handle]
- nrdesc = self.handle2desc[data[0].handle]
+ nrdescfam = 0
+ if not parentfamdata[1]:
+ nrdescfam = self.famhandle2desc[parentfamdata[0].handle]
+ nrdesc = 0
+ if not data[1]:
+ nrdesc = self.handle2desc[data[0].handle]
famstart = parentfamdata[2]
famslice = parentfamdata[3]
nrchild = parentfamdata[6]
diff --git a/gramps/gui/grampsbar.py b/gramps/gui/widgets/grampletbar.py
similarity index 73%
rename from gramps/gui/grampsbar.py
rename to gramps/gui/widgets/grampletbar.py
index 52ce2e332..76df4e661 100644
--- a/gramps/gui/grampsbar.py
+++ b/gramps/gui/widgets/grampletbar.py
@@ -22,7 +22,7 @@
# $Id$
"""
-Module that implements the sidebar and bottombar fuctionality.
+Module that implements the gramplet bar fuctionality.
"""
#-------------------------------------------------------------------------
#
@@ -31,7 +31,8 @@ Module that implements the sidebar and bottombar fuctionality.
#-------------------------------------------------------------------------
from __future__ import print_function
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import time
import os
import sys
@@ -54,18 +55,19 @@ from gi.repository import Gtk
#
#-------------------------------------------------------------------------
from gramps.gen.const import URL_MANUAL_PAGE, VERSION_DIR
-from .managedwindow import ManagedWindow
-from .display import display_help, display_url
-from .widgets.grampletpane import (AVAILABLE_GRAMPLETS,
- GET_AVAILABLE_GRAMPLETS,
- GET_GRAMPLET_LIST,
- get_gramplet_opts,
- get_gramplet_options_by_name,
- make_requested_gramplet,
- GuiGramplet)
-from .widgets.undoablebuffer import UndoableBuffer
-from .utils import is_right_click
-from .dialog import QuestionDialog
+from gramps.gen.config import config
+from ..managedwindow import ManagedWindow
+from ..display import display_help, display_url
+from .grampletpane import (AVAILABLE_GRAMPLETS,
+ GET_AVAILABLE_GRAMPLETS,
+ GET_GRAMPLET_LIST,
+ get_gramplet_opts,
+ get_gramplet_options_by_name,
+ make_requested_gramplet,
+ GuiGramplet)
+from .undoablebuffer import UndoableBuffer
+from ..utils import is_right_click
+from ..dialog import QuestionDialog
#-------------------------------------------------------------------------
#
@@ -77,12 +79,12 @@ NL = "\n"
#-------------------------------------------------------------------------
#
-# GrampsBar class
+# GrampletBar class
#
#-------------------------------------------------------------------------
-class GrampsBar(Gtk.Notebook):
+class GrampletBar(Gtk.Notebook):
"""
- A class which defines the graphical representation of the GrampsBar.
+ A class which defines the graphical representation of the GrampletBar.
"""
def __init__(self, dbstate, uistate, pageview, configfile, defaults):
GObject.GObject.__init__(self)
@@ -94,15 +96,28 @@ class GrampsBar(Gtk.Notebook):
self.defaults = defaults
self.detached_gramplets = []
self.empty = False
+ self.close_buttons = []
- self.set_group_name("grampsbar")
+ self.set_group_name("grampletbar")
self.set_show_border(False)
self.set_scrollable(True)
+
+ book_button = Gtk.Button()
+ box = Gtk.VBox() # Arrow is too small unless in a Vbox
+ arrow = Gtk.Arrow(Gtk.ArrowType.DOWN, Gtk.ShadowType.NONE)
+ arrow.show()
+ box.add(arrow)
+ box.show()
+ book_button.add(box)
+ book_button.set_relief(Gtk.ReliefStyle.NONE)
+ book_button.connect('clicked', self.__button_clicked)
+ book_button.show()
+ self.set_action_widget(book_button, Gtk.PackType.END)
+
self.connect('switch-page', self.__switch_page)
self.connect('page-added', self.__page_added)
self.connect('page-removed', self.__page_removed)
self.connect('create-window', self.__create_window)
- self.connect('button-press-event', self.__button_press)
config_settings, opts_list = self.__load(defaults)
@@ -123,6 +138,8 @@ class GrampsBar(Gtk.Notebook):
self.show()
self.set_current_page(config_settings[1])
+ uistate.connect('grampletbar-close-changed', self.cb_close_changed)
+
def __load(self, defaults):
"""
Load the gramplets from the configuration file.
@@ -133,7 +150,10 @@ class GrampsBar(Gtk.Notebook):
filename = self.configfile
if filename and os.path.exists(filename):
cp = configparser.ConfigParser()
- cp.read(filename)
+ try:
+ cp.read(filename)
+ except:
+ pass
for sec in cp.sections():
if sec == "Bar Options":
if "visible" in cp.options(sec):
@@ -175,7 +195,7 @@ class GrampsBar(Gtk.Notebook):
except IOError:
print("Failed writing '%s'; gramplets not saved" % filename)
return
- fp.write(";; Gramps bar configuration file" + NL)
+ fp.write(";; Gramplet bar configuration file" + NL)
fp.write((";; Automatically created at %s" %
time.strftime("%Y/%m/%d %H:%M:%S")) + NL + NL)
fp.write("[Bar Options]" + NL)
@@ -283,13 +303,13 @@ class GrampsBar(Gtk.Notebook):
def has_gramplet(self, gname):
"""
- Return True if the GrampsBar contains the gramplet, else False.
+ Return True if the GrampletBar contains the gramplet, else False.
"""
return gname in self.all_gramplets()
def all_gramplets(self):
"""
- Return a list of names of all the gramplets in the GrampsBar.
+ Return a list of names of all the gramplets in the GrampletBar.
"""
if self.empty:
return self.detached_gramplets
@@ -299,7 +319,7 @@ class GrampsBar(Gtk.Notebook):
def restore(self):
"""
- Restore the GrampsBar to its default gramplets.
+ Restore the GrampletBar to its default gramplets.
"""
list(map(self.remove_gramplet, self.all_gramplets()))
list(map(self.add_gramplet, self.defaults))
@@ -307,12 +327,15 @@ class GrampsBar(Gtk.Notebook):
def __create_empty_tab(self):
"""
- Create an empty tab to be displayed when the GrampsBar is empty.
+ Create an empty tab to be displayed when the GrampletBar is empty.
"""
- tab_label = Gtk.Label(label=_('Gramps Bar'))
+ tab_label = Gtk.Label(label=_('Gramplet Bar'))
tab_label.show()
- msg = _('Right-click to the right of the tab to add a gramplet.')
+ msg = _('Select the down arrow on the right corner for adding, removing or restoring gramplets.')
content = Gtk.Label(label=msg)
+ content.set_alignment(0, 0)
+ content.set_line_wrap(True)
+ content.set_size_request(150, -1)
content.show()
self.append_page(content, tab_label)
return content
@@ -330,21 +353,29 @@ class GrampsBar(Gtk.Notebook):
def __create_tab_label(self, gramplet):
"""
- Create a tab label.
+ Create a tab label consisting of a label and a close button.
"""
- label = Gtk.Label()
+ tablabel = TabLabel(gramplet, self.__delete_clicked)
+
if hasattr(gramplet.pui, "has_data"):
- if gramplet.pui.has_data:
- label.set_text("%s " % gramplet.title)
- else:
- label.set_text(gramplet.title)
+ tablabel.set_has_data(gramplet.pui.has_data)
else: # just a function; always show yes it has data
- label.set_text("%s " % gramplet.title)
-
- label.set_use_markup(True)
- label.set_tooltip_text(gramplet.tname)
- label.show_all()
- return label
+ tablabel.set_has_data(True)
+
+ if config.get('interface.grampletbar-close'):
+ tablabel.use_close(True)
+ else:
+ tablabel.use_close(False)
+
+ return tablabel
+
+ def cb_close_changed(self):
+ """
+ Close button preference changed.
+ """
+ for gramplet in self.get_children():
+ tablabel = self.get_tab_label(gramplet)
+ tablabel.use_close(config.get('interface.grampletbar-close'))
def __delete_clicked(self, button, gramplet):
"""
@@ -355,7 +386,7 @@ class GrampsBar(Gtk.Notebook):
def __switch_page(self, notebook, unused, new_page):
"""
- Called when the user has switched to a new GrampsBar page.
+ Called when the user has switched to a new GrampletBar page.
"""
old_page = notebook.get_current_page()
if old_page >= 0:
@@ -372,7 +403,7 @@ class GrampsBar(Gtk.Notebook):
def __page_added(self, notebook, unused, new_page):
"""
- Called when a new page is added to the GrampsBar.
+ Called when a new page is added to the GrampletBar.
"""
gramplet = self.get_nth_page(new_page)
if self.empty:
@@ -395,19 +426,19 @@ class GrampsBar(Gtk.Notebook):
def __page_removed(self, notebook, unused, page_num):
"""
- Called when a page is removed to the GrampsBar.
+ Called when a page is removed to the GrampletBar.
"""
if self.get_n_pages() == 0:
self.empty = True
self.__create_empty_tab()
- def __create_window(self, grampsbar, gramplet, x_pos, y_pos):
+ def __create_window(self, grampletbar, gramplet, x_pos, y_pos):
"""
- Called when the user has switched to a new GrampsBar page.
+ Called when the user has switched to a new GrampletBar page.
"""
gramplet.page = self.page_num(gramplet)
self.detached_gramplets.append(gramplet)
- win = DetachedWindow(grampsbar, gramplet, x_pos, y_pos)
+ win = DetachedWindow(grampletbar, gramplet, x_pos, y_pos)
gramplet.detached_window = win
return win.get_notebook()
@@ -418,47 +449,39 @@ class GrampsBar(Gtk.Notebook):
gramplet.detached_window.close()
gramplet.detached_window = None
- def __button_press(self, widget, event):
+ def __button_clicked(self, button):
"""
- Called when a button is pressed in the tabs section of the GrampsBar.
+ Called when the drop-down button is clicked.
"""
- if is_right_click(event):
- menu = Gtk.Menu()
+ menu = Gtk.Menu()
- ag_menu = Gtk.MenuItem(label=_('Add a gramplet'))
- nav_type = self.pageview.navigation_type()
- skip = self.all_gramplets()
- gramplet_list = GET_GRAMPLET_LIST(nav_type, skip)
+ ag_menu = Gtk.MenuItem(label=_('Add a gramplet'))
+ nav_type = self.pageview.navigation_type()
+ skip = self.all_gramplets()
+ gramplet_list = GET_GRAMPLET_LIST(nav_type, skip)
+ gramplet_list.sort()
+ self.__create_submenu(ag_menu, gramplet_list, self.__add_clicked)
+ ag_menu.show()
+ menu.append(ag_menu)
+
+ if not (self.empty or config.get('interface.grampletbar-close')):
+ rg_menu = Gtk.MenuItem(label=_('Remove a gramplet'))
+ gramplet_list = [(gramplet.title, gramplet.gname)
+ for gramplet in self.get_children() +
+ self.detached_gramplets]
gramplet_list.sort()
- self.__create_submenu(ag_menu, gramplet_list, self.__add_clicked)
- ag_menu.show()
- menu.append(ag_menu)
+ self.__create_submenu(rg_menu, gramplet_list,
+ self.__remove_clicked)
+ rg_menu.show()
+ menu.append(rg_menu)
- if not self.empty:
- rg_menu = Gtk.MenuItem(label=_('Remove a gramplet'))
- gramplet_list = [(gramplet.title, gramplet.gname)
- for gramplet in self.get_children() +
- self.detached_gramplets]
- gramplet_list.sort()
- self.__create_submenu(rg_menu, gramplet_list,
- self.__remove_clicked)
- rg_menu.show()
- menu.append(rg_menu)
+ rd_menu = Gtk.MenuItem(label=_('Restore default gramplets'))
+ rd_menu.connect("activate", self.__restore_clicked)
+ rd_menu.show()
+ menu.append(rd_menu)
- rd_menu = Gtk.MenuItem(label=_('Restore default gramplets'))
- rd_menu.connect("activate", self.__restore_clicked)
- rd_menu.show()
- menu.append(rd_menu)
-
- menu.show_all()
- #GTK3 does not show the popup, workaround: pass position function
- menu.popup(None, None,
- lambda menu, data: (event.get_root_coords()[0],
- event.get_root_coords()[1], True),
- None, event.button, event.time)
- return True
-
- return False
+ menu.show_all()
+ menu.popup(None, None, cb_menu_position, button, 0, 0)
def __create_submenu(self, main_menu, gramplet_list, callback_func):
"""
@@ -491,7 +514,7 @@ class GrampsBar(Gtk.Notebook):
Called when restore defaults is clicked from the context menu.
"""
QuestionDialog(_("Restore to defaults?"),
- _("The Grampsbar will be restored to contain its default "
+ _("The gramplet bar will be restored to contain its default "
"gramplets. This action cannot be undone."),
_("OK"),
self.restore)
@@ -567,12 +590,12 @@ class DetachedWindow(ManagedWindow):
"""
Class for showing a detached gramplet.
"""
- def __init__(self, grampsbar, gramplet, x_pos, y_pos):
+ def __init__(self, grampletbar, gramplet, x_pos, y_pos):
"""
Construct the window.
"""
self.title = gramplet.title + " " + _("Gramplet")
- self.grampsbar = grampsbar
+ self.grampletbar = grampletbar
self.gramplet = gramplet
ManagedWindow.__init__(self, gramplet.uistate, [],
@@ -591,10 +614,18 @@ class DetachedWindow(ManagedWindow):
self.notebook = Gtk.Notebook()
self.notebook.set_show_tabs(False)
self.notebook.set_show_border(False)
+ self.notebook.connect('page-added', self.page_added)
self.notebook.show()
- self.window.vbox.add(self.notebook)
+ self.window.vbox.pack_start(self.notebook, True, True, 0)
self.show()
+ def page_added(self, notebook, gramplet, page_num):
+ """
+ Called when the gramplet is added to the notebook. This takes the
+ focus from the help button (bug #6306).
+ """
+ gramplet.grab_focus()
+
def handle_response(self, object, response):
"""
Callback for taking care of button clicks.
@@ -632,11 +663,69 @@ class DetachedWindow(ManagedWindow):
def close(self, *args):
"""
- Dock the detached gramplet back in the GrampsBar from where it came.
+ Dock the detached gramplet back in the GrampletBar from where it came.
"""
size = self.window.get_size()
self.gramplet.detached_width = size[0]
self.gramplet.detached_height = size[1]
self.gramplet.detached_window = None
- self.gramplet.reparent(self.grampsbar)
+ self.gramplet.reparent(self.grampletbar)
ManagedWindow.close(self, *args)
+
+#-------------------------------------------------------------------------
+#
+# TabLabel class
+#
+#-------------------------------------------------------------------------
+class TabLabel(Gtk.HBox):
+ """
+ Create a tab label consisting of a label and a close button.
+ """
+ def __init__(self, gramplet, callback):
+ Gtk.HBox.__init__(self)
+
+ self.text = gramplet.title
+ self.set_spacing(4)
+
+ self.label = Gtk.Label()
+ self.label.set_tooltip_text(gramplet.tname)
+ self.label.show()
+
+ self.closebtn = Gtk.Button()
+ image = Gtk.Image()
+ image.set_from_stock(Gtk.STOCK_CLOSE, Gtk.IconSize.MENU)
+ self.closebtn.connect("clicked", callback, gramplet)
+ self.closebtn.set_image(image)
+ self.closebtn.set_relief(Gtk.ReliefStyle.NONE)
+
+ self.pack_start(self.label, True, True, 0)
+ self.pack_end(self.closebtn, False, False, 0)
+
+ def set_has_data(self, has_data):
+ """
+ Set the label to indicate if the gramplet has data.
+ """
+ if has_data:
+ self.label.set_text("%s " % self.text)
+ self.label.set_use_markup(True)
+ else:
+ self.label.set_text(self.text)
+
+ def use_close(self, use_close):
+ """
+ Display the cose button according to user preference.
+ """
+ if use_close:
+ self.closebtn.show()
+ else:
+ self.closebtn.hide()
+
+def cb_menu_position(menu, button):
+ """
+ Determine the position of the popup menu.
+ """
+ ret_val, x_pos, y_pos = button.get_window().get_origin()
+ x_pos += button.get_allocation().x
+ y_pos += button.get_allocation().y + button.get_allocation().height
+
+ return (x_pos, y_pos, False)
diff --git a/gramps/gui/widgets/grampletpane.py b/gramps/gui/widgets/grampletpane.py
index a4fa62549..de91c7a7e 100644
--- a/gramps/gui/widgets/grampletpane.py
+++ b/gramps/gui/widgets/grampletpane.py
@@ -38,7 +38,8 @@ from gi.repository import Gtk
from gi.repository import Pango
import time
import os
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import sys
if sys.version_info[0] < 3:
import ConfigParser as configparser
@@ -716,11 +717,7 @@ class GuiGramplet(object):
if isinstance(self.pane, Gtk.Notebook):
if self.pane.get_tab_label(self):
label = self.pane.get_tab_label(self)
- if value:
- label.set_text("%s " % self.title)
- label.set_use_markup(True)
- else:
- label.set_text(self.title)
+ label.set_has_data(value)
class GridGramplet(GuiGramplet):
"""
diff --git a/gramps/gui/widgets/labels.py b/gramps/gui/widgets/labels.py
index d5500fac6..22123801b 100644
--- a/gramps/gui/widgets/labels.py
+++ b/gramps/gui/widgets/labels.py
@@ -30,7 +30,8 @@ __all__ = ["LinkLabel", "EditLabel", "BasicLabel", "GenderLabel",
#-------------------------------------------------------------------------
import os
import cgi
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import logging
_LOG = logging.getLogger(".widgets.labels")
diff --git a/gramps/gui/widgets/monitoredwidgets.py b/gramps/gui/widgets/monitoredwidgets.py
index cc43048aa..0aec13ae3 100644
--- a/gramps/gui/widgets/monitoredwidgets.py
+++ b/gramps/gui/widgets/monitoredwidgets.py
@@ -34,7 +34,6 @@ __all__ = ["MonitoredCheckbox", "MonitoredEntry",
#-------------------------------------------------------------------------
import logging
_LOG = logging.getLogger(".widgets.monitoredwidgets")
-import locale
import sys
#-------------------------------------------------------------------------
@@ -52,7 +51,8 @@ from gi.repository import Pango
# Gramps modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from ..autocomp import StandardCustomSelector, fill_entry
from gramps.gen.datehandler import displayer, parser
from gramps.gen.lib.date import Date, NextYear
@@ -455,7 +455,7 @@ class MonitoredDataType(object):
map = get_val().get_map().copy()
if ignore_values :
- for key in map.keys():
+ for key in list(map.keys()):
if key in ignore_values and key not in (None, default):
del map[key]
@@ -748,13 +748,13 @@ class MonitoredComboSelectedEntry(object):
"""
fvalue = self.mapping[first]
svalue = self.mapping[second]
- return locale.strcoll(fvalue, svalue)
+ return glocale.strcoll(fvalue, svalue)
def __by_value_key(self, first):
"""
Method for sorting keys based on the values.
"""
- return locale.strxfrm(self.mapping[first])
+ return glocale.sort_key(self.mapping[first])
def on_combochange(self, obj):
"""
diff --git a/gramps/gui/widgets/photo.py b/gramps/gui/widgets/photo.py
index 9002ddbea..a985d4625 100644
--- a/gramps/gui/widgets/photo.py
+++ b/gramps/gui/widgets/photo.py
@@ -35,7 +35,8 @@ from gi.repository import Gtk
#-------------------------------------------------------------------------
from ..thumbnails import get_thumbnail_image, SIZE_NORMAL, SIZE_LARGE
from ..utils import open_file_with_default_application
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gui/widgets/progressdialog.py b/gramps/gui/widgets/progressdialog.py
index ecc79badd..01416c95e 100644
--- a/gramps/gui/widgets/progressdialog.py
+++ b/gramps/gui/widgets/progressdialog.py
@@ -30,7 +30,8 @@ from __future__ import print_function
#
#-------------------------------------------------------------------------
import time
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import logging
log = logging.getLogger("gen.progressdialog")
@@ -432,12 +433,12 @@ class _GtkProgressBar(Gtk.VBox):
self._cancel.connect("clicked",
lambda x: long_op_status.cancel())
self._cancel.show()
- self._hbox.pack_end(self._cancel, expand=False, fill=True, padding=0)
+ self._hbox.pack_end(self._cancel, False, True, 0)
self._hbox.pack_start(self._pbar, True, True, 0)
- self.pack_start(self._lbl, expand=False, fill=False)
- self.pack_start(self._hbox, expand=False, fill=False)
+ self.pack_start(self._lbl, False, False, 0)
+ self.pack_start(self._hbox, False, False, 0)
self._pbar_max = (long_op_status.get_total_steps()/
@@ -483,7 +484,18 @@ class GtkProgressDialog(Gtk.Dialog):
""":param title: The title to display on the top of the window.
:type title: string
"""
- GObject.GObject.__init__(self, *window_params)
+ #GObject.GObject.__init__(self, *window_params)
+ GObject.GObject.__init__(self)
+ if len(window_params) >= 2:
+ self.set_transient_for(window_params[1])
+ if len(window_params) >= 3:
+ flags = window_params[2]
+ if Gtk.DialogFlags.MODAL & flags:
+ self.set_modal(True)
+ if Gtk.DialogFlags.DESTROY_WITH_PARENT & flags:
+ self.set_destroy_with_parent(True)
+ if len(window_params) >= 4:
+ self.add_buttons(window_params[3:])
self.connect('delete_event', self._warn)
self.set_title(title)
#self.set_resize_mode(Gtk.RESIZE_IMMEDIATE)
@@ -502,7 +514,7 @@ class GtkProgressDialog(Gtk.Dialog):
"""
pbar = _GtkProgressBar(long_op_status)
- self.vbox.pack_start(pbar, expand=False, fill=False)
+ self.vbox.pack_start(pbar, False, False, 0)
pbar.show()
# this seems to cause an infinite loop:
diff --git a/gramps/gui/widgets/reorderfam.py b/gramps/gui/widgets/reorderfam.py
index 4eba112af..25a20c80c 100644
--- a/gramps/gui/widgets/reorderfam.py
+++ b/gramps/gui/widgets/reorderfam.py
@@ -25,7 +25,8 @@
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/gui/widgets/styledtextbuffer.py b/gramps/gui/widgets/styledtextbuffer.py
index c64b271ca..6f88496b8 100644
--- a/gramps/gui/widgets/styledtextbuffer.py
+++ b/gramps/gui/widgets/styledtextbuffer.py
@@ -30,7 +30,8 @@ __all__ = ["ALLOWED_STYLES", "MATCH_START", "MATCH_END", "MATCH_FLAVOR",
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import re
import logging
diff --git a/gramps/gui/widgets/styledtexteditor.py b/gramps/gui/widgets/styledtexteditor.py
index 7938a0cab..998598248 100644
--- a/gramps/gui/widgets/styledtexteditor.py
+++ b/gramps/gui/widgets/styledtexteditor.py
@@ -30,7 +30,8 @@ __all__ = ["StyledTextEditor"]
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import logging
_LOG = logging.getLogger(".widgets.styledtexteditor")
diff --git a/gramps/gui/widgets/undoableentry.py b/gramps/gui/widgets/undoableentry.py
index 1cb93f44a..caf179f30 100644
--- a/gramps/gui/widgets/undoableentry.py
+++ b/gramps/gui/widgets/undoableentry.py
@@ -29,7 +29,8 @@ __all__ = ["UndoableEntry"]
# Standard python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import logging
_LOG = logging.getLogger(".widgets.undoableentry")
diff --git a/gramps/gui/widgets/validatedmaskedentry.py b/gramps/gui/widgets/validatedmaskedentry.py
index 9ba505ef9..52c63d044 100644
--- a/gramps/gui/widgets/validatedmaskedentry.py
+++ b/gramps/gui/widgets/validatedmaskedentry.py
@@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2007-2008 Zsolt Foldvari
+# Copyright (C) 2012 Benny Malengier
#
# 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
@@ -27,7 +28,8 @@ __all__ = ["MaskedEntry", "ValidatableMaskedEntry"]
# Standard python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import string
import sys
@@ -135,8 +137,12 @@ class FadeOut(GObject.GObject):
return
##_LOG.debug('_start_merging: Starting')
- func = self._merge_colors(self._start_color,
- Gdk.color_parse(self.ERROR_COLOR)).next
+ generator = self._merge_colors(self._start_color,
+ Gdk.color_parse(self.ERROR_COLOR))
+ if sys.version_info[0] < 3:
+ func = generator.next
+ else:
+ func = generator.__next__
self._background_timeout_id = (
GObject.timeout_add(FadeOut.MERGE_COLORS_DELAY, func))
self._countdown_timeout_id = -1
@@ -173,444 +179,9 @@ class FadeOut(GObject.GObject):
GObject.source_remove(self._countdown_timeout_id)
self._countdown_timeout_id = -1
- self._widget.update_background(self._start_color)
+ self._widget.update_background(self._start_color, unset=True)
self._done = False
-class Tooltip(Gtk.Window):
- """Tooltip for the Icon in the MaskedEntry"""
-
- DEFAULT_DELAY = 500
- BORDER_WIDTH = 4
-
- def __init__(self, widget):
- GObject.GObject.__init__(self, type=Gtk.WindowType.POPUP)
- # from gtktooltips.c:gtk_tooltips_force_window
- self.set_app_paintable(True)
- self.set_resizable(False)
- self.set_name("gtk-tooltips")
- self.set_border_width(Tooltip.BORDER_WIDTH)
- #TODO GTK3: this signal no longer exists. Convert to draw
- self.connect('draw', self._on__draw_event)
-
- self._label = Gtk.Label()
- self.add(self._label)
- self._show_timeout_id = -1
-
- # from gtktooltips.c:gtk_tooltips_draw_tips
- def _calculate_pos(self, widget):
- screen = widget.get_screen()
-
- greq = Gtk.Requisition()
- greq = self.size_request()
- w = greq.width
- h = greq.height
-
- _, x, y = widget.get_window().get_origin()
-
- # TODO GTK3 No longer WidgetFlags!
- #if widget.get_state_flags() & Gtk.WidgetFlags.NO_WINDOW:
- x += widget.get_allocation().width
- y += widget.get_allocation().height
-
- x = screen.get_root_window().get_pointer()[1]
- #TODO GTK3, how: x = screen.get_window().get_device_position()[0]
- x -= (w / 2 + Tooltip.BORDER_WIDTH)
-
- pointer_screen, px, py, _ = screen.get_display().get_pointer()
- if pointer_screen != screen:
- px = x
- py = y
-
- monitor_num = screen.get_monitor_at_point(px, py)
- monitor = screen.get_monitor_geometry(monitor_num)
-
- if (x + w) > monitor.x + monitor.width:
- x -= (x + w) - (monitor.x + monitor.width);
- elif x < monitor.x:
- x = monitor.x
-
- if ((y + h + widget.get_allocation().height + Tooltip.BORDER_WIDTH) >
- monitor.y + monitor.height):
- y -= h + Tooltip.BORDER_WIDTH
- else:
- y += widget.get_allocation().height + Tooltip.BORDER_WIDTH
-
- return x, y
-
- # from gtktooltips.c:gtk_tooltips_paint_window
- def _on__draw_event(self, window, cairo_context):
- #GTK3 TODO, paint_flat_box deprecated !!
- greq = self.size_request()
- w = greq.width
- h = greq.height
- Gtk.render_frame(window.get_style_context(), cairo_context,
- 0,0,w,h)
- #window.get_style().paint_flat_box(window.window,
- # Gtk.StateType.NORMAL, Gtk.ShadowType.OUT,
- # None, window, "tooltip",
- # 0, 0, w, h)
- return False
-
- def _real_display(self, widget):
- x, y = self._calculate_pos(widget)
-
- self.move(x, y)
- self.show_all()
-
- # Public API
-
- def set_text(self, text):
- self._label.set_text(text)
-
- def hide(self):
- Gtk.Window.hide(self)
- GObject.source_remove(self._show_timeout_id)
- self._show_timeout_id = -1
-
- def display(self, widget):
- if not self._label.get_text():
- return
-
- if self._show_timeout_id != -1:
- return
-
- self._show_timeout_id = GObject.timeout_add(Tooltip.DEFAULT_DELAY,
- self._real_display,
- widget)
-
-# This is tricky and contains quite a few hacks:
-# An entry contains 2 GdkWindows, one for the background and one for
-# the text area. The normal one, on which the (normally white) background
-# is drawn can be accessed through entry.window (after realization)
-# The other window is the one where the cursor and the text is drawn upon,
-# it's refered to as "text area" inside the GtkEntry code and it is called
-# the same here. It can only be accessed through window.get_children()[0],
-# since it's considered private to the entry.
-#
-# +-------------------------------------+
-# | (1) | (1) parent widget (grey)
-# |+----------------(2)----------------+|
-# || |-- /-\ | || (2) entry.window (white)
-# || |- | | |(4) (3) ||
-# || | \-/ | || (3) text area (transparent)
-# |+-----------------------------------+|
-# |-------------------------------------| (4) cursor, black
-# | |
-# +-------------------------------------|
-#
-# So, now we want to put an icon in the edge:
-# An earlier approached by Lorzeno drew the icon directly on the text area,
-# which is not desired since if the text is using the whole width of the
-# entry the icon will be drawn on top of the text.
-# Now what we want to do is to resize the text area and create a
-# new window upon which we can draw the icon.
-#
-# +-------------------------------------+
-# | | (5) icon window
-# |+----------------------------++-----+|
-# || |-- /-\ | || ||
-# || |- | | | || (5) ||
-# || | \-/ | || ||
-# |+----------------------------++-----+|
-# |-------------------------------------|
-# | |
-# +-------------------------------------+
-#
-# When resizing the text area the cursor and text is not moved into the
-# correct position, it'll still be off by the width of the icon window
-# To fix this we need to call a private function, gtk_entry_recompute,
-# a workaround is to call set_visiblity() which calls recompute()
-# internally.
-#
-
-class IconEntry(object):
- """
- Helper object for rendering an icon in a GtkEntry
- """
-
- def __init__(self, entry):
- if not isinstance(entry, Gtk.Entry):
- raise TypeError("entry must be a Gtk.Entry")
- self._constructed = False
- self._pixbuf = None
- self._pixw = 1
- self._pixh = 1
- self._text_area = None
- self._text_area_pos = (0, 0)
- self._icon_win = None
- self._entry = entry
- self._tooltip = Tooltip(self)
- self._locked = False
- entry.connect('enter-notify-event',
- self._on_entry__enter_notify_event)
- entry.connect('leave-notify-event',
- self._on_entry__leave_notify_event)
- entry.connect('notify::xalign',
- self._on_entry__notify_xalign)
- self._update_position()
-
- def _on_entry__notify_xalign(self, entry, pspec):
- self._update_position()
-
- def _on_entry__enter_notify_event(self, entry, event):
- icon_win = self.get_icon_window()
- if event.window != icon_win:
- return
-
- self._tooltip.display(entry)
-
- def _on_entry__leave_notify_event(self, entry, event):
- if event.window != self.get_icon_window():
- return
-
- self._tooltip.hide()
-
- def set_tooltip(self, text):
- self._tooltip.set_text(text)
-
- def get_icon_window(self):
- return self._icon_win
-
- def set_pixbuf(self, pixbuf):
- """
- @param pixbuf: a GdkPixbuf.Pixbuf or None
- """
- entry = self._entry
- if not isinstance(entry.get_toplevel(), Gtk.Window):
- # For widgets in SlaveViews, wait until they're attached
- # to something visible, then set the pixbuf
- entry.connect_object('realize', self.set_pixbuf, pixbuf)
- return
-
- if pixbuf:
- if not isinstance(pixbuf, GdkPixbuf.Pixbuf):
- raise TypeError("pixbuf must be a GdkPixbuf")
- else:
- # Turning off the icon should also restore the background
- entry.override_background_color(Gtk.StateType.NORMAL, None)
- if not self._pixbuf:
- return
- self._pixbuf = pixbuf
-
- if pixbuf:
- self._pixw = pixbuf.get_width()
- self._pixh = pixbuf.get_height()
- else:
- self._pixw = self._pixh = 0
-
- win = self._icon_win
- if not win:
- self.construct()
- win = self._icon_win
-
- self.resize_windows()
-
- # XXX: Why?
- if win:
- if not pixbuf:
- win.hide()
- else:
- win.show()
-
- self._recompute()
- entry.queue_draw()
-
- def construct(self):
- if self._constructed:
- return
-
- entry = self._entry
- if not entry.get_realized():
- entry.realize()
-
- # Hack: Save a reference to the text area, now when its created
- self._text_area = entry.get_window().get_children()[0]
- self._text_area_pos = self._text_area.get_position()
-
- # PyGTK should allow default values for most of the values here.
- attr = Gdk.WindowAttr()
- attr.width = self._pixw
- attr.height = self._pixh
- attr.x = 0
- attr.y = 0
- attr.cursor = Gdk.Cursor.new_for_display(
- entry.get_display(), Gdk.CursorType.LEFT_PTR)
- #attr.wmclass_name=''
- #attr.wmclass_class=''
- attr.override_redirect=True
- attr.event_mask = (Gdk.EventMask.ENTER_NOTIFY_MASK |
- Gdk.EventMask.LEAVE_NOTIFY_MASK)
- # GTK3 We can we not set title?
- #attr.title = 'icon window'
- attr.wclass = Gdk.WindowWindowClass.INPUT_OUTPUT
- attr.window_type = Gdk.WindowType.CHILD
- attr.visual = entry.get_visual()
- attrmask = (
- #Gdk.WindowAttributesType.TITLE |
- Gdk.WindowAttributesType.X |
- Gdk.WindowAttributesType.Y |
- Gdk.WindowAttributesType.CURSOR |
- Gdk.WindowAttributesType.VISUAL |
- Gdk.WindowAttributesType.NOREDIR
- )
- #the window containing the icon image
- self._icon_win = Gdk.Window(entry.get_window(),
- attr,
- attrmask)
-## Gdk.WindowType.CHILD,
-## (Gdk.EventMask.ENTER_NOTIFY_MASK |
-## Gdk.EventMask.LEAVE_NOTIFY_MASK),
-## Gdk.WindowWindowClass.INPUT_OUTPUT,
-## title='icon window',
-## x=0, y=0,
-## visual=entry.get_visual(),
-## #TODO GTK3: is there alternative for:
-## #colormap=entry.get_colormap(),
-## cursor=Gdk.Cursor.new_for_display(
-## entry.get_display(), Gdk.CursorType.LEFT_PTR),
-## wmclass_name='',
-## wmclass_class='', override_redirect=True)
- self._icon_win.set_user_data(entry)
- #win.set_background(entry.get_style().base[entry.get_state()])
- self._constructed = True
-
- def deconstruct(self):
- if self._icon_win:
- self._icon_win.set_user_data(None)
- # Destroy not needed, called by the GC.
- # TODO GTK3: we see error: Gdk-WARNING **: losing last reference to undestroyed window
- # TODO Investigate
- self._icon_win = None
-
- def update_background(self, color):
- if self._locked:
- return
- if not self._icon_win:
- return
-
- self.draw_pixbuf()
-
- maxvalcol = 65535.
- if color:
- red = int(color.red/ maxvalcol*255)
- green = int(color.green/ maxvalcol*255)
- blue = int(color.blue/ maxvalcol*255)
- rgba = Gdk.RGBA()
- Gdk.RGBA.parse(rgba, 'rgb(%f,%f,%f)'%(red, green, blue))
- self._entry.override_background_color(Gtk.StateFlags.NORMAL, rgba)
- #GTK 3: workaround, background not changing in themes, use symbolic
- self._entry.override_symbolic_color('bg_color', rgba)
- self._entry.override_symbolic_color('theme_bg_color', rgba)
- else:
- self._entry.override_background_color(Gtk.StateFlags.NORMAL, None)
- self._entry.override_symbolic_color('bg_color', None)
- self._entry.override_symbolic_color('theme_bg_color', None)
-
-
- def get_background(self):
- """ Return default background color as a Gdk.Color """
- backcol = self._entry.get_style_context().get_background_color(Gtk.StateType.NORMAL)
- bcol= Gdk.Color.parse('#fff')[1]
- bcol.red = int(backcol.red * 65535)
- bcol.green = int(backcol.green * 65535)
- bcol.blue = int(backcol.blue * 65535)
- return bcol
-
- def resize_windows(self):
- if not self._pixbuf:
- return
-
- icony = iconx = 0
-
- # Make space for the icon, both windows
- # GTK 3 gives for entry the sizes for the entire editor
- geom =self._text_area.get_geometry()
- origx = geom[0]
- origy = geom[1]
- origw = geom[2]
- origh = geom[3]
- textw = origw
- texth = origh
- textw = textw - self._pixw - (iconx + icony)
-
- if self._pos == Gtk.PositionType.LEFT:
- textx, texty = self._text_area_pos
- textx += iconx + self._pixw
-
- # FIXME: Why is this needed. Focus padding?
- # The text jumps without this
- textw -= 2
- self._text_area.move_resize(textx, texty, textw, texth)
- self._recompute()
- elif self._pos == Gtk.PositionType.RIGHT:
- self._text_area.resize(textw, texth)
- iconx += textw
-
- icon_win = self._icon_win
- # XXX: Why?
- if not icon_win:
- return
-
- # If the size of the window is large enough, resize and move it
- # Otherwise just move it to the right side of the entry
- if (icon_win.get_width(), icon_win.get_height()) != (self._pixw, self._pixh):
- icon_win.move_resize(origx + origw - self._pixw, icony + origy, 100, 100)
- icon_win.move_resize(origx + origw - self._pixw, icony + origy, self._pixw, self._pixh)
- else:
- icon_win.move(origx + origw - self._pixw, icony + origy)
-
- def draw_pixbuf(self):
- if not self._pixbuf:
- return
-
- win = self._icon_win
- # XXX: Why?
- if not win:
- return
-
- # Draw background first - not needed with cairo!
- ##color = self._entry.get_style_context().get_background_color(
- ## self._entry.get_state())
-
- # If sensitive draw the icon, regardless of the window emitting the
- # event since makes it a bit smoother on resize
- if self._entry.get_sensitive():
- #GTK 3: we use cairo to draw the pixbuf
- cairo_t = Gdk.cairo_create(win)
- Gdk.cairo_set_source_pixbuf(cairo_t, self._pixbuf, 0, 0)
- cairo_t.new_path()
- cairo_t.move_to (0, 0);
- cairo_t.rel_line_to (win.get_width(), 0);
- cairo_t.rel_line_to (0, win.get_height());
- cairo_t.rel_line_to (-win.get_width(), 0);
- cairo_t.close_path ();
- cairo_t.fill()
-
- def _update_position(self):
- if self._entry.get_property('xalign') > 0.5:
- self._pos = Gtk.PositionType.LEFT
- else:
- self._pos = Gtk.PositionType.RIGHT
-
- def _recompute(self):
- # Protect against re-entrancy when inserting text, happens in DateEntry
- if self._locked:
- return
-
- self._locked = True
-
- # Hack: This triggers a .recompute() which is private
- visibility = self._entry.get_visibility()
- self._entry.set_visibility(not visibility)
- self._entry.set_visibility(visibility)
-
- # Another option would be to call insert_text, however it
- # emits the signal ::changed which is not desirable.
- #self._entry.insert_text('')
-
- self._locked = False
-
-
(DIRECTION_LEFT, DIRECTION_RIGHT) = (1, -1)
(INPUT_ASCII_LETTER,
@@ -683,7 +254,8 @@ class MaskedEntry(UndoableEntry):
self._completion = None
self._exact_completion = False
self._block_changed = False
- self._icon = IconEntry(self)
+ self.hasicon = False
+## self._icon = IconEntry(self)
# List of validators
# str -> static characters
@@ -703,25 +275,25 @@ class MaskedEntry(UndoableEntry):
self.in_do_draw = False
# Virtual methods, note do_size_alloc needs gtk 2.9 +
- def do_size_allocate(self, allocation):
- Gtk.Entry.do_size_allocate(self, allocation)
+## def do_size_allocate(self, allocation):
+## Gtk.Entry.do_size_allocate(self, allocation)
+##
+## if self.get_realized():
+## self._icon.resize_windows()
- if self.get_realized():
- self._icon.resize_windows()
+## def do_draw(self, cairo_t):
+## Gtk.Entry.do_draw(self, cairo_t)
+##
+## if Gtk.cairo_should_draw_window(cairo_t, self.get_window()):
+## self._icon.draw_pixbuf()
- def do_draw(self, cairo_t):
- Gtk.Entry.do_draw(self, cairo_t)
+## def do_realize(self):
+## Gtk.Entry.do_realize(self)
+## self._icon.construct()
- if Gtk.cairo_should_draw_window(cairo_t, self.get_window()):
- self._icon.draw_pixbuf()
-
- def do_realize(self):
- Gtk.Entry.do_realize(self)
- self._icon.construct()
-
- def do_unrealize(self):
- self._icon.deconstruct()
- Gtk.Entry.do_unrealize(self)
+## def do_unrealize(self):
+## self._icon.deconstruct()
+## Gtk.Entry.do_unrealize(self)
# Mask & Fields
@@ -1455,23 +1027,59 @@ class MaskedEntry(UndoableEntry):
# IconEntry
def set_tooltip(self, text):
- self._icon.set_tooltip(text)
+ self.set_icon_tooltip_text(Gtk.EntryIconPosition.SECONDARY, text)
def set_pixbuf(self, pixbuf):
- self._icon.set_pixbuf(pixbuf)
+ self.set_icon_from_pixbuf(Gtk.EntryIconPosition.SECONDARY, pixbuf)
def set_stock(self, stock_name):
- pixbuf = self.render_icon(stock_name, Gtk.IconSize.MENU)
- self._icon.set_pixbuf(pixbuf)
+ self.set_icon_from_stock(Gtk.EntryIconPosition.SECONDARY, stock_name)
- def update_background(self, color):
- self._icon.update_background(color)
+ def update_background(self, color, unset=False):
+ maxvalcol = 65535.
+ if color:
+ red = int(color.red/ maxvalcol*255)
+ green = int(color.green/ maxvalcol*255)
+ blue = int(color.blue/ maxvalcol*255)
+ rgba = Gdk.RGBA()
+ Gdk.RGBA.parse(rgba, 'rgb(%f,%f,%f)'%(red, green, blue))
+ self.override_background_color(Gtk.StateFlags.NORMAL |
+ Gtk.StateFlags.ACTIVE | Gtk.StateFlags.SELECTED |
+ Gtk.StateFlags.FOCUSED, rgba)
+ #GTK 3: workaround, background not changing in themes, use symbolic
+ self.override_symbolic_color('bg_color', rgba)
+ self.override_symbolic_color('base_color', rgba)
+ self.override_symbolic_color('theme_bg_color', rgba)
+ self.override_symbolic_color('theme_base_color', rgba)
+ self.get_window().set_background_rgba(rgba)
+ pango_context = self.get_layout().get_context()
+ font_description = pango_context.get_font_description()
+ if unset:
+ font_description.set_weight(Pango.Weight.NORMAL)
+ else:
+ font_description.set_weight(Pango.Weight.BOLD)
+ self.override_font(font_description)
+ else:
+ self.override_background_color(Gtk.StateFlags.NORMAL |
+ Gtk.StateFlags.ACTIVE | Gtk.StateFlags.SELECTED |
+ Gtk.StateFlags.FOCUSED, None)
+ # Setting the following to None causes an error (bug #6353).
+ #self.override_symbolic_color('bg_color', None)
+ #self.override_symbolic_color('base_color', None)
+ #self.override_symbolic_color('theme_bg_color', None)
+ #self.override_symbolic_color('theme_base_color', None)
+ pango_context = self.get_layout().get_context()
+ font_description = pango_context.get_font_description()
+ font_description.set_weight(Pango.Weight.NORMAL)
+ self.override_font(font_description)
def get_background(self):
- return self._icon.get_background()
-
- def get_icon_window(self):
- return self._icon.get_icon_window()
+ backcol = self.get_style_context().get_background_color(Gtk.StateType.NORMAL)
+ bcol= Gdk.Color.parse('#fff')[1]
+ bcol.red = int(backcol.red * 65535)
+ bcol.green = int(backcol.green * 65535)
+ bcol.blue = int(backcol.blue * 65535)
+ return bcol
# Gtk.EntryCompletion convenience function
@@ -1674,7 +1282,6 @@ class ValidatableMaskedEntry(MaskedEntry):
"""Change the validation state to valid, which will remove icons and
reset the background color
"""
-
##_LOG.debug('Setting state for %s to VALID' % self.model_attribute)
self._set_valid_state(True)
diff --git a/gramps/guiQML/viewmanager.py b/gramps/guiQML/viewmanager.py
index 4193c15fc..33cabb6f8 100644
--- a/gramps/guiQML/viewmanager.py
+++ b/gramps/guiQML/viewmanager.py
@@ -63,7 +63,8 @@ from PySide import QtOpenGL
#-------------------------------------------------------------------------
from gramps.gen.const import ROOT_DIR
from gramps.cli.grampscli import CLIManager, CLIDbLoader
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from guiQML.views.dbman import DbManager
from guiQML.questiondialog import ErrorDialog
diff --git a/gramps/guiQML/views/centralview.py b/gramps/guiQML/views/centralview.py
index fc35bc22a..7dee2ce0f 100644
--- a/gramps/guiQML/views/centralview.py
+++ b/gramps/guiQML/views/centralview.py
@@ -64,7 +64,8 @@ from PySide import QtOpenGL
#
#-------------------------------------------------------------------------
from gramps.gen.const import ROOT_DIR
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.constfunc import cuni, UNITYPE
diff --git a/gramps/guiQML/views/dbman.py b/gramps/guiQML/views/dbman.py
index 07be1293e..a831df7bf 100644
--- a/gramps/guiQML/views/dbman.py
+++ b/gramps/guiQML/views/dbman.py
@@ -65,7 +65,8 @@ from PySide import QtOpenGL
#-------------------------------------------------------------------------
from gramps.gen.const import IMAGE_DIR, ROOT_DIR
from gramps.cli.clidbman import CLIDbManager, NAME_FILE, time_val
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.constfunc import cuni, UNITYPE
#-------------------------------------------------------------------------
diff --git a/gramps/guiQML/views/personview.py b/gramps/guiQML/views/personview.py
index d39b0d5ba..1583ece8c 100644
--- a/gramps/guiQML/views/personview.py
+++ b/gramps/guiQML/views/personview.py
@@ -59,7 +59,8 @@ from PySide import QtOpenGL
from gramps.gen.const import ROOT_DIR
from gramps.gen.constfunc import cuni, UNITYPE
from gramps.gui.views.treemodels import conv_unicode_tosrtkey
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.display.name import displayer as name_displayer
from gramps.gen.lib import Name
##TODO: follow must be refractored so as not to require GTK
diff --git a/gramps/plugins/docgen/asciidoc.py b/gramps/plugins/docgen/asciidoc.py
index 99ef89b27..b74964afa 100644
--- a/gramps/plugins/docgen/asciidoc.py
+++ b/gramps/plugins/docgen/asciidoc.py
@@ -30,13 +30,15 @@
# python modules
#
#------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
-
+import io
+import sys
#------------------------------------------------------------------------
#
# Gramps modules
#
#------------------------------------------------------------------------
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.plug.docgen import (BaseDoc, TextDoc,
PARA_ALIGN_RIGHT, PARA_ALIGN_CENTER)
from gramps.gen.errors import ReportError
@@ -155,12 +157,12 @@ class AsciiDoc(BaseDoc,TextDoc):
self.filename = filename
try:
- self.f = open(self.filename,"w")
- except IOError as msg:
+ self.f = io.open(self.filename,"w",
+ encoding='ascii',
+ errors = 'backslashreplace')
+ except Exception as msg:
errmsg = "%s\n%s" % (_("Could not create %s") % self.filename, msg)
raise ReportError(errmsg)
- except:
- raise ReportError(_("Could not create %s") % self.filename)
self.in_cell = 0
self.text = ""
diff --git a/gramps/plugins/docgen/docgen.gpr.py b/gramps/plugins/docgen/docgen.gpr.py
index 9ecbb2226..8aab0ba65 100644
--- a/gramps/plugins/docgen/docgen.gpr.py
+++ b/gramps/plugins/docgen/docgen.gpr.py
@@ -31,7 +31,7 @@ plg.id = 'asciidoc'
plg.name = _("Plain Text")
plg.description = _("Generates documents in plain text format (.txt).")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'asciidoc.py'
plg.ptype = DOCGEN
@@ -52,7 +52,7 @@ plg.id = 'gtkprint'
plg.name = _('Print...')
plg.description = _("Generates documents and prints them directly.")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'gtkprint.py'
plg.ptype = DOCGEN
@@ -73,7 +73,7 @@ plg.id = 'htmldoc'
plg.name = _('HTML')
plg.description = _("Generates documents in HTML format.")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'htmldoc.py'
plg.ptype = DOCGEN
@@ -94,7 +94,7 @@ plg.id = 'latexdoc'
plg.name = _('LaTeX')
plg.description = _("Generates documents in LaTeX format.")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'latexdoc.py'
plg.ptype = DOCGEN
@@ -116,7 +116,7 @@ plg.name = _('OpenDocument Text')
plg.description = _("Generates documents in OpenDocument "
"Text format (.odt).")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'odfdoc.py'
plg.ptype = DOCGEN
@@ -137,7 +137,7 @@ plg.id = 'pdfdoc'
plg.name = _('PDF document')
plg.description = _("Generates documents in PDF format (.pdf).")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'pdfdoc.py'
plg.ptype = DOCGEN
@@ -158,7 +158,7 @@ plg.id = 'psdrawdoc'
plg.name = _('PostScript')
plg.description = _("Generates documents in PostScript format (.ps).")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'psdrawdoc.py'
plg.ptype = DOCGEN
@@ -179,7 +179,7 @@ plg.id = 'rftdoc'
plg.name = _('RTF document')
plg.description = _("Generates documents in Rich Text format (.rtf).")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'rtfdoc.py'
plg.ptype = DOCGEN
@@ -201,7 +201,7 @@ plg.name = _('SVG document')
plg.description = _("Generates documents in Scalable "
"Vector Graphics format (.svg).")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'svgdrawdoc.py'
plg.ptype = DOCGEN
diff --git a/gramps/plugins/docgen/gtkprint.py b/gramps/plugins/docgen/gtkprint.py
index c53a5aaa9..0216a8f30 100644
--- a/gramps/plugins/docgen/gtkprint.py
+++ b/gramps/plugins/docgen/gtkprint.py
@@ -29,7 +29,8 @@ from __future__ import division
# Python modules
#
#------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from math import radians
#------------------------------------------------------------------------
diff --git a/gramps/plugins/docgen/htmldoc.py b/gramps/plugins/docgen/htmldoc.py
index d1bdbe459..e027c3c71 100644
--- a/gramps/plugins/docgen/htmldoc.py
+++ b/gramps/plugins/docgen/htmldoc.py
@@ -39,13 +39,14 @@ Report output generator for html documents, based on Html and HtmlBackend
import os
import shutil
import time
-from gramps.gen.ggettext import gettext as _
#------------------------------------------------------------------------
#
# GRAMPS modules
#
#------------------------------------------------------------------------
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.utils.image import resize_to_jpeg
from gramps.gen.const import DATA_DIR, WEBSTUFF_IMAGE_DIR, PROGRAM_NAME, URL_HOMEPAGE, VERSION
from gramps.gen.plug.docgen import BaseDoc, TextDoc, FONT_SANS_SERIF, URL_PATTERN
diff --git a/gramps/plugins/docgen/latexdoc.py b/gramps/plugins/docgen/latexdoc.py
index 24bba64f0..4eda5a6d9 100644
--- a/gramps/plugins/docgen/latexdoc.py
+++ b/gramps/plugins/docgen/latexdoc.py
@@ -37,9 +37,12 @@
# python modules
#
#------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from bisect import bisect
import re, os, sys
+import logging
+_LOG = logging.getLogger(".latexdoc")
#----------------------------------------------------------------------- -
#
@@ -48,7 +51,14 @@ import re, os, sys
#------------------------------------------------------------------------
from gramps.gen.plug.docgen import BaseDoc, TextDoc, PAPER_LANDSCAPE, FONT_SANS_SERIF, URL_PATTERN
from gramps.gen.plug.docbackend import DocBackend
-import Image
+HAVE_PIL = False
+try:
+ from PIL import Image
+ HAVE_PIL = True
+except:
+ _LOG.warning(
+ _('No PIL Image installed for your python version, cannot produce jpg '
+ 'images from non-jpg images in LaTex Documents'))
_CLICKABLE = r'''\url{\1}'''
@@ -1203,7 +1213,9 @@ class LaTeXDoc(BaseDoc, TextDoc):
outfile = os.path.splitext(infile)[0]
pictname = latexescape(os.path.split(outfile)[1])
outfile = ''.join((outfile, '.jpg'))
- if infile != outfile:
+ outfile2 = ''.join((outfile, '.jpeg'))
+ outfile3 = ''.join((outfile, '.png'))
+ if HAVE_PIL and infile not in [outfile, outfile2, outfile3] :
try:
curr_img = Image.open(infile)
curr_img.save(outfile)
@@ -1214,6 +1226,11 @@ class LaTeXDoc(BaseDoc, TextDoc):
self.emit(''.join(('%\n *** Error: cannot convert ', infile,
'\n *** to ', outfile,
'%\n')))
+ elif not HAVE_PIL:
+ self.emit(''.join(('%\n *** Error: cannot convert ', infile,
+ '\n *** to ', outfile,
+ 'PIL not installed %\n')))
+
if self.in_table:
self.pict_in_table = True
@@ -1222,7 +1239,6 @@ class LaTeXDoc(BaseDoc, TextDoc):
self.pict_width = x
self.pict_height = y
-
def write_text(self,text,mark=None,links=False):
"""Write the text to the file"""
if text == '\n':
diff --git a/gramps/plugins/docgen/odfdoc.py b/gramps/plugins/docgen/odfdoc.py
index 30e073b7f..832df55f8 100644
--- a/gramps/plugins/docgen/odfdoc.py
+++ b/gramps/plugins/docgen/odfdoc.py
@@ -101,7 +101,8 @@ from gramps.gen.errors import ReportError
# internationalization
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
_apptype = 'application/vnd.oasis.opendocument.text'
@@ -1017,7 +1018,10 @@ class ODFDoc(BaseDoc, TextDoc, DrawDoc):
return
not_extension, extension = os.path.splitext(file_name)
- odf_name = md5(file_name).hexdigest() + extension
+ file_name_hash = file_name
+ if sys.version_info[0] >= 3:
+ file_name_hash = file_name_hash.encode('utf-8')
+ odf_name = md5(file_name_hash).hexdigest() + extension
media_list_item = (file_name, odf_name)
if not media_list_item in self.media_list:
@@ -1180,7 +1184,9 @@ class ODFDoc(BaseDoc, TextDoc, DrawDoc):
"""
Add a zip file to an archive
"""
- zipinfo = zipfile.ZipInfo(name.encode('utf-8'))
+ if sys.version_info[0] < 3:
+ name = name.encode('utf-8')
+ zipinfo = zipfile.ZipInfo(name)
zipinfo.date_time = t
zipinfo.compress_type = zipfile.ZIP_DEFLATED
zipinfo.external_attr = 0o644 << 16
diff --git a/gramps/plugins/docgen/pdfdoc.py b/gramps/plugins/docgen/pdfdoc.py
index 4d06579a4..3f2dc22c9 100644
--- a/gramps/plugins/docgen/pdfdoc.py
+++ b/gramps/plugins/docgen/pdfdoc.py
@@ -29,7 +29,8 @@
# Python modules
#
#------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import sys
#------------------------------------------------------------------------
@@ -86,14 +87,17 @@ class PdfDoc(libcairodoc.CairoDoc):
top_margin = self.paper.get_top_margin() * DPI / 2.54
# create cairo context and pango layout
- filename = self._backend.filename.encode(sys.getfilesystemencoding())
+ filename = self._backend.filename
+ if sys.version_info[0] < 3:
+ filename = self._backend.filename.encode(glocale.getfilesystemencoding())
try:
surface = cairo.PDFSurface(filename, paper_width, paper_height)
except IOError as msg:
errmsg = "%s\n%s" % (_("Could not create %s") % filename, msg)
raise ReportError(errmsg)
- except:
- raise ReportError(_("Could not create %s") % filename)
+ except Exception as err:
+ errmsg = "%s\n%s" % (_("Could not create %s") % filename, err)
+ raise ReportError(errmsg)
surface.set_fallback_resolution(300, 300)
cr = cairo.Context(surface)
fontmap = PangoCairo.font_map_new()
diff --git a/gramps/plugins/docgen/psdrawdoc.py b/gramps/plugins/docgen/psdrawdoc.py
index 03922ae3f..84cfe5140 100644
--- a/gramps/plugins/docgen/psdrawdoc.py
+++ b/gramps/plugins/docgen/psdrawdoc.py
@@ -32,11 +32,12 @@ PostScript document generator.
# python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
-
+
#-------------------------------------------------------------------------
#Gramps modules
#-------------------------------------------------------------------------
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.plug.report import utils as ReportUtils
from gramps.gen.plug.docgen import BaseDoc, DrawDoc, FONT_SERIF, PAPER_PORTRAIT, SOLID
from gramps.gen.plug.utils import gformat
diff --git a/gramps/plugins/docgen/rtfdoc.py b/gramps/plugins/docgen/rtfdoc.py
index 3a5e98681..1e36e7b38 100644
--- a/gramps/plugins/docgen/rtfdoc.py
+++ b/gramps/plugins/docgen/rtfdoc.py
@@ -31,7 +31,8 @@
#------------------------------------------------------------------------
from __future__ import print_function
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import logging
LOG = logging.getLogger(".rtfdoc")
@@ -295,7 +296,7 @@ class RTFDoc(BaseDoc,TextDoc):
self.text += '}'
def start_superscript(self):
- self.text += '{{\*\updnprop5801}\up10 '
+ self.text += '{{\\*\\updnprop5801}\\up10 '
def end_superscript(self):
self.text += '}'
diff --git a/gramps/plugins/docgen/svgdrawdoc.py b/gramps/plugins/docgen/svgdrawdoc.py
index f6a7e108c..ef17972d4 100644
--- a/gramps/plugins/docgen/svgdrawdoc.py
+++ b/gramps/plugins/docgen/svgdrawdoc.py
@@ -31,7 +31,6 @@ SVG document generator.
# python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
import sys
if sys.version_info[0] < 3:
from StringIO import StringIO
@@ -43,6 +42,8 @@ else:
# Gramps modules
#
#-------------------------------------------------------------------------
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.plug.docgen import BaseDoc, DrawDoc, SOLID, FONT_SANS_SERIF
from gramps.gen.errors import ReportError
diff --git a/gramps/plugins/drawreport/ancestortree.py b/gramps/plugins/drawreport/ancestortree.py
index ca297a263..2381530a7 100644
--- a/gramps/plugins/drawreport/ancestortree.py
+++ b/gramps/plugins/drawreport/ancestortree.py
@@ -39,7 +39,8 @@ def log2(val):
X_INDEX = log2
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
#------------------------------------------------------------------------
#
diff --git a/gramps/plugins/drawreport/calendarreport.py b/gramps/plugins/drawreport/calendarreport.py
index 3145ae36a..8f623e24a 100644
--- a/gramps/plugins/drawreport/calendarreport.py
+++ b/gramps/plugins/drawreport/calendarreport.py
@@ -26,8 +26,8 @@
# python modules
#
#------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
-from gramps.gen.ggettext import ngettext
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from functools import partial
import datetime
import time
@@ -255,10 +255,9 @@ class Calendar(Report):
last_edge = 0
font_height = pt2cm(1.5 * ptext1style.get_font().get_size())
x = last_edge + (width - last_edge)/2
- y = height - font_height
- self.doc.center_text("CAL-Text1style", self.text1, x, y * 3)
- self.doc.center_text("CAL-Text2style", self.text2, x, y * 2)
- self.doc.center_text("CAL-Text3style", self.text3, x, y * 1)
+ self.doc.center_text("CAL-Text1style", self.text1, x, height - font_height * 3)
+ self.doc.center_text("CAL-Text2style", self.text2, x, height - font_height * 2)
+ self.doc.center_text("CAL-Text3style", self.text3, x, height - font_height * 1)
self.doc.end_page()
def collect_data(self):
@@ -323,7 +322,7 @@ class Calendar(Report):
'person' : short_name,
'relation' : ""}
else:
- text = (ngettext('%(person)s, %(age)d%(relation)s',
+ text = (glocale.get_translation().ngettext('%(person)s, %(age)d%(relation)s',
'%(person)s, %(age)d%(relation)s', nyears)
% {'person' : short_name,
'age' : nyears,
@@ -383,7 +382,7 @@ class Calendar(Report):
'person' : short_name,
}
else:
- text = (ngettext("%(spouse)s and\n %(person)s, %(nyears)d",
+ text = (glocale.get_translation().ngettext("%(spouse)s and\n %(person)s, %(nyears)d",
"%(spouse)s and\n %(person)s, %(nyears)d", nyears)
% {'spouse' : spouse_name,
'person' : short_name,
diff --git a/gramps/plugins/drawreport/descendtree.py b/gramps/plugins/drawreport/descendtree.py
index 696803898..53ad67649 100644
--- a/gramps/plugins/drawreport/descendtree.py
+++ b/gramps/plugins/drawreport/descendtree.py
@@ -34,7 +34,8 @@ from __future__ import division
# GRAMPS modules
#
#------------------------------------------------------------------------
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gen.errors import ReportError
diff --git a/gramps/plugins/drawreport/drawplugins.gpr.py b/gramps/plugins/drawreport/drawplugins.gpr.py
index e01edb8b5..b2b8eb0f0 100644
--- a/gramps/plugins/drawreport/drawplugins.gpr.py
+++ b/gramps/plugins/drawreport/drawplugins.gpr.py
@@ -32,7 +32,7 @@ plg.id = 'ancestor_chart,BKI'
plg.name = _("Ancestor Chart")
plg.description = _("Produces a graphical ancestral chart")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'ancestortree.py'
plg.ptype = REPORT
@@ -48,7 +48,7 @@ plg.id = 'ancestor_chart'
plg.name = _("Ancestor Tree")
plg.description = _("Produces a graphical ancestral tree")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'ancestortree.py'
plg.ptype = REPORT
@@ -70,7 +70,7 @@ plg.id = 'calendar'
plg.name = _("Calendar")
plg.description = _("Produces a graphical calendar")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'calendarreport.py'
plg.ptype = REPORT
@@ -92,7 +92,7 @@ plg.id = 'descend_chart,BKI'
plg.name = _("Descendant Chart")
plg.description = _("Produces a graphical descendant chart")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'descendtree.py'
plg.ptype = REPORT
@@ -108,7 +108,7 @@ plg.id = 'descend_chart'
plg.name = _("Descendant Tree")
plg.description = _("Produces a graphical descendant tree")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'descendtree.py'
plg.ptype = REPORT
@@ -134,7 +134,7 @@ plg.status = STABLE
plg.fname = 'descendtree.py'
plg.ptype = REPORT
plg.category = CATEGORY_DRAW
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.authors = ["Craig J. Anderson"]
plg.authors_email = ["ander882@hotmail.com"]
plg.require_active = True
@@ -151,7 +151,7 @@ plg.status = STABLE
plg.fname = 'descendtree.py'
plg.ptype = REPORT
plg.category = CATEGORY_DRAW
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.authors = ["Craig J. Anderson"]
plg.authors_email = ["ander882@hotmail.com"]
plg.require_active = True
@@ -170,7 +170,7 @@ plg.id = 'fan_chart'
plg.name = _("Fan Chart")
plg.description = _("Produces fan charts")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'fanchart.py'
plg.ptype = REPORT
@@ -193,7 +193,7 @@ plg.name = _("Statistics Charts")
plg.description = _("Produces statistical bar and pie charts of the people "
"in the database")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'statisticschart.py'
plg.ptype = REPORT
@@ -216,7 +216,7 @@ plg.id = 'timeline'
plg.name = _("Timeline Chart")
plg.description = _("Produces a timeline chart.")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'timeline.py'
plg.ptype = REPORT
diff --git a/gramps/plugins/drawreport/fanchart.py b/gramps/plugins/drawreport/fanchart.py
index 61de2ec32..f74db8c4d 100644
--- a/gramps/plugins/drawreport/fanchart.py
+++ b/gramps/plugins/drawreport/fanchart.py
@@ -28,7 +28,8 @@
# python modules
#
#------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from math import pi, cos, sin, log10, acos
def log2(val):
diff --git a/gramps/plugins/drawreport/statisticschart.py b/gramps/plugins/drawreport/statisticschart.py
index d35d2191e..311a96cac 100644
--- a/gramps/plugins/drawreport/statisticschart.py
+++ b/gramps/plugins/drawreport/statisticschart.py
@@ -34,7 +34,8 @@ from __future__ import division
#
#------------------------------------------------------------------------
import time
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from functools import partial
#------------------------------------------------------------------------
diff --git a/gramps/plugins/drawreport/timeline.py b/gramps/plugins/drawreport/timeline.py
index 4148b5b42..a0dc4a12d 100644
--- a/gramps/plugins/drawreport/timeline.py
+++ b/gramps/plugins/drawreport/timeline.py
@@ -33,7 +33,8 @@ from __future__ import division
# python modules
#
#------------------------------------------------------------------------
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
#------------------------------------------------------------------------
#
diff --git a/gramps/plugins/export/export.gpr.py b/gramps/plugins/export/export.gpr.py
index 3572f6657..61129f936 100644
--- a/gramps/plugins/export/export.gpr.py
+++ b/gramps/plugins/export/export.gpr.py
@@ -32,7 +32,7 @@ plg.name = _("Comma Separated Values Spreadsheet (CSV)")
plg.name_accell = _("Comma _Separated Values Spreadsheet (CSV)")
plg.description = _("CSV is a common spreadsheet format.")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'exportcsv.py'
plg.ptype = EXPORT
@@ -53,7 +53,7 @@ plg.name = _('Web Family Tree')
plg.name_accell = _('_Web Family Tree')
plg.description = _("Web Family Tree format")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'exportftree.py'
plg.ptype = EXPORT
@@ -75,7 +75,7 @@ plg.name_accell = _('GE_DCOM')
plg.description = _('GEDCOM is used to transfer data between genealogy programs. '
'Most genealogy software will accept a GEDCOM file as input.')
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'exportgedcom.py'
plg.ptype = EXPORT
@@ -96,7 +96,7 @@ plg.name = _('GeneWeb')
plg.name_accell = _('_GeneWeb')
plg.description = _('GeneWeb is a web based genealogy program.')
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'exportgeneweb.py'
plg.ptype = EXPORT
@@ -118,7 +118,7 @@ plg.name_accell = _('Gra_mps XML Package (family tree and media)')
plg.description = _('Gramps package is an archived XML family tree together '
'with the media object files.')
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'exportpkg.py'
plg.ptype = EXPORT
@@ -141,7 +141,7 @@ plg.description = _('Gramps XML export is a complete archived XML backup of a'
' Gramps family tree without the media object files.'
' Suitable for backup purposes.')
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'exportxml.py'
plg.ptype = EXPORT
@@ -162,7 +162,7 @@ plg.name = _('vCalendar')
plg.name_accell = _('vC_alendar')
plg.description = _('vCalendar is used in many calendaring and PIM applications.')
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'exportvcalendar.py'
plg.ptype = EXPORT
@@ -183,7 +183,7 @@ plg.name = _('vCard')
plg.name_accell = _('_vCard')
plg.description = _('vCard is used in many addressbook and pim applications.')
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'exportvcard.py'
plg.ptype = EXPORT
diff --git a/gramps/plugins/export/exportcsv.glade b/gramps/plugins/export/exportcsv.glade
index 7637992e6..cbb195b41 100644
--- a/gramps/plugins/export/exportcsv.glade
+++ b/gramps/plugins/export/exportcsv.glade
@@ -110,13 +110,15 @@
True
False
0
- <b>Options</b>
- True
+ Options
+
+
+
3
GTK_FILL
-
+
@@ -133,7 +135,7 @@
1
2
GTK_FILL
-
+
@@ -178,7 +180,7 @@
1
2
GTK_FILL
-
+
@@ -200,7 +202,7 @@
2
3
GTK_FILL
-
+
@@ -220,7 +222,7 @@
1
2
GTK_FILL
-
+
@@ -252,7 +254,7 @@
4
5
GTK_FILL
-
+
@@ -278,7 +280,7 @@
2
3
GTK_FILL
-
+
diff --git a/gramps/plugins/export/exportcsv.py b/gramps/plugins/export/exportcsv.py
index 30b161021..e8d0e3f15 100644
--- a/gramps/plugins/export/exportcsv.py
+++ b/gramps/plugins/export/exportcsv.py
@@ -32,7 +32,8 @@
#-------------------------------------------------------------------------
import os
import sys
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
import csv
if sys.version_info[0] < 3:
from cStringIO import StringIO
diff --git a/gramps/plugins/export/exportftree.glade b/gramps/plugins/export/exportftree.glade
index 81376cf7d..36f9bbeb7 100644
--- a/gramps/plugins/export/exportftree.glade
+++ b/gramps/plugins/export/exportftree.glade
@@ -116,13 +116,15 @@
True
False
0
- <b>Options</b>
- True
+ Options
+
+
+
3
GTK_FILL
-
+
@@ -139,7 +141,7 @@
1
2
GTK_SHRINK | GTK_FILL
-
+
@@ -161,7 +163,7 @@
2
3
GTK_FILL
-
+
diff --git a/gramps/plugins/export/exportftree.py b/gramps/plugins/export/exportftree.py
index 1b3a82baf..c030d0ead 100644
--- a/gramps/plugins/export/exportftree.py
+++ b/gramps/plugins/export/exportftree.py
@@ -30,7 +30,8 @@
#
#-------------------------------------------------------------------------
import os
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#------------------------------------------------------------------------
#
diff --git a/gramps/plugins/export/exportgedcom.py b/gramps/plugins/export/exportgedcom.py
index 5af52f266..5ecba9c19 100644
--- a/gramps/plugins/export/exportgedcom.py
+++ b/gramps/plugins/export/exportgedcom.py
@@ -33,15 +33,17 @@
# Standard Python Modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
import os
import time
+import io
#-------------------------------------------------------------------------
#
# GRAMPS modules
#
#-------------------------------------------------------------------------
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.lib import AttributeType, ChildRefType, Citation, Date, EventRoleType, EventType, LdsOrd, NameType, NoteType, Person, UrlType
from gramps.gen.const import VERSION
import gramps.plugins.lib.libgedcom as libgedcom
@@ -234,7 +236,7 @@ class GedcomWriter(UpdateCallback):
"""
self.dirname = os.path.dirname (filename)
- self.gedcom_file = open(filename, "w")
+ self.gedcom_file = io.open(filename, "w", encoding='utf-8')
self._header(filename)
self._submitter()
self._individuals()
diff --git a/gramps/plugins/export/exportgeneweb.glade b/gramps/plugins/export/exportgeneweb.glade
index 525833953..a222c26be 100644
--- a/gramps/plugins/export/exportgeneweb.glade
+++ b/gramps/plugins/export/exportgeneweb.glade
@@ -118,13 +118,15 @@
True
False
0
- <b>Options</b>
- True
+ Options
+
+
+
3
GTK_FILL
-
+
@@ -141,7 +143,7 @@
1
2
GTK_FILL
-
+
@@ -165,7 +167,7 @@
3
4
GTK_FILL
-
+
@@ -185,6 +187,9 @@
+
+
+
Exclude _notes
@@ -204,7 +209,7 @@
1
2
GTK_FILL
-
+
@@ -224,7 +229,7 @@
1
2
GTK_FILL
-
+
diff --git a/gramps/plugins/export/exportgeneweb.py b/gramps/plugins/export/exportgeneweb.py
index c722f346f..e068e5638 100644
--- a/gramps/plugins/export/exportgeneweb.py
+++ b/gramps/plugins/export/exportgeneweb.py
@@ -31,7 +31,8 @@
#
#-------------------------------------------------------------------------
import os
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#------------------------------------------------------------------------
#
diff --git a/gramps/plugins/export/exportpkg.py b/gramps/plugins/export/exportpkg.py
index 26bed467e..7f2ec37fb 100644
--- a/gramps/plugins/export/exportpkg.py
+++ b/gramps/plugins/export/exportpkg.py
@@ -40,7 +40,8 @@ if sys.version_info[0] < 3:
from cStringIO import StringIO
else:
from io import StringIO
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#------------------------------------------------------------------------
#
@@ -63,7 +64,7 @@ from gi.repository import Gtk
#
#-------------------------------------------------------------------------
from gramps.gui.plug.export import WriterOptionBox
-from exportxml import XmlWriter
+from gramps.plugins.export.exportxml import XmlWriter
from gramps.gen.utils.file import media_path_full, get_unicode_path_from_file_chooser
from gramps.gen.constfunc import win
@@ -214,7 +215,10 @@ class PackageWriter(object):
# select_clicked()
# Write XML now
- g = StringIO()
+ if sys.version_info[0] < 3:
+ g = StringIO()
+ else:
+ g = io.BytesIO()
gfile = XmlWriter(self.db, self.user, 2)
gfile.write_handle(g)
tarinfo = tarfile.TarInfo('data.gramps')
diff --git a/gramps/plugins/export/exportvcalendar.glade b/gramps/plugins/export/exportvcalendar.glade
index d691d8877..5462be56a 100644
--- a/gramps/plugins/export/exportvcalendar.glade
+++ b/gramps/plugins/export/exportvcalendar.glade
@@ -97,13 +97,15 @@
True
False
0
- <b>Options</b>
- True
+ Options
+
+
+
3
GTK_FILL
-
+
@@ -118,7 +120,7 @@
1
2
GTK_FILL
-
+
diff --git a/gramps/plugins/export/exportvcalendar.py b/gramps/plugins/export/exportvcalendar.py
index 1deb7c49f..881da3576 100644
--- a/gramps/plugins/export/exportvcalendar.py
+++ b/gramps/plugins/export/exportvcalendar.py
@@ -32,7 +32,6 @@
import os
import sys
from time import localtime
-from gramps.gen.ggettext import gettext as _
#------------------------------------------------------------------------
#
@@ -48,6 +47,8 @@ log = logging.getLogger(".ExportVCal")
# GRAMPS modules
#
#-------------------------------------------------------------------------
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gui.plug.export import WriterOptionBox
from gramps.gen.utils.db import family_name
from gramps.gen.lib import Date, EventType
@@ -89,8 +90,7 @@ class CalendarWriter(object):
self.oldval = newval
def writeln(self, text):
- #self.g.write('%s\n' % (text.encode('iso-8859-1')))
- self.g.write('%s\n' % (text.encode(sys.getfilesystemencoding())))
+ self.g.write('%s\n' % text.encode('ascii', 'backslashreplace'))
def export_data(self, filename):
diff --git a/gramps/plugins/export/exportvcard.glade b/gramps/plugins/export/exportvcard.glade
index afe5b962e..6c82c5ff9 100644
--- a/gramps/plugins/export/exportvcard.glade
+++ b/gramps/plugins/export/exportvcard.glade
@@ -106,13 +106,15 @@
True
False
0
- <b>Options</b>
- True
+ Options
+
+
+
3
GTK_FILL
-
+
@@ -127,7 +129,7 @@
1
2
GTK_FILL
-
+
diff --git a/gramps/plugins/export/exportvcard.py b/gramps/plugins/export/exportvcard.py
index 853c3ec56..03cf93718 100644
--- a/gramps/plugins/export/exportvcard.py
+++ b/gramps/plugins/export/exportvcard.py
@@ -47,7 +47,8 @@ log = logging.getLogger(".ExportVCard")
# GRAMPS modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gui.plug.export import WriterOptionBox
from gramps.gen.const import PROGRAM_NAME, VERSION
from gramps.gen.lib import Date
@@ -144,12 +145,11 @@ class VCardWriter(object):
Can't cope with nested VCards, section 2.4.2 of RFC 2426.
"""
- sysencoding = sys.getfilesystemencoding()
self.filehandle.write('%s\r\n' % '\r\n'.join(
- [line.encode(sysencoding) for line in self.txtwrp.wrap(text)]))
+ [line.encode('utf-8') for line in self.txtwrp.wrap(text)]))
def export_data(self):
- """Open the file and loop over everyone two write their VCards."""
+ """Open the file and loop over everyone too write their VCards."""
with OpenFileOrStdout(self.filename) as self.filehandle:
if self.filehandle:
self.count = 0
diff --git a/gramps/plugins/export/exportxml.py b/gramps/plugins/export/exportxml.py
index 424e37f9c..c97c031e5 100644
--- a/gramps/plugins/export/exportxml.py
+++ b/gramps/plugins/export/exportxml.py
@@ -41,7 +41,8 @@ import shutil
import os
import codecs
from xml.sax.saxutils import escape
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#------------------------------------------------------------------------
@@ -121,7 +122,7 @@ class GrampsXmlWriter(UpdateCallback):
self.status = None
- def write(self,filename):
+ def write(self, filename):
"""
Write the database to the specified file.
"""
@@ -180,7 +181,7 @@ class GrampsXmlWriter(UpdateCallback):
if self.compress and _gzip_ok:
try:
- g = gzip.GzipFile(mode="wb",fileobj=handle)
+ g = gzip.GzipFile(mode="wb", fileobj=handle)
except:
g = handle
else:
@@ -583,6 +584,10 @@ class GrampsXmlWriter(UpdateCallback):
self.write_media_list(citation.get_media_list(), index+1)
self.write_data_map(citation.get_data_map())
self.write_ref("sourceref", citation.get_reference_handle(), index+1)
+
+ for tag_handle in citation.get_tag_list():
+ self.write_ref("tagref", tag_handle, index+1)
+
self.g.write("%s\n" % sp)
def write_source(self,source,index=1):
@@ -596,6 +601,10 @@ class GrampsXmlWriter(UpdateCallback):
self.write_media_list(source.get_media_list(),index+1)
self.write_data_map(source.get_data_map())
self.write_reporef_list(source.get_reporef_list(),index+1)
+
+ for tag_handle in source.get_tag_list():
+ self.write_ref("tagref", tag_handle, index+1)
+
self.g.write("%s\n" % sp)
def write_repository(self,repo,index=1):
@@ -611,6 +620,10 @@ class GrampsXmlWriter(UpdateCallback):
# url list
self.write_url_list(repo.get_url_list(),index+1)
self.write_note_list(repo.get_note_list(),index+1)
+
+ for tag_handle in repo.get_tag_list():
+ self.write_ref("tagref", tag_handle, index+1)
+
self.g.write("%s\n" % sp)
def write_address_list(self, obj,index=1):
@@ -721,6 +734,10 @@ class GrampsXmlWriter(UpdateCallback):
for citation_handle in event.get_citation_list():
self.write_ref("citationref", citation_handle, index+1)
self.write_media_list(event.get_media_list(),index+1)
+
+ for tag_handle in event.get_tag_list():
+ self.write_ref("tagref", tag_handle, index+1)
+
self.g.write("%s\n" % sp)
def dump_ordinance(self, ord,index=1):
@@ -1186,6 +1203,10 @@ class GrampsXmlWriter(UpdateCallback):
self.write_note_list(place.get_note_list(), index+1)
for citation_handle in place.get_citation_list():
self.write_ref("citationref", citation_handle, index+1)
+
+ for tag_handle in place.get_tag_list():
+ self.write_ref("tagref", tag_handle, index+1)
+
self.g.write("%s\n" % (" "*index))
def write_object(self, obj, index=1):
diff --git a/gramps/plugins/export/test/exportVCard_test.py b/gramps/plugins/export/test/exportvcard_test.py
similarity index 100%
rename from gramps/plugins/export/test/exportVCard_test.py
rename to gramps/plugins/export/test/exportvcard_test.py
diff --git a/gramps/plugins/gramplet/ageondategramplet.py b/gramps/plugins/gramplet/ageondategramplet.py
index c34145af4..b03287f0b 100644
--- a/gramps/plugins/gramplet/ageondategramplet.py
+++ b/gramps/plugins/gramplet/ageondategramplet.py
@@ -35,7 +35,8 @@ on a particular date.
#
#------------------------------------------------------------------------
from gramps.gen.plug import Gramplet
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gen.datehandler import parser
from gramps.gui.plug.quick import run_quick_report_by_name
diff --git a/gramps/plugins/gramplet/agestats.py b/gramps/plugins/gramplet/agestats.py
index 1a20956ec..560525b37 100644
--- a/gramps/plugins/gramplet/agestats.py
+++ b/gramps/plugins/gramplet/agestats.py
@@ -28,7 +28,8 @@ import locale
from collections import defaultdict
from gramps.gen.plug import Gramplet
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.lib import ChildRefType
class AgeStatsGramplet(Gramplet):
diff --git a/gramps/plugins/gramplet/attributes.py b/gramps/plugins/gramplet/attributes.py
index 69e6f6e95..6f98dd183 100644
--- a/gramps/plugins/gramplet/attributes.py
+++ b/gramps/plugins/gramplet/attributes.py
@@ -22,7 +22,8 @@
from gramps.gui.listmodel import ListModel, NOSORT
from gramps.gui.plug.quick import run_quick_report_by_name
from gramps.gen.plug import Gramplet
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gi.repository import Gtk
class Attributes(Gramplet):
diff --git a/gramps/plugins/gramplet/attributesgramplet.py b/gramps/plugins/gramplet/attributesgramplet.py
index 51876bac0..31c426f8c 100644
--- a/gramps/plugins/gramplet/attributesgramplet.py
+++ b/gramps/plugins/gramplet/attributesgramplet.py
@@ -21,7 +21,8 @@
from gramps.gen.plug import Gramplet
from gramps.gen.display.name import displayer as name_displayer
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
class AttributesGramplet(Gramplet):
"""
diff --git a/gramps/plugins/gramplet/backlinks.py b/gramps/plugins/gramplet/backlinks.py
index dc90974d5..c0d1a341d 100644
--- a/gramps/plugins/gramplet/backlinks.py
+++ b/gramps/plugins/gramplet/backlinks.py
@@ -23,7 +23,8 @@
from gramps.gui.listmodel import ListModel, NOSORT
from gramps.gen.utils.db import navigation_label
from gramps.gen.plug import Gramplet
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gi.repository import Gtk
class Backlinks(Gramplet):
diff --git a/gramps/plugins/gramplet/calendargramplet.py b/gramps/plugins/gramplet/calendargramplet.py
index bfb3f4c2b..39013268f 100644
--- a/gramps/plugins/gramplet/calendargramplet.py
+++ b/gramps/plugins/gramplet/calendargramplet.py
@@ -24,7 +24,8 @@
#
#------------------------------------------------------------------------
from gramps.gen.plug import Gramplet
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gui.plug.quick import run_quick_report_by_name
from gramps.gen.lib import Date
@@ -39,11 +40,14 @@ class CalendarGramplet(Gramplet):
self.set_tooltip(_("Double-click a day for details"))
self.gui.calendar = Gtk.Calendar()
self.gui.calendar.connect('day-selected-double-click', self.double_click)
- if self.uistate.screen_width() <= 1024:
- self.gui.calendar.set_display_options(Gtk.CALENDAR_SHOW_HEADING)
+ self.gui.calendar.set_display_options(
+ Gtk.CalendarDisplayOptions.SHOW_HEADING)
self.gui.get_container_widget().remove(self.gui.textview)
- self.gui.get_container_widget().add_with_viewport(self.gui.calendar)
- self.gui.calendar.show()
+ vbox = Gtk.VBox(False, 0)
+ vbox.pack_start(self.gui.calendar, False, False, 0)
+ self.gui.get_container_widget().add_with_viewport(vbox)
+ vbox.show_all()
+ #self.gui.calendar.show()
def post_init(self):
self.disconnect("active-changed")
diff --git a/gramps/plugins/gramplet/children.py b/gramps/plugins/gramplet/children.py
index 54c749d7d..618bbb6ea 100644
--- a/gramps/plugins/gramplet/children.py
+++ b/gramps/plugins/gramplet/children.py
@@ -22,7 +22,8 @@
from gramps.gui.editors import EditPerson
from gramps.gui.listmodel import ListModel, NOSORT
from gramps.gen.plug import Gramplet
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
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.datehandler import get_date
diff --git a/gramps/plugins/gramplet/citations.py b/gramps/plugins/gramplet/citations.py
index 10b5ddb7f..9e627ccb6 100644
--- a/gramps/plugins/gramplet/citations.py
+++ b/gramps/plugins/gramplet/citations.py
@@ -23,7 +23,8 @@
from gramps.gui.editors import EditSource, EditCitation
from gramps.gui.listmodel import ListModel, NOSORT
from gramps.gen.plug import Gramplet
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.errors import WindowActiveError
from gi.repository import Gtk
diff --git a/gramps/plugins/gramplet/descendgramplet.py b/gramps/plugins/gramplet/descendgramplet.py
index 19519009d..8ebc69eb4 100644
--- a/gramps/plugins/gramplet/descendgramplet.py
+++ b/gramps/plugins/gramplet/descendgramplet.py
@@ -30,7 +30,8 @@
# standard python modules
#
#------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#------------------------------------------------------------------------
#
diff --git a/gramps/plugins/gramplet/editexifmetadata.py b/gramps/plugins/gramplet/editexifmetadata.py
index 9ff5ee091..6b8ab929a 100644
--- a/gramps/plugins/gramplet/editexifmetadata.py
+++ b/gramps/plugins/gramplet/editexifmetadata.py
@@ -49,7 +49,8 @@ from gi.repository import Gtk
# -----------------------------------------------------------------------------
from gramps.gui.display import display_help
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.datehandler import displayer as _dd
from gramps.gen.datehandler import parser as _dp
diff --git a/gramps/plugins/gramplet/events.py b/gramps/plugins/gramplet/events.py
index 9d991d214..0048277f2 100644
--- a/gramps/plugins/gramplet/events.py
+++ b/gramps/plugins/gramplet/events.py
@@ -22,7 +22,8 @@
from gramps.gui.editors import EditEvent
from gramps.gui.listmodel import ListModel, NOSORT
from gramps.gen.plug import Gramplet
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.display.name import displayer as name_displayer
from gramps.gen.datehandler import get_date
from gramps.gen.utils.db import get_birth_or_fallback, get_marriage_or_fallback
diff --git a/gramps/plugins/gramplet/fanchartdescgramplet.py b/gramps/plugins/gramplet/fanchartdescgramplet.py
index 0f58202ec..2465c1cfc 100644
--- a/gramps/plugins/gramplet/fanchartdescgramplet.py
+++ b/gramps/plugins/gramplet/fanchartdescgramplet.py
@@ -42,7 +42,8 @@ except ImportError:
# GRAMPS modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.plug import Gramplet
from gramps.gen.errors import WindowActiveError
from gramps.gui.editors import EditPerson
diff --git a/gramps/plugins/gramplet/fanchartgramplet.py b/gramps/plugins/gramplet/fanchartgramplet.py
index b37a0e926..ffa52b756 100644
--- a/gramps/plugins/gramplet/fanchartgramplet.py
+++ b/gramps/plugins/gramplet/fanchartgramplet.py
@@ -48,7 +48,8 @@ except ImportError:
# GRAMPS modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.plug import Gramplet
from gramps.gen.errors import WindowActiveError
from gramps.gui.editors import EditPerson
diff --git a/gramps/plugins/gramplet/faqgramplet.py b/gramps/plugins/gramplet/faqgramplet.py
index eb68fad07..9f20c2d00 100644
--- a/gramps/plugins/gramplet/faqgramplet.py
+++ b/gramps/plugins/gramplet/faqgramplet.py
@@ -24,7 +24,8 @@
#
#------------------------------------------------------------------------
from gramps.gen.plug import Gramplet
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gen.const import URL_MANUAL_PAGE
#------------------------------------------------------------------------
diff --git a/gramps/plugins/gramplet/givennamegramplet.py b/gramps/plugins/gramplet/givennamegramplet.py
index 3c3eb26a3..4e5e9bb95 100644
--- a/gramps/plugins/gramplet/givennamegramplet.py
+++ b/gramps/plugins/gramplet/givennamegramplet.py
@@ -21,7 +21,8 @@
#
#
from collections import defaultdict
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.plug import Gramplet
from gramps.gen.config import config
diff --git a/gramps/plugins/gramplet/gramplet.gpr.py b/gramps/plugins/gramplet/gramplet.gpr.py
index 9a25edbfb..cedb0e440 100644
--- a/gramps/plugins/gramplet/gramplet.gpr.py
+++ b/gramps/plugins/gramplet/gramplet.gpr.py
@@ -33,7 +33,7 @@ register(GRAMPLET,
name=_("Age on Date"),
description = _("Gramplet showing ages of living people on a specific date"),
version="2.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="ageondategramplet.py",
height=200,
@@ -54,7 +54,7 @@ register(GRAMPLET,
detached_width = 600,
detached_height = 450,
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
)
register(GRAMPLET,
@@ -70,7 +70,7 @@ register(GRAMPLET,
detached_width = 325,
detached_height = 250,
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
navtypes=["Person"],
)
@@ -84,7 +84,7 @@ register(GRAMPLET,
gramplet = 'CalendarGramplet',
gramplet_title=_("Calendar"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
)
register(GRAMPLET,
@@ -100,7 +100,7 @@ register(GRAMPLET,
detached_width = 500,
detached_height = 500,
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
navtypes=["Person"],
)
@@ -117,7 +117,7 @@ register(GRAMPLET,
detached_width = 475,
gramplet_title=_("Fan Chart"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
navtypes=["Person"],
)
@@ -134,7 +134,7 @@ register(GRAMPLET,
detached_width = 475,
gramplet_title=_("Descendant Fan"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
navtypes=["Person"],
)
@@ -148,7 +148,7 @@ register(GRAMPLET,
gramplet = 'FAQGramplet',
gramplet_title=_("FAQ"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
)
register(GRAMPLET,
@@ -162,7 +162,7 @@ register(GRAMPLET,
gramplet = 'GivenNameCloudGramplet',
gramplet_title=_("Given Name Cloud"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
)
register(GRAMPLET,
@@ -178,7 +178,7 @@ register(GRAMPLET,
detached_width = 600,
detached_height = 400,
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
navtypes=["Person"],
)
@@ -195,7 +195,7 @@ register(GRAMPLET,
detached_width = 600,
detached_height = 400,
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
)
register(GRAMPLET,
@@ -210,7 +210,7 @@ register(GRAMPLET,
detached_width = 250,
detached_height = 300,
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
navtypes=["Person"],
)
@@ -225,7 +225,7 @@ register(GRAMPLET,
gramplet = 'LogGramplet',
gramplet_title=_("Session Log"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
)
register(GRAMPLET,
@@ -239,7 +239,7 @@ register(GRAMPLET,
gramplet = 'StatsGramplet',
gramplet_title=_("Statistics"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
)
register(GRAMPLET,
@@ -253,21 +253,21 @@ register(GRAMPLET,
gramplet = 'SurnameCloudGramplet',
gramplet_title=_("Surname Cloud"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
)
register(GRAMPLET,
- id="TODO",
- name=_("TODO"),
- description = _("Gramplet for generic notes"),
+ id="To Do",
+ name=_("To Do"),
+ description = _("Gramplet for displaying a To Do list"),
status = STABLE,
fname="todogramplet.py",
height=300,
expand=True,
- gramplet = 'TODOGramplet',
- gramplet_title=_("TODO List"),
+ gramplet = 'ToDoGramplet',
+ gramplet_title=_("To Do"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
)
register(GRAMPLET,
@@ -280,7 +280,7 @@ register(GRAMPLET,
gramplet = 'TopSurnamesGramplet',
gramplet_title=_("Top Surnames"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
)
register(GRAMPLET,
@@ -294,7 +294,7 @@ register(GRAMPLET,
gramplet = 'WelcomeGramplet',
gramplet_title=_("Welcome to Gramps!"),
version="1.0.1",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
)
register(GRAMPLET,
@@ -308,7 +308,7 @@ register(GRAMPLET,
gramplet = 'WhatNextGramplet',
gramplet_title = _("What's Next?"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
)
#------------------------------------------------------------------------
@@ -325,7 +325,7 @@ register(GRAMPLET,
detached_width = 510,
detached_height = 550,
version = '1.5.0',
- gramps_target_version = '4.0',
+ gramps_target_version = '4.1',
status = STABLE,
fname = "editexifmetadata.py",
help_url = "Edit Image Exif Metadata",
@@ -342,7 +342,7 @@ register(GRAMPLET,
name=_("Person Details"),
description = _("Gramplet showing details of a person"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="persondetails.py",
height=200,
@@ -356,7 +356,7 @@ register(GRAMPLET,
name=_("Repository Details"),
description = _("Gramplet showing details of a repository"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="repositorydetails.py",
height=200,
@@ -370,7 +370,7 @@ register(GRAMPLET,
name=_("Place Details"),
description = _("Gramplet showing details of a place"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="placedetails.py",
height=200,
@@ -384,7 +384,7 @@ register(GRAMPLET,
name=_("Media Preview"),
description = _("Gramplet showing a preview of a media object"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="mediapreview.py",
height=200,
@@ -408,7 +408,7 @@ if available:
name = _("Metadata Viewer"),
description = _("Gramplet showing metadata for a media object"),
version = "1.0.0",
- gramps_target_version = "4.0",
+ gramps_target_version = "4.1",
status = STABLE,
fname = "metadataviewer.py",
height = 200,
@@ -422,7 +422,7 @@ register(GRAMPLET,
name=_("Person Residence"),
description = _("Gramplet showing residence events for a person"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="personresidence.py",
height=200,
@@ -436,7 +436,7 @@ register(GRAMPLET,
name=_("Person Events"),
description = _("Gramplet showing the events for a person"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="events.py",
height=200,
@@ -450,7 +450,7 @@ register(GRAMPLET,
name=_("Family Events"),
description = _("Gramplet showing the events for a family"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="events.py",
height=200,
@@ -464,7 +464,7 @@ register(GRAMPLET,
name=_("Person Gallery"),
description = _("Gramplet showing media objects for a person"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="gallery.py",
height=200,
@@ -478,7 +478,7 @@ register(GRAMPLET,
name=_("Family Gallery"),
description = _("Gramplet showing media objects for a family"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="gallery.py",
height=200,
@@ -492,7 +492,7 @@ register(GRAMPLET,
name=_("Event Gallery"),
description = _("Gramplet showing media objects for an event"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="gallery.py",
height=200,
@@ -506,7 +506,7 @@ register(GRAMPLET,
name=_("Place Gallery"),
description = _("Gramplet showing media objects for a place"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="gallery.py",
height=200,
@@ -520,7 +520,7 @@ register(GRAMPLET,
name=_("Source Gallery"),
description = _("Gramplet showing media objects for a source"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="gallery.py",
height=200,
@@ -534,7 +534,7 @@ register(GRAMPLET,
name=_("Citation Gallery"),
description = _("Gramplet showing media objects for a citation"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="gallery.py",
height=200,
@@ -548,7 +548,7 @@ register(GRAMPLET,
name=_("Person Attributes"),
description = _("Gramplet showing the attributes of a person"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="attributes.py",
height=200,
@@ -562,7 +562,7 @@ register(GRAMPLET,
name=_("Event Attributes"),
description = _("Gramplet showing the attributes of an event"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="attributes.py",
height=200,
@@ -576,7 +576,7 @@ register(GRAMPLET,
name=_("Family Attributes"),
description = _("Gramplet showing the attributes of a family"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="attributes.py",
height=200,
@@ -590,7 +590,7 @@ register(GRAMPLET,
name=_("Media Attributes"),
description = _("Gramplet showing the attributes of a media object"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="attributes.py",
height=200,
@@ -604,7 +604,7 @@ register(GRAMPLET,
name=_("Person Notes"),
description = _("Gramplet showing the notes for a person"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="notes.py",
height=200,
@@ -618,7 +618,7 @@ register(GRAMPLET,
name=_("Event Notes"),
description = _("Gramplet showing the notes for an event"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="notes.py",
height=200,
@@ -632,7 +632,7 @@ register(GRAMPLET,
name=_("Family Notes"),
description = _("Gramplet showing the notes for a family"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="notes.py",
height=200,
@@ -646,7 +646,7 @@ register(GRAMPLET,
name=_("Place Notes"),
description = _("Gramplet showing the notes for a place"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="notes.py",
height=200,
@@ -660,7 +660,7 @@ register(GRAMPLET,
name=_("Source Notes"),
description = _("Gramplet showing the notes for a source"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="notes.py",
height=200,
@@ -674,7 +674,7 @@ register(GRAMPLET,
name=_("Citation Notes"),
description = _("Gramplet showing the notes for a citation"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="notes.py",
height=200,
@@ -688,7 +688,7 @@ register(GRAMPLET,
name=_("Repository Notes"),
description = _("Gramplet showing the notes for a repository"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="notes.py",
height=200,
@@ -702,7 +702,7 @@ register(GRAMPLET,
name=_("Media Notes"),
description = _("Gramplet showing the notes for a media object"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="notes.py",
height=200,
@@ -716,7 +716,7 @@ register(GRAMPLET,
name=_("Person Citations"),
description = _("Gramplet showing the citations for a person"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="citations.py",
height=200,
@@ -730,7 +730,7 @@ register(GRAMPLET,
name=_("Event Citations"),
description = _("Gramplet showing the citations for an event"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="citations.py",
height=200,
@@ -744,7 +744,7 @@ register(GRAMPLET,
name=_("Family Citations"),
description = _("Gramplet showing the citations for a family"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="citations.py",
height=200,
@@ -758,7 +758,7 @@ register(GRAMPLET,
name=_("Place Citations"),
description = _("Gramplet showing the citations for a place"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="citations.py",
height=200,
@@ -772,7 +772,7 @@ register(GRAMPLET,
name=_("Media Citations"),
description = _("Gramplet showing the citations for a media object"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="citations.py",
height=200,
@@ -786,7 +786,7 @@ register(GRAMPLET,
name=_("Person Children"),
description = _("Gramplet showing the children of a person"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="children.py",
height=200,
@@ -800,7 +800,7 @@ register(GRAMPLET,
name=_("Family Children"),
description = _("Gramplet showing the children of a family"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="children.py",
height=200,
@@ -814,7 +814,7 @@ register(GRAMPLET,
name=_("Person Backlinks"),
description = _("Gramplet showing the backlinks for a person"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="backlinks.py",
height=200,
@@ -828,7 +828,7 @@ register(GRAMPLET,
name=_("Event Backlinks"),
description = _("Gramplet showing the backlinks for an event"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="backlinks.py",
height=200,
@@ -842,7 +842,7 @@ register(GRAMPLET,
name=_("Family Backlinks"),
description = _("Gramplet showing the backlinks for a family"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="backlinks.py",
height=200,
@@ -856,7 +856,7 @@ register(GRAMPLET,
name=_("Place Backlinks"),
description = _("Gramplet showing the backlinks for a place"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="backlinks.py",
height=200,
@@ -870,7 +870,7 @@ register(GRAMPLET,
name=_("Source Backlinks"),
description = _("Gramplet showing the backlinks for a source"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="backlinks.py",
height=200,
@@ -884,7 +884,7 @@ register(GRAMPLET,
name=_("Citation Backlinks"),
description = _("Gramplet showing the backlinks for a citation"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="backlinks.py",
height=200,
@@ -898,7 +898,7 @@ register(GRAMPLET,
name=_("Repository Backlinks"),
description = _("Gramplet showing the backlinks for a repository"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="backlinks.py",
height=200,
@@ -912,7 +912,7 @@ register(GRAMPLET,
name=_("Media Backlinks"),
description = _("Gramplet showing the backlinks for a media object"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="backlinks.py",
height=200,
@@ -926,7 +926,7 @@ register(GRAMPLET,
name=_("Note Backlinks"),
description = _("Gramplet showing the backlinks for a note"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="backlinks.py",
height=200,
@@ -940,7 +940,7 @@ register(GRAMPLET,
name=_("Person Filter"),
description = _("Gramplet providing a person filter"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="filter.py",
height=200,
@@ -954,7 +954,7 @@ register(GRAMPLET,
name=_("Family Filter"),
description = _("Gramplet providing a family filter"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="filter.py",
height=200,
@@ -968,7 +968,7 @@ register(GRAMPLET,
name=_("Event Filter"),
description = _("Gramplet providing an event filter"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="filter.py",
height=200,
@@ -982,7 +982,7 @@ register(GRAMPLET,
name=_("Source Filter"),
description = _("Gramplet providing a source filter"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="filter.py",
height=200,
@@ -996,7 +996,7 @@ register(GRAMPLET,
name=_("Citation Filter"),
description = _("Gramplet providing a citation filter"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="filter.py",
height=200,
@@ -1010,7 +1010,7 @@ register(GRAMPLET,
name=_("Place Filter"),
description = _("Gramplet providing a place filter"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="filter.py",
height=200,
@@ -1024,7 +1024,7 @@ register(GRAMPLET,
name=_("Media Filter"),
description = _("Gramplet providing a media filter"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="filter.py",
height=200,
@@ -1038,7 +1038,7 @@ register(GRAMPLET,
name=_("Repository Filter"),
description = _("Gramplet providing a repository filter"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="filter.py",
height=200,
@@ -1052,7 +1052,7 @@ register(GRAMPLET,
name=_("Note Filter"),
description = _("Gramplet providing a note filter"),
version="1.0.0",
- gramps_target_version="4.0",
+ gramps_target_version="4.1",
status = STABLE,
fname="filter.py",
height=200,
@@ -1066,7 +1066,7 @@ register(GRAMPLET,
name=_("Records Gramplet"),
description=_("Shows some interesting records about people and families"),
version='1.0',
- gramps_target_version='4.0',
+ gramps_target_version='4.1',
status=STABLE,
fname='recordsgramplet.py',
authors=["Reinhard Müller"],
@@ -1076,3 +1076,115 @@ register(GRAMPLET,
expand=True,
gramplet_title=_("Records")
)
+
+register(GRAMPLET,
+ id="Person To Do",
+ name=_("Person To Do"),
+ description = _("Gramplet showing the To Do notes for a person"),
+ version="1.0.0",
+ gramps_target_version="4.1",
+ status = STABLE,
+ fname="todo.py",
+ height=200,
+ gramplet = 'PersonToDo',
+ gramplet_title=_("To Do"),
+ navtypes=["Person"],
+ )
+
+register(GRAMPLET,
+ id="Event To Do",
+ name=_("Event To Do"),
+ description = _("Gramplet showing the To Do notes for an event"),
+ version="1.0.0",
+ gramps_target_version="4.1",
+ status = STABLE,
+ fname="todo.py",
+ height=200,
+ gramplet = 'EventToDo',
+ gramplet_title=_("To Do"),
+ navtypes=["Event"],
+ )
+
+register(GRAMPLET,
+ id="Family To Do",
+ name=_("Family To Do"),
+ description = _("Gramplet showing the To Do notes for a family"),
+ version="1.0.0",
+ gramps_target_version="4.1",
+ status = STABLE,
+ fname="todo.py",
+ height=200,
+ gramplet = 'FamilyToDo',
+ gramplet_title=_("To Do"),
+ navtypes=["Family"],
+ )
+
+register(GRAMPLET,
+ id="Place To Do",
+ name=_("Place To Do"),
+ description = _("Gramplet showing the To Do notes for a place"),
+ version="1.0.0",
+ gramps_target_version="4.1",
+ status = STABLE,
+ fname="todo.py",
+ height=200,
+ gramplet = 'PlaceToDo',
+ gramplet_title=_("To Do"),
+ navtypes=["Place"],
+ )
+
+register(GRAMPLET,
+ id="Source To Do",
+ name=_("Source To Do"),
+ description = _("Gramplet showing the To Do notes for a source"),
+ version="1.0.0",
+ gramps_target_version="4.1",
+ status = STABLE,
+ fname="todo.py",
+ height=200,
+ gramplet = 'SourceToDo',
+ gramplet_title=_("To Do"),
+ navtypes=["Source"],
+ )
+
+register(GRAMPLET,
+ id="Citation To Do",
+ name=_("Citation To Do"),
+ description = _("Gramplet showing the To Do notes for a citation"),
+ version="1.0.0",
+ gramps_target_version="4.1",
+ status = STABLE,
+ fname="todo.py",
+ height=200,
+ gramplet = 'CitationToDo',
+ gramplet_title=_("To Do"),
+ navtypes=["Citation"],
+ )
+
+register(GRAMPLET,
+ id="Repository To Do",
+ name=_("Repository To Do"),
+ description = _("Gramplet showing the To Do notes for a repository"),
+ version="1.0.0",
+ gramps_target_version="4.1",
+ status = STABLE,
+ fname="todo.py",
+ height=200,
+ gramplet = 'RepositoryToDo',
+ gramplet_title=_("To Do"),
+ navtypes=["Repository"],
+ )
+
+register(GRAMPLET,
+ id="Media To Do",
+ name=_("Media To Do"),
+ description = _("Gramplet showing the To Do notes for a media object"),
+ version="1.0.0",
+ gramps_target_version="4.1",
+ status = STABLE,
+ fname="todo.py",
+ height=200,
+ gramplet = 'MediaToDo',
+ gramplet_title=_("To Do"),
+ navtypes=["Media"],
+ )
diff --git a/gramps/plugins/gramplet/notes.py b/gramps/plugins/gramplet/notes.py
index 6ece6d83a..ae6777fe2 100644
--- a/gramps/plugins/gramplet/notes.py
+++ b/gramps/plugins/gramplet/notes.py
@@ -24,7 +24,8 @@ from gramps.gen.plug import Gramplet
from gramps.gui.widgets.styledtexteditor import StyledTextEditor
from gramps.gui.widgets import SimpleButton
from gramps.gen.lib import StyledText
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gi.repository import Gtk
class Notes(Gramplet):
diff --git a/gramps/plugins/gramplet/pedigreegramplet.py b/gramps/plugins/gramplet/pedigreegramplet.py
index 230e417d9..88550d6da 100644
--- a/gramps/plugins/gramplet/pedigreegramplet.py
+++ b/gramps/plugins/gramplet/pedigreegramplet.py
@@ -35,8 +35,8 @@ import locale
#
#------------------------------------------------------------------------
from gramps.gen.plug import Gramplet
-from gramps.gen.ggettext import sgettext as _
-from gramps.gen.ggettext import ngettext
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gen.display.name import displayer as name_displayer
from gramps.gen.datehandler import get_date
from gramps.gen.lib import EventType
@@ -268,13 +268,13 @@ class PedigreeGramplet(Gramplet):
self.link(_("Generation %d") % g, 'PersonList', handles,
tooltip=_("Double-click to see people in generation %d") % g)
percent = locale.format('%.2f', float(count)/2**(g-1) * 100) + percent_sign
- self.append_text(ngettext(
+ self.append_text(glocale.get_translation().ngettext(
" has %(count_person)d of %(max_count_person)d individuals (%(percent)s complete)\n",
" has %(count_person)d of %(max_count_person)d individuals (%(percent)s complete)\n",
2**(g-1)) % {'count_person': count, 'max_count_person': 2**(g-1), 'percent': percent})
self.link(_("All generations"), 'PersonList', all,
tooltip=_("Double-click to see all generations"))
- self.append_text(ngettext(
+ self.append_text(glocale.get_translation().ngettext(
" have %d individual\n",
" have %d individuals\n",
len(all)) % len(all))
diff --git a/gramps/plugins/gramplet/persondetails.py b/gramps/plugins/gramplet/persondetails.py
index 41dba8e5b..940119a36 100644
--- a/gramps/plugins/gramplet/persondetails.py
+++ b/gramps/plugins/gramplet/persondetails.py
@@ -23,7 +23,8 @@ from gramps.gen.lib import EventType, EventRoleType
from gramps.gen.plug import Gramplet
from gramps.gui.widgets import Photo
from gramps.gen.display.name import displayer as name_displayer
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.datehandler import get_date
from gramps.gen.utils.file import media_path_full
from gi.repository import Gtk
diff --git a/gramps/plugins/gramplet/personresidence.py b/gramps/plugins/gramplet/personresidence.py
index 42a657fb8..704eaa5e7 100644
--- a/gramps/plugins/gramplet/personresidence.py
+++ b/gramps/plugins/gramplet/personresidence.py
@@ -23,7 +23,8 @@ from gramps.gen.lib import EventType, EventRoleType
from gramps.gui.editors import EditEvent
from gramps.gui.listmodel import ListModel, NOSORT
from gramps.gen.plug import Gramplet
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.datehandler import get_date
from gramps.gen.errors import WindowActiveError
from gi.repository import Gtk
diff --git a/gramps/plugins/gramplet/placedetails.py b/gramps/plugins/gramplet/placedetails.py
index e42efa744..effd206db 100644
--- a/gramps/plugins/gramplet/placedetails.py
+++ b/gramps/plugins/gramplet/placedetails.py
@@ -21,7 +21,8 @@
from gramps.gen.plug import Gramplet
from gramps.gui.widgets import Photo
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.utils.place import conv_lat_lon
from gramps.gen.utils.file import media_path_full
from gi.repository import Gtk
diff --git a/gramps/plugins/gramplet/quickviewgramplet.py b/gramps/plugins/gramplet/quickviewgramplet.py
index 7e5f63112..4ab31e70f 100644
--- a/gramps/plugins/gramplet/quickviewgramplet.py
+++ b/gramps/plugins/gramplet/quickviewgramplet.py
@@ -32,7 +32,8 @@
#
#------------------------------------------------------------------------
from gramps.gen.plug import Gramplet
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_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,
diff --git a/gramps/plugins/gramplet/recordsgramplet.py b/gramps/plugins/gramplet/recordsgramplet.py
index 1caef5349..015558958 100644
--- a/gramps/plugins/gramplet/recordsgramplet.py
+++ b/gramps/plugins/gramplet/recordsgramplet.py
@@ -27,7 +27,8 @@
# Standard Python modules
#
#------------------------------------------------------------------------
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
#------------------------------------------------------------------------
#
diff --git a/gramps/plugins/gramplet/relativegramplet.py b/gramps/plugins/gramplet/relativegramplet.py
index e0b9dbeaf..5f785dbd5 100644
--- a/gramps/plugins/gramplet/relativegramplet.py
+++ b/gramps/plugins/gramplet/relativegramplet.py
@@ -24,7 +24,8 @@
#
#------------------------------------------------------------------------
from gramps.gen.plug import Gramplet
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gen.display.name import displayer as name_displayer
#------------------------------------------------------------------------
diff --git a/gramps/plugins/gramplet/repositorydetails.py b/gramps/plugins/gramplet/repositorydetails.py
index dffd6cde7..9a1257f99 100644
--- a/gramps/plugins/gramplet/repositorydetails.py
+++ b/gramps/plugins/gramplet/repositorydetails.py
@@ -21,7 +21,8 @@
from gramps.gen.lib import UrlType
from gramps.gen.plug import Gramplet
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gi.repository import Gtk
from gi.repository import Pango
diff --git a/gramps/plugins/gramplet/sessionloggramplet.py b/gramps/plugins/gramplet/sessionloggramplet.py
index 3e7e41e31..04b05f082 100644
--- a/gramps/plugins/gramplet/sessionloggramplet.py
+++ b/gramps/plugins/gramplet/sessionloggramplet.py
@@ -28,7 +28,8 @@ import time
from gramps.gen.lib import Person, Family
from gramps.gen.db import PERSON_KEY, FAMILY_KEY, TXNDEL
from gramps.gen.plug import Gramplet
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gen.display.name import displayer as name_displayer
from gramps.gen.utils.db import family_name
diff --git a/gramps/plugins/gramplet/statsgramplet.py b/gramps/plugins/gramplet/statsgramplet.py
index 6f6a2ba55..d06362154 100644
--- a/gramps/plugins/gramplet/statsgramplet.py
+++ b/gramps/plugins/gramplet/statsgramplet.py
@@ -31,7 +31,8 @@ import posixpath
#
#------------------------------------------------------------------------
from gramps.gen.plug import Gramplet
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gen.utils.file import media_path_full
from gramps.gen.datehandler import get_date
from gramps.gen.lib import Person
diff --git a/gramps/plugins/gramplet/surnamecloudgramplet.py b/gramps/plugins/gramplet/surnamecloudgramplet.py
index c1f2162e1..9270be3a2 100644
--- a/gramps/plugins/gramplet/surnamecloudgramplet.py
+++ b/gramps/plugins/gramplet/surnamecloudgramplet.py
@@ -26,7 +26,8 @@ from collections import defaultdict
#
#------------------------------------------------------------------------
from gramps.gen.plug import Gramplet
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gen.config import config
#------------------------------------------------------------------------
diff --git a/gramps/plugins/gramplet/todo.py b/gramps/plugins/gramplet/todo.py
new file mode 100644
index 000000000..c895e94c8
--- /dev/null
+++ b/gramps/plugins/gramplet/todo.py
@@ -0,0 +1,402 @@
+# Gramps - a GTK+/GNOME based genealogy program
+#
+# Copyright (C) 2013 Nick Hall
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# $Id$
+#
+
+from gramps.gen.plug import Gramplet
+from gramps.gui.widgets.styledtexteditor import StyledTextEditor
+from gramps.gui.widgets import SimpleButton
+from gramps.gen.lib import StyledText, Note, NoteType
+from gramps.gen.db import DbTxn
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
+from gi.repository import Gtk
+
+class ToDo(Gramplet):
+ """
+ Displays the To Do notes for an object.
+ """
+ def init(self):
+ self.gui.WIDGET = self.build_gui()
+ self.gui.get_container_widget().remove(self.gui.textview)
+ self.gui.get_container_widget().add_with_viewport(self.gui.WIDGET)
+ self.gui.WIDGET.show()
+
+ def build_gui(self):
+ """
+ Build the GUI interface.
+ """
+ top = Gtk.VBox(False)
+
+ hbox = Gtk.HBox()
+ self.left = SimpleButton(Gtk.STOCK_GO_BACK, self.left_clicked)
+ self.left.set_tooltip_text(_('Previous To Do note'))
+ self.left.set_sensitive(False)
+ hbox.pack_start(self.left, False, False, 0)
+ self.right = SimpleButton(Gtk.STOCK_GO_FORWARD, self.right_clicked)
+ self.right.set_tooltip_text(_('Next To Do note'))
+ self.right.set_sensitive(False)
+ hbox.pack_start(self.right, False, False, 0)
+ self.edit = SimpleButton(Gtk.STOCK_EDIT, self.edit_clicked)
+ self.edit.set_tooltip_text(_('Edit the selected To Do note'))
+ self.edit.set_sensitive(False)
+ hbox.pack_start(self.edit, False, False, 0)
+ self.new = SimpleButton(Gtk.STOCK_NEW, self.new_clicked)
+ self.new.set_tooltip_text(_('Add a new To Do note'))
+ hbox.pack_start(self.new, False, False, 0)
+ self.page = Gtk.Label()
+ hbox.pack_end(self.page, False, False, 10)
+
+ scrolledwindow = Gtk.ScrolledWindow()
+ scrolledwindow.set_policy(Gtk.PolicyType.AUTOMATIC,
+ Gtk.PolicyType.AUTOMATIC)
+ self.texteditor = StyledTextEditor()
+ self.texteditor.set_editable(False)
+ self.texteditor.set_wrap_mode(Gtk.WrapMode.WORD)
+ scrolledwindow.add(self.texteditor)
+
+ top.pack_start(hbox, False, False, 0)
+ top.pack_start(scrolledwindow, True, True, 0)
+ top.show_all()
+ return top
+
+ def get_note_list(self, obj):
+ """
+ Get a list of To Do notes for the current object.
+ """
+ note_list = []
+ for note_handle in obj.get_note_list():
+ note = self.dbstate.db.get_note_from_handle(note_handle)
+ if int(note.get_type()) == NoteType.TODO:
+ note_list.append(note.get_handle())
+ return note_list
+
+ def get_notes(self, obj):
+ """
+ Display the To Do notes for the current object.
+ """
+ self.obj = obj
+ self.left.set_sensitive(False)
+ self.right.set_sensitive(False)
+ self.edit.set_sensitive(False)
+ self.texteditor.set_text(StyledText())
+ self.note_list = self.get_note_list(obj)
+ self.page.set_text('')
+ if len(self.note_list) > 0:
+ self.set_has_data(True)
+ self.edit.set_sensitive(True)
+ if len(self.note_list) > 1:
+ self.right.set_sensitive(True)
+ self.current = 0
+ self.display_note()
+ else:
+ self.set_has_data(False)
+
+ def clear_text(self):
+ self.left.set_sensitive(False)
+ self.right.set_sensitive(False)
+ self.edit.set_sensitive(False)
+ self.texteditor.set_text(StyledText())
+ self.page.set_text('')
+ self.current = 0
+
+ def display_note(self):
+ """
+ Display the current note.
+ """
+ note_handle = self.note_list[self.current]
+ note = self.dbstate.db.get_note_from_handle(note_handle)
+ self.texteditor.set_text(note.get_styledtext())
+ self.page.set_text(_('%(current)d of %(total)d') %
+ {'current': self.current + 1,
+ 'total': len(self.note_list)})
+
+ def left_clicked(self, button):
+ """
+ Display the previous note.
+ """
+ if self.current > 0:
+ self.current -= 1
+ self.right.set_sensitive(True)
+ if self.current == 0:
+ self.left.set_sensitive(False)
+ self.display_note()
+
+ def right_clicked(self, button):
+ """
+ Display the next note.
+ """
+ if self.current < len(self.note_list) - 1:
+ self.current += 1
+ self.left.set_sensitive(True)
+ if self.current == len(self.note_list) - 1:
+ self.right.set_sensitive(False)
+ self.display_note()
+
+ def get_has_data(self, obj):
+ """
+ Return True if the gramplet has data, else return False.
+ """
+ if obj is None:
+ return False
+ if self.get_note_list(obj):
+ return True
+ return False
+
+ def edit_clicked(self, obj):
+ """
+ Edit current To Do note.
+ """
+ from gramps.gui.editors import EditNote
+ note_handle = self.note_list[self.current]
+ note = self.dbstate.db.get_note_from_handle(note_handle)
+ try:
+ EditNote(self.gui.dbstate, self.gui.uistate, [], note)
+ except AttributeError:
+ pass
+
+ def new_clicked(self, obj):
+ """
+ Create a new To Do note.
+ """
+ from gramps.gui.editors import EditNote
+ note = Note()
+ note.set_type(NoteType.TODO)
+ try:
+ EditNote(self.gui.dbstate, self.gui.uistate, [], note, self.created)
+ except AttributeError:
+ pass
+
+class PersonToDo(ToDo):
+ """
+ Displays the To Do notes for a person.
+ """
+ def db_changed(self):
+ self.dbstate.db.connect('person-update', self.update)
+
+ def active_changed(self, handle):
+ self.update()
+
+ def update_has_data(self):
+ active_handle = self.get_active('Person')
+ active = self.dbstate.db.get_person_from_handle(active_handle)
+ self.set_has_data(self.get_has_data(active))
+
+ def main(self):
+ active_handle = self.get_active('Person')
+ active = self.dbstate.db.get_person_from_handle(active_handle)
+ if active:
+ self.get_notes(active)
+ else:
+ self.clear_text()
+ self.set_has_data(False)
+
+ def created(self, handle):
+ with DbTxn('Attach Note', self.dbstate.db) as trans:
+ self.obj.add_note(handle)
+ self.dbstate.db.commit_person(self.obj, trans)
+
+class EventToDo(ToDo):
+ """
+ Displays the To Do notes for an event.
+ """
+ def db_changed(self):
+ self.dbstate.db.connect('event-update', self.update)
+ self.connect_signal('Event', self.update)
+
+ def update_has_data(self):
+ active_handle = self.get_active('Event')
+ active = self.dbstate.db.get_event_from_handle(active_handle)
+ self.set_has_data(self.get_has_data(active))
+
+ def main(self):
+ active_handle = self.get_active('Event')
+ active = self.dbstate.db.get_event_from_handle(active_handle)
+ if active:
+ self.get_notes(active)
+ else:
+ self.clear_text()
+ self.set_has_data(False)
+
+ def created(self, handle):
+ with DbTxn('Attach Note', self.dbstate.db) as trans:
+ self.obj.add_note(handle)
+ self.dbstate.db.commit_event(self.obj, trans)
+
+class FamilyToDo(ToDo):
+ """
+ Displays the To Do notes for a family.
+ """
+ def db_changed(self):
+ self.dbstate.db.connect('family-update', self.update)
+ self.connect_signal('Family', self.update)
+
+ def update_has_data(self):
+ active_handle = self.get_active('Family')
+ active = self.dbstate.db.get_family_from_handle(active_handle)
+ self.set_has_data(self.get_has_data(active))
+
+ def main(self):
+ active_handle = self.get_active('Family')
+ active = self.dbstate.db.get_family_from_handle(active_handle)
+ if active:
+ self.get_notes(active)
+ else:
+ self.clear_text()
+ self.set_has_data(False)
+
+ def created(self, handle):
+ with DbTxn('Attach Note', self.dbstate.db) as trans:
+ self.obj.add_note(handle)
+ self.dbstate.db.commit_family(self.obj, trans)
+
+class PlaceToDo(ToDo):
+ """
+ Displays the To Do notes for a place.
+ """
+ def db_changed(self):
+ self.dbstate.db.connect('place-update', self.update)
+ self.connect_signal('Place', self.update)
+
+ def update_has_data(self):
+ active_handle = self.get_active('Place')
+ active = self.dbstate.db.get_place_from_handle(active_handle)
+ self.set_has_data(self.get_has_data(active))
+
+ def main(self):
+ active_handle = self.get_active('Place')
+ active = self.dbstate.db.get_place_from_handle(active_handle)
+ if active:
+ self.get_notes(active)
+ else:
+ self.clear_text()
+ self.set_has_data(False)
+
+ def created(self, handle):
+ with DbTxn('Attach Note', self.dbstate.db) as trans:
+ self.obj.add_note(handle)
+ self.dbstate.db.commit_place(self.obj, trans)
+
+class SourceToDo(ToDo):
+ """
+ Displays the To Do notes for a source.
+ """
+ def db_changed(self):
+ self.dbstate.db.connect('source-update', self.update)
+ self.connect_signal('Source', self.update)
+
+ def update_has_data(self):
+ active_handle = self.get_active('Source')
+ active = self.dbstate.db.get_source_from_handle(active_handle)
+ self.set_has_data(self.get_has_data(active))
+
+ def main(self):
+ active_handle = self.get_active('Source')
+ active = self.dbstate.db.get_source_from_handle(active_handle)
+ if active:
+ self.get_notes(active)
+ else:
+ self.clear_text()
+ self.set_has_data(False)
+
+ def created(self, handle):
+ with DbTxn('Attach Note', self.dbstate.db) as trans:
+ self.obj.add_note(handle)
+ self.dbstate.db.commit_source(self.obj, trans)
+
+class CitationToDo(ToDo):
+ """
+ Displays the To Do notes for a Citation.
+ """
+ def db_changed(self):
+ self.dbstate.db.connect('citation-update', self.update)
+ self.connect_signal('Citation', self.update)
+
+ def update_has_data(self):
+ active_handle = self.get_active('Citation')
+ active = self.dbstate.db.get_citation_from_handle(active_handle)
+ self.set_has_data(self.get_has_data(active))
+
+ def main(self):
+ active_handle = self.get_active('Citation')
+ active = self.dbstate.db.get_citation_from_handle(active_handle)
+ if active:
+ self.get_notes(active)
+ else:
+ self.clear_text()
+ self.set_has_data(False)
+
+ def created(self, handle):
+ with DbTxn('Attach Note', self.dbstate.db) as trans:
+ self.obj.add_note(handle)
+ self.dbstate.db.commit_citation(self.obj, trans)
+
+class RepositoryToDo(ToDo):
+ """
+ Displays the To Do notes for a repository.
+ """
+ def db_changed(self):
+ self.dbstate.db.connect('repository-update', self.update)
+ self.connect_signal('Repository', self.update)
+
+ def update_has_data(self):
+ active_handle = self.get_active('Repository')
+ active = self.dbstate.db.get_repository_from_handle(active_handle)
+ self.set_has_data(self.get_has_data(active))
+
+ def main(self):
+ active_handle = self.get_active('Repository')
+ active = self.dbstate.db.get_repository_from_handle(active_handle)
+ if active:
+ self.get_notes(active)
+ else:
+ self.clear_text()
+ self.set_has_data(False)
+
+ def created(self, handle):
+ with DbTxn('Attach Note', self.dbstate.db) as trans:
+ self.obj.add_note(handle)
+ self.dbstate.db.commit_repository(self.obj, trans)
+
+class MediaToDo(ToDo):
+ """
+ Displays the To Do notes for a media object.
+ """
+ def db_changed(self):
+ self.dbstate.db.connect('media-update', self.update)
+ self.connect_signal('Media', self.update)
+
+ def update_has_data(self):
+ active_handle = self.get_active('Media')
+ active = self.dbstate.db.get_object_from_handle(active_handle)
+ self.set_has_data(self.get_has_data(active))
+
+ def main(self):
+ active_handle = self.get_active('Media')
+ active = self.dbstate.db.get_object_from_handle(active_handle)
+ if active:
+ self.get_notes(active)
+ else:
+ self.clear_text()
+ self.set_has_data(False)
+
+ def created(self, handle):
+ with DbTxn('Attach Note', self.dbstate.db) as trans:
+ self.obj.add_note(handle)
+ self.dbstate.db.commit_media_object(self.obj, trans)
diff --git a/gramps/plugins/gramplet/todogramplet.py b/gramps/plugins/gramplet/todogramplet.py
index 8028acb17..b5704edd0 100644
--- a/gramps/plugins/gramplet/todogramplet.py
+++ b/gramps/plugins/gramplet/todogramplet.py
@@ -1,6 +1,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2007-2009 Douglas S. Blank
+# Copyright (C) 2013 Nick Hall
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -15,35 +16,193 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
+#
# $Id$
+#
-#------------------------------------------------------------------------
-#
-# GRAMPS modules
-#
-#------------------------------------------------------------------------
from gramps.gen.plug import Gramplet
-from gramps.gen.ggettext import sgettext as _
+from gramps.gui.widgets.styledtexteditor import StyledTextEditor
+from gramps.gui.widgets import SimpleButton
+from gramps.gen.lib import StyledText, Note, NoteType
+from gramps.gen.filters import GenericFilterFactory, rules
+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
+_ = glocale.get_translation().gettext
-#------------------------------------------------------------------------
-#
-# TODOGramplet class
-#
-#------------------------------------------------------------------------
-class TODOGramplet(Gramplet):
+class ToDoGramplet(Gramplet):
+ """
+ Displays all the To Do notes in the database.
+ """
def init(self):
- # GUI setup:
- self.set_tooltip(_("Enter text"))
- self.gui.textview.set_editable(True)
- self.append_text(_("Enter your TODO list here."))
+ self.gui.WIDGET = self.build_gui()
+ self.gui.get_container_widget().remove(self.gui.textview)
+ self.gui.get_container_widget().add_with_viewport(self.gui.WIDGET)
+ self.gui.WIDGET.show()
- def on_load(self):
- self.load_data_to_text()
+ def build_gui(self):
+ """
+ Build the GUI interface.
+ """
+ top = Gtk.VBox(False)
+
+ hbox = Gtk.HBox()
+ self.left = SimpleButton(Gtk.STOCK_GO_BACK, self.left_clicked)
+ self.left.set_tooltip_text(_('Previous To Do note'))
+ self.left.set_sensitive(False)
+ hbox.pack_start(self.left, False, False, 0)
+ self.right = SimpleButton(Gtk.STOCK_GO_FORWARD, self.right_clicked)
+ self.right.set_tooltip_text(_('Next To Do note'))
+ self.right.set_sensitive(False)
+ hbox.pack_start(self.right, False, False, 0)
+ self.edit = SimpleButton(Gtk.STOCK_EDIT, self.edit_clicked)
+ self.edit.set_tooltip_text(_('Edit the selected To Do note'))
+ self.edit.set_sensitive(False)
+ hbox.pack_start(self.edit, False, False, 0)
+ self.new = SimpleButton(Gtk.STOCK_NEW, self.new_clicked)
+ self.new.set_tooltip_text(_('Add a new To Do note'))
+ hbox.pack_start(self.new, False, False, 0)
+ self.page = Gtk.Label()
+ hbox.pack_end(self.page, False, False, 10)
+
+ self.title = Gtk.Label()
+ self.title.set_alignment(0, 0)
+ self.title.set_line_wrap(True)
+
+ scrolledwindow = Gtk.ScrolledWindow()
+ scrolledwindow.set_policy(Gtk.PolicyType.AUTOMATIC,
+ Gtk.PolicyType.AUTOMATIC)
+ self.texteditor = StyledTextEditor()
+ self.texteditor.set_editable(False)
+ self.texteditor.set_wrap_mode(Gtk.WrapMode.WORD)
+ scrolledwindow.add(self.texteditor)
- def post_init(self):
- self.disconnect("active-changed")
+ top.pack_start(hbox, False, False, 0)
+ top.pack_start(self.title, False, False, 4)
+ top.pack_start(scrolledwindow, True, True, 0)
+ top.show_all()
+ return top
- def on_save(self):
- self.gui.data = [] # clear out old data
- self.save_text_to_data()
+ def main(self):
+ self.get_notes()
+
+ def get_note_list(self):
+ """
+ Get a list of all To Do notes.
+ """
+ all_notes = self.dbstate.db.get_note_handles()
+ FilterClass = GenericFilterFactory('Note')
+ filter = FilterClass()
+ filter.add_rule(rules.note.HasType(["To Do"]))
+ note_list = filter.apply(self.dbstate.db, all_notes)
+ return note_list
+
+ def get_notes(self):
+ """
+ Display all the To Do notes.
+ """
+ self.left.set_sensitive(False)
+ self.right.set_sensitive(False)
+ self.edit.set_sensitive(False)
+ self.texteditor.set_text(StyledText())
+ self.note_list = self.get_note_list()
+ self.page.set_text('')
+ self.title.set_text('')
+ if len(self.note_list) > 0:
+ self.set_has_data(True)
+ self.edit.set_sensitive(True)
+ if len(self.note_list) > 1:
+ self.right.set_sensitive(True)
+ self.current = 0
+ self.display_note()
+ else:
+ self.set_has_data(False)
+
+ def clear_text(self):
+ self.left.set_sensitive(False)
+ self.right.set_sensitive(False)
+ self.edit.set_sensitive(False)
+ self.texteditor.set_text(StyledText())
+ self.page.set_text('')
+ self.title.set_text('')
+ self.current = 0
+
+ def display_note(self):
+ """
+ Display the current note.
+ """
+ note_handle = self.note_list[self.current]
+ note = self.dbstate.db.get_note_from_handle(note_handle)
+ obj = [x for x in self.dbstate.db.find_backlink_handles(note_handle)]
+ if obj:
+ name, obj = navigation_label(self.dbstate.db, obj[0][0], obj[0][1])
+ self.title.set_text(name)
+ else:
+ self.title.set_text(_("Unattached"))
+ self.texteditor.set_text(note.get_styledtext())
+ self.page.set_text(_('%(current)d of %(total)d') %
+ {'current': self.current + 1,
+ 'total': len(self.note_list)})
+
+ def left_clicked(self, button):
+ """
+ Display the previous note.
+ """
+ if self.current > 0:
+ self.current -= 1
+ self.right.set_sensitive(True)
+ if self.current == 0:
+ self.left.set_sensitive(False)
+ self.display_note()
+
+ def right_clicked(self, button):
+ """
+ Display the next note.
+ """
+ if self.current < len(self.note_list) - 1:
+ self.current += 1
+ self.left.set_sensitive(True)
+ if self.current == len(self.note_list) - 1:
+ self.right.set_sensitive(False)
+ self.display_note()
+
+ def get_has_data(self):
+ """
+ Return True if the gramplet has data, else return False.
+ """
+ if self.get_note_list():
+ return True
+ return False
+
+ def edit_clicked(self, obj):
+ """
+ Edit current To Do note.
+ """
+ from gramps.gui.editors import EditNote
+ note_handle = self.note_list[self.current]
+ note = self.dbstate.db.get_note_from_handle(note_handle)
+ try:
+ EditNote(self.gui.dbstate, self.gui.uistate, [], note)
+ except AttributeError:
+ pass
+
+ def new_clicked(self, obj):
+ """
+ Create a new To Do note.
+ """
+ from gramps.gui.editors import EditNote
+ note = Note()
+ note.set_type(NoteType.TODO)
+ try:
+ EditNote(self.gui.dbstate, self.gui.uistate, [], note)
+ except AttributeError:
+ pass
+
+ def update_has_data(self):
+ self.set_has_data(self.get_has_data())
+
+ def db_changed(self):
+ self.dbstate.db.connect('note-add', self.update)
+ self.dbstate.db.connect('note-delete', self.update)
+ self.dbstate.db.connect('note-update', self.update)
diff --git a/gramps/plugins/gramplet/topsurnamesgramplet.py b/gramps/plugins/gramplet/topsurnamesgramplet.py
index 4fd7afadf..bc50f6b73 100644
--- a/gramps/plugins/gramplet/topsurnamesgramplet.py
+++ b/gramps/plugins/gramplet/topsurnamesgramplet.py
@@ -26,7 +26,8 @@ from collections import defaultdict
#
#------------------------------------------------------------------------
from gramps.gen.plug import Gramplet
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gen.config import config
#------------------------------------------------------------------------
diff --git a/gramps/plugins/gramplet/welcomegramplet.py b/gramps/plugins/gramplet/welcomegramplet.py
index 232ced628..47807662d 100644
--- a/gramps/plugins/gramplet/welcomegramplet.py
+++ b/gramps/plugins/gramplet/welcomegramplet.py
@@ -35,7 +35,8 @@ from gramps.gen.plug import Gramplet
from gramps.gui.widgets.styledtexteditor import StyledTextEditor
from gramps.gui.widgets import SimpleButton
from gramps.gen.lib import StyledText, StyledTextTag, StyledTextTagType
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
#------------------------------------------------------------------------
#
@@ -111,7 +112,7 @@ class WelcomeGramplet(Gramplet):
welcome += linkst(_('Start with Genealogy and Gramps'),
_('http://www.gramps-project.org/wiki/index.php?title=Start_with_Genealogy')) + '\n'
welcome += linkst(_('Gramps online manual'),
- _('http://www.gramps-project.org/wiki/index.php?title=Gramps_3.3_Wiki_Manual')) + '\n'
+ _('http://www.gramps-project.org/wiki/index.php?title=Gramps_4.0_Wiki_Manual')) + '\n'
welcome += linkst(_('Ask questions on gramps-users mailing list'),
_('http://gramps-project.org/contact/')) + '\n\n'
@@ -128,9 +129,9 @@ class WelcomeGramplet(Gramplet):
'"Family Trees" from the menu, pick "Manage Family Trees", press '
'"New" and name your family tree. For more details, please read the '
'information at the links above\n\n')
- welcome += boldst(_('Gramplet View')) + '\n\n' + _(
- 'You are currently reading from the "Gramplets" page, where you can'
- ' add your own gramplets. You can also add Gramplets to any view by'
+ welcome += boldst(_('Dashboard View')) + '\n\n' + _(
+ 'You are currently reading from the "Dashboard" view, where you can'
+ ' 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'
' of the tab.\n\n'
'You can click the configuration icon in the toolbar to add additional'
diff --git a/gramps/plugins/gramplet/whatsnext.py b/gramps/plugins/gramplet/whatsnext.py
index db09c6757..1926fd8be 100644
--- a/gramps/plugins/gramplet/whatsnext.py
+++ b/gramps/plugins/gramplet/whatsnext.py
@@ -31,7 +31,8 @@ from gramps.gen.lib import EventType, FamilyRelType
from gramps.gen.plug import Gramplet
from gramps.gen.display.name import displayer as name_displayer
from gramps.gen.plug.report import utils as ReportUtils
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
#------------------------------------------------------------------------
#
diff --git a/gramps/plugins/graph/graphplugins.gpr.py b/gramps/plugins/graph/graphplugins.gpr.py
index fd6cb15c1..de12121ca 100644
--- a/gramps/plugins/graph/graphplugins.gpr.py
+++ b/gramps/plugins/graph/graphplugins.gpr.py
@@ -31,7 +31,7 @@ plg.id = 'familylines_graph'
plg.name = _("Family Lines Graph")
plg.description = _("Produces family line graphs using GraphViz.")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'gvfamilylines.py'
plg.ptype = REPORT
@@ -54,7 +54,7 @@ plg.id = 'hourglass_graph'
plg.name = _("Hourglass Graph")
plg.description = _("Produces an hourglass graph using Graphviz.")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'gvhourglass.py'
plg.ptype = REPORT
@@ -76,7 +76,7 @@ plg.id = 'rel_graph'
plg.name = _("Relationship Graph")
plg.description = _("Produces relationship graphs using Graphviz.")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'gvrelgraph.py'
plg.ptype = REPORT
diff --git a/gramps/plugins/graph/gvfamilylines.py b/gramps/plugins/graph/gvfamilylines.py
index 7c7aea774..04c2e95c4 100644
--- a/gramps/plugins/graph/gvfamilylines.py
+++ b/gramps/plugins/graph/gvfamilylines.py
@@ -36,7 +36,8 @@ from __future__ import unicode_literals
# python modules
#
#------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from functools import partial
#------------------------------------------------------------------------
diff --git a/gramps/plugins/graph/gvhourglass.py b/gramps/plugins/graph/gvhourglass.py
index 18f54f6e8..304a585f4 100644
--- a/gramps/plugins/graph/gvhourglass.py
+++ b/gramps/plugins/graph/gvhourglass.py
@@ -31,7 +31,8 @@ Generate an hourglass graph using the GraphViz generator.
# python modules
#
#------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#------------------------------------------------------------------------
#
diff --git a/gramps/plugins/graph/gvrelgraph.py b/gramps/plugins/graph/gvrelgraph.py
index 02f0af3bf..0bbade82b 100644
--- a/gramps/plugins/graph/gvrelgraph.py
+++ b/gramps/plugins/graph/gvrelgraph.py
@@ -39,7 +39,8 @@ Create a relationship graph using Graphviz
# python modules
#
#------------------------------------------------------------------------
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from functools import partial
#------------------------------------------------------------------------
@@ -47,6 +48,7 @@ from functools import partial
# GRAMPS modules
#
#------------------------------------------------------------------------
+from gramps.gen.constfunc import conv_to_unicode
from gramps.gen.plug.menu import (BooleanOption, EnumeratedListOption, FilterOption,
PersonOption, ColorOption)
from gramps.gen.plug.report import Report
@@ -172,7 +174,8 @@ class RelGraphReport(Report):
children
"""
# Hash people in a dictionary for faster inclusion checking
- person_dict = dict([handle, 1] for handle in self.person_handles)
+ person_dict = dict([conv_to_unicode(handle, 'utf-8'), 1]
+ for handle in self.person_handles)
for person_handle in self.person_handles:
person = self.database.get_person_from_handle(person_handle)
@@ -182,7 +185,7 @@ class RelGraphReport(Report):
father_handle = family.get_father_handle()
mother_handle = family.get_mother_handle()
for child_ref in family.get_child_ref_list():
- if child_ref.ref == person_handle:
+ if child_ref.ref == conv_to_unicode(person_handle, 'utf-8'):
frel = child_ref.frel
mrel = child_ref.mrel
break
@@ -241,7 +244,7 @@ class RelGraphReport(Report):
(shape, style, color, fill) = self.get_gender_style(person)
url = ""
if self.includeurl:
- h = person_handle
+ h = conv_to_unicode(person_handle, 'utf-8')
dirpath = "ppl/%s/%s" % (h[-1], h[-2])
dirpath = dirpath.lower()
url = "%s/%s.html" % (dirpath, h)
@@ -400,8 +403,15 @@ class RelGraphReport(Report):
label += " (%s)" % p_id
if self.includedates:
birth, death = self.get_date_strings(person)
- label = label + '%s(%s - %s)' % (lineDelimiter, birth, death)
-
+ if birth or death:
+ label += ' %s(' % lineDelimiter
+ if birth:
+ label += '%s' % birth
+ label += ' - '
+ if death:
+ label += '%s' % death
+ label += ')'
+
# see if we have a table that needs to be terminated
if self.bUseHtmlOutput:
label += ''
diff --git a/gramps/plugins/importer/import.gpr.py b/gramps/plugins/importer/import.gpr.py
index 9af0b3cca..d3c68059d 100644
--- a/gramps/plugins/importer/import.gpr.py
+++ b/gramps/plugins/importer/import.gpr.py
@@ -33,7 +33,7 @@ plg.id = 'im_csv'
plg.name = _("Comma Separated Values Spreadsheet (CSV)")
plg.description = _("Import data from CSV files")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'importcsv.py'
plg.ptype = IMPORT
@@ -52,7 +52,7 @@ plg.name = _('GEDCOM')
plg.description = _('GEDCOM is used to transfer data between genealogy programs. '
'Most genealogy software will accept a GEDCOM file as input.')
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'importgedcom.py'
plg.ptype = IMPORT
@@ -70,7 +70,7 @@ plg.id = 'im_geneweb'
plg.name = _('GeneWeb')
plg.description = _('Import data from GeneWeb files')
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'importgeneweb.py'
plg.ptype = IMPORT
@@ -89,7 +89,7 @@ plg.name = _('Gramps package (portable XML)')
plg.description = _('Import data from a Gramps package (an archived XML '
'family tree together with the media object files.)')
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'importgpkg.py'
plg.ptype = IMPORT
@@ -110,7 +110,7 @@ plg.description = _('The Gramps XML format is a text '
'read-write compatible with the '
'present Gramps database format.')
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'importxml.py'
plg.ptype = IMPORT
@@ -128,7 +128,7 @@ plg.id = 'im_grdb'
plg.name = _('Gramps 2.x database')
plg.description = _('Import data from Gramps 2.x database files')
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'importgrdb.py'
plg.ptype = IMPORT
@@ -146,7 +146,7 @@ plg.id = 'im_progen'
plg.name = _('Pro-Gen')
plg.description = _('Import data from Pro-Gen files')
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'importprogen.py'
plg.ptype = IMPORT
@@ -164,7 +164,7 @@ plg.id = 'im_vcard'
plg.name = _('vCard')
plg.description = _('Import data from vCard files')
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'importvcard.py'
plg.ptype = IMPORT
diff --git a/gramps/plugins/importer/importcsv.py b/gramps/plugins/importer/importcsv.py
index b3b2b6dee..1765edd15 100644
--- a/gramps/plugins/importer/importcsv.py
+++ b/gramps/plugins/importer/importcsv.py
@@ -48,9 +48,9 @@ LOG = logging.getLogger(".ImportCSV")
# GRAMPS modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import sgettext as _
-from gramps.gen.ggettext import ngettext
-from gramps.gen.lib import ChildRef, Citation, Event, EventRef, EventType, Family, FamilyRelType, Name, NameType, Note, NoteType, Person, Place, Source, Surname
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
+from gramps.gen.lib import ChildRef, Citation, Event, EventRef, EventType, Family, FamilyRelType, Name, NameType, Note, NoteType, Person, Place, Source, Surname, Tag
from gramps.gen.db import DbTxn
from gramps.gen.plug.utils import OpenFileOrStdin
from gramps.gen.datehandler import parser as _dp
@@ -59,6 +59,7 @@ from gramps.gen.utils.id import create_id
from gramps.gui.utils import ProgressMeter
from gramps.gen.lib.eventroletype import EventRoleType
from gramps.gen.constfunc import cuni, conv_to_unicode, STRTYPE
+from gramps.gen.config import config
#-------------------------------------------------------------------------
#
@@ -95,6 +96,8 @@ class UTF8Recoder(object):
"Encode the next line of the file."
return self.reader.next().encode("utf-8")
+ next = __next__
+
class UnicodeReader(object):
"""
A CSV reader which will iterate over lines in the CSV file,
@@ -120,6 +123,8 @@ class UnicodeReader(object):
def __iter__(self):
return self
+ next = __next__
+
#-------------------------------------------------------------------------
#
# Support and main functions
@@ -141,7 +146,11 @@ def rd(line_number, row, col, key, default = None):
def importData(dbase, filename, user):
"""Function called by Gramps to import data on persons in CSV format."""
- parser = CSVParser(dbase, user)
+ if dbase.get_feature("skip-import-additions"): # don't add source or tags
+ parser = CSVParser(dbase, user, None)
+ else:
+ parser = CSVParser(dbase, user, (config.get('preferences.tag-on-import-format') if
+ config.get('preferences.tag-on-import') else None))
try:
with OpenFileOrStdin(filename, 'b') as filehandle:
parser.parse(filehandle)
@@ -157,7 +166,7 @@ def importData(dbase, filename, user):
#-------------------------------------------------------------------------
class CSVParser(object):
"""Class to read data in CSV format from a file object."""
- def __init__(self, dbase, user):
+ def __init__(self, dbase, user, default_tag_format=None):
self.db = dbase
self.user = user
self.trans = None
@@ -235,6 +244,16 @@ class CSVParser(object):
for val in column2label[key]:
lab2col_dict.append((val, key))
self.label2column = dict(lab2col_dict)
+ if default_tag_format:
+ name = time.strftime(default_tag_format)
+ tag = self.db.get_tag_from_name(name)
+ if tag:
+ self.default_tag = tag
+ else:
+ self.default_tag = Tag()
+ self.default_tag.set_name(name)
+ else:
+ self.default_tag = None
def cleanup_column_name(self, column):
"""Handle column aliases for CSV spreadsheet import and SQL."""
@@ -313,11 +332,13 @@ class CSVParser(object):
tym = time.time()
self.db.disable_signals()
with DbTxn(_("CSV import"), self.db, batch=True) as self.trans:
+ if self.default_tag and self.default_tag.handle is None:
+ self.db.add_tag(self.default_tag, self.trans)
self._parse_csv_data(data, progress)
self.db.enable_signals()
self.db.request_rebuild()
tym = time.time() - tym
- msg = ngettext('Import Complete: %d second',
+ msg = glocale.get_translation().ngettext('Import Complete: %d second',
'Import Complete: %d seconds', tym ) % tym
LOG.debug(msg)
LOG.debug("New Families: %d" % self.fam_count)
@@ -432,6 +453,8 @@ class CSVParser(object):
new_note.handle = create_id()
new_note.type.set(NoteType.EVENT)
new_note.set(note)
+ if self.default_tag:
+ new_note.add_tag(self.default_tag.handle)
self.db.add_note(new_note, self.trans)
marriage.add_note(new_note.handle)
self.db.commit_event(marriage, self.trans)
@@ -506,6 +529,8 @@ class CSVParser(object):
new_note.handle = create_id()
new_note.type.set(NoteType.PERSON)
new_note.set(note)
+ if self.default_tag:
+ new_note.add_tag(self.default_tag.handle)
self.db.add_note(new_note, self.trans)
child.add_note(new_note.handle)
self.db.commit_person(child, self.trans)
@@ -592,6 +617,8 @@ class CSVParser(object):
new_note.handle = create_id()
new_note.type.set(NoteType.PERSON)
new_note.set(note)
+ if self.default_tag:
+ new_note.add_tag(self.default_tag.handle)
self.db.add_note(new_note, self.trans)
person.add_note(new_note.handle)
if grampsid is not None:
@@ -719,6 +746,8 @@ class CSVParser(object):
family.set_gramps_id(id_)
# add it:
family.set_handle(self.db.create_id())
+ if self.default_tag:
+ family.add_tag(self.default_tag.handle)
if husband:
family.set_father_handle(husband.get_handle())
husband.add_family_handle(family.get_handle())
@@ -775,6 +804,8 @@ class CSVParser(object):
def create_person(self):
""" Used to create a new person we know doesn't exist """
person = Person()
+ if self.default_tag:
+ person.add_tag(self.default_tag.handle)
self.db.add_person(person, self.trans)
self.indi_count += 1
return person
diff --git a/gramps/plugins/importer/importgedcom.glade b/gramps/plugins/importer/importgedcom.glade
index 5806a6fdc..fc3b8fc84 100644
--- a/gramps/plugins/importer/importgedcom.glade
+++ b/gramps/plugins/importer/importgedcom.glade
@@ -1,6 +1,29 @@
+
+
+
+
+
+
+
+ default
+
+
+ ANSEL
+
+
+ ANSI (iso-8859-1)
+
+
+ ASCII
+
+
+ UTF8
+
+
+
400
False
@@ -49,8 +72,10 @@
True
False
- <span size="larger" weight="bold">GEDCOM Encoding</span>
- True
+ GEDCOM Encoding
+
+
+
False
@@ -150,29 +175,6 @@
okbutton1
-
-
-
-
-
-
-
- default
-
-
- ANSEL
-
-
- ANSI (iso-8859-1)
-
-
- ASCII
-
-
- UTF8
-
-
-
False
True
@@ -228,8 +230,10 @@
True
False
0
- <b>Warning messages</b>
- True
+ Warning messages
+
+
+
@@ -285,7 +289,7 @@
1
2
GTK_FILL
-
+
@@ -302,7 +306,7 @@
1
2
GTK_FILL
-
+
@@ -319,7 +323,7 @@
2
3
GTK_FILL
-
+
@@ -331,7 +335,7 @@
2
3
-
+
@@ -345,7 +349,7 @@
3
1
2
-
+
@@ -359,7 +363,7 @@
3
2
3
-
+
@@ -374,7 +378,7 @@
3
4
GTK_FILL
-
+
@@ -391,7 +395,7 @@
1
2
GTK_FILL
-
+
@@ -408,7 +412,7 @@
2
3
GTK_FILL
-
+
@@ -421,7 +425,7 @@
4
5
-
+
@@ -436,7 +440,7 @@
5
1
2
-
+
@@ -450,7 +454,7 @@
5
2
3
-
+
@@ -495,14 +499,19 @@
+
+
+
True
False
- <b>Status</b>
- True
+ Status
+
+
+
@@ -521,7 +530,7 @@
5
GTK_FILL
-
+
diff --git a/gramps/plugins/importer/importgedcom.py b/gramps/plugins/importer/importgedcom.py
index 7e2c9e8e4..70d53c838 100644
--- a/gramps/plugins/importer/importgedcom.py
+++ b/gramps/plugins/importer/importgedcom.py
@@ -29,7 +29,6 @@
#
#------------------------------------------------------------------------
import sys
-from gramps.gen.ggettext import gettext as _
#------------------------------------------------------------------------
#
@@ -44,6 +43,8 @@ LOG = logging.getLogger(".GedcomImport")
# GRAMPS modules
#
#------------------------------------------------------------------------
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.errors import DbError, GedcomError
from gramps.gui.glade import Glade
from gramps.plugins.lib.libmixin import DbMixin
@@ -114,9 +115,15 @@ def importData(database, filename, user):
if code_set:
stage_one.set_encoding(code_set)
ifile.seek(0)
- gedparse = libgedcom.GedcomParser(
- database, ifile, filename, user, stage_one,
- config.get('preferences.default-source'))
+ if database.get_feature("skip-import-additions"): # don't add source or tags
+ gedparse = libgedcom.GedcomParser(
+ database, ifile, filename, user, stage_one, None, None)
+ else:
+ gedparse = libgedcom.GedcomParser(
+ database, ifile, filename, user, stage_one,
+ config.get('preferences.default-source'),
+ (config.get('preferences.tag-on-import-format') if
+ config.get('preferences.tag-on-import') else None))
except IOError as msg:
user.notify_error(_("%s could not be opened\n") % filename, str(msg))
return
diff --git a/gramps/plugins/importer/importgeneweb.py b/gramps/plugins/importer/importgeneweb.py
index 4cea4da82..78b9ebf36 100644
--- a/gramps/plugins/importer/importgeneweb.py
+++ b/gramps/plugins/importer/importgeneweb.py
@@ -33,8 +33,8 @@ from __future__ import print_function
import re
import time
import sys
-from gramps.gen.ggettext import gettext as _
-from gramps.gen.ggettext import ngettext
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#------------------------------------------------------------------------
#
@@ -187,7 +187,7 @@ class GeneWebParser(object):
self.errmsg(str(err))
t = time.time() - t
- msg = ngettext('Import Complete: %d second','Import Complete: %d seconds', t ) % t
+ msg = glocale.get_translation().ngettext('Import Complete: %d second','Import Complete: %d seconds', t ) % t
self.db.enable_signals()
self.db.request_rebuild()
diff --git a/gramps/plugins/importer/importgpkg.py b/gramps/plugins/importer/importgpkg.py
index e8c6c88f0..43d816cf8 100644
--- a/gramps/plugins/importer/importgpkg.py
+++ b/gramps/plugins/importer/importgpkg.py
@@ -31,7 +31,8 @@
#-------------------------------------------------------------------------
import os
import tarfile
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#------------------------------------------------------------------------
#
@@ -94,6 +95,7 @@ def impData(database, name, user):
importer = importData
info = importer(database, imp_db_name, user)
+
newmediapath = database.get_mediapath()
#import of gpkg should not change media path as all media has new paths!
if not oldmediapath == newmediapath :
diff --git a/gramps/plugins/importer/importgrdb.py b/gramps/plugins/importer/importgrdb.py
index 27a1551b4..a62983fbb 100644
--- a/gramps/plugins/importer/importgrdb.py
+++ b/gramps/plugins/importer/importgrdb.py
@@ -35,7 +35,8 @@ LOG = logging.getLogger(".Db")
# Gramps Modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/plugins/importer/importprogen.py b/gramps/plugins/importer/importprogen.py
index f8b565ea3..d560aee84 100644
--- a/gramps/plugins/importer/importprogen.py
+++ b/gramps/plugins/importer/importprogen.py
@@ -31,7 +31,6 @@ from __future__ import unicode_literals
#
#-------------------------------------------------------------------------
import re
-from gramps.gen.ggettext import gettext as _
import os
import struct
@@ -48,6 +47,8 @@ log = logging.getLogger('.ImportProGen')
# GRAMPS modules
#
#-------------------------------------------------------------------------
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.utils.id import create_id
from gramps.gui.utils import ProgressMeter
from gramps.gen.lib import (Attribute, AttributeType, ChildRef, Date, Event,
diff --git a/gramps/plugins/importer/importvcard.py b/gramps/plugins/importer/importvcard.py
index 4d12f241f..b11c7be97 100644
--- a/gramps/plugins/importer/importvcard.py
+++ b/gramps/plugins/importer/importvcard.py
@@ -32,8 +32,8 @@
import sys
import re
import time
-from gramps.gen.ggettext import gettext as _
-from gramps.gen.ggettext import ngettext
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#------------------------------------------------------------------------
#
@@ -228,7 +228,7 @@ class VCardParser(object):
self.database.enable_signals()
self.database.request_rebuild()
tym = time.time() - tym
- msg = ngettext('Import Complete: %d second',
+ msg = glocale.get_translation().ngettext('Import Complete: %d second',
'Import Complete: %d seconds', tym ) % tym
LOG.debug(msg)
diff --git a/gramps/plugins/importer/importxml.py b/gramps/plugins/importer/importxml.py
index 904625d7c..6d3bd24f6 100644
--- a/gramps/plugins/importer/importxml.py
+++ b/gramps/plugins/importer/importxml.py
@@ -33,7 +33,8 @@ import os
import sys
import time
from xml.parsers.expat import ExpatError, ParserCreate
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import re
import logging
import collections
@@ -67,6 +68,7 @@ from gramps.gen.db.dbconst import (PERSON_KEY, FAMILY_KEY, SOURCE_KEY,
CITATION_KEY)
from gramps.gen.updatecallback import UpdateCallback
from gramps.gen.const import VERSION
+from gramps.gen.config import config
#import gramps.plugins.lib.libgrampsxml
from gramps.plugins.lib import libgrampsxml
@@ -123,7 +125,12 @@ def importData(database, filename, user):
change = time.time()
else:
change = os.path.getmtime(filename)
- parser = GrampsParser(database, user, change)
+ if database.get_feature("skip-import-additions"): # don't add source or tags
+ parser = GrampsParser(database, user, change, None)
+ else:
+ parser = GrampsParser(database, user, change,
+ (config.get('preferences.tag-on-import-format') if
+ config.get('preferences.tag-on-import') else None))
if filename != '-':
linecounter = LineParser(filename)
@@ -368,7 +375,21 @@ class LineParser(object):
try:
if use_gzip:
- ofile = gzip.open(filename, "rb")
+ if sys.version_info[0] == 2:
+ ofile = gzip.open(filename, "rb")
+ else:
+ import io
+ # Bug 6255. TextIOWrapper is required for python3 to
+ # present file contents as text, otherwise they
+ # are read as binary. However due to a missing
+ # method (read1) in early python3 versions this
+ # try block will fail.
+ # Gramps will still import XML files using python
+ # versions < 3.3.0 but the file progress meter
+ # will not work properly, going immediately to
+ # 100%.
+ # It should work correctly from version 3.3.
+ ofile = io.TextIOWrapper(gzip.open(filename, "rb"))
else:
ofile = open(filename, "r")
@@ -376,11 +397,12 @@ class LineParser(object):
self.count += 1
if PERSON_RE.match(line):
self.person_count += 1
-
- ofile.close()
except:
self.count = 0
self.person_count = 0
+ finally:
+ # Ensure the file handle is always closed
+ ofile.close()
def get_count(self):
return self.count
@@ -457,7 +479,7 @@ class ImportOpenFileContextManager:
#-------------------------------------------------------------------------
class GrampsParser(UpdateCallback):
- def __init__(self, database, user, change):
+ def __init__(self, database, user, change, default_tag_format=None):
UpdateCallback.__init__(self, user.callback)
self.user = user
self.__gramps_version = 'unknown'
@@ -564,6 +586,17 @@ class GrampsParser(UpdateCallback):
self.eidswap = {}
self.import_handles = {}
+ if default_tag_format:
+ name = time.strftime(default_tag_format)
+ tag = self.db.get_tag_from_name(name)
+ if tag:
+ self.default_tag = tag
+ else:
+ self.default_tag = Tag()
+ self.default_tag.set_name(name)
+ else:
+ self.default_tag = None
+
self.func_map = {
#name part
"name": (self.start_name, self.stop_name),
@@ -895,6 +928,9 @@ class GrampsParser(UpdateCallback):
self.db.disable_signals()
+ if self.default_tag and self.default_tag.handle is None:
+ self.db.add_tag(self.default_tag, self.trans)
+
self.p = ParserCreate()
self.p.StartElementHandler = self.startElement
self.p.EndElementHandler = self.endElement
@@ -934,6 +970,7 @@ class GrampsParser(UpdateCallback):
del self.func_map
del self.func_list
del self.p
+ del self.update
self.db.enable_signals()
self.db.request_rebuild()
return self.info
@@ -1384,6 +1421,8 @@ class GrampsParser(UpdateCallback):
self.person.change = int(attrs.get('change', self.change))
self.info.add('new-object', PERSON_KEY, self.person)
self.convert_marker(attrs, self.person)
+ if self.default_tag:
+ self.person.add_tag(self.default_tag.handle)
return self.person
def start_people(self, attrs):
@@ -1520,6 +1559,8 @@ class GrampsParser(UpdateCallback):
if 'type' in attrs:
self.family.type.set_from_xml_str(attrs["type"])
self.convert_marker(attrs, self.family)
+ if self.default_tag:
+ self.family.add_tag(self.default_tag.handle)
return self.family
def start_rel(self, attrs):
@@ -1720,7 +1761,22 @@ class GrampsParser(UpdateCallback):
if self.note:
self.note.add_tag(handle)
-
+
+ if self.event:
+ self.event.add_tag(handle)
+
+ if self.placeobj:
+ self.placeobj.add_tag(handle)
+
+ if self.repo:
+ self.repo.add_tag(handle)
+
+ if self.source:
+ self.source.add_tag(handle)
+
+ if self.citation:
+ self.citation.add_tag(handle)
+
def start_range(self, attrs):
self.note_tags[-1].ranges.append((int(attrs['start']),
int(attrs['end'])))
@@ -1833,6 +1889,8 @@ class GrampsParser(UpdateCallback):
#set correct change time
self.db.commit_note(self.note, self.trans, self.change)
self.info.add('new-object', NOTE_KEY, self.note)
+ if self.default_tag:
+ self.note.add_tag(self.default_tag.handle)
return self.note
def start_noteref(self, attrs):
@@ -2088,6 +2146,8 @@ class GrampsParser(UpdateCallback):
src = attrs.get("src", '')
if src:
self.object.path = src
+ if self.default_tag:
+ self.object.add_tag(self.default_tag.handle)
return self.object
def start_repo(self, attrs):
diff --git a/gramps/plugins/importer/test/importVCard_test.py b/gramps/plugins/importer/test/importvcard_test.py
similarity index 100%
rename from gramps/plugins/importer/test/importVCard_test.py
rename to gramps/plugins/importer/test/importvcard_test.py
diff --git a/gramps/plugins/lib/libcairodoc.py b/gramps/plugins/lib/libcairodoc.py
index 9327ca6ba..5ef596060 100644
--- a/gramps/plugins/lib/libcairodoc.py
+++ b/gramps/plugins/lib/libcairodoc.py
@@ -30,15 +30,15 @@
"""Report output generator based on Cairo.
"""
-from __future__ import division
+from __future__ import division, print_function
#------------------------------------------------------------------------
#
# Python modules
#
#------------------------------------------------------------------------
-from __future__ import print_function
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from math import radians
import re
@@ -47,6 +47,7 @@ import re
# Gramps modules
#
#------------------------------------------------------------------------
+from gramps.gen.constfunc import conv_to_unicode, UNITYPE
from gramps.gen.plug.docgen import (BaseDoc, TextDoc, DrawDoc, ParagraphStyle,
TableCellStyle, SOLID, FONT_SANS_SERIF, FONT_SERIF,
FONT_MONOSPACE, PARA_ALIGN_CENTER, PARA_ALIGN_LEFT)
@@ -66,7 +67,7 @@ log = logging.getLogger(".libcairodoc")
#-------------------------------------------------------------------------
#
-# GTK modules
+# Pango modules
#
#-------------------------------------------------------------------------
from gi.repository import Pango, PangoCairo
@@ -502,7 +503,10 @@ class GtkDocParagraph(GtkDocBaseElement):
"""
Internal method to allow for splitting of paragraphs
"""
- self._plaintext = plaintext
+ if not isinstance(plaintext, UNITYPE):
+ self._plaintext = conv_to_unicode(plaintext, 'utf-8')
+ else:
+ self._plaintext = plaintext
def __set_attrlist(self, attrlist):
"""
@@ -629,18 +633,51 @@ class GtkDocParagraph(GtkDocBaseElement):
#now recalculate the attrilist:
newattrlist = layout.get_attributes().copy()
newattrlist.filter(self.filterattr, index)
- oldattrlist = newattrlist.get_iterator()
- while next(oldattrlist) :
- vals = oldattrlist.get_attrs()
- #print vals
- for attr in vals:
- newattr = attr.copy()
- newattr.start_index -= index if newattr.start_index > index \
- else 0
- newattr.end_index -= index
- newattrlist.insert(newattr)
- new_paragraph.__set_attrlist(newattrlist)
+## GTK3 PROBLEM: get_iterator no longer available!!
+## REFERENCES:
+## http://www.gramps-project.org/bugs/view.php?id=6208
+## https://bugzilla.gnome.org/show_bug.cgi?id=646788
+## workaround: https://github.com/matasbbb/pitivit/commit/da815339e5ce3631b122a72158ba9ffcc9ee4372
+## OLD EASY CODE:
+## oldattrlist = newattrlist.get_iterator()
+## while oldattrlist.next() :
+## vals = oldattrlist.get_attrs()
+## #print (vals)
+## for attr in vals:
+## newattr = attr.copy()
+## newattr.start_index -= index if newattr.start_index > index \
+## else 0
+## newattr.end_index -= index
+## newattrlist.insert(newattr)
+## ## START OF WORKAROUND
+ oldtext = self._text
+ pos = 0
+ realpos = 0
+ markstarts = []
+ #index is in bytecode in the text.. !!
+ while pos < index:
+ char = oldtext[realpos]
+ if char == '<' and oldtext[realpos+1] != '/':
+ # a markup starts
+ end = realpos + oldtext[realpos:].find('>') + 1
+ markstarts += [oldtext[realpos:end]]
+ realpos = end
+ elif char == '<':
+ #this is the closing tag, we did not stop yet, so remove tag!
+ realpos = realpos + oldtext[realpos:].find('>') + 1
+ markstarts.pop()
+ else:
+ pos += len(char.encode('utf-8'))
+ realpos += 1
+ #now construct the marked up text to use
+ newtext = ''.join(markstarts)
+ newtext += oldtext[realpos:]
+ #have it parsed
+ parse_ok, newattrlist, _plaintext, accel_char= \
+ Pango.parse_markup(newtext, -1, '\000')
+## ##END OF WORKAROUND
+ new_paragraph.__set_attrlist(newattrlist)
# then update the first one
self.__set_plaintext(self._plaintext.encode('utf-8')[:index])
self._style.set_bottom_margin(0)
@@ -1007,7 +1044,7 @@ class GtkDocPicture(GtkDocBaseElement):
return (None, self), 0
def draw(self, cr, layout, width, dpi_x, dpi_y):
- from gi.repository import Gtk
+ from gi.repository import Gtk, Gdk
img_width = self._width * dpi_x / 2.54
img_height = self._height * dpi_y / 2.54
@@ -1031,8 +1068,7 @@ class GtkDocPicture(GtkDocBaseElement):
cr.save()
cr.translate(l_margin, 0)
cr.scale(scale, scale)
- gcr = Gdk.CairoContext(cr)
- gcr.set_source_pixbuf(pixbuf,
+ Gdk.cairo_set_source_pixbuf(cr, pixbuf,
(img_width / scale - pixbuf_width) / 2,
(img_height / scale - pixbuf_height) / 2)
cr.rectangle(0 , 0, img_width / scale, img_height / scale)
diff --git a/gramps/plugins/lib/libgedcom.py b/gramps/plugins/lib/libgedcom.py
index 62c4ce9f8..872b779c6 100644
--- a/gramps/plugins/lib/libgedcom.py
+++ b/gramps/plugins/lib/libgedcom.py
@@ -96,7 +96,6 @@ import sys
import re
import time
import codecs
-from gramps.gen.ggettext import gettext as _
from xml.parsers.expat import ParserCreate
from collections import defaultdict
if sys.version_info[0] < 3:
@@ -121,13 +120,15 @@ LOG = logging.getLogger(".libgedcom")
# GRAMPS modules
#
#-------------------------------------------------------------------------
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.errors import GedcomError
from gramps.gen.const import DATA_DIR
from gramps.gen.lib import (Address, Attribute, AttributeType, ChildRef,
ChildRefType, Citation, Date, Event, EventRef, EventRoleType,
EventType, Family, FamilyRelType, LdsOrd, Location, MediaObject,
MediaRef, Name, NameType, Note, NoteType, Person, PersonRef, Place,
- RepoRef, Repository, RepositoryType, Researcher, Source,
+ RepoRef, Repository, RepositoryType, Researcher, Source, Tag,
SourceMediaType, Surname, Url, UrlType)
from gramps.gen.db import DbTxn
from gramps.gen.updatecallback import UpdateCallback
@@ -761,6 +762,15 @@ class Lexer(object):
else:
self.current_list.insert(0, data)
+ def clean_up(self):
+ """
+ Break circular references to parsing methods stored in dictionaries
+ to aid garbage collection
+ """
+ for key in (self.func_map.keys()):
+ del self.func_map[key]
+ del self.func_map
+
#-----------------------------------------------------------------------
#
# GedLine - represents a tokenized version of a GEDCOM line
@@ -1807,7 +1817,7 @@ class GedcomParser(UpdateCallback):
return name
def __init__(self, dbase, ifile, filename, user, stage_one,
- default_source):
+ default_source, default_tag_format=None):
UpdateCallback.__init__(self, user.callback)
self.user = user
self.set_total(stage_one.get_line_count())
@@ -1831,10 +1841,21 @@ class GedcomParser(UpdateCallback):
self.gedmap = GedcomInfoDB()
self.gedsource = self.gedmap.get_from_source_tag('GEDCOM 5.5')
self.use_def_src = default_source
+ self.func_list = []
if self.use_def_src:
self.def_src = Source()
fname = os.path.basename(filename).split('\\')[-1]
self.def_src.set_title(_("Import from GEDCOM (%s)") % fname)
+ if default_tag_format:
+ name = time.strftime(default_tag_format)
+ tag = self.dbase.get_tag_from_name(name)
+ if tag:
+ self.default_tag = tag
+ else:
+ self.default_tag = Tag()
+ self.default_tag.set_name(name)
+ else:
+ self.default_tag = None
self.dir_path = os.path.dirname(filename)
self.is_ftw = False
self.groups = None
@@ -1900,6 +1921,7 @@ class GedcomParser(UpdateCallback):
# +1 <>
TOKEN_CHAN : self.__repo_chan,
}
+ self.func_list.append(self.subm_parse_tbl)
#
# Parse table for <> below the level 0 INDI tag
@@ -1992,6 +2014,7 @@ class GedcomParser(UpdateCallback):
TOKEN__TODO : self.__skip_record,
TOKEN_TITL : self.__person_titl,
}
+ self.func_list.append(self.indi_parse_tbl)
self.name_parse_tbl = {
# +1 NPFX {0:1}
@@ -2027,6 +2050,7 @@ class GedcomParser(UpdateCallback):
# found in Brother's keeper.
TOKEN__ADPN : self.__name_adpn,
}
+ self.func_list.append(self.name_parse_tbl)
#
# Parse table for <> below the level 0 REPO tag
@@ -2051,6 +2075,7 @@ class GedcomParser(UpdateCallback):
TOKEN_EMAIL : self.__repo_email,
TOKEN_WWW : self.__repo_www,
}
+ self.func_list.append(self.repo_parse_tbl)
self.event_parse_tbl = {
# n TYPE {0:1}
@@ -2100,6 +2125,7 @@ class GedcomParser(UpdateCallback):
TOKEN_EMAIL : self.__event_email, # FTB for RESI events
TOKEN_WWW : self.__event_www, # FTB for RESI events
}
+ self.func_list.append(self.event_parse_tbl)
self.adopt_parse_tbl = {
TOKEN_TYPE : self.__event_type,
@@ -2129,6 +2155,7 @@ class GedcomParser(UpdateCallback):
TOKEN_CHAN : self.__ignore,
TOKEN_QUAY : self.__ignore,
}
+ self.func_list.append(self.adopt_parse_tbl)
self.famc_parse_tbl = {
# n FAMC @@ {1:1}
@@ -2143,6 +2170,7 @@ class GedcomParser(UpdateCallback):
# GEDit
TOKEN_STAT : self.__ignore,
}
+ self.func_list.append(self.famc_parse_tbl)
self.person_fact_parse_tbl = {
TOKEN_TYPE : self.__person_fact_type,
@@ -2150,6 +2178,7 @@ class GedcomParser(UpdateCallback):
TOKEN_NOTE : self.__person_attr_note,
TOKEN_RNOTE : self.__person_attr_note,
}
+ self.func_list.append(self.person_fact_parse_tbl)
self.person_attr_parse_tbl = {
TOKEN_TYPE : self.__person_attr_type,
@@ -2166,6 +2195,7 @@ class GedcomParser(UpdateCallback):
TOKEN_NOTE : self.__person_attr_note,
TOKEN_RNOTE : self.__person_attr_note,
}
+ self.func_list.append(self.person_attr_parse_tbl)
self.lds_parse_tbl = {
TOKEN_TEMP : self.__lds_temple,
@@ -2178,6 +2208,7 @@ class GedcomParser(UpdateCallback):
TOKEN_RNOTE : self.__lds_note,
TOKEN_STAT : self.__lds_stat,
}
+ self.func_list.append(self.lds_parse_tbl)
self.asso_parse_tbl = {
TOKEN_RELA : self.__person_asso_rela,
@@ -2185,6 +2216,7 @@ class GedcomParser(UpdateCallback):
TOKEN_NOTE : self.__person_asso_note,
TOKEN_RNOTE : self.__person_asso_note,
}
+ self.func_list.append(self.asso_parse_tbl)
self.citation_parse_tbl = {
TOKEN_PAGE : self.__citation_page,
@@ -2200,6 +2232,7 @@ class GedcomParser(UpdateCallback):
TOKEN_RNOTE : self.__citation_note,
TOKEN_TEXT : self.__citation_data_text,
}
+ self.func_list.append(self.citation_parse_tbl)
self.object_parse_tbl = {
TOKEN_FORM : self.__object_ref_form,
@@ -2209,6 +2242,7 @@ class GedcomParser(UpdateCallback):
TOKEN_RNOTE : self.__object_ref_note,
TOKEN_IGNORE : self.__ignore,
}
+ self.func_list.append(self.object_parse_tbl)
self.parse_loc_tbl = {
TOKEN_ADDR : self.__location_addr,
@@ -2226,6 +2260,7 @@ class GedcomParser(UpdateCallback):
TOKEN_PHON : self.__ignore,
TOKEN_IGNORE : self.__ignore,
}
+ self.func_list.append(self.parse_loc_tbl)
#
# Parse table for <> below the level 0 FAM tag
@@ -2281,6 +2316,7 @@ class GedcomParser(UpdateCallback):
TOKEN_SUBM : self.__ignore,
TOKEN_ATTR : self.__family_attr,
}
+ self.func_list.append(self.family_func)
self.family_rel_tbl = {
TOKEN__FREL : self.__family_frel,
@@ -2288,6 +2324,7 @@ class GedcomParser(UpdateCallback):
TOKEN_ADOP : self.__family_adopt,
TOKEN__STAT : self.__family_stat,
}
+ self.func_list.append(self.family_rel_tbl)
#
# Parse table for <> below the level 0 SOUR tag
@@ -2341,6 +2378,7 @@ class GedcomParser(UpdateCallback):
TOKEN_DATE : self.__ignore,
TOKEN_IGNORE : self.__ignore,
}
+ self.func_list.append(self.source_func)
#
# Parse table for <> below the level 0 OBJE tag
@@ -2369,6 +2407,7 @@ class GedcomParser(UpdateCallback):
TOKEN_RIN : self.__obje_rin,
TOKEN_CHAN : self.__obje_chan,
}
+ self.func_list.append(self.obje_func)
self.parse_addr_tbl = {
TOKEN_DATE : self.__address_date,
@@ -2388,10 +2427,12 @@ class GedcomParser(UpdateCallback):
TOKEN_TYPE : self.__ignore,
TOKEN_CAUS : self.__ignore,
}
+ self.func_list.append(self.parse_addr_tbl)
self.event_cause_tbl = {
TOKEN_SOUR : self.__event_cause_source,
}
+ self.func_list.append(self.event_cause_tbl)
self.event_place_map = {
TOKEN_NOTE : self.__event_place_note,
@@ -2405,11 +2446,13 @@ class GedcomParser(UpdateCallback):
# Not legal, but generated by Ultimate Family Tree
TOKEN_QUAY : self.__ignore,
}
+ self.func_list.append(self.event_place_map)
self.place_map_tbl = {
TOKEN_LATI : self.__place_lati,
TOKEN_LONG : self.__place_long,
}
+ self.func_list.append(self.place_map_tbl)
self.repo_ref_tbl = {
TOKEN_CALN : self.__repo_ref_call,
@@ -2418,15 +2461,18 @@ class GedcomParser(UpdateCallback):
TOKEN_MEDI : self.__repo_ref_medi,
TOKEN_IGNORE : self.__ignore,
}
+ self.func_list.append(self.repo_ref_tbl)
self.parse_person_adopt = {
TOKEN_ADOP : self.__person_adopt_famc_adopt,
}
+ self.func_list.append(self.parse_person_adopt)
self.opt_note_tbl = {
TOKEN_RNOTE : self.__optional_note,
TOKEN_NOTE : self.__optional_note,
}
+ self.func_list.append(self.opt_note_tbl)
self.citation_data_tbl = {
TOKEN_DATE : self.__citation_data_date,
@@ -2434,10 +2480,12 @@ class GedcomParser(UpdateCallback):
TOKEN_RNOTE : self.__citation_data_note,
TOKEN_NOTE : self.__citation_data_note,
}
+ self.func_list.append(self.citation_data_tbl)
self.citation_even_tbl = {
TOKEN_ROLE : self.__citation_even_role,
}
+ self.func_list.append(self.citation_even_tbl)
#
# Parse table for <> record below the level 0 HEAD tag
@@ -2493,6 +2541,7 @@ class GedcomParser(UpdateCallback):
TOKEN_DATE : self.__header_date,
TOKEN_NOTE : self.__header_note,
}
+ self.func_list.append(self.head_parse_tbl)
self.header_sour_parse_tbl = {
TOKEN_VERS : self.__header_sour_vers,
@@ -2500,24 +2549,29 @@ class GedcomParser(UpdateCallback):
TOKEN_CORP : self.__header_sour_corp,
TOKEN_DATA : self.__header_sour_data,
}
+ self.func_list.append(self.header_sour_parse_tbl)
self.header_sour_data = {
TOKEN_DATE : self.__header_sour_date,
TOKEN_COPR : self.__header_sour_copr,
}
+ self.func_list.append(self.header_sour_data)
self.header_corp_addr = {
TOKEN_ADDR : self.__repo_addr,
TOKEN_PHON : self.__repo_phon,
}
+ self.func_list.append(self.header_corp_addr)
self.header_subm = {
TOKEN_NAME : self.__header_subm_name,
}
+ self.func_list.append(self.header_subm)
self.place_form = {
TOKEN_FORM : self.__place_form,
}
+ self.func_list.append(self.place_form)
#
# Parse table for <> below the level 0 NOTE tag
@@ -2536,6 +2590,7 @@ class GedcomParser(UpdateCallback):
TOKEN_RIN : self.__ignore,
TOKEN_CHAN : self.__note_chan,
}
+ self.func_list.append(self.note_parse_tbl)
# look for existing place titles, build a map
self.place_names = {}
@@ -2594,6 +2649,8 @@ class GedcomParser(UpdateCallback):
self.want_parse_warnings = True
if self.use_def_src:
self.dbase.add_source(self.def_src, self.trans)
+ if self.default_tag and self.default_tag.handle is None:
+ self.dbase.add_tag(self.default_tag, self.trans)
self.__parse_record()
self.__parse_trailer()
for title, handle in self.inline_srcs.items():
@@ -2601,6 +2658,7 @@ class GedcomParser(UpdateCallback):
src.set_handle(handle)
src.set_title(title)
self.dbase.add_source(src, self.trans)
+ self.__clean_up()
if not self.dbase.get_feature("skip-check-xref"):
self.__check_xref()
@@ -2612,6 +2670,19 @@ class GedcomParser(UpdateCallback):
message = _("GEDCOM import report: %s errors detected") % \
self.number_of_errors
self.user.info(message, "".join(self.errors), monospaced=True)
+
+ def __clean_up(self):
+ """
+ Break circular references to parsing methods stored in dictionaries
+ to aid garbage collection
+ """
+ for func_map in self.func_list:
+ for key in func_map.keys():
+ del func_map[key]
+ del func_map
+ del self.func_list
+ del self.update
+ self.lexer.clean_up()
def __find_person_handle(self, gramps_id):
"""
@@ -3318,6 +3389,9 @@ class GedcomParser(UpdateCallback):
# Add the default reference if no source has found
self.__add_default_source(person)
+ # Add a default tag if provided
+ self.__add_default_tag(person)
+
self.__check_msgs(_("INDI (individual) Gramps ID %s") %
person.get_gramps_id(), state, person)
# commit the person to the database
@@ -4579,6 +4653,9 @@ class GedcomParser(UpdateCallback):
# add default reference if no reference exists
self.__add_default_source(family)
+ # Add a default tag if provided
+ self.__add_default_tag(family)
+
self.__check_msgs(_("FAM (family) Gramps ID %s") % family.get_gramps_id(),
state, family)
# commit family to database
@@ -6118,6 +6195,9 @@ class GedcomParser(UpdateCallback):
# Add the default reference if no source has found
self.__add_default_source(media)
+ # Add a default tag if provided
+ self.__add_default_tag(media)
+
self.__check_msgs(_("OBJE (multi-media object) Gramps ID %s") %
media.get_gramps_id(), state, media)
# commit the person to the database
@@ -6931,6 +7011,9 @@ class GedcomParser(UpdateCallback):
self.__undefined)
state.msg += sub_state.msg
+ # Add a default tag if provided
+ self.__add_default_tag(new_note)
+
self.dbase.commit_note(new_note, self.trans, new_note.change)
obj.add_note(new_note.get_handle())
@@ -7255,6 +7338,13 @@ class GedcomParser(UpdateCallback):
self.dbase.add_citation(citation, self.trans)
obj.add_citation(citation.handle)
+ def __add_default_tag(self, obj):
+ """
+ Add the default tag to the object.
+ """
+ if self.default_tag:
+ obj.add_tag(self.default_tag.handle)
+
def __subm_name(self, line, state):
"""
@param line: The current line in GedLine format
diff --git a/gramps/plugins/lib/libgrampsxml.py b/gramps/plugins/lib/libgrampsxml.py
index 728474c9e..dcebedf69 100644
--- a/gramps/plugins/lib/libgrampsxml.py
+++ b/gramps/plugins/lib/libgrampsxml.py
@@ -35,5 +35,5 @@
# Public Constants
#
#------------------------------------------------------------------------
-GRAMPS_XML_VERSION = "1.5.0"
+GRAMPS_XML_VERSION = "1.6.0"
diff --git a/gramps/plugins/lib/libgrdb.py b/gramps/plugins/lib/libgrdb.py
index e6a5f854b..470c9e826 100644
--- a/gramps/plugins/lib/libgrdb.py
+++ b/gramps/plugins/lib/libgrdb.py
@@ -37,7 +37,6 @@ else:
import pickle
import time
import random
-import locale
import os
from sys import maxsize
from gramps.gen.config import config
@@ -45,7 +44,8 @@ if config.get('preferences.use-bsddb3') or sys.version_info[0] >= 3:
from bsddb3 import db
else:
from bsddb import db
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import logging
LOG = logging.getLogger(".Db")
@@ -59,6 +59,7 @@ from gramps.gen.lib import (MediaObject, Person, Family, Source, Event, Place,
Repository, Note, GenderStats, Researcher)
from gramps.gen.utils.callback import Callback
from gramps.gen.constfunc import STRTYPE, cuni
+from gramps.gen.const import GRAMPS_LOCALE as glocale
#-------------------------------------------------------------------------
#
@@ -1887,7 +1888,7 @@ class DbGrdb(Callback):
raise NotImplementedError
def sort_surname_list(self):
- self.surname_list.sort(key=locale.strxfrm)
+ self.surname_list.sort(key=glocale.sort_key)
def add_to_surname_list(self, person, batch_transaction):
if batch_transaction:
@@ -2266,29 +2267,29 @@ class DbGrdb(Callback):
return str(handle) in self.note_map
def __sortbyplace(self, first, second):
- return locale.strcoll(self.place_map.get(str(first))[2],
+ return glocale.strcoll(self.place_map.get(str(first))[2],
self.place_map.get(str(second))[2])
def __sortbyplace_key(self, place):
- return locale.strxfrm(self.place_map.get(str(place))[2])
+ return glocale.sort_key(self.place_map.get(str(place))[2])
def __sortbysource(self, first, second):
source1 = cuni(self.source_map[str(first)][2])
source2 = cuni(self.source_map[str(second)][2])
- return locale.strcoll(source1, source2)
+ return glocale.strcoll(source1, source2)
def __sortbysource_key(self, key):
source = cuni(self.source_map[str(key)][2])
- return locale.strxfrm(source)
+ return glocale.sort_key(source)
def __sortbymedia(self, first, second):
media1 = self.media_map[str(first)][4]
media2 = self.media_map[str(second)][4]
- return locale.strcoll(media1, media2)
+ return glocale.strcoll(media1, media2)
def __sortbymedia_key(self, key):
media = self.media_map[str(key)][4]
- return locale.strxfrm(media)
+ return glocale.sort_key(media)
def set_mediapath(self, path):
"""Set the default media path for database, path should be utf-8."""
diff --git a/gramps/plugins/lib/libholiday.py b/gramps/plugins/lib/libholiday.py
index 11f5a2194..7ec1c52a8 100644
--- a/gramps/plugins/lib/libholiday.py
+++ b/gramps/plugins/lib/libholiday.py
@@ -27,7 +27,8 @@
#------------------------------------------------------------------------
from __future__ import print_function
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from xml.parsers import expat
from gramps.gen.lib.calendar import (gregorian_ymd, hebrew_sdn)
import datetime
diff --git a/gramps/plugins/lib/libhtml.py b/gramps/plugins/lib/libhtml.py
index 414f263c5..c232d1f6b 100644
--- a/gramps/plugins/lib/libhtml.py
+++ b/gramps/plugins/lib/libhtml.py
@@ -36,6 +36,7 @@ from __future__ import print_function
import re
import locale
+from gramps.gen.constfunc import STRTYPE
"""
HTML operations.
@@ -201,7 +202,7 @@ class Html(list):
if title is not None:
head += (Html('title', title, inline=True, indent=True))
if html5:
- head += Html('meta', charset="utf-8", indent=True)
+ head += Html('meta', charset=encoding, indent=True)
else:
meta1 = 'http-equiv="content-type" content="text/html;charset=%s"'
meta2 = 'http-equiv="Content-Style-Type" content="text/css"'
@@ -331,7 +332,8 @@ class Html(list):
:rtype: object reference
:returns: reference to object with new value added
"""
- if isinstance(value, Html) or not hasattr(value, '__iter__'):
+ if (isinstance(value, Html) or not hasattr(value, '__iter__') or
+ isinstance(value, STRTYPE)):
value = [value]
index = len(self) - (1 if self.close else 0)
self[index:index] = value
@@ -553,8 +555,9 @@ class Html(list):
:param name: new HTML contents
"""
if len(self) < 2:
- raise AttributeError('No closing tag. Cannot set inside value')
- if isinstance(value, Html) or not hasattr(value, '__iter__'):
+ raise AttributeError('No closing tag. Cannot set inside value')
+ if (isinstance(value, Html) or not hasattr(value, '__iter__') or
+ isinstance(value, STRTYPE)):
value = [value]
self[1:-1] = value
#
diff --git a/gramps/plugins/lib/libhtmlconst.py b/gramps/plugins/lib/libhtmlconst.py
index bd303b2bf..de1bc798d 100644
--- a/gramps/plugins/lib/libhtmlconst.py
+++ b/gramps/plugins/lib/libhtmlconst.py
@@ -32,7 +32,8 @@
General constants used in different html enabled plugins
"""
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#------------------------------------------------------------------------
#
diff --git a/gramps/plugins/lib/libmetadata.py b/gramps/plugins/lib/libmetadata.py
index 5179897bb..5b62133e0 100644
--- a/gramps/plugins/lib/libmetadata.py
+++ b/gramps/plugins/lib/libmetadata.py
@@ -36,7 +36,8 @@ from gi.repository import Gtk
#-------------------------------------------------------------------------
from gramps.gui.listmodel import ListModel
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.utils.place import conv_lat_lon
from fractions import Fraction
from gramps.gen.lib import Date
diff --git a/gramps/plugins/lib/libnarrate.py b/gramps/plugins/lib/libnarrate.py
index 3a8257345..10840570b 100644
--- a/gramps/plugins/lib/libnarrate.py
+++ b/gramps/plugins/lib/libnarrate.py
@@ -72,7 +72,8 @@ def _get_empty_endnote_numbers(obj):
return ""
# avoid normal translation!
-##from gramps.gen.ggettext import gettext as _
+##from gramps.gen.const import GRAMPS_LOCALE as glocale
+##_ = glocale.get_translation().gettext
def _(message): return message
#------------------------------------------------------------------------
diff --git a/gramps/plugins/lib/libpersonview.py b/gramps/plugins/lib/libpersonview.py
index de5dbe23e..03c89756f 100644
--- a/gramps/plugins/lib/libpersonview.py
+++ b/gramps/plugins/lib/libpersonview.py
@@ -49,7 +49,7 @@ _LOG = logging.getLogger(".gui.personview")
#-------------------------------------------------------------------------
from gramps.gen.lib import Person, Surname
from gramps.gen.db import DbTxn
-from gramps.gui.views.listview import ListView
+from gramps.gui.views.listview import ListView, TEXT, MARKUP, ICON
from gramps.gen.utils.string import data_recover_msg
from gramps.gen.display.name import displayer as name_displayer
from gramps.gui.dialog import ErrorDialog, QuestionDialog
@@ -67,7 +67,8 @@ from gramps.gen.plug import CATEGORY_QR_PERSON
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
#-------------------------------------------------------------------------
#
@@ -86,30 +87,30 @@ class BasePersonView(ListView):
COL_DDAT = 5
COL_DPLAC = 6
COL_SPOUSE = 7
- COL_TAGS = 8
- COL_CHAN = 9
- #name of the columns
- COLUMN_NAMES = [
- _('Name'),
- _('ID'),
- _('Gender'),
- _('Birth Date'),
- _('Birth Place'),
- _('Death Date'),
- _('Death Place'),
- _('Spouse'),
- _('Tags'),
- _('Last Changed'),
+ COL_PRIV = 8
+ COL_TAGS = 9
+ COL_CHAN = 10
+ # column definitions
+ COLUMNS = [
+ (_('Name'), TEXT, None),
+ (_('ID'), TEXT, None),
+ (_('Gender'), TEXT, None),
+ (_('Birth Date'), MARKUP, None),
+ (_('Birth Place'), MARKUP, None),
+ (_('Death Date'), MARKUP, None),
+ (_('Death Place'), MARKUP, None),
+ (_('Spouse'), TEXT, None),
+ (_('Private'), ICON, 'gramps-lock'),
+ (_('Tags'), TEXT, None),
+ (_('Last Changed'), TEXT, None),
]
- # columns that contain markup
- MARKUP_COLS = [COL_BDAT, COL_BPLAC, COL_DDAT, COL_DPLAC]
# default setting with visible columns, order of the col, and their size
CONFIGSETTINGS = (
('columns.visible', [COL_NAME, COL_ID, COL_GEN, COL_BDAT, COL_DDAT]),
('columns.rank', [COL_NAME, COL_ID, COL_GEN, COL_BDAT, COL_BPLAC,
- COL_DDAT, COL_DPLAC, COL_SPOUSE, COL_TAGS,
+ COL_DDAT, COL_DPLAC, COL_SPOUSE, COL_PRIV, COL_TAGS,
COL_CHAN]),
- ('columns.size', [250, 75, 75, 100, 175, 100, 175, 100, 100, 100])
+ ('columns.size', [250, 75, 75, 100, 175, 100, 175, 100, 40, 100, 100])
)
ADD_MSG = _("Add a new person")
EDIT_MSG = _("Edit the selected person")
@@ -128,18 +129,15 @@ class BasePersonView(ListView):
'person-delete' : self.row_delete,
'person-rebuild' : self.object_build,
'person-groupname-rebuild' : self.object_build,
- 'tag-update' : self.tag_updated,
'no-database': self.no_database,
}
ListView.__init__(
self, title, pdata, dbstate, uistate,
- BasePersonView.COLUMN_NAMES, len(BasePersonView.COLUMN_NAMES),
- model, signal_map, dbstate.db.get_bookmarks(),
+ model, signal_map,
PersonBookmarks, nav_group,
multiple=True,
- filter_class=PersonSidebarFilter,
- markup=BasePersonView.MARKUP_COLS)
+ filter_class=PersonSidebarFilter)
self.func_list.update({
'J' : self.jump,
@@ -156,12 +154,6 @@ class BasePersonView(ListView):
"""
return 'Person'
- def get_bookmarks(self):
- """
- Return the bookmark object
- """
- return self.dbstate.db.get_bookmarks()
-
def drag_info(self):
"""
Specify the drag type for a single selection
@@ -382,20 +374,6 @@ class BasePersonView(ListView):
self.all_action.set_visible(False)
self.edit_action.set_visible(False)
- def set_active(self):
- """
- Called when the page is displayed.
- """
- ListView.set_active(self)
- self.uistate.viewmanager.tags.tag_enable()
-
- def set_inactive(self):
- """
- Called when the page is no longer displayed.
- """
- ListView.set_inactive(self)
- self.uistate.viewmanager.tags.tag_disable()
-
def merge(self, obj):
"""
Merge the selected people.
diff --git a/gramps/plugins/lib/libplaceview.py b/gramps/plugins/lib/libplaceview.py
index ef43943b3..a5fc1956a 100644
--- a/gramps/plugins/lib/libplaceview.py
+++ b/gramps/plugins/lib/libplaceview.py
@@ -47,7 +47,7 @@ from gi.repository import Gtk
#
#-------------------------------------------------------------------------
from gramps.gen.lib import Place
-from gramps.gui.views.listview import ListView
+from gramps.gui.views.listview import ListView, TEXT, MARKUP, ICON
from gramps.gui.widgets.menuitem import add_menuitem
from gramps.gen.errors import WindowActiveError
from gramps.gui.views.bookmarks import PlaceBookmarks
@@ -65,7 +65,8 @@ from gramps.gen.plug import CATEGORY_QR_PLACE
# internationalization
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
@@ -79,21 +80,24 @@ class PlaceBaseView(ListView):
COL_NAME = 0
COL_ID = 1
COL_LOCATION = 2
- COL_CHAN = 3
- # name of the columns
- COLUMN_NAMES = [
- _('Place Name'),
- _('ID'),
- _('Location'),
- _('Last Changed'),
+ COL_PRIV = 3
+ COL_TAGS = 4
+ COL_CHAN = 5
+ # column definitions
+ COLUMNS = [
+ (_('Place Name'), MARKUP, None),
+ (_('ID'), TEXT, None),
+ (_('Location'), TEXT, None),
+ (_('Private'), ICON, 'gramps-lock'),
+ (_('Tags'), TEXT, None),
+ (_('Last Changed'), TEXT, None),
]
- # columns that contain markup
- MARKUP_COLS = [COL_NAME]
# default setting with visible columns, order of the col, and their size
CONFIGSETTINGS = (
('columns.visible', [COL_NAME, COL_ID, COL_LOCATION]),
- ('columns.rank', [COL_NAME, COL_ID, COL_LOCATION, COL_CHAN]),
- ('columns.size', [250, 75, 350, 100])
+ ('columns.rank', [COL_NAME, COL_ID, COL_LOCATION, COL_PRIV, COL_TAGS,
+ COL_CHAN]),
+ ('columns.size', [250, 75, 350, 40, 100, 100])
)
ADD_MSG = _("Add a new place")
EDIT_MSG = _("Edit the selected place")
@@ -102,8 +106,7 @@ class PlaceBaseView(ListView):
FILTER_TYPE = "Place"
QR_CATEGORY = CATEGORY_QR_PLACE
- def __init__(self, pdata, dbstate, uistate, title, model, nav_group,
- markup=None):
+ def __init__(self, pdata, dbstate, uistate, title, model, nav_group):
signal_map = {
'place-add' : self.row_add,
@@ -117,12 +120,10 @@ class PlaceBaseView(ListView):
ListView.__init__(
self, title, pdata, dbstate, uistate,
- self.COLUMN_NAMES, 5,
model, signal_map,
- dbstate.db.get_place_bookmarks(),
PlaceBookmarks, nav_group,
multiple=True,
- filter_class=PlaceSidebarFilter, markup=markup)
+ filter_class=PlaceSidebarFilter)
self.func_list.update({
'J' : self.jump,
@@ -134,11 +135,13 @@ class PlaceBaseView(ListView):
def navigation_type(self):
return 'Place'
- def get_bookmarks(self):
- return self.dbstate.db.get_place_bookmarks()
-
def define_actions(self):
ListView.define_actions(self)
+ self._add_toolmenu_action('MapsList', _('Loading...'),
+ _("Attempt to see selected locations with a Map "
+ "Service (OpenstreetMap, Google Maps, ...)"),
+ self.gotomap,
+ _('Select a Map Service'))
self._add_action('GotoMap', Gtk.STOCK_JUMP_TO,
_('_Look up with Map Service'),
callback=self.gotomap,
@@ -154,6 +157,7 @@ class PlaceBaseView(ListView):
"""
tb = self.uistate.viewmanager.uimanager.get_widget('/ToolBar')
tb.remove(self.maptoolbtn)
+ ListView.set_inactive(self)
def change_page(self):
"""
@@ -329,6 +333,7 @@ class PlaceBaseView(ListView):
+
@@ -405,6 +410,26 @@ class PlaceBaseView(ListView):
else:
return None
+ def tag_updated(self, handle_list):
+ """
+ Update tagged rows when a tag color changes.
+ """
+ all_links = set([])
+ for tag_handle in handle_list:
+ links = set([link[1] for link in
+ self.dbstate.db.find_backlink_handles(tag_handle,
+ include_classes='Place')])
+ all_links = all_links.union(links)
+ self.row_update(list(all_links))
+
+ def add_tag(self, transaction, place_handle, tag_handle):
+ """
+ Add the given tag to the given place.
+ """
+ place = self.dbstate.db.get_place_from_handle(place_handle)
+ place.add_tag(tag_handle)
+ self.dbstate.db.commit_place(place, transaction)
+
def get_default_gramplets(self):
"""
Define the default gramplets for the sidebar and bottombar.
diff --git a/gramps/plugins/lib/libplugins.gpr.py b/gramps/plugins/lib/libplugins.gpr.py
index e3fa0b556..2af730b0c 100644
--- a/gramps/plugins/lib/libplugins.gpr.py
+++ b/gramps/plugins/lib/libplugins.gpr.py
@@ -32,7 +32,7 @@ name = "Cairodoc lib",
description = _("Provides a library for using Cairo to "
"generate documents."),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'libcairodoc.py',
authors = ["The Gramps project"],
@@ -50,7 +50,7 @@ id = 'libgedcom',
name = "GEDCOM library",
description = _("Provides GEDCOM processing functionality"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'libgedcom.py',
authors = ["The Gramps project"],
@@ -68,7 +68,7 @@ name = "Grampsxml lib",
description = _("Provides common functionality for Gramps XML "
"import/export."),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'libgrampsxml.py',
authors = ["The Gramps project"],
@@ -86,7 +86,7 @@ id = 'libgrdb',
name = "grdb lib",
description = _("Base class for ImportGrdb") ,
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'libgrdb.py',
authors = ["The Gramps project"],
@@ -104,7 +104,7 @@ id = 'libholiday',
name = "holiday lib",
description = _("Provides holiday information for different countries.") ,
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'libholiday.py',
authors = ["The Gramps project"],
@@ -122,7 +122,7 @@ id = 'libhtmlbackend',
name = "htmlbackend lib",
description = _("Manages a HTML file implementing DocBackend.") ,
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'libhtmlbackend.py',
authors = ["The Gramps project"],
@@ -140,7 +140,7 @@ id = 'libhtmlconst',
name = "htmlconst lib",
description = _("Common constants for html files.") ,
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'libhtmlconst.py',
authors = ["The Gramps project"],
@@ -158,7 +158,7 @@ id = 'libhtml',
name = "html lib",
description = _("Manages an HTML DOM tree.") ,
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'libhtml.py',
authors = ["Gerald Britton"],
@@ -176,7 +176,7 @@ id = 'libmapservice',
name = "mapservice lib",
description = _("Provides base functionality for map services.") ,
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'libmapservice.py',
authors = ["The Gramps project"],
@@ -193,7 +193,7 @@ id = 'libnarrate',
name = "narration lib",
description = _("Provides Textual Narration.") ,
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'libnarrate.py',
authors = ["Brian Matherly"],
@@ -210,7 +210,7 @@ id = 'libodfbackend',
name = "odfbackend lib",
description = _("Manages an ODF file implementing DocBackend.") ,
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'libodfbackend.py',
authors = ["The Gramps project"],
@@ -227,7 +227,7 @@ id = 'libtranslate',
name = "translation lib",
description = _("Provides Textual Translation.") ,
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'libtranslate.py',
authors = ["Brian Matherly"],
@@ -244,7 +244,7 @@ id = 'libpersonview',
name = "person list lib",
description = _("Provides the Base needed for the List People views.") ,
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'libpersonview.py',
authors = ["The Gramps project"],
@@ -261,7 +261,7 @@ id = 'libplaceview',
name = "place list lib",
description = _("Provides the Base needed for the List Place views.") ,
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'libplaceview.py',
authors = ["The Gramps project"],
@@ -278,7 +278,7 @@ id = 'libsubstkeyword',
name = "Substitution Values",
description = _("Provides variable substitution on display lines.") ,
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'libsubstkeyword.py',
authors = ["The Gramps project"],
@@ -295,7 +295,7 @@ name = "Graphical report lib",
description = _("Provides the base needed for the ancestor and "
"descendant graphical reports.") ,
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'libtreebase.py',
authors = ["The Gramps project"],
diff --git a/gramps/plugins/lib/librecords.py b/gramps/plugins/lib/librecords.py
index 584766821..fb7347ed5 100644
--- a/gramps/plugins/lib/librecords.py
+++ b/gramps/plugins/lib/librecords.py
@@ -28,7 +28,8 @@
#
#------------------------------------------------------------------------
import datetime
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
#------------------------------------------------------------------------
#
diff --git a/gramps/plugins/lib/libtranslate.py b/gramps/plugins/lib/libtranslate.py
index 68ef05f44..fe5a8da02 100644
--- a/gramps/plugins/lib/libtranslate.py
+++ b/gramps/plugins/lib/libtranslate.py
@@ -8,7 +8,7 @@
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
-# This program is distributed in the hope that it will be useful,
+# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
@@ -29,155 +29,76 @@ Translator class for use by plugins.
# python modules
#
#------------------------------------------------------------------------
-import gettext
-_ = gettext.gettext
#------------------------------------------------------------------------
#
# GRAMPS modules
#
#------------------------------------------------------------------------
-from gramps.gen.utils.trans import get_localedomain
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.datehandler import displayer, LANG_TO_DISPLAY
from gramps.gen.config import config
from gramps.gen.lib.grampstype import GrampsType
from gramps.gen.constfunc import cuni
-#------------------------------------------------------------------------
-#
-# Private Constants
-#
-#------------------------------------------------------------------------
-_LANG_MAP = {
- "bg" : _("Bulgarian"),
- "ca" : _("Catalan"),
- "cs" : _("Czech"),
- "da" : _("Danish"),
- "de" : _("German"),
- "el" : _("Greek"),
- "en" : _("English"),
- "eo" : _("Esperanto"),
- "es" : _("Spanish"),
- "fi" : _("Finnish"),
- "fr" : _("French"),
- "he" : _("Hebrew"),
- "hr" : _("Croatian"),
- "hu" : _("Hungarian"),
- "it" : _("Italian"),
- "ja" : _("Japanese"),
- "lt" : _("Lithuanian"),
- "mk" : _("Macedonian"),
- "nb" : _("Norwegian Bokmal"),
- "nl" : _("Dutch"),
- "nn" : _("Norwegian Nynorsk"),
- "pl" : _("Polish"),
- "pt" : _("Portuguese"),
- "ro" : _("Romanian"),
- "ru" : _("Russian"),
- "sk" : _("Slovak"),
- "sl" : _("Slovenian"),
- "sq" : _("Albanian"),
- "sv" : _("Swedish"),
- "tr" : _("Turkish"),
- "uk" : _("Ukrainian"),
- "vi" : _("Vietnamese"),
- "zh" : _("Chinese")
-}
-
-_COUNTRY_MAP = {
- "BR" : _("Brazil"),
- "CN" : _("China"),
- "PT" : _("Portugal")
-}
-
-#------------------------------------------------------------------------
-#
-# Public Functions
-#
-#------------------------------------------------------------------------
-def get_language_string(lang_code):
- """
- Given a language code of the form "lang_region", return a text string
- representing that language.
- """
- code_parts = lang_code.rsplit("_")
-
- lang = code_parts[0]
- if lang in _LANG_MAP:
- lang = _LANG_MAP[lang]
-
- if len(code_parts) > 1:
- country = code_parts[1]
- if country in _COUNTRY_MAP:
- country = _COUNTRY_MAP[country]
- retstr = _("%(language)s (%(country)s)") % \
- { 'language' : lang, 'country' : country }
- else:
- retstr = lang
-
- return retstr
#-------------------------------------------------------------------------
#
# Translator
#
#-------------------------------------------------------------------------
-class Translator:
+class Translator(object):
"""
This class provides translated strings for the configured language.
"""
DEFAULT_TRANSLATION_STR = "default"
-
+
def __init__(self, lang=DEFAULT_TRANSLATION_STR):
"""
- :param lang: The language to translate to.
+ :param lang: The language to translate to.
The language can be:
* The name of any installed .mo file
* "en" to use the message strings in the code
* "default" to use the default translation being used by gettext.
:type lang: string
:return: nothing
-
+
"""
if lang == Translator.DEFAULT_TRANSLATION_STR:
- self.__trans = None
+ self.__trans = glocale.get_translation()
self.__dd = displayer
else:
- # fallback=True will cause the translator to use English if
- # lang = "en" or if something goes wrong.
- self.__trans = gettext.translation(get_localedomain(),
- languages=[lang],
- fallback=True)
+ # If lang isn't supported, this will fallback to the
+ # current global language
+ self.__trans = glocale.get_translation(languages=[lang])
val = config.get('preferences.date-format')
if lang in LANG_TO_DISPLAY:
self.__dd = LANG_TO_DISPLAY[lang](val)
else:
self.__dd = displayer
-
+
def gettext(self, message):
"""
Return the unicode translated string.
-
+
:param message: The message to be translated.
:type message: string
:returns: The translated message
:rtype: unicode
-
+
"""
- if self.__trans is None:
- return cuni(gettext.gettext(message))
- else:
- return self.__trans.ugettext(message)
-
+ return self.__trans.gettext(message)
+
def ngettext(self, singular, plural, n):
"""
Return the unicode translated singular/plural string.
-
+
The translation of singular/plural is returned unless the translation is
not available and the singular contains the separator. In that case,
the returned value is the portion of singular following the last
separator. Default separator is '|'.
-
+
:param singular: The singular form of the string to be translated.
may contain a context separator
:type singular: unicode
@@ -187,53 +108,49 @@ class Translator:
:type n: int
:returns: The translated singular/plural message
:rtype: unicode
-
+
"""
- if self.__trans is None:
- return cuni(gettext.ngettext(singular, plural, n))
- else:
- return self.__trans.ungettext(singular, plural, n)
-
+ return self.__trans.ngettext(singular, plural, n)
+
def sgettext(self, msgid, sep='|'):
"""
Strip the context used for resolving translation ambiguities.
-
+
The translation of msgid is returned unless the translation is
not available and the msgid contains the separator. In that case,
the returned value is the portion of msgid following the last
separator. Default separator is '|'.
-
+
:param msgid: The string to translated.
:type msgid: unicode
:param sep: The separator marking the context.
:type sep: unicode
:returns: Translation or the original with context stripped.
:rtype: unicode
-
+
"""
- msgval = self.gettext(msgid)
- if msgval == msgid:
- sep_idx = msgid.rfind(sep)
- msgval = msgid[sep_idx+1:]
- return cuni(msgval)
-
+ try:
+ return self.__trans.sgettext(msgid)
+ except AttributeError:
+ return self.__trans.gettext(msgid)
+
def get_date(self, date):
"""
Return a string representing the date appropriate for the language being
translated.
-
+
:param date: The date to be represented.
:type date: :class:`~gen.lib.date.Date`
:returns: The date as text in the proper language.
:rtype: unicode
"""
return self.__dd.display(date)
-
+
def get_type(self, name):
"""
Return a string representing the name appropriate for the language being
translated.
-
+
:param name: The name type to be represented.
:returns: The name as text in the proper language.
:rtype: unicode
diff --git a/gramps/plugins/lib/libtreebase.py b/gramps/plugins/lib/libtreebase.py
index 8eaac4bd8..f5dbf3601 100644
--- a/gramps/plugins/lib/libtreebase.py
+++ b/gramps/plugins/lib/libtreebase.py
@@ -27,7 +27,8 @@
# python modules
#
#------------------------------------------------------------------------
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gen.plug.report import utils as ReportUtils
@@ -403,7 +404,7 @@ class Canvas(Page):
#Calculate my (x) page
#fix soon. should not use .level
- x_page = box.level[0] / colsperpage
+ x_page = box.level[0] // colsperpage
self.__add_box_to_page(x_page, self.y_pages-1,
x_page_offsets[x_page],
diff --git a/gramps/plugins/lib/maps/geography.py b/gramps/plugins/lib/maps/geography.py
index 0ac6d29ee..f578b91f2 100644
--- a/gramps/plugins/lib/maps/geography.py
+++ b/gramps/plugins/lib/maps/geography.py
@@ -27,12 +27,14 @@
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
import os
import sys
import re
from gi.repository import GObject
import time
+from gi.repository import GLib
from math import pi
#-------------------------------------------------------------------------
@@ -54,7 +56,7 @@ from gramps.gen.display.name import displayer as _nd
from gramps.gui.views.navigationview import NavigationView
from gramps.gen.utils.libformatting import FormattingHelper
from gramps.gen.errors import WindowActiveError
-from gramps.gen.const import HOME_DIR, ROOT_DIR
+from gramps.gen.const import HOME_DIR, IMAGE_DIR
from gramps.gui.managedwindow import ManagedWindow
from gramps.gen.config import config
from gramps.gui.editors import EditPlace, EditEvent, EditFamily, EditPerson
@@ -62,7 +64,7 @@ from gramps.gui.selectors.selectplace import SelectPlace
from gi.repository import OsmGpsMap as osmgpsmap
from . import constants
-from .osmGps import OsmGps
+from .osmgps import OsmGps
from .selectionlayer import SelectionLayer
from .placeselection import PlaceSelection
@@ -124,9 +126,9 @@ class GeoGraphyView(OsmGps, NavigationView):
)
def __init__(self, title, pdata, dbstate, uistate,
- get_bookmarks, bm_type, nav_group):
+ bm_type, nav_group):
NavigationView.__init__(self, title, pdata, dbstate, uistate,
- get_bookmarks, bm_type, nav_group)
+ bm_type, nav_group)
self.dbstate = dbstate
self.dbstate.connect('database-changed', self.change_db)
@@ -148,21 +150,23 @@ class GeoGraphyView(OsmGps, NavigationView):
self.places_found = []
self.select_fct = None
self.geo_mainmap = None
- path = os.path.join(ROOT_DIR, "images", "48x48",
+ path = os.path.join(IMAGE_DIR, "48x48",
('gramps-geo-mainmap' + '.png' ))
pathu = path
if sys.version_info[0] < 3:
- pathu = path.encode(sys.getfilesystemencoding())
+ pathu = path.encode(glocale.getfilesystemencoding())
self.geo_mainmap = cairo.ImageSurface.create_from_png(pathu)
- path = os.path.join(ROOT_DIR, "images", "48x48",
+ path = os.path.join(IMAGE_DIR, "48x48",
('gramps-geo-altmap' + '.png' ))
pathu = path
if sys.version_info[0] < 3:
- pathu = path.encode(sys.getfilesystemencoding())
+ pathu = path.encode(glocale.getfilesystemencoding())
self.geo_altmap = cairo.ImageSurface.create_from_png(pathu)
if ( config.get('geography.map_service') in
( constants.OPENSTREETMAP,
- constants.OPENSTREETMAP_RENDERER
+ constants.MAPS_FOR_FREE,
+ constants.OPENCYCLEMAP,
+ constants.OSM_PUBLIC_TRANSPORT,
)):
default_image = self.geo_mainmap
else:
@@ -171,11 +175,11 @@ class GeoGraphyView(OsmGps, NavigationView):
for ident in ( EventType.BIRTH,
EventType.DEATH,
EventType.MARRIAGE ):
- path = os.path.join(ROOT_DIR, "images", "48x48",
+ path = os.path.join(IMAGE_DIR, "48x48",
(constants.ICONS.get(int(ident), default_image) + '.png' ))
pathu = path
if sys.version_info[0] < 3:
- pathu = path.encode(sys.getfilesystemencoding())
+ pathu = path.encode(glocale.getfilesystemencoding())
self.geo_othermap[ident] = cairo.ImageSurface.create_from_png(pathu)
def change_page(self):
@@ -224,7 +228,6 @@ class GeoGraphyView(OsmGps, NavigationView):
is no need to store the database, since we will get the value
from self.state.db
"""
- self.bookmarks.update_bookmarks(self.dbstate.db.get_bookmarks())
if self.active:
self.bookmarks.redraw()
@@ -597,10 +600,10 @@ class GeoGraphyView(OsmGps, NavigationView):
and lvl < 18 ):
lvl += 1
self.osm.set_zoom(lvl)
- GObject.timeout_add(50, self._autozoom_in, lvl,
+ GLib.timeout_add(int(50), self._autozoom_in, lvl,
p1lat, p1lon, p2lat, p2lon)
else:
- GObject.timeout_add(50, self._autozoom_out, lvl,
+ GLib.timeout_add(int(50), self._autozoom_out, lvl,
p1lat, p1lon, p2lat, p2lon)
def _autozoom_out(self, lvl, p1lat, p1lon, p2lat, p2lon):
@@ -612,7 +615,7 @@ class GeoGraphyView(OsmGps, NavigationView):
and lvl > 1 ):
lvl -= 1
self.osm.set_zoom(lvl)
- GObject.timeout_add(50, self._autozoom_out, lvl,
+ GLib.timeout_add(int(50), self._autozoom_out, lvl,
p1lat, p1lon, p2lat, p2lon)
else:
layer = self.get_selection_layer()
@@ -639,7 +642,7 @@ class GeoGraphyView(OsmGps, NavigationView):
p2lat = self.end_selection.rlat
p2lon = self.end_selection.rlon
# We zoom in until at least one marker missing.
- GObject.timeout_add(50, self._autozoom_in, level_start,
+ GLib.timeout_add(int(50), self._autozoom_in, level_start,
p1lat, p1lon, p2lat, p2lon)
def _set_center_and_zoom(self):
diff --git a/gramps/plugins/lib/maps/osmGps.py b/gramps/plugins/lib/maps/osmgps.py
similarity index 99%
rename from gramps/plugins/lib/maps/osmGps.py
rename to gramps/plugins/lib/maps/osmgps.py
index 0b380552f..88be59fe9 100644
--- a/gramps/plugins/lib/maps/osmGps.py
+++ b/gramps/plugins/lib/maps/osmgps.py
@@ -60,7 +60,8 @@ from .lifewaylayer import LifeWayLayer
from .markerlayer import MarkerLayer
from .datelayer import DateLayer
from .messagelayer import MessageLayer
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gen.config import config
from gramps.gui.dialog import ErrorDialog
diff --git a/gramps/plugins/lib/maps/placeselection.py b/gramps/plugins/lib/maps/placeselection.py
index 44436e2b4..df7a92f52 100644
--- a/gramps/plugins/lib/maps/placeselection.py
+++ b/gramps/plugins/lib/maps/placeselection.py
@@ -27,7 +27,8 @@
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
import re
from gi.repository import GObject
import math
@@ -54,7 +55,7 @@ from gi.repository import Gtk
#-------------------------------------------------------------------------
from gramps.gen.errors import WindowActiveError
from gramps.gui.managedwindow import ManagedWindow
-from .osmGps import OsmGps
+from .osmgps import OsmGps
#-------------------------------------------------------------------------
#
diff --git a/gramps/plugins/mapservices/eniroswedenmap.py b/gramps/plugins/mapservices/eniroswedenmap.py
index 05b317809..260a2c896 100644
--- a/gramps/plugins/mapservices/eniroswedenmap.py
+++ b/gramps/plugins/mapservices/eniroswedenmap.py
@@ -31,7 +31,8 @@ Eniro Sweden (Denmark) map service plugin. Opens place in kartor.eniro.se
# python modules
#
#------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#------------------------------------------------------------------------
#
diff --git a/gramps/plugins/mapservices/googlemap.py b/gramps/plugins/mapservices/googlemap.py
index 30e084069..dd5f96366 100644
--- a/gramps/plugins/mapservices/googlemap.py
+++ b/gramps/plugins/mapservices/googlemap.py
@@ -28,7 +28,8 @@ Google Maps map service plugin. Open place in maps.google.com
# python modules
#
#------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#------------------------------------------------------------------------
#
diff --git a/gramps/plugins/mapservices/mapservice.gpr.py b/gramps/plugins/mapservices/mapservice.gpr.py
index f4291f9bc..f1d1efb14 100644
--- a/gramps/plugins/mapservices/mapservice.gpr.py
+++ b/gramps/plugins/mapservices/mapservice.gpr.py
@@ -31,7 +31,7 @@ id = 'EniroMaps',
name = _("EniroMaps"),
description = _("Opens on kartor.eniro.se"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'eniroswedenmap.py',
authors = ["Peter Landgren"],
@@ -50,7 +50,7 @@ id = 'GoogleMaps',
name = _("GoogleMaps"),
description = _("Open on maps.google.com"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'googlemap.py',
authors = ["Benny Malengier"],
@@ -69,7 +69,7 @@ id = 'OpenStreetMap',
name = _("OpenStreetMap"),
description = _("Open on openstreetmap.org"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'openstreetmap.py',
authors = ["Benny Malengier"],
diff --git a/gramps/plugins/mapservices/openstreetmap.py b/gramps/plugins/mapservices/openstreetmap.py
index cf19d00f0..e33554a34 100644
--- a/gramps/plugins/mapservices/openstreetmap.py
+++ b/gramps/plugins/mapservices/openstreetmap.py
@@ -28,7 +28,8 @@ OpenStreetMap map service plugin. Open place in openstreetmap.org
# python modules
#
#------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#------------------------------------------------------------------------
#
diff --git a/gramps/plugins/quickview/ageondate.py b/gramps/plugins/quickview/ageondate.py
index 90e319a5e..e17e16e71 100644
--- a/gramps/plugins/quickview/ageondate.py
+++ b/gramps/plugins/quickview/ageondate.py
@@ -30,7 +30,8 @@ Display references for any object
from gramps.gen.simple import SimpleAccess, SimpleDoc
from gramps.gui.plug.quick import QuickTable
from gramps.gen.utils.alive import probably_alive
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.datehandler import displayer
from gramps.gen.config import config
diff --git a/gramps/plugins/quickview/all_events.py b/gramps/plugins/quickview/all_events.py
index 9189517d0..d2d7934d9 100644
--- a/gramps/plugins/quickview/all_events.py
+++ b/gramps/plugins/quickview/all_events.py
@@ -28,7 +28,8 @@ Display a person's events, both personal and family
from gramps.gen.simple import SimpleAccess, by_date, SimpleDoc
from gramps.gui.plug.quick import QuickTable
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
def run(database, document, person):
"""
diff --git a/gramps/plugins/quickview/all_relations.py b/gramps/plugins/quickview/all_relations.py
index 147b59101..495361fce 100644
--- a/gramps/plugins/quickview/all_relations.py
+++ b/gramps/plugins/quickview/all_relations.py
@@ -32,7 +32,8 @@ Display a person's relations to the home person
#-------------------------------------------------------------------------
from gramps.gen.simple import SimpleAccess, SimpleDoc
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.relationship import get_relationship_calculator
# define the formatting string once as a constant. Since this is reused
diff --git a/gramps/plugins/quickview/attributematch.py b/gramps/plugins/quickview/attributematch.py
index dbe94c6d9..a485a3b57 100644
--- a/gramps/plugins/quickview/attributematch.py
+++ b/gramps/plugins/quickview/attributematch.py
@@ -24,7 +24,8 @@
from gramps.gen.simple import SimpleAccess, SimpleDoc
from gramps.gui.plug.quick import QuickTable
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
def run(database, document, attribute, value=None):
sdb = SimpleAccess(database)
diff --git a/gramps/plugins/quickview/filterbyname.py b/gramps/plugins/quickview/filterbyname.py
index ed9537155..abb745e1d 100644
--- a/gramps/plugins/quickview/filterbyname.py
+++ b/gramps/plugins/quickview/filterbyname.py
@@ -36,8 +36,8 @@ from gramps.gen.datehandler import get_date
import posixpath
from collections import defaultdict
-from gramps.gen.ggettext import sgettext as _
-from gramps.gen.ggettext import ngettext
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
fname_map = {'all': _('Filtering_on|all'),
'Inverse Person': _('Filtering_on|Inverse Person'),
@@ -392,7 +392,7 @@ def run(database, document, filter_name, *args, **kwargs):
else:
raise AttributeError("invalid filter name: '%s'" % filter_name)
- sdoc.paragraph(ngettext("Filter matched %d record."
+ sdoc.paragraph(glocale.get_translation().ngettext("Filter matched %d record."
,
"Filter matched %d records.", matches) % matches)
sdoc.paragraph("")
diff --git a/gramps/plugins/quickview/lineage.py b/gramps/plugins/quickview/lineage.py
index ef79c7c4e..dae274117 100644
--- a/gramps/plugins/quickview/lineage.py
+++ b/gramps/plugins/quickview/lineage.py
@@ -35,7 +35,8 @@ Display a person's father or mother lineage
from gramps.gen.lib import ChildRefType, Person
from gramps.gen.simple import SimpleAccess, SimpleDoc
from gramps.gui.plug.quick import QuickTable
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
__FMT = "%-30s\t%-12s\t%-12s"
__FMT_REM = " %s: %s"
diff --git a/gramps/plugins/quickview/linkreferences.py b/gramps/plugins/quickview/linkreferences.py
index 16ba8d4e9..fe458ef02 100644
--- a/gramps/plugins/quickview/linkreferences.py
+++ b/gramps/plugins/quickview/linkreferences.py
@@ -28,7 +28,8 @@ Display link references for a note
from gramps.gen.simple import SimpleAccess, SimpleDoc
from gramps.gui.plug.quick import QuickTable
from gramps.gen.lib import StyledTextTagType
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
def run(database, document, obj):
"""
diff --git a/gramps/plugins/quickview/onthisday.py b/gramps/plugins/quickview/onthisday.py
index 7780401cb..94dbfe21d 100644
--- a/gramps/plugins/quickview/onthisday.py
+++ b/gramps/plugins/quickview/onthisday.py
@@ -28,7 +28,8 @@ Display all events on a particular day.
from gramps.gen.simple import SimpleAccess, SimpleDoc, SimpleTable
from gramps.gui.plug.quick import QuickTable
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.lib import Date
def get_ref(db, objclass, handle):
diff --git a/gramps/plugins/quickview/quickview.gpr.py b/gramps/plugins/quickview/quickview.gpr.py
index c8ee57a60..e784c5acf 100644
--- a/gramps/plugins/quickview/quickview.gpr.py
+++ b/gramps/plugins/quickview/quickview.gpr.py
@@ -32,7 +32,7 @@ id = 'ageondate',
name = _("Age on Date"),
description = _("Display people and ages on a particular date"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'ageondate.py',
authors = ["Douglas Blank"],
@@ -52,7 +52,7 @@ id = 'attribute_match',
name = _("Attribute Match"),
description = _("Display people with same attribute."),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'attributematch.py',
authors = ["Douglas Blank"],
@@ -72,7 +72,7 @@ id = 'all_events',
name = _("All Events"),
description = _("Display a person's events, both personal and family."),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'all_events.py',
authors = ["Donald N. Allingham"],
@@ -87,7 +87,7 @@ id = 'all_events_fam',
name = _("All Family Events"),
description = _("Display the family and family members events."),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'all_events.py',
authors = ["B. Malengier"],
@@ -107,7 +107,7 @@ id = 'all_relations',
name = _("Relation to Home Person"),
description = _("Display all relationships between person and home person."),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'all_relations.py',
authors = ["B. Malengier"],
@@ -127,7 +127,7 @@ id = 'filterbyname',
name = _("Filter"),
description = _("Display filtered data"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'filterbyname.py',
authors = ["Douglas Blank"],
@@ -147,7 +147,7 @@ id = 'father_lineage',
name = _("Father lineage"),
description = _("Display father lineage"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'lineage.py',
authors = ["B. Malengier"],
@@ -161,7 +161,7 @@ id = 'mother_lineage',
name = _("Mother lineage"),
description = _("Display mother lineage"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'lineage.py',
authors = ["B. Malengier"],
@@ -181,7 +181,7 @@ id = 'onthisday',
name = _("On This Day"),
description = _("Display events on a particular day"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'onthisday.py',
authors = ["Douglas Blank"],
@@ -214,7 +214,7 @@ for (category, item, trans) in refitems:
name = _("%s References") % trans,
description = _("Display references for a %s") % trans,
version = '1.0',
- gramps_target_version = '4.0',
+ gramps_target_version = '4.1',
status = STABLE,
fname = 'references.py',
authors = ["Douglas Blank"],
@@ -228,7 +228,7 @@ register(QUICKREPORT,
name = _("Link References"),
description = _("Display link references for a note"),
version = '1.0',
- gramps_target_version = '4.0',
+ gramps_target_version = '4.1',
status = STABLE,
fname = 'linkreferences.py',
authors = ["Douglas Blank"],
@@ -249,7 +249,7 @@ name = _("Repository References"),
description = _("Display the repository reference for sources related to"
" the active repository"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'reporef.py',
authors = ["Jerome Rapinat"],
@@ -269,7 +269,7 @@ id = 'samesurnames',
name = _("Same Surnames"),
description = _("Display people with the same surname as a person."),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'samesurnames.py',
authors = ["Douglas Blank"],
@@ -283,7 +283,7 @@ id = 'samegivens',
name = _("Same Given Names"),
description = _("Display people with the same given name as a person."),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'samesurnames.py',
authors = ["Douglas Blank"],
@@ -297,7 +297,7 @@ id = 'samegivens_misc',
name = _("Same Given Names - stand-alone"),
description = _("Display people with the same given name as a person."),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'samesurnames.py',
authors = ["Douglas Blank"],
@@ -316,7 +316,7 @@ id = 'siblings',
name = _("Siblings"),
description = _("Display a person's siblings."),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'siblings.py',
authors = ["Donald N. Allingham"],
diff --git a/gramps/plugins/quickview/references.py b/gramps/plugins/quickview/references.py
index 092636dd2..fb9752c01 100644
--- a/gramps/plugins/quickview/references.py
+++ b/gramps/plugins/quickview/references.py
@@ -29,7 +29,8 @@ Display references for any object
from gramps.gen.simple import SimpleAccess, SimpleDoc
from gramps.gui.plug.quick import QuickTable
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
def get_ref(db, objclass, handle):
"""
diff --git a/gramps/plugins/quickview/reporef.py b/gramps/plugins/quickview/reporef.py
index 12a57c2f0..77f22d3ce 100755
--- a/gramps/plugins/quickview/reporef.py
+++ b/gramps/plugins/quickview/reporef.py
@@ -36,7 +36,8 @@ Display RepoRef for sources related to active repository
from gramps.gen.simple import SimpleAccess, SimpleDoc
from gramps.gui.plug.quick import QuickTable
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
def run(database, document, repo):
"""
diff --git a/gramps/plugins/quickview/samesurnames.py b/gramps/plugins/quickview/samesurnames.py
index 881215ee6..f2bb963bb 100644
--- a/gramps/plugins/quickview/samesurnames.py
+++ b/gramps/plugins/quickview/samesurnames.py
@@ -29,8 +29,8 @@ Display a people who have a person's same surname or given name.
from gramps.gen.simple import SimpleAccess, SimpleDoc
from gramps.gui.plug.quick import QuickTable
-from gramps.gen.ggettext import gettext as _
-from gramps.gen.ggettext import ngettext
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.lib import Person
from gramps.gen.filters.rules import Rule
from gramps.gen.filters import GenericFilterFactory
@@ -124,7 +124,7 @@ def run(database, document, person):
matches += 1
document.has_data = matches > 0
- sdoc.paragraph(ngettext("There is %d person with a matching name, or alternate name.\n"
+ sdoc.paragraph(glocale.get_translation().ngettext("There is %d person with a matching name, or alternate name.\n"
,
"There are %d people with a matching name, or alternate name.\n"
, matches) % matches)
@@ -166,7 +166,7 @@ def run_given(database, document, person):
matches += 1
document.has_data = matches > 0
- sdoc.paragraph(ngettext("There is %d person with a matching name, or alternate name.\n"
+ sdoc.paragraph(glocale.get_translation().ngettext("There is %d person with a matching name, or alternate name.\n"
,
"There are %d people with a matching name, or alternate name.\n"
, matches) % matches)
diff --git a/gramps/plugins/quickview/siblings.py b/gramps/plugins/quickview/siblings.py
index d1c1094b0..d0ba1cab6 100644
--- a/gramps/plugins/quickview/siblings.py
+++ b/gramps/plugins/quickview/siblings.py
@@ -29,7 +29,8 @@ Display a person's siblings in a report window
from gramps.gen.simple import SimpleAccess, SimpleDoc
from gramps.gui.plug.quick import QuickTable
from gramps.gen.relationship import get_relationship_calculator
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
def run(database, document, person):
"""
diff --git a/gramps/plugins/rel/relplugins.gpr.py b/gramps/plugins/rel/relplugins.gpr.py
index 59b33e0df..0ac99c782 100644
--- a/gramps/plugins/rel/relplugins.gpr.py
+++ b/gramps/plugins/rel/relplugins.gpr.py
@@ -32,7 +32,7 @@ plg.id = 'relcalc_ca'
plg.name = _("Catalan Relationship Calculator")
plg.description = _("Calculates relationships between people")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'rel_ca.py'
plg.ptype = RELCALC
@@ -46,7 +46,7 @@ plg.id = 'relcalc_cs'
plg.name = _("Czech Relationship Calculator")
plg.description = _("Calculates relationships between people")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'rel_cs.py'
plg.ptype = RELCALC
@@ -59,7 +59,7 @@ plg.id = 'relcalc_da'
plg.name = _("Danish Relationship Calculator")
plg.description = _("Calculates relationships between people")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'rel_da.py'
plg.ptype = RELCALC
@@ -75,7 +75,7 @@ plg.id = 'relcalc_de'
plg.name = _("German Relationship Calculator")
plg.description = _("Calculates relationships between people")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'rel_de.py'
plg.ptype = RELCALC
@@ -91,7 +91,7 @@ plg.id = 'relcalc_es'
plg.name = _("Spanish Relationship Calculator")
plg.description = _("Calculates relationships between people")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'rel_es.py'
plg.ptype = RELCALC
@@ -106,7 +106,7 @@ plg.id = 'relcalc_fi'
plg.name = _("Finnish Relationship Calculator")
plg.description = _("Calculates relationships between people")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'rel_fi.py'
plg.ptype = RELCALC
@@ -121,7 +121,7 @@ plg.id = 'relcalc_fr'
plg.name = _("French Relationship Calculator")
plg.description = _("Calculates relationships between people")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'rel_fr.py'
plg.ptype = RELCALC
@@ -138,7 +138,7 @@ plg.id = 'relcalc_hr'
plg.name = _("Croatian Relationship Calculator")
plg.description = _("Calculates relationships between people")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'rel_hr.py'
plg.ptype = RELCALC
@@ -152,7 +152,7 @@ plg.id = 'relcalc_hu'
plg.name = _("Hungarian Relationship Calculator")
plg.description = _("Calculates relationships between people")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'rel_hu.py'
plg.ptype = RELCALC
@@ -165,7 +165,7 @@ plg.id = 'relcalc_it'
plg.name = _("Italian Relationship Calculator")
plg.description = _("Calculates relationships between people")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'rel_it.py'
plg.ptype = RELCALC
@@ -178,7 +178,7 @@ plg.id = 'relcalc_nl'
plg.name = _("Dutch Relationship Calculator")
plg.description = _("Calculates relationships between people")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'rel_nl.py'
plg.ptype = RELCALC
@@ -195,7 +195,7 @@ plg.id = 'relcalc_no'
plg.name = _("Norwegian Relationship Calculator")
plg.description = _("Calculates relationships between people")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'rel_no.py'
plg.ptype = RELCALC
@@ -212,7 +212,7 @@ plg.id = 'relcalc_pl'
plg.name = _("Polish Relationship Calculator")
plg.description = _("Calculates relationships between people")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'rel_pl.py'
plg.ptype = RELCALC
@@ -228,7 +228,7 @@ plg.id = 'relcalc_pt'
plg.name = _("Portuguese Relationship Calculator")
plg.description = _("Calculates relationships between people")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'rel_pt.py'
plg.ptype = RELCALC
@@ -244,7 +244,7 @@ plg.id = 'relcalc_ru'
plg.name = _("Russian Relationship Calculator")
plg.description = _("Calculates relationships between people")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'rel_ru.py'
plg.ptype = RELCALC
@@ -260,7 +260,7 @@ plg.id = 'relcalc_sk'
plg.name = _("Slovak Relationship Calculator")
plg.description = _("Calculates relationships between people")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'rel_sk.py'
plg.ptype = RELCALC
@@ -274,7 +274,7 @@ plg.id = 'relcalc_sl'
plg.name = _("Slovenian Relationship Calculator")
plg.description = _("Calculates relationships between people")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'rel_sl.py'
plg.ptype = RELCALC
@@ -287,7 +287,7 @@ plg.id = 'relcalc_sv'
plg.name = _("Swedish Relationship Calculator")
plg.description = _("Calculates relationships between people")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'rel_sv.py'
plg.ptype = RELCALC
diff --git a/gramps/plugins/sidebar/categorysidebar.py b/gramps/plugins/sidebar/categorysidebar.py
index 594c22a1a..f9774ed2d 100644
--- a/gramps/plugins/sidebar/categorysidebar.py
+++ b/gramps/plugins/sidebar/categorysidebar.py
@@ -45,12 +45,6 @@ from gramps.gui.viewmanager import get_available_views, views_to_show
#
#-------------------------------------------------------------------------
UICATEGORY = '''
-
-
- %s
-
-
-
%s
@@ -58,22 +52,6 @@ UICATEGORY = '''
'''
-CATEGORY_ICON = {
- 'Gramplets': 'gramps-gramplet',
- 'People': 'gramps-person',
- 'Relationships': 'gramps-relation',
- 'Families': 'gramps-family',
- 'Events': 'gramps-event',
- 'Ancestry': 'gramps-pedigree',
- 'Places': 'gramps-place',
- 'Geography': 'gramps-geo',
- 'Sources': 'gramps-source',
- 'Repositories': 'gramps-repository',
- 'Media': 'gramps-media',
- 'Notes': 'gramps-notes',
- 'Citations': 'gramps-citation',
-}
-
#-------------------------------------------------------------------------
#
# CategorySidebar class
@@ -84,7 +62,7 @@ class CategorySidebar(BaseSidebar):
A sidebar displaying a column of toggle buttons that allows the user to
change the current view.
"""
- def __init__(self, dbstate, uistate):
+ def __init__(self, dbstate, uistate, categories, views):
self.viewmanager = uistate.viewmanager
@@ -92,8 +70,6 @@ class CategorySidebar(BaseSidebar):
self.button_handlers = []
self.ui_category = {}
- self.view_toggle_actions = {}
- self.cat_view_group = None
self.merge_ids = []
self.window = Gtk.ScrolledWindow()
@@ -103,49 +79,26 @@ class CategorySidebar(BaseSidebar):
self.window.show()
use_text = config.get('interface.sidebar-text')
- for cat_num, cat_views in enumerate(self.viewmanager.get_views()):
- uimenuitems = ''
+ for cat_num, cat_name, cat_icon in categories:
+
+ # create the button and add it to the sidebar
+ button = self.__make_sidebar_button(use_text, cat_num,
+ cat_name, cat_icon)
+ vbox.pack_start(button, False, True, 0)
+
+ # Enable view switching during DnD
+ button.drag_dest_set(0, [], 0)
+ button.connect('drag_motion', self.cb_switch_page_on_dnd, cat_num)
+
+ # toollbar buttons for switching views in a category
uitoolitems = ''
- self.view_toggle_actions[cat_num] = []
- for view_num, page in enumerate(cat_views):
-
- if view_num == 0:
- category = page[0].category[1]
- cat_icon = CATEGORY_ICON.get(page[0].category[0])
- if cat_icon is None:
- cat_icon = 'gramps-view'
-
- # create the button and add it to the sidebar
- button = self.__make_sidebar_button(use_text, cat_num,
- category, cat_icon)
- vbox.pack_start(button, False, True, 0)
-
- # Enable view switching during DnD
- button.drag_dest_set(0, [], 0)
- button.connect('drag_motion', self.cb_switch_page_on_dnd,
- cat_num)
- vbox.show_all()
-
- pageid = (page[0].id + '_%i' % view_num)
- uimenuitems += '\n ' % pageid
+ for view_num, view_name, view_icon in views[cat_num]:
+ pageid = 'page_%i_%i' % (cat_num, view_num)
uitoolitems += '\n ' % pageid
- # id, stock, button text, UI, tooltip, page
- if view_num < 9:
- modifier = "%d" % ((view_num % 9) + 1)
- else:
- modifier = ""
+ if len(views[cat_num]) > 1:
+ self.ui_category[cat_num] = UICATEGORY % uitoolitems
- stock_icon = page[0].stock_icon
- if stock_icon is None:
- stock_icon = cat_icon
- self.view_toggle_actions[cat_num].append((pageid,
- stock_icon,
- page[0].name, modifier, page[0].name, view_num))
-
- if len(cat_views) > 1:
- #allow for switching views in a category
- self.ui_category[cat_num] = UICATEGORY % (uimenuitems,
- uitoolitems)
+ vbox.show_all()
def get_top(self):
"""
@@ -159,19 +112,8 @@ class CategorySidebar(BaseSidebar):
"""
# Add buttons to the toolbar for the different view in the category
uimanager = self.viewmanager.uimanager
- if self.cat_view_group:
- if self.cat_view_group in uimanager.get_action_groups():
- uimanager.remove_action_group(self.cat_view_group)
-
- list(map(uimanager.remove_ui, self.merge_ids))
-
+ list(map(uimanager.remove_ui, self.merge_ids))
if cat_num in self.ui_category:
- self.cat_view_group = Gtk.ActionGroup('categoryviews')
- self.cat_view_group.add_radio_actions(
- self.view_toggle_actions[cat_num], value=view_num,
- on_change=self.cb_view_clicked, user_data=cat_num)
- self.cat_view_group.set_sensitive(True)
- uimanager.insert_action_group(self.cat_view_group, 1)
mergeid = uimanager.add_ui_from_string(self.ui_category[cat_num])
self.merge_ids.append(mergeid)
@@ -263,3 +205,10 @@ class CategorySidebar(BaseSidebar):
if self.viewmanager.notebook.get_current_page() != page_no:
self.viewmanager.notebook.set_current_page(page_no)
self.__handlers_unblock()
+
+ def inactive(self):
+ """
+ Called when the sidebar is hidden.
+ """
+ uimanager = self.viewmanager.uimanager
+ list(map(uimanager.remove_ui, self.merge_ids))
diff --git a/gramps/plugins/sidebar/dropdownsidebar.py b/gramps/plugins/sidebar/dropdownsidebar.py
new file mode 100644
index 000000000..74d1204f4
--- /dev/null
+++ b/gramps/plugins/sidebar/dropdownsidebar.py
@@ -0,0 +1,215 @@
+#
+# Gramps - a GTK+/GNOME based genealogy program
+#
+# Copyright (C) 2005-2007 Donald N. Allingham
+# Copyright (C) 2008 Brian G. Matherly
+# Copyright (C) 2009 Benny Malengier
+# Copyright (C) 2010 Nick Hall
+# Copyright (C) 2011 Tim G L Lyons
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# $Id: categorysidebar.py 20634 2012-11-07 17:53:14Z bmcage $
+
+#-------------------------------------------------------------------------
+#
+# GNOME modules
+#
+#-------------------------------------------------------------------------
+from gi.repository import Gtk
+
+#-------------------------------------------------------------------------
+#
+# GRAMPS modules
+#
+#-------------------------------------------------------------------------
+from gramps.gen.config import config
+from gramps.gui.basesidebar import BaseSidebar
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
+#-------------------------------------------------------------------------
+#
+# DropdownSidebar class
+#
+#-------------------------------------------------------------------------
+class DropdownSidebar(BaseSidebar):
+ """
+ A sidebar displaying toggle buttons and buttons with drop-down menus that
+ allows the user to change the current view.
+ """
+ def __init__(self, dbstate, uistate, categories, views):
+
+ self.viewmanager = uistate.viewmanager
+ self.views = views
+
+ self.buttons = []
+ self.button_handlers = []
+
+ self.window = Gtk.ScrolledWindow()
+ grid = Gtk.Grid()
+ self.window.add_with_viewport(grid)
+ self.window.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
+ self.window.show()
+
+ use_text = config.get('interface.sidebar-text')
+ for cat_num, cat_name, cat_icon in categories:
+ self.__make_category(grid, use_text, cat_num, cat_name, cat_icon)
+
+ grid.show_all()
+
+ def get_top(self):
+ """
+ Return the top container widget for the GUI.
+ """
+ return self.window
+
+ def view_changed(self, cat_num, view_num):
+ """
+ Called when the active view is changed.
+ """
+ # Set new button as selected
+ self.__handlers_block()
+ for index, button in enumerate(self.buttons):
+ if index == cat_num:
+ button.set_active(True)
+ else:
+ button.set_active(False)
+ self.__handlers_unblock()
+
+ def __handlers_block(self):
+ """
+ Block signals to the buttons to prevent spurious events.
+ """
+ for idx in range(len(self.buttons)):
+ self.buttons[idx].handler_block(self.button_handlers[idx])
+
+ def __handlers_unblock(self):
+ """
+ Unblock signals to the buttons.
+ """
+ for idx in range(len(self.buttons)):
+ self.buttons[idx].handler_unblock(self.button_handlers[idx])
+
+ def cb_view_clicked(self, radioaction, current, cat_num):
+ """
+ Called when a button causes a view change.
+ """
+ view_num = radioaction.get_current_value()
+ self.viewmanager.goto_page(cat_num, view_num)
+
+ def __category_clicked(self, button, cat_num):
+ """
+ Called when a category button is clicked.
+ """
+ # Make the button inactive. It will be set to active in the
+ # view_changed method if the change was successful.
+ button.set_active(False)
+ self.viewmanager.goto_page(cat_num, None)
+
+ def __view_clicked(self, button, cat_num):
+ """
+ Called when a view drop-down arrow is clicked.
+ """
+ menu = Gtk.Menu()
+ for item in self.views[cat_num]:
+ menuitem = Gtk.ImageMenuItem(label=item[1])
+ image = Gtk.Image.new_from_stock(item[2], Gtk.IconSize.MENU)
+ image.show()
+ menuitem.set_image(image)
+ menuitem.connect("activate", self.cb_menu_clicked, cat_num, item[0])
+ menuitem.show()
+ menu.append(menuitem)
+ menu.popup(None, None, cb_menu_position, button, 0, 0)
+
+ def cb_menu_clicked(self, menuitem, cat_num, view_num):
+ """
+ Called when a view is selected from a drop-down menu.
+ """
+ self.viewmanager.goto_page(cat_num, view_num)
+
+ def __make_category(self, grid, use_text, cat_num, cat_name, cat_icon):
+ """
+ Create a row in the sidebar for a category.
+ """
+ # create the button
+ button = Gtk.ToggleButton()
+ button.set_relief(Gtk.ReliefStyle.NONE)
+ button.set_alignment(0, 0.5)
+ self.buttons.append(button)
+
+ # create the drop-down button to display views
+ if len(self.views[cat_num]) > 1:
+ dropdown = Gtk.Button()
+ dropdown.set_relief(Gtk.ReliefStyle.NONE)
+ dropdown.set_alignment(0.5, 0.5)
+ arrow = Gtk.Arrow(Gtk.ArrowType.DOWN, Gtk.ShadowType.NONE)
+ dropdown.add(arrow)
+ dropdown.connect('clicked', self.__view_clicked, cat_num)
+ dropdown.set_tooltip_text(_('Click to select a view'))
+ grid.attach(dropdown, 1, cat_num, 1, 1)
+
+ # add the tooltip
+ button.set_tooltip_text(cat_name)
+
+ # connect the signal, along with the cat_num as user data
+ handler_id = button.connect('clicked', self.__category_clicked, cat_num)
+ self.button_handlers.append(handler_id)
+ button.show()
+
+ # add the image. If we are using text, use the BUTTON (larger) size.
+ # otherwise, use the smaller size
+ hbox = Gtk.HBox()
+ hbox.show()
+ image = Gtk.Image()
+ if use_text:
+ image.set_from_stock(cat_icon, Gtk.IconSize.BUTTON)
+ else:
+ image.set_from_stock(cat_icon, Gtk.IconSize.DND)
+ image.show()
+ hbox.pack_start(image, False, False, 0)
+ hbox.set_spacing(4)
+
+ # add text if requested
+ if use_text:
+ label = Gtk.Label(label=cat_name)
+ label.show()
+ hbox.pack_start(label, False, True, 0)
+
+ button.add(hbox)
+
+ # Enable view switching during DnD
+ button.drag_dest_set(0, [], 0)
+ button.connect('drag_motion', self.cb_switch_page_on_dnd, cat_num)
+
+ grid.attach(button, 0, cat_num, 1, 1)
+
+ def cb_switch_page_on_dnd(self, widget, context, xpos, ypos, time, page_no):
+ """
+ Switches the page based on drag and drop.
+ """
+ self.__handlers_block()
+ if self.viewmanager.notebook.get_current_page() != page_no:
+ self.viewmanager.notebook.set_current_page(page_no)
+ self.__handlers_unblock()
+
+def cb_menu_position(menu, button):
+ """
+ Determine the position of the popup menu.
+ """
+ ret_val, x_pos, y_pos = button.get_window().get_origin()
+ x_pos += button.get_allocation().x
+ y_pos += button.get_allocation().y + button.get_allocation().height
+
+ return (x_pos, y_pos, False)
diff --git a/gramps/plugins/sidebar/expandersidebar.py b/gramps/plugins/sidebar/expandersidebar.py
new file mode 100644
index 000000000..50b8b0993
--- /dev/null
+++ b/gramps/plugins/sidebar/expandersidebar.py
@@ -0,0 +1,233 @@
+#
+# Gramps - a GTK+/GNOME based genealogy program
+#
+# Copyright (C) 2005-2007 Donald N. Allingham
+# Copyright (C) 2008 Brian G. Matherly
+# Copyright (C) 2009 Benny Malengier
+# Copyright (C) 2010 Nick Hall
+# Copyright (C) 2011 Tim G L Lyons
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# $Id: categorysidebar.py 20634 2012-11-07 17:53:14Z bmcage $
+
+#-------------------------------------------------------------------------
+#
+# GNOME modules
+#
+#-------------------------------------------------------------------------
+from gi.repository import Gtk
+import logging
+
+#-------------------------------------------------------------------------
+#
+# GRAMPS modules
+#
+#-------------------------------------------------------------------------
+from gramps.gen.config import config
+from gramps.gui.basesidebar import BaseSidebar
+
+#-------------------------------------------------------------------------
+#
+# ExpanderSidebar class
+#
+#-------------------------------------------------------------------------
+class ExpanderSidebar(BaseSidebar):
+ """
+ A sidebar displaying toggle buttons and buttons with drop-down menus that
+ allows the user to change the current view.
+ """
+ def __init__(self, dbstate, uistate, categories, views):
+
+ self.viewmanager = uistate.viewmanager
+ self.views = views
+
+ self.expanders = []
+ self.buttons = []
+ self.button_handlers = []
+ self.lookup = {}
+
+ self.window = Gtk.ScrolledWindow()
+ vbox = Gtk.VBox()
+ self.window.add_with_viewport(vbox)
+ self.window.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
+ self.window.show()
+
+ use_text = config.get('interface.sidebar-text')
+ for cat_num, cat_name, cat_icon in categories:
+
+ expander = Gtk.Expander()
+ self.expanders.append(expander)
+
+ catbox = Gtk.HBox()
+ image = Gtk.Image()
+ image.set_from_stock(cat_icon, Gtk.IconSize.BUTTON)
+ catbox.pack_start(image, False, False, 4)
+ if use_text:
+ label = Gtk.Label(label=cat_name)
+ catbox.pack_start(label, False, True, 4)
+ catbox.set_tooltip_text(cat_name)
+ expander.set_label_widget(catbox)
+
+ viewbox = Gtk.VBox()
+ for view_num, view_name, view_icon in views[cat_num]:
+ # create the button and add it to the sidebar
+ button = self.__make_sidebar_button(use_text, cat_num, view_num,
+ view_name, view_icon)
+
+ viewbox.pack_start(button, False, False, 0)
+ expander.add(viewbox)
+ vbox.pack_start(expander, False, True, 0)
+
+ # Enable view switching during DnD
+ #catbox.drag_dest_set(0, [], 0)
+ #catbox.connect('drag_motion', self.cb_switch_page_on_dnd, cat_num)
+
+ vbox.show_all()
+
+ def get_top(self):
+ """
+ Return the top container widget for the GUI.
+ """
+ return self.window
+
+ def view_changed(self, cat_num, view_num):
+ """
+ Called when the active view is changed.
+ """
+ # Expand category
+ if cat_num is not None:
+ self.expanders[cat_num].set_expanded(True)
+ # Set new button as selected
+ try:
+ button_num = self.lookup[(cat_num, view_num)]
+ except KeyError as err:
+ logging.warning("Key Error retrieving button number: %s" % str(err))
+ button_num = 0
+ self.__handlers_block()
+ for index, button in enumerate(self.buttons):
+ if index == button_num:
+ button.set_active(True)
+ else:
+ button.set_active(False)
+ self.__handlers_unblock()
+
+ def __handlers_block(self):
+ """
+ Block signals to the buttons to prevent spurious events.
+ """
+ for idx in range(len(self.buttons)):
+ self.buttons[idx].handler_block(self.button_handlers[idx])
+
+ def __handlers_unblock(self):
+ """
+ Unblock signals to the buttons.
+ """
+ for idx in range(len(self.buttons)):
+ self.buttons[idx].handler_unblock(self.button_handlers[idx])
+
+ def cb_view_clicked(self, radioaction, current, cat_num):
+ """
+ Called when a button causes a view change.
+ """
+ view_num = radioaction.get_current_value()
+ self.viewmanager.goto_page(cat_num, view_num)
+
+ def __category_clicked(self, button, cat_num):
+ """
+ Called when a category button is clicked.
+ """
+ # Make the button inactive. It will be set to active in the
+ # view_changed method if the change was successful.
+ button.set_active(False)
+ self.viewmanager.goto_page(cat_num, None)
+
+ def __view_clicked(self, button, cat_num, view_num):
+ """
+ Called when a view button is clicked.
+ """
+ self.viewmanager.goto_page(cat_num, view_num)
+
+ def cb_menu_clicked(self, menuitem, cat_num, view_num):
+ """
+ Called when a view is selected from a drop-down menu.
+ """
+ self.viewmanager.goto_page(cat_num, view_num)
+
+ def __make_sidebar_button(self, use_text, cat_num, view_num, view_name, view_icon):
+ """
+ Create the sidebar button. The page_title is the text associated with
+ the button.
+ """
+ top = Gtk.HBox()
+
+ # create the button
+ button = Gtk.ToggleButton()
+ button.set_relief(Gtk.ReliefStyle.NONE)
+ button.set_alignment(0, 0.5)
+ self.buttons.append(button)
+ self.lookup[(cat_num, view_num)] = len(self.buttons) - 1
+
+ # add the tooltip
+ button.set_tooltip_text(view_name)
+
+ # connect the signal, along with the index as user data
+ handler_id = button.connect('clicked', self.__view_clicked, cat_num, view_num)
+ self.button_handlers.append(handler_id)
+ button.show()
+
+ # add the image. If we are using text, use the BUTTON (larger) size.
+ # otherwise, use the smaller size
+ hbox = Gtk.HBox()
+ hbox.show()
+ image = Gtk.Image()
+ if use_text:
+ image.set_from_stock(view_icon, Gtk.IconSize.BUTTON)
+ else:
+ image.set_from_stock(view_icon, Gtk.IconSize.DND)
+ image.show()
+ hbox.pack_start(image, False, False, 0)
+ hbox.set_spacing(4)
+
+ # add text if requested
+ if use_text:
+ label = Gtk.Label(label=view_name)
+ label.show()
+ hbox.pack_start(label, False, True, 0)
+
+ button.add(hbox)
+
+ top.pack_start(button, False, True, 0)
+
+ return top
+
+ def cb_switch_page_on_dnd(self, widget, context, xpos, ypos, time, page_no):
+ """
+ Switches the page based on drag and drop.
+ """
+ self.__handlers_block()
+ if self.viewmanager.notebook.get_current_page() != page_no:
+ self.viewmanager.notebook.set_current_page(page_no)
+ self.__handlers_unblock()
+
+def cb_menu_position(menu, button):
+ """
+ Determine the position of the popup menu.
+ """
+ ret_val, x_pos, y_pos = button.get_window().get_origin()
+ x_pos += button.get_allocation().x
+ y_pos += button.get_allocation().y + button.get_allocation().height
+
+ return (x_pos, y_pos, False)
diff --git a/gramps/plugins/sidebar/sidebar.gpr.py b/gramps/plugins/sidebar/sidebar.gpr.py
index 3318f5a9b..b95724273 100644
--- a/gramps/plugins/sidebar/sidebar.gpr.py
+++ b/gramps/plugins/sidebar/sidebar.gpr.py
@@ -30,7 +30,7 @@ id = 'categorysidebar',
name = _("Category Sidebar"),
description = _("A sidebar to allow the selection of view categories"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'categorysidebar.py',
authors = ["Nick Hall"],
@@ -39,3 +39,33 @@ sidebarclass = 'CategorySidebar',
menu_label = _('Category'),
order = START
)
+
+register(SIDEBAR,
+id = 'dropdownsidebar',
+name = _("Drop-down Sidebar"),
+description = _("Selection of categories and views from drop-down lists"),
+version = '1.0',
+gramps_target_version = '4.1',
+status = STABLE,
+fname = 'dropdownsidebar.py',
+authors = ["Nick Hall"],
+authors_email = ["nick__hall@hotmail.com"],
+sidebarclass = 'DropdownSidebar',
+menu_label = _('Drop-Down'),
+order = END
+)
+
+register(SIDEBAR,
+id = 'expandersidebar',
+name = _("Expander Sidebar"),
+description = _("Selection of views from lists with expanders"),
+version = '1.0',
+gramps_target_version = '4.1',
+status = STABLE,
+fname = 'expandersidebar.py',
+authors = ["Nick Hall"],
+authors_email = ["nick__hall@hotmail.com"],
+sidebarclass = 'ExpanderSidebar',
+menu_label = _('Expander'),
+order = END
+)
diff --git a/gramps/plugins/textreport/alphabeticalindex.py b/gramps/plugins/textreport/alphabeticalindex.py
index 557e57b1d..328c4271c 100644
--- a/gramps/plugins/textreport/alphabeticalindex.py
+++ b/gramps/plugins/textreport/alphabeticalindex.py
@@ -24,7 +24,8 @@
# Python modules
#
#------------------------------------------------------------------------
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
#------------------------------------------------------------------------
#
diff --git a/gramps/plugins/textreport/ancestorreport.py b/gramps/plugins/textreport/ancestorreport.py
index 151f83e33..089459b16 100644
--- a/gramps/plugins/textreport/ancestorreport.py
+++ b/gramps/plugins/textreport/ancestorreport.py
@@ -32,13 +32,15 @@
#------------------------------------------------------------------------
import math
import copy
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#------------------------------------------------------------------------
#
# gramps modules
#
#------------------------------------------------------------------------
+from gramps.gen.const import GRAMPS_LOCALE as glocale
from gramps.gen.display.name import displayer as global_name_display
from gramps.gen.errors import ReportError
from gramps.gen.lib import ChildRefType
@@ -50,9 +52,8 @@ from gramps.gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle,
from gramps.gen.plug.report import Report
from gramps.gen.plug.report import utils as ReportUtils
from gramps.gen.plug.report import MenuReportOptions
-from gramps.gen.utils.trans import get_available_translations
from gramps.plugins.lib.libnarrate import Narrator
-from gramps.plugins.lib.libtranslate import Translator, get_language_string
+from gramps.plugins.lib.libtranslate import Translator
#------------------------------------------------------------------------
#
@@ -299,8 +300,9 @@ class AncestorOptions(MenuReportOptions):
trans = EnumeratedListOption(_("Translation"),
Translator.DEFAULT_TRANSLATION_STR)
trans.add_item(Translator.DEFAULT_TRANSLATION_STR, _("Default"))
- for language in get_available_translations():
- trans.add_item(language, get_language_string(language))
+ languages = glocale.get_language_dict()
+ for language in sorted(languages, key=glocale.sort_key):
+ trans.add_item(languages[language], language)
trans.set_help(_("The translation to be used for the report."))
menu.add_option(category_name, "trans", trans)
diff --git a/gramps/plugins/textreport/birthdayreport.py b/gramps/plugins/textreport/birthdayreport.py
index 07c04fc2d..462172e58 100644
--- a/gramps/plugins/textreport/birthdayreport.py
+++ b/gramps/plugins/textreport/birthdayreport.py
@@ -29,8 +29,9 @@
#
#------------------------------------------------------------------------
import copy
-from gramps.gen.ggettext import gettext as _
-from gramps.gen.ggettext import ngettext
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
+ngettext = glocale.get_translation().ngettext
import datetime, time
#------------------------------------------------------------------------
diff --git a/gramps/plugins/textreport/custombooktext.py b/gramps/plugins/textreport/custombooktext.py
index 60a43ee34..c6539ba8c 100644
--- a/gramps/plugins/textreport/custombooktext.py
+++ b/gramps/plugins/textreport/custombooktext.py
@@ -30,7 +30,8 @@
# python modules
#
#------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#------------------------------------------------------------------------
#
diff --git a/gramps/plugins/textreport/descendreport.py b/gramps/plugins/textreport/descendreport.py
index b91e854e4..9b90d05e5 100644
--- a/gramps/plugins/textreport/descendreport.py
+++ b/gramps/plugins/textreport/descendreport.py
@@ -35,7 +35,8 @@ Reports/Text Reports/Descendant Report.
#
#------------------------------------------------------------------------
import copy
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#------------------------------------------------------------------------
#
@@ -334,7 +335,7 @@ class DescendantReport(Report):
raise ReportError(_("Person %s is not in the Database") % pid )
sort = Sort(self.database)
- self.by_birthdate = sort.by_birthdate
+ self.by_birthdate = sort.by_birthdate_key
#Initialize the Printinfo class
self._showdups = menu.get_option_by_name('dups').get_value()
diff --git a/gramps/plugins/textreport/detancestralreport.py b/gramps/plugins/textreport/detancestralreport.py
index b3c6486b7..b5291b2de 100644
--- a/gramps/plugins/textreport/detancestralreport.py
+++ b/gramps/plugins/textreport/detancestralreport.py
@@ -35,13 +35,15 @@
#
#------------------------------------------------------------------------
import copy
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#------------------------------------------------------------------------
#
# GRAMPS modules
#
#------------------------------------------------------------------------
+from gramps.gen.const import GRAMPS_LOCALE as glocale
from gramps.gen.display.name import displayer as global_name_display
from gramps.gen.errors import ReportError
from gramps.gen.lib import EventType, FamilyRelType, Person, NoteType
@@ -54,8 +56,7 @@ from gramps.gen.plug.report import endnotes
from gramps.gen.plug.report import utils as ReportUtils
from gramps.gen.plug.report import MenuReportOptions
from gramps.plugins.lib.libnarrate import Narrator
-from gramps.gen.utils.trans import get_available_translations
-from gramps.plugins.lib.libtranslate import Translator, get_language_string
+from gramps.plugins.lib.libtranslate import Translator
#------------------------------------------------------------------------
#
@@ -753,8 +754,9 @@ class DetAncestorOptions(MenuReportOptions):
trans = EnumeratedListOption(_("Translation"),
Translator.DEFAULT_TRANSLATION_STR)
trans.add_item(Translator.DEFAULT_TRANSLATION_STR, _("Default"))
- for language in get_available_translations():
- trans.add_item(language, get_language_string(language))
+ languages = glocale.get_language_dict()
+ for language in sorted(languages, key=glocale.sort_key):
+ trans.add_item(languages[language], language)
trans.set_help(_("The translation to be used for the report."))
addopt("trans", trans)
diff --git a/gramps/plugins/textreport/detdescendantreport.py b/gramps/plugins/textreport/detdescendantreport.py
index 3bc96db83..b536737aa 100644
--- a/gramps/plugins/textreport/detdescendantreport.py
+++ b/gramps/plugins/textreport/detdescendantreport.py
@@ -37,7 +37,6 @@
#
#------------------------------------------------------------------------
import copy
-from gramps.gen.ggettext import gettext as _
from functools import partial
#------------------------------------------------------------------------
@@ -45,6 +44,9 @@ from functools import partial
# GRAMPS modules
#
#------------------------------------------------------------------------
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
+from gramps.gen.const import GRAMPS_LOCALE as glocale
from gramps.gen.display.name import displayer as global_name_display
from gramps.gen.errors import ReportError
from gramps.gen.lib import FamilyRelType, Person, NoteType
@@ -58,8 +60,7 @@ from gramps.gen.plug.report import endnotes
from gramps.gen.plug.report import utils as ReportUtils
from gramps.gen.plug.report import MenuReportOptions
from gramps.plugins.lib.libnarrate import Narrator
-from gramps.gen.utils.trans import get_available_translations
-from gramps.plugins.lib.libtranslate import Translator, get_language_string
+from gramps.plugins.lib.libtranslate import Translator
#------------------------------------------------------------------------
#
@@ -928,8 +929,9 @@ class DetDescendantOptions(MenuReportOptions):
trans = EnumeratedListOption(_("Translation"),
Translator.DEFAULT_TRANSLATION_STR)
trans.add_item(Translator.DEFAULT_TRANSLATION_STR, _("Default"))
- for language in get_available_translations():
- trans.add_item(language, get_language_string(language))
+ languages = glocale.get_language_dict()
+ for language in sorted(languages, key=glocale.sort_key):
+ trans.add_item(languages[language], language)
trans.set_help(_("The translation to be used for the report."))
add_option("trans", trans)
diff --git a/gramps/plugins/textreport/endoflinereport.py b/gramps/plugins/textreport/endoflinereport.py
index 989483ea9..4c3f1583a 100644
--- a/gramps/plugins/textreport/endoflinereport.py
+++ b/gramps/plugins/textreport/endoflinereport.py
@@ -29,7 +29,8 @@
#
#------------------------------------------------------------------------
import copy
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#------------------------------------------------------------------------
#
diff --git a/gramps/plugins/textreport/familygroup.py b/gramps/plugins/textreport/familygroup.py
index fbe24e70a..5d6bb0e73 100644
--- a/gramps/plugins/textreport/familygroup.py
+++ b/gramps/plugins/textreport/familygroup.py
@@ -46,7 +46,8 @@ from gramps.gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle, TableS
TableCellStyle, FONT_SANS_SERIF, FONT_SERIF,
INDEX_TYPE_TOC, PARA_ALIGN_CENTER)
from gramps.gen.datehandler import get_date
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gen.display.name import displayer as global_name_display
#------------------------------------------------------------------------
diff --git a/gramps/plugins/textreport/indivcomplete.py b/gramps/plugins/textreport/indivcomplete.py
index 5ffa044d8..7734b6786 100644
--- a/gramps/plugins/textreport/indivcomplete.py
+++ b/gramps/plugins/textreport/indivcomplete.py
@@ -33,7 +33,8 @@
#------------------------------------------------------------------------
import os
import copy
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from collections import defaultdict
#------------------------------------------------------------------------
diff --git a/gramps/plugins/textreport/kinshipreport.py b/gramps/plugins/textreport/kinshipreport.py
index 749fde37c..947a71322 100644
--- a/gramps/plugins/textreport/kinshipreport.py
+++ b/gramps/plugins/textreport/kinshipreport.py
@@ -31,7 +31,8 @@
#
#------------------------------------------------------------------------
import copy
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#------------------------------------------------------------------------
#
diff --git a/gramps/plugins/textreport/numberofancestorsreport.py b/gramps/plugins/textreport/numberofancestorsreport.py
index 72c358543..dc2a07b57 100644
--- a/gramps/plugins/textreport/numberofancestorsreport.py
+++ b/gramps/plugins/textreport/numberofancestorsreport.py
@@ -32,8 +32,8 @@
#
#------------------------------------------------------------------------
import copy
-from gramps.gen.ggettext import gettext as _
-from gramps.gen.ggettext import ngettext
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import locale
import math
@@ -120,7 +120,7 @@ class NumberOfAncestorsReport(Report):
# TC # English return something like:
# Generation 3 has 2 individuals. (50.00%)
- text = ngettext(
+ text = glocale.get_translation().ngettext(
"Generation %(generation)d has %(count)d individual. %(percent)s",
"Generation %(generation)d has %(count)d individuals. %(percent)s",
thisgensize) % {'generation': gen, 'count': thisgensize, 'percent': percent}
diff --git a/gramps/plugins/textreport/placereport.py b/gramps/plugins/textreport/placereport.py
index 350397b5b..cdddfec8e 100644
--- a/gramps/plugins/textreport/placereport.py
+++ b/gramps/plugins/textreport/placereport.py
@@ -29,7 +29,8 @@
# python modules
#
#------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#------------------------------------------------------------------------
#
diff --git a/gramps/plugins/textreport/recordsreport.py b/gramps/plugins/textreport/recordsreport.py
index f55e61593..f19269f0b 100644
--- a/gramps/plugins/textreport/recordsreport.py
+++ b/gramps/plugins/textreport/recordsreport.py
@@ -27,7 +27,8 @@
# Standard Python modules
#
#------------------------------------------------------------------------
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
#------------------------------------------------------------------------
#
diff --git a/gramps/plugins/textreport/simplebooktitle.py b/gramps/plugins/textreport/simplebooktitle.py
index c0a8a38c0..192ac6066 100644
--- a/gramps/plugins/textreport/simplebooktitle.py
+++ b/gramps/plugins/textreport/simplebooktitle.py
@@ -28,7 +28,8 @@
#
#------------------------------------------------------------------------
import time
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
import os
#------------------------------------------------------------------------
diff --git a/gramps/plugins/textreport/summary.py b/gramps/plugins/textreport/summary.py
index 4a22bb403..72c7cc2dc 100644
--- a/gramps/plugins/textreport/summary.py
+++ b/gramps/plugins/textreport/summary.py
@@ -32,7 +32,8 @@ Reports/Text Reports/Database Summary Report.
#
#------------------------------------------------------------------------
import posixpath
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#------------------------------------------------------------------------
#
diff --git a/gramps/plugins/textreport/tableofcontents.py b/gramps/plugins/textreport/tableofcontents.py
index f70562ab9..a897bd63c 100644
--- a/gramps/plugins/textreport/tableofcontents.py
+++ b/gramps/plugins/textreport/tableofcontents.py
@@ -24,7 +24,8 @@
# Python modules
#
#------------------------------------------------------------------------
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
#------------------------------------------------------------------------
#
diff --git a/gramps/plugins/textreport/tagreport.py b/gramps/plugins/textreport/tagreport.py
index 9561cafd8..858fe2cc4 100644
--- a/gramps/plugins/textreport/tagreport.py
+++ b/gramps/plugins/textreport/tagreport.py
@@ -30,7 +30,8 @@
# standard python modules
#
#------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#------------------------------------------------------------------------
#
diff --git a/gramps/plugins/textreport/textplugins.gpr.py b/gramps/plugins/textreport/textplugins.gpr.py
index e6727eb9e..7e5f370fc 100644
--- a/gramps/plugins/textreport/textplugins.gpr.py
+++ b/gramps/plugins/textreport/textplugins.gpr.py
@@ -32,7 +32,7 @@ plg.id = 'ancestor_report'
plg.name = _("Ahnentafel Report")
plg.description = _("Produces a textual ancestral report")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'ancestorreport.py'
plg.ptype = REPORT
@@ -54,7 +54,7 @@ plg.id = 'birthday_report'
plg.name = _("Birthday and Anniversary Report")
plg.description = _("Produces a report of birthdays and anniversaries")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'birthdayreport.py'
plg.ptype = REPORT
@@ -76,7 +76,7 @@ plg.id = 'custom_text'
plg.name = _("Custom Text")
plg.description = _("Add custom text to the book report")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'custombooktext.py'
plg.ptype = REPORT
@@ -98,7 +98,7 @@ plg.id = 'descend_report'
plg.name = _("Descendant Report")
plg.description = _("Produces a list of descendants of the active person")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'descendreport.py'
plg.ptype = REPORT
@@ -120,7 +120,7 @@ plg.id = 'det_ancestor_report'
plg.name = _("Detailed Ancestral Report")
plg.description = _("Produces a detailed ancestral report")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'detancestralreport.py'
plg.ptype = REPORT
@@ -142,7 +142,7 @@ plg.id = 'det_descendant_report'
plg.name = _("Detailed Descendant Report")
plg.description = _("Produces a detailed descendant report")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'detdescendantreport.py'
plg.ptype = REPORT
@@ -164,7 +164,7 @@ plg.id = 'endofline_report'
plg.name = _("End of Line Report")
plg.description = _("Produces a textual end of line report")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'endoflinereport.py'
plg.ptype = REPORT
@@ -187,7 +187,7 @@ plg.name = _("Family Group Report")
plg.description = _("Produces a family group report showing information "
"on a set of parents and their children.")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'familygroup.py'
plg.ptype = REPORT
@@ -209,7 +209,7 @@ plg.id = 'indiv_complete'
plg.name = _("Complete Individual Report")
plg.description = _("Produces a complete report on the selected people")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'indivcomplete.py'
plg.ptype = REPORT
@@ -231,7 +231,7 @@ plg.id = 'kinship_report'
plg.name = _("Kinship Report")
plg.description = _("Produces a textual report of kinship for a given person")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'kinshipreport.py'
plg.ptype = REPORT
@@ -253,7 +253,7 @@ plg.id = 'tag_report'
plg.name = _("Tag Report")
plg.description = _("Produces a list of people with a specified tag")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'tagreport.py'
plg.ptype = REPORT
@@ -276,7 +276,7 @@ plg.id = 'number_of_ancestors_report'
plg.name = _("Number of Ancestors Report")
plg.description = _("Counts number of ancestors of selected person")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'numberofancestorsreport.py'
plg.ptype = REPORT
@@ -298,7 +298,7 @@ plg.id = 'place_report'
plg.name = _("Place Report")
plg.description = _("Produces a textual place report")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'placereport.py'
plg.ptype = REPORT
@@ -321,7 +321,7 @@ plg.id = 'simple_book_title'
plg.name = _("Title Page")
plg.description = _("Produces a title page for book reports.")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'simplebooktitle.py'
plg.ptype = REPORT
@@ -343,7 +343,7 @@ plg.id = 'summary'
plg.name = _("Database Summary Report")
plg.description = _("Provides a summary of the current database")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'summary.py'
plg.ptype = REPORT
@@ -366,7 +366,7 @@ plg.id = 'table_of_contents'
plg.name = _("Table Of Contents")
plg.description = _("Produces a table of contents for book reports.")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'tableofcontents.py'
plg.ptype = REPORT
@@ -388,7 +388,7 @@ plg.id = 'alphabetical_index'
plg.name = _("Alphabetical Index")
plg.description = _("Produces an alphabetical index for book reports.")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'alphabeticalindex.py'
plg.ptype = REPORT
@@ -410,7 +410,7 @@ plg.id = 'records'
plg.name = _("Records Report")
plg.description = _("Shows some interesting records about people and families")
plg.version = '1.1'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'recordsreport.py'
plg.ptype = REPORT
diff --git a/gramps/plugins/tool/changenames.py b/gramps/plugins/tool/changenames.py
index 9385914cb..40c7ed4df 100644
--- a/gramps/plugins/tool/changenames.py
+++ b/gramps/plugins/tool/changenames.py
@@ -45,7 +45,8 @@ from gramps.gui.managedwindow import ManagedWindow
from gramps.gui.dialog import OkDialog
from gramps.gui.plug import tool
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gui.glade import Glade
#-------------------------------------------------------------------------
diff --git a/gramps/plugins/tool/changetypes.py b/gramps/plugins/tool/changetypes.py
index 2173c4e99..20365749e 100644
--- a/gramps/plugins/tool/changetypes.py
+++ b/gramps/plugins/tool/changetypes.py
@@ -31,16 +31,14 @@
#------------------------------------------------------------------------
from __future__ import print_function
-from gramps.gen.ggettext import gettext as _
-from gramps.gen.ggettext import ngettext
-
#------------------------------------------------------------------------
#
# GRAMPS modules
#
#------------------------------------------------------------------------
from gramps.gui.utils import ProgressMeter
-import locale
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gui.managedwindow import ManagedWindow
from gramps.gui.autocomp import fill_combo
from gramps.gen.lib import EventType
@@ -80,7 +78,7 @@ class ChangeTypes(tool.BatchTool, ManagedWindow):
# Need to display localized event names
etype = EventType()
- event_names = sorted(etype.get_standard_names(), key=locale.strxfrm)
+ event_names = sorted(etype.get_standard_names(), key=glocale.sort_key)
fill_combo(self.auto1,event_names)
fill_combo(self.auto2,event_names)
@@ -135,7 +133,7 @@ class ChangeTypes(tool.BatchTool, ManagedWindow):
if modified == 0:
msg = _("No event record was modified.")
else:
- msg = ngettext("%d event record was modified."
+ msg = glocale.get_translation().ngettext("%d event record was modified."
, "%d event records were modified.", modified) % modified
if cli:
diff --git a/gramps/plugins/tool/check.py b/gramps/plugins/tool/check.py
index aed913f4d..d29611776 100644
--- a/gramps/plugins/tool/check.py
+++ b/gramps/plugins/tool/check.py
@@ -41,8 +41,9 @@ else:
from io import StringIO
import time
-from gramps.gen.ggettext import gettext as _
-from gramps.gen.ggettext import ngettext
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
+ngettext = glocale.get_translation().ngettext
from collections import defaultdict
#------------------------------------------------------------------------
@@ -345,7 +346,7 @@ class CheckIntegrity(object):
logging.warning(' FAIL: encoding error on media object '
'"%(gid)s" path "%(path)s"' %
{'gid' : obj.gramps_id, 'path' : obj.path})
- if not isinstance(data[2], UNITYPE):
+ if not isinstance(data[4], UNITYPE):
logging.warning(' FAIL: encoding error on media object '
'"%(gid)s" description "%(desc)s"' %
{'gid' : obj.gramps_id, 'desc' : obj.desc})
@@ -689,8 +690,8 @@ class CheckIntegrity(object):
photo_desc = obj.get_description()
if photo_name is not None and photo_name != "" and not find_file(photo_name):
if cl:
- # Convert to file system encoding before prining
- fn = os.path.basename(photo_name).encode(sys.getfilesystemencoding())
+ # Convert to stdout encoding before prining
+ fn = os.path.basename(photo_name).encode(sys.stdout.encoding, 'backslashreplace')
logging.warning(" FAIL: media file %s was not found." %
fn)
self.bad_photo.append(ObjectId)
@@ -2194,8 +2195,7 @@ class Report(ManagedWindow):
def __init__(self, uistate, text, cl=0):
if cl:
- # Convert to file system encoding before printing
- print (text.encode(sys.getfilesystemencoding()))
+ print (text.encode(sys.stdout.encoding, 'backslashreplace'))
return
ManagedWindow.__init__(self, uistate, [], self)
diff --git a/gramps/plugins/tool/dateparserdisplaytest.py b/gramps/plugins/tool/dateparserdisplaytest.py
index af4b29e66..53710b7ec 100644
--- a/gramps/plugins/tool/dateparserdisplaytest.py
+++ b/gramps/plugins/tool/dateparserdisplaytest.py
@@ -36,7 +36,8 @@ Tools/Debug/Check Localized Date Parser and Displayer
#-------------------------------------------------------------------------
import traceback
import sys
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/plugins/tool/desbrowser.glade b/gramps/plugins/tool/desbrowser.glade
index e8dc402f8..b162dac11 100644
--- a/gramps/plugins/tool/desbrowser.glade
+++ b/gramps/plugins/tool/desbrowser.glade
@@ -103,8 +103,10 @@
True
False
- <i>Double-click on the row to edit personal information</i>
- True
+ Double-click on the row to edit personal information
+
+
+
False
diff --git a/gramps/plugins/tool/desbrowser.py b/gramps/plugins/tool/desbrowser.py
index c56a271aa..c3f7326f6 100644
--- a/gramps/plugins/tool/desbrowser.py
+++ b/gramps/plugins/tool/desbrowser.py
@@ -42,7 +42,8 @@ from gramps.gen.display.name import displayer as name_displayer
from gramps.gui.plug import tool
from gramps.gui.display import display_help
from gramps.gui.managedwindow import ManagedWindow
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gui.glade import Glade
from gramps.gui.editors import EditPerson
diff --git a/gramps/plugins/tool/dumpgenderstats.py b/gramps/plugins/tool/dumpgenderstats.py
index 1692a778f..d91f34ea0 100644
--- a/gramps/plugins/tool/dumpgenderstats.py
+++ b/gramps/plugins/tool/dumpgenderstats.py
@@ -28,7 +28,8 @@
"""
from __future__ import print_function
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gi.repository import Gtk
from gramps.gui.listmodel import ListModel, INTEGER
from gramps.gui.managedwindow import ManagedWindow
diff --git a/gramps/plugins/tool/eval.glade b/gramps/plugins/tool/eval.glade
index f1e7fd4a1..d405c4841 100644
--- a/gramps/plugins/tool/eval.glade
+++ b/gramps/plugins/tool/eval.glade
@@ -159,13 +159,15 @@
True
False
0
- <b>Evaluation Window</b>
- True
+ Evaluation Window
+
+
+
2
GTK_FILL
-
+
@@ -173,15 +175,17 @@
True
False
0
- <b>Output Window</b>
- True
+ Output Window
+
+
+
2
2
3
GTK_FILL
-
+
@@ -210,15 +214,17 @@
True
False
0
- <b>Error Window</b>
- True
+ Error Window
+
+
+
2
4
5
GTK_FILL
-
+
diff --git a/gramps/plugins/tool/eval.py b/gramps/plugins/tool/eval.py
index c89fed959..b94c866b9 100644
--- a/gramps/plugins/tool/eval.py
+++ b/gramps/plugins/tool/eval.py
@@ -35,7 +35,8 @@ if sys.version_info[0] < 3:
from cStringIO import StringIO
else:
from io import StringIO
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import traceback
#------------------------------------------------------------------------
diff --git a/gramps/plugins/tool/eventcmp.py b/gramps/plugins/tool/eventcmp.py
index 63acf2850..142e9f306 100644
--- a/gramps/plugins/tool/eventcmp.py
+++ b/gramps/plugins/tool/eventcmp.py
@@ -58,7 +58,8 @@ from gramps.gui.plug import tool
from gramps.gen.plug.report import utils as ReportUtils
from gramps.gui.display import display_help
from gramps.gui.managedwindow import ManagedWindow
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gui.glade import Glade
from gramps.gui.editors import FilterEditor
diff --git a/gramps/plugins/tool/eventnames.py b/gramps/plugins/tool/eventnames.py
index fcba3eb2b..26dd615e6 100644
--- a/gramps/plugins/tool/eventnames.py
+++ b/gramps/plugins/tool/eventnames.py
@@ -29,8 +29,9 @@
# python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
-from gramps.gen.ggettext import ngettext
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
+
#-------------------------------------------------------------------------
#
@@ -111,7 +112,7 @@ class EventNames(tool.BatchTool, ManagedWindow):
if self.change == True:
OkDialog(_('Modifications made'),
- ngettext("%s event description has been added",
+ glocale.get_translation().ngettext("%s event description has been added",
"%s event descriptions have been added", counter) % counter)
else:
OkDialog(_('No modifications made'),
diff --git a/gramps/plugins/tool/extractcity.py b/gramps/plugins/tool/extractcity.py
index 475227f49..5cb5906d6 100644
--- a/gramps/plugins/tool/extractcity.py
+++ b/gramps/plugins/tool/extractcity.py
@@ -32,7 +32,8 @@ from __future__ import unicode_literals
#
#-------------------------------------------------------------------------
import re
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/plugins/tool/finddupes.glade b/gramps/plugins/tool/finddupes.glade
index 7ec9a6f3a..629c15dca 100644
--- a/gramps/plugins/tool/finddupes.glade
+++ b/gramps/plugins/tool/finddupes.glade
@@ -123,13 +123,15 @@
True
False
0
- <b>Match Threshold</b>
- True
+ Match Threshold
+
+
+
2
GTK_FILL
-
+
@@ -137,15 +139,17 @@
True
False
0
- <b>Options</b>
- True
+ Options
+
+
+
2
3
4
GTK_FILL
-
+
@@ -167,7 +171,7 @@
4
5
GTK_FILL
-
+
diff --git a/gramps/plugins/tool/finddupes.py b/gramps/plugins/tool/finddupes.py
index 8c6305fe4..0f6655e98 100644
--- a/gramps/plugins/tool/finddupes.py
+++ b/gramps/plugins/tool/finddupes.py
@@ -49,7 +49,8 @@ from gramps.gui.merge import MergePerson
from gramps.gui.display import display_help
from gramps.gui.managedwindow import ManagedWindow
from gramps.gui.dialog import RunDatabaseRepair
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gui.glade import Glade
#-------------------------------------------------------------------------
diff --git a/gramps/plugins/tool/leak.glade b/gramps/plugins/tool/leak.glade
index 7cd0e16bd..0dab2e853 100644
--- a/gramps/plugins/tool/leak.glade
+++ b/gramps/plugins/tool/leak.glade
@@ -91,12 +91,14 @@
True
False
0
- <b>Uncollected Objects</b>
- True
+ Uncollected Objects
+
+
+
GTK_FILL
-
+
diff --git a/gramps/plugins/tool/leak.py b/gramps/plugins/tool/leak.py
index 061e9e297..f5c4fd611 100644
--- a/gramps/plugins/tool/leak.py
+++ b/gramps/plugins/tool/leak.py
@@ -32,7 +32,8 @@ Show uncollected objects in a window.
#
#------------------------------------------------------------------------
import sys
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gen.config import config
if config.get('preferences.use-bsddb3') or sys.version_info[0] >= 3:
from bsddb3.db import DBError
@@ -99,7 +100,10 @@ class Leak(tool.Tool, ManagedWindow):
self.list.append_column(column)
self.selection = self.list.get_selection()
- gc.set_debug(gc.DEBUG_UNCOLLECTABLE|gc.DEBUG_OBJECTS|gc.DEBUG_SAVEALL)
+ flags = gc.DEBUG_UNCOLLECTABLE|gc.DEBUG_SAVEALL
+ if hasattr(gc, "DEBUG_OBJECTS"):
+ flags = flags | gc.DEBUG_OBJECTS
+ gc.set_debug(flags)
self.set_window(self.window, self.glade.get_object('title'),
self.title)
@@ -130,7 +134,10 @@ class Leak(tool.Tool, ManagedWindow):
referrers = gc.get_referrers(self.modeldata[count])
text = ""
for referrer in referrers:
- text += str(referrer) + '\n'
+ try:
+ text += str(referrer) + '\n'
+ except ReferenceError:
+ pass
InfoDialog(_('Referrers of %d') % count, text,
parent=self.window)
@@ -141,7 +148,10 @@ class Leak(tool.Tool, ManagedWindow):
referents = gc.get_referents(self.modeldata[count])
text = ""
for referent in referents:
- text += str(referent) + '\n'
+ try:
+ text += str(referent) + '\n'
+ except ReferenceError:
+ pass
InfoDialog(_('%d refers to') % count, text,
parent=self.window)
@@ -157,6 +167,8 @@ class Leak(tool.Tool, ManagedWindow):
except DBError:
self.modeldata.append(each)
self.model.append((count, 'db.DB instance at %s' % id(each)))
+ except ReferenceError:
+ pass
count += 1
self.glade.get_object('label2').set_text(_('Uncollected Objects: %s') % str(len(gc.garbage)))
diff --git a/gramps/plugins/tool/mediamanager.py b/gramps/plugins/tool/mediamanager.py
index 2698ea44c..e41d42e92 100644
--- a/gramps/plugins/tool/mediamanager.py
+++ b/gramps/plugins/tool/mediamanager.py
@@ -58,7 +58,8 @@ from gramps.gen.db import DbTxn
from gramps.gen.updatecallback import UpdateCallback
from gramps.gui.plug import tool
from gramps.gen.utils.file import media_path_full, relative_path, media_path
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gen.mime import get_type, is_image_type
from gramps.gen.constfunc import cuni
diff --git a/gramps/plugins/tool/mergecitations.glade b/gramps/plugins/tool/mergecitations.glade
index b8f45fb97..7982834d8 100644
--- a/gramps/plugins/tool/mergecitations.glade
+++ b/gramps/plugins/tool/mergecitations.glade
@@ -129,13 +129,15 @@
True
False
0
- <b>Match Threshold</b>
- True
+ Match Threshold
+
+
+
2
GTK_FILL
-
+
@@ -143,15 +145,17 @@
True
False
0
- <b>Options</b>
- True
+ Options
+
+
+
2
3
4
GTK_FILL
-
+
@@ -173,7 +177,7 @@
4
5
GTK_FILL
-
+
diff --git a/gramps/plugins/tool/mergecitations.py b/gramps/plugins/tool/mergecitations.py
index 259f3a288..22a11c1d2 100644
--- a/gramps/plugins/tool/mergecitations.py
+++ b/gramps/plugins/tool/mergecitations.py
@@ -55,8 +55,9 @@ from gramps.gui.dialog import OkDialog
from gramps.gui.display import display_help
from gramps.gen.datehandler import get_date
from gramps.gui.managedwindow import ManagedWindow
-from gramps.gen.ggettext import sgettext as _
-from gramps.gen.ggettext import ngettext
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
+
from gramps.gui.glade import Glade
from gramps.gen.db import DbTxn
from gramps.gen.lib import (Person, Family, Event, Place, MediaObject, Citation,
@@ -225,7 +226,7 @@ class MergeCitations(tool.BatchTool,ManagedWindow):
self.progress.close()
OkDialog(
_("Number of merges done"),
- ngettext("%(num)d citation merged",
+ glocale.get_translation().ngettext("%(num)d citation merged",
"%(num)d citations merged", num_merges) % {'num': num_merges})
self.close(obj)
diff --git a/gramps/plugins/tool/notrelated.py b/gramps/plugins/tool/notrelated.py
index e8221b375..18ea718ab 100644
--- a/gramps/plugins/tool/notrelated.py
+++ b/gramps/plugins/tool/notrelated.py
@@ -25,13 +25,6 @@
"Find people who are not related to the selected person"
-#------------------------------------------------------------------------
-#
-# Python modules
-#
-#------------------------------------------------------------------------
-import locale
-
#------------------------------------------------------------------------
#
# GNOME/GTK modules
@@ -46,14 +39,15 @@ from gi.repository import GObject
#
#------------------------------------------------------------------------
from gramps.gen.const import URL_MANUAL_PAGE
-from gramps.gen.ggettext import ngettext
from gramps.gui.plug import tool
from gramps.gen.plug.report import utils as ReportUtils
from gramps.gui.editors import EditPerson, EditFamily
from gramps.gui.managedwindow import ManagedWindow
from gramps.gui.utils import ProgressMeter
from gramps.gui.display import display_help
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
+ngettext = glocale.get_translation().ngettext
from gramps.gui.glade import Glade
from gramps.gen.lib import Tag
from gramps.gen.db import DbTxn
@@ -302,7 +296,7 @@ class NotRelated(tool.ActivePersonTool, ManagedWindow) :
#TRANS: No singular form is needed.
self.progress.set_pass(
- ngettext("Finding relationships between %d person",
+ ngettext("Finding relationships between %d person",
"Finding relationships between %d people",
self.numberOfPeopleInDatabase) %
self.numberOfPeopleInDatabase,
@@ -372,7 +366,7 @@ class NotRelated(tool.ActivePersonTool, ManagedWindow) :
# we have at least 1 "unrelated" person to find
self.progress.set_pass(
- ngettext("Looking for %d person", "Looking for %d people",
+ ngettext("Looking for %d person", "Looking for %d people",
self.numberOfUnrelatedPeople) %
self.numberOfUnrelatedPeople,
self.numberOfPeopleInDatabase)
@@ -398,7 +392,7 @@ class NotRelated(tool.ActivePersonTool, ManagedWindow) :
def populateModel(self) :
self.progress.set_pass(
- ngettext("Looking up the name of %d person",
+ ngettext("Looking up the name of %d person",
"Looking up the names of %d people",
self.numberOfUnrelatedPeople) %
self.numberOfUnrelatedPeople,
@@ -471,7 +465,7 @@ class NotRelated(tool.ActivePersonTool, ManagedWindow) :
for handle in person.get_tag_list():
tag = self.db.get_tag_from_handle(handle)
tags.append(tag.get_name())
- tags.sort(key=locale.strxfrm)
+ tags.sort(key=glocale.sort_key)
return ', '.join(tags)
#------------------------------------------------------------------------
diff --git a/gramps/plugins/tool/ownereditor.py b/gramps/plugins/tool/ownereditor.py
index 3468f711f..1bfdeb6f2 100644
--- a/gramps/plugins/tool/ownereditor.py
+++ b/gramps/plugins/tool/ownereditor.py
@@ -44,7 +44,8 @@ from gramps.gui.display import display_help
from gramps.gui.widgets import MonitoredEntry
from gramps.gui.managedwindow import ManagedWindow
from gramps.gui.plug import tool
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gui.glade import Glade
from gramps.gui.utils import is_right_click
diff --git a/gramps/plugins/tool/patchnames.py b/gramps/plugins/tool/patchnames.py
index 9e3abb4c5..073d2ad4b 100644
--- a/gramps/plugins/tool/patchnames.py
+++ b/gramps/plugins/tool/patchnames.py
@@ -52,7 +52,8 @@ from gramps.gui.managedwindow import ManagedWindow
from gramps.gui.display import display_help
from gramps.gen.lib import NameOriginType, Surname
from gramps.gen.db import DbTxn
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gui.glade import Glade
#-------------------------------------------------------------------------
diff --git a/gramps/plugins/tool/phpgedview.glade b/gramps/plugins/tool/phpgedview.glade
index 797274e00..525f1e6a4 100644
--- a/gramps/plugins/tool/phpgedview.glade
+++ b/gramps/plugins/tool/phpgedview.glade
@@ -87,14 +87,16 @@
True
False
- <b>phpGedView import</b>
- True
+ phpGedView import
center
+
+
+
2
GTK_FILL
-
+
@@ -109,7 +111,7 @@
2
1
2
-
+
@@ -124,7 +126,7 @@
4
5
GTK_FILL
-
+
@@ -140,7 +142,7 @@
5
6
GTK_FILL
-
+
@@ -175,7 +177,7 @@
3
4
GTK_FILL
-
+
7
@@ -190,7 +192,7 @@
4
5
GTK_FILL
-
+
7
@@ -205,7 +207,7 @@
5
6
GTK_FILL
-
+
7
@@ -220,7 +222,7 @@
2
3
GTK_FILL
-
+
7
@@ -235,7 +237,7 @@
1
2
GTK_FILL
-
+
7
@@ -251,7 +253,7 @@
6
7
GTK_FILL
-
+
diff --git a/gramps/plugins/tool/phpgedviewconnector.py b/gramps/plugins/tool/phpgedviewconnector.py
index 4fe660a8f..7010a773a 100644
--- a/gramps/plugins/tool/phpgedviewconnector.py
+++ b/gramps/plugins/tool/phpgedviewconnector.py
@@ -37,7 +37,8 @@ else:
from gi.repository import Gtk
import os
from tempfile import mkstemp
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gui.glade import Glade
import gramps.plugins.lib.libgedcom as libgedcom
diff --git a/gramps/plugins/tool/rebuild.py b/gramps/plugins/tool/rebuild.py
index a0430ee45..b882d04ab 100644
--- a/gramps/plugins/tool/rebuild.py
+++ b/gramps/plugins/tool/rebuild.py
@@ -31,7 +31,8 @@
#-------------------------------------------------------------------------
from __future__ import print_function
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#------------------------------------------------------------------------
#
@@ -79,7 +80,7 @@ class Rebuild(tool.Tool, UpdateCallback):
uistate.push_message(dbstate, _("Rebuilding secondary indexes..."))
UpdateCallback.__init__(self, self.callback)
- self.set_total(11)
+ self.set_total(12)
self.db.rebuild_secondary(self.update)
self.reset()
diff --git a/gramps/plugins/tool/rebuildgenderstat.py b/gramps/plugins/tool/rebuildgenderstat.py
index 7b1b1b408..0da7143e6 100644
--- a/gramps/plugins/tool/rebuildgenderstat.py
+++ b/gramps/plugins/tool/rebuildgenderstat.py
@@ -31,7 +31,8 @@
#-------------------------------------------------------------------------
from __future__ import print_function
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#------------------------------------------------------------------------
#
diff --git a/gramps/plugins/tool/rebuildrefmap.py b/gramps/plugins/tool/rebuildrefmap.py
index 329b26001..946382cea 100644
--- a/gramps/plugins/tool/rebuildrefmap.py
+++ b/gramps/plugins/tool/rebuildrefmap.py
@@ -33,7 +33,8 @@
#-------------------------------------------------------------------------
from __future__ import print_function
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#------------------------------------------------------------------------
#
diff --git a/gramps/plugins/tool/relcalc.py b/gramps/plugins/tool/relcalc.py
index f7a899b9e..64d2f1fa1 100644
--- a/gramps/plugins/tool/relcalc.py
+++ b/gramps/plugins/tool/relcalc.py
@@ -30,7 +30,8 @@
# Standard python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
@@ -61,7 +62,7 @@ from gramps.gui.glade import Glade
#
#-------------------------------------------------------------------------
-column_names = BasePersonView.COLUMN_NAMES
+column_names = [column[0] for column in BasePersonView.COLUMNS]
#-------------------------------------------------------------------------
#
@@ -166,11 +167,11 @@ class RelCalc(tool.Tool, ManagedWindow):
return (_("Relationship Calculator tool"),None)
def on_apply_clicked(self, obj):
- model, node = self.tree.get_selection().get_selected()
- if not node:
+ model, iter_ = self.tree.get_selection().get_selected()
+ if not iter_:
return
- handle = model.get_value(node, PeopleBaseModel.COLUMN_INT_ID)
+ handle = model.get_handle_from_iter(iter_)
other_person = self.db.get_person_from_handle(handle)
if other_person is None :
self.textbuffer.set_text("")
diff --git a/gramps/plugins/tool/removeunused.glade b/gramps/plugins/tool/removeunused.glade
index 428383d0d..6f69fc869 100644
--- a/gramps/plugins/tool/removeunused.glade
+++ b/gramps/plugins/tool/removeunused.glade
@@ -332,8 +332,10 @@
True
False
- <b>Double-click on a row to view/edit data</b>
- True
+ Double-click on a row to view/edit data
+
+
+
False
diff --git a/gramps/plugins/tool/removeunused.py b/gramps/plugins/tool/removeunused.py
index df665403b..cb1a49761 100644
--- a/gramps/plugins/tool/removeunused.py
+++ b/gramps/plugins/tool/removeunused.py
@@ -31,7 +31,8 @@
#
#-------------------------------------------------------------------------
from __future__ import with_statement
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#------------------------------------------------------------------------
#
@@ -302,7 +303,7 @@ class RemoveUnused(tool.Tool, ManagedWindow, UpdateCallback):
def selection_toggled(self, cell, path_string):
sort_path = tuple(map(int, path_string.split(':')))
- real_path = self.sort_model.convert_path_to_child_path(sort_path)
+ real_path = self.sort_model.convert_path_to_child_path(Gtk.TreePath(sort_path))
row = self.real_model[real_path]
row[RemoveUnused.MARK_COL] = not row[RemoveUnused.MARK_COL]
self.real_model.row_changed(real_path, row.iter)
diff --git a/gramps/plugins/tool/reorderids.py b/gramps/plugins/tool/reorderids.py
index 82d49dfa0..8d13a6b50 100644
--- a/gramps/plugins/tool/reorderids.py
+++ b/gramps/plugins/tool/reorderids.py
@@ -35,7 +35,8 @@ scheme specified in the database's prefix ids
from __future__ import print_function
import re
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#------------------------------------------------------------------------
#
diff --git a/gramps/plugins/tool/sortevents.py b/gramps/plugins/tool/sortevents.py
index d9252ee9d..f4960fdd7 100644
--- a/gramps/plugins/tool/sortevents.py
+++ b/gramps/plugins/tool/sortevents.py
@@ -28,7 +28,8 @@
# python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/plugins/tool/soundgen.py b/gramps/plugins/tool/soundgen.py
index b0e8a1a27..69c722702 100644
--- a/gramps/plugins/tool/soundgen.py
+++ b/gramps/plugins/tool/soundgen.py
@@ -34,7 +34,8 @@ from gramps.gen.soundex import soundex
from gramps.gui.display import display_help
from gramps.gui.managedwindow import ManagedWindow
from gramps.gui.autocomp import fill_combo
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gui.plug import tool
from gramps.gui.glade import Glade
from gramps.gen.constfunc import cuni
diff --git a/gramps/plugins/tool/testcasegenerator.py b/gramps/plugins/tool/testcasegenerator.py
index 8e416e277..d98385d4d 100644
--- a/gramps/plugins/tool/testcasegenerator.py
+++ b/gramps/plugins/tool/testcasegenerator.py
@@ -35,7 +35,8 @@ from __future__ import unicode_literals
from __future__ import print_function
from random import randint,choice,random
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import time
#-------------------------------------------------------------------------
diff --git a/gramps/plugins/tool/tools.gpr.py b/gramps/plugins/tool/tools.gpr.py
index 8709e8877..04d4a51d8 100644
--- a/gramps/plugins/tool/tools.gpr.py
+++ b/gramps/plugins/tool/tools.gpr.py
@@ -36,7 +36,7 @@ name = _("Fix Capitalization of Family Names"),
description = _("Searches the entire database and attempts to "
"fix capitalization of the names."),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'changenames.py',
authors = ["Donald N. Allingham"],
@@ -59,7 +59,7 @@ name = _("Rename Event Types"),
description = _("Allows all the events of a certain name "
"to be renamed to a new name."),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'changetypes.py',
authors = ["Donald N. Allingham"],
@@ -82,7 +82,7 @@ name = _("Check and Repair Database"),
description = _("Checks the database for integrity problems, fixing the "
"problems that it can"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'check.py',
authors = ["Donald N. Allingham"],
@@ -104,7 +104,7 @@ id = 'dbrowse',
name = _("Interactive Descendant Browser"),
description = _("Provides a browsable hierarchy based on the active person"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'desbrowser.py',
authors = ["Donald N. Allingham"],
@@ -127,7 +127,7 @@ id = 'eval',
name = "Python Evaluation Window",
description = "Provides a window that can evaluate python code",
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'eval.py',
authors = ["Donald N. Allingham"],
@@ -151,7 +151,7 @@ description = _("Aids in the analysis of data by allowing the "
"development of custom filters that can be applied "
"to the database to find similar events"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'eventcmp.py',
authors = ["Donald N. Allingham"],
@@ -173,7 +173,7 @@ id = 'evname',
name = _("Extract Event Description"),
description = _("Extracts event descriptions from the event data"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'eventnames.py',
authors = ["Donald N. Allingham"],
@@ -196,7 +196,7 @@ name = _("Extract Place Data from a Place Title"),
description = _("Attempts to extract city and state/province "
"from a place title"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'extractcity.py',
authors = ["Donald N. Allingham"],
@@ -219,7 +219,7 @@ name = _("Find Possible Duplicate People"),
description = _("Searches the entire database, looking for "
"individual entries that may represent the same person."),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'finddupes.py',
authors = ["Donald N. Allingham"],
@@ -241,7 +241,7 @@ id = 'leak',
name = "Show Uncollected Objects",
description = "Provide a window listing all uncollected objects",
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'leak.py',
authors = ["Donald N. Allingham"],
@@ -263,7 +263,7 @@ id = 'mediaman',
name = _("Media Manager"),
description = _("Manages batch operations on media files"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'mediamanager.py',
authors = ["Alex Roitman"],
@@ -286,7 +286,7 @@ name = _("Not Related"),
description = _("Find people who are not in any way related to the "
"selected person"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'notrelated.py',
authors = ["Stephane Charette"],
@@ -308,7 +308,7 @@ id = 'editowner',
name = _("Edit Database Owner Information"),
description = _("Allow editing database owner information."),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'ownereditor.py',
authors = ["Zsolt Foldvari"],
@@ -330,7 +330,7 @@ id = 'patchnames',
name = _("Extract Information from Names"),
description = _("Extract titles, prefixes and compound surnames from given name or family name."),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'patchnames.py',
authors = ["Donald N. Allingham", "Benny Malengier"],
@@ -352,7 +352,7 @@ id = 'rebuild',
name = _("Rebuild Secondary Indexes"),
description = _("Rebuilds secondary indexes"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'rebuild.py',
authors = ["Donald N. Allingham"],
@@ -374,7 +374,7 @@ id = 'rebuild_refmap',
name = _("Rebuild Reference Maps"),
description = _("Rebuilds reference maps"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'rebuildrefmap.py',
authors = ["Alex Roitman"],
@@ -396,7 +396,7 @@ id = 'rebuild_genstats',
name = _("Rebuild Gender Statistics"),
description = _("Rebuilds gender statistics for name gender guessing..."),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'rebuildgenderstat.py',
authors = ["Benny Malengier"],
@@ -418,7 +418,7 @@ id = 'relcalc',
name = _("Relationship Calculator"),
description = _("Calculates the relationship between two people"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'relcalc.py',
authors = ["Donald N. Allingham"],
@@ -440,7 +440,7 @@ id = 'remove_unused',
name = _("Remove Unused Objects"),
description = _("Removes unused objects from the database"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'removeunused.py',
authors = ["Donald N. Allingham"],
@@ -463,7 +463,7 @@ name = _("Reorder Gramps IDs"),
description = _("Reorders the Gramps IDs "
"according to Gramps' default rules."),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'reorderids.py',
authors = ["Donald N. Allingham"],
@@ -485,7 +485,7 @@ id = 'sortevents',
name = _("Sorts events"),
description = _("Sorts events"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'sortevents.py',
authors = ["Gary Burton"],
@@ -507,7 +507,7 @@ id = 'soundgen',
name = _("Generate SoundEx Codes"),
description = _("Generates SoundEx codes for names"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'soundgen.py',
authors = ["Donald N. Allingham"],
@@ -529,7 +529,7 @@ id = 'verify',
name = _("Verify the Data"),
description = _("Verifies the data against user-defined tests"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'verify.py',
authors = ["Alex Roitman"],
@@ -552,7 +552,7 @@ name = _("Merge Citations"),
description = _("Searches the entire database, looking for "
"citations that have the same Volume/Page, Date and Confidence."),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'mergecitations.py',
authors = ["Tim G L Lyons"],
diff --git a/gramps/plugins/tool/toolsdebug.gpr.py b/gramps/plugins/tool/toolsdebug.gpr.py
index b369e5b2c..c5ce4bf09 100644
--- a/gramps/plugins/tool/toolsdebug.gpr.py
+++ b/gramps/plugins/tool/toolsdebug.gpr.py
@@ -39,7 +39,7 @@ description = ("This test tool will create many people showing all"
" the birth date. This way you can ensure that dates"
" printed can be parsed back in correctly."),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = UNSTABLE,
fname = 'dateparserdisplaytest.py',
authors = ["Martin Hawlisch"],
@@ -62,7 +62,7 @@ name = "Dump Gender Statistics",
description = ("Will dump the statistics for the gender guessing "
"from the first name."),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'dumpgenderstats.py',
authors = ["Donald N. Allingham", "Martin Hawlisch"],
@@ -86,7 +86,7 @@ description = ("The testcase generator will generate some persons "
"and families that have broken links in the database "
"or data that is in conflict to a relation."),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = UNSTABLE,
fname = 'testcasegenerator.py',
authors = ["Martin Hawlisch"],
@@ -110,7 +110,7 @@ description = ("This tool generates sources and citations ofr each source in "
"order to populate the database for testing with significant "
"numbers of sources and citations"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = UNSTABLE,
fname = 'populatesources.py',
authors = ["Tim Lyons"],
diff --git a/gramps/plugins/tool/verify.glade b/gramps/plugins/tool/verify.glade
index f17f8fcae..4a2f55269 100644
--- a/gramps/plugins/tool/verify.glade
+++ b/gramps/plugins/tool/verify.glade
@@ -91,6 +91,751 @@
1
10
+
+ False
+ dialog
+
+
+ True
+ False
+ vertical
+
+
+ True
+ False
+ end
+
+
+ gtk-help
+ False
+ True
+ True
+ True
+ False
+ False
+ True
+
+
+
+ False
+ False
+ 0
+
+
+
+
+ gtk-close
+ False
+ True
+ True
+ True
+ False
+ False
+ True
+
+
+
+ False
+ False
+ 1
+
+
+
+
+ _Run
+ False
+ True
+ True
+ True
+ False
+ False
+ True
+
+
+
+ False
+ False
+ 2
+
+
+
+
+ False
+ True
+ end
+ 0
+
+
+
+
+ True
+ False
+
+
+ True
+ False
+ 6
+
+
+ False
+ False
+ 0
+
+
+
+
+ True
+ True
+
+
+ True
+ False
+ 12
+ 8
+ 2
+ 6
+ 6
+
+
+ True
+ True
+ adjustment15
+ 1
+ True
+
+
+ 1
+ 2
+ GTK_EXPAND | GTK_SHRINK | GTK_FILL
+
+
+
+
+
+ True
+ False
+ 0
+ Maximum _age
+ True
+ True
+ oldage
+
+
+
+
+
+
+
+ True
+ False
+ 0
+ Mi_nimum age to marry
+ True
+ True
+ yngmar
+
+
+ 1
+ 2
+
+
+
+
+
+ True
+ True
+ adjustment14
+ 1
+
+
+ 1
+ 2
+ 1
+ 2
+ GTK_EXPAND | GTK_SHRINK | GTK_FILL
+
+
+
+
+
+ True
+ False
+ 0
+ Ma_ximum age to marry
+ True
+ True
+ oldmar
+
+
+ 2
+ 3
+
+
+
+
+
+ True
+ True
+ adjustment13
+ 1
+
+
+ 1
+ 2
+ 2
+ 3
+ GTK_EXPAND | GTK_SHRINK | GTK_FILL
+
+
+
+
+
+ True
+ False
+ 0
+ Maximum number of _spouses for a person
+ True
+ True
+ wedder
+
+
+ 3
+ 4
+ GTK_FILL
+
+
+
+
+
+ True
+ True
+ adjustment12
+ 1
+
+
+ 1
+ 2
+ 3
+ 4
+ GTK_EXPAND | GTK_SHRINK | GTK_FILL
+
+
+
+
+
+ True
+ True
+ adjustment11
+ 1
+
+
+ 1
+ 2
+ 4
+ 5
+ GTK_EXPAND | GTK_SHRINK | GTK_FILL
+
+
+
+
+
+ True
+ False
+ 0
+ Maximum number of consecutive years of _widowhood before next marriage
+ True
+ True
+ lngwdw
+
+
+ 4
+ 5
+
+
+
+
+
+ True
+ False
+ 0
+ Maximum age for an _unmarried person
+ True
+ True
+ oldunm
+
+
+ 5
+ 6
+ GTK_FILL
+
+
+
+
+
+ True
+ True
+ adjustment10
+ 1
+
+
+ 1
+ 2
+ 5
+ 6
+
+
+
+
+
+ _Estimate missing or inexact dates
+ False
+ True
+ True
+ False
+ False
+ True
+ 0.5
+ True
+
+
+ 2
+ 6
+ 7
+
+
+
+
+
+ _Identify invalid dates
+ False
+ True
+ True
+ False
+ False
+ True
+ 0.5
+ True
+
+
+ 2
+ 7
+ 8
+
+
+
+
+
+
+
+ True
+ False
+ 0
+ General
+
+
+
+
+
+ False
+
+
+
+
+ True
+ False
+ 12
+ 3
+ 2
+ 6
+ 6
+
+
+ True
+ False
+ 0
+ 2
+ 2
+ Mi_nimum age to bear a child
+ True
+ True
+ yngmom
+
+
+
+
+
+
+
+ True
+ False
+ 0
+ 2
+ 2
+ Ma_ximum age to bear a child
+ True
+ True
+ oldmom
+
+
+ 1
+ 2
+
+
+
+
+
+ True
+ False
+ 0
+ 2
+ 2
+ Maximum number of chil_dren
+ True
+ True
+ mxchildmom
+
+
+ 2
+ 3
+
+
+
+
+
+ True
+ True
+ adjustment9
+ 1
+
+
+ 1
+ 2
+ GTK_SHRINK | GTK_FILL
+
+
+
+
+
+ True
+ True
+ adjustment8
+ 1
+
+
+ 1
+ 2
+ 1
+ 2
+ GTK_SHRINK | GTK_FILL
+
+
+
+
+
+ True
+ True
+ adjustment7
+ 1
+
+
+ 1
+ 2
+ 2
+ 3
+ GTK_SHRINK | GTK_FILL
+
+
+
+
+
+ 1
+
+
+
+
+ True
+ False
+ 0
+ Women
+
+
+
+
+
+ 1
+ False
+
+
+
+
+ True
+ False
+ 12
+ 3
+ 2
+ 6
+ 6
+
+
+ True
+ False
+ 0
+ 2
+ 2
+ Mi_nimum age to father a child
+ True
+ True
+ yngdad
+
+
+
+
+
+
+
+ True
+ False
+ 0
+ 2
+ 2
+ Ma_ximum age to father a child
+ True
+ True
+ olddad
+
+
+ 1
+ 2
+
+
+
+
+
+ True
+ False
+ 0
+ 2
+ 2
+ Maximum number of chil_dren
+ True
+ True
+ mxchilddad
+
+
+ 2
+ 3
+
+
+
+
+
+ True
+ True
+ adjustment6
+ 1
+
+
+ 1
+ 2
+ 2
+ 3
+ GTK_SHRINK | GTK_FILL
+
+
+
+
+
+ True
+ True
+ adjustment5
+ 1
+
+
+ 1
+ 2
+ 1
+ 2
+ GTK_SHRINK | GTK_FILL
+
+
+
+
+
+ True
+ True
+ adjustment4
+ 1
+
+
+ 1
+ 2
+ GTK_SHRINK | GTK_FILL
+
+
+
+
+
+ 2
+
+
+
+
+ True
+ False
+ 0
+ Men
+
+
+
+
+
+ 2
+ False
+
+
+
+
+ True
+ False
+ 12
+ 3
+ 2
+ 6
+ 6
+
+
+ True
+ True
+ adjustment3
+ 1
+
+
+ 1
+ 2
+ GTK_EXPAND | GTK_SHRINK | GTK_FILL
+
+
+
+
+
+ True
+ True
+ adjustment2
+ 1
+
+
+ 1
+ 2
+ 1
+ 2
+ GTK_EXPAND | GTK_SHRINK | GTK_FILL
+
+
+
+
+
+ True
+ True
+ adjustment1
+ 1
+
+
+ 1
+ 2
+ 2
+ 3
+ GTK_EXPAND | GTK_SHRINK | GTK_FILL
+
+
+
+
+
+ True
+ False
+ 0
+ Maximum husband-wife age _difference
+ True
+ True
+ hwdif
+
+
+
+
+
+
+
+ True
+ False
+ 0
+ Maximum number of years _between children
+ True
+ True
+ cspace
+
+
+ 1
+ 2
+
+
+
+
+
+ True
+ False
+ 0
+ Maximum _span of years for all children
+ True
+ True
+ cbspan
+
+
+ 2
+ 3
+
+
+
+
+
+ 3
+
+
+
+
+ True
+ False
+ 0
+ Families
+
+
+
+
+
+ 3
+ False
+
+
+
+
+ True
+ True
+ 1
+
+
+
+
+ False
+ True
+ 2
+
+
+
+
+
+ helpbutton1
+ button5
+ button4
+
+
False
500
@@ -211,8 +956,10 @@
True
False
- <b>Double-click on a row to view/edit data</b>
- True
+ Double-click on a row to view/edit data
+
+
+
False
@@ -326,741 +1073,4 @@
closebutton1
-
- False
- dialog
-
-
- True
- False
- vertical
-
-
- True
- False
- end
-
-
- gtk-help
- False
- True
- True
- True
- False
- False
- True
-
-
-
- False
- False
- 0
-
-
-
-
- gtk-close
- False
- True
- True
- True
- False
- False
- True
-
-
-
- False
- False
- 1
-
-
-
-
- _Run
- False
- True
- True
- True
- False
- False
- True
-
-
-
- False
- False
- 2
-
-
-
-
- False
- True
- end
- 0
-
-
-
-
- True
- False
-
-
- True
- False
- 6
-
-
- False
- False
- 0
-
-
-
-
- True
- True
-
-
- True
- False
- 12
- 8
- 2
- 6
- 6
-
-
- True
- True
- adjustment15
- 1
- True
-
-
- 1
- 2
- GTK_EXPAND | GTK_SHRINK | GTK_FILL
-
-
-
-
-
- True
- False
- 0
- Maximum _age
- True
- True
- oldage
-
-
-
-
-
-
-
- True
- False
- 0
- Mi_nimum age to marry
- True
- True
- yngmar
-
-
- 1
- 2
-
-
-
-
-
- True
- True
- adjustment14
- 1
-
-
- 1
- 2
- 1
- 2
- GTK_EXPAND | GTK_SHRINK | GTK_FILL
-
-
-
-
-
- True
- False
- 0
- Ma_ximum age to marry
- True
- True
- oldmar
-
-
- 2
- 3
-
-
-
-
-
- True
- True
- adjustment13
- 1
-
-
- 1
- 2
- 2
- 3
- GTK_EXPAND | GTK_SHRINK | GTK_FILL
-
-
-
-
-
- True
- False
- 0
- Maximum number of _spouses for a person
- True
- True
- wedder
-
-
- 3
- 4
- GTK_FILL
-
-
-
-
-
- True
- True
- adjustment12
- 1
-
-
- 1
- 2
- 3
- 4
- GTK_EXPAND | GTK_SHRINK | GTK_FILL
-
-
-
-
-
- True
- True
- adjustment11
- 1
-
-
- 1
- 2
- 4
- 5
- GTK_EXPAND | GTK_SHRINK | GTK_FILL
-
-
-
-
-
- True
- False
- 0
- Maximum number of consecutive years of _widowhood before next marriage
- True
- True
- lngwdw
-
-
- 4
- 5
-
-
-
-
-
- True
- False
- 0
- Maximum age for an _unmarried person
- True
- True
- oldunm
-
-
- 5
- 6
- GTK_FILL
-
-
-
-
-
- True
- True
- adjustment10
- 1
-
-
- 1
- 2
- 5
- 6
-
-
-
-
-
- _Estimate missing or inexact dates
- False
- True
- True
- False
- False
- True
- 0.5
- True
-
-
- 2
- 6
- 7
-
-
-
-
-
- _Identify invalid dates
- False
- True
- True
- False
- False
- True
- 0.5
- True
-
-
- 2
- 7
- 8
-
-
-
-
-
-
-
- True
- False
- 0
- <b>General</b>
- True
-
-
- False
-
-
-
-
- True
- False
- 12
- 3
- 2
- 6
- 6
-
-
- True
- False
- 0
- 2
- 2
- Mi_nimum age to bear a child
- True
- True
- yngmom
-
-
-
-
-
-
-
- True
- False
- 0
- 2
- 2
- Ma_ximum age to bear a child
- True
- True
- oldmom
-
-
- 1
- 2
-
-
-
-
-
- True
- False
- 0
- 2
- 2
- Maximum number of chil_dren
- True
- True
- mxchildmom
-
-
- 2
- 3
-
-
-
-
-
- True
- True
- adjustment9
- 1
-
-
- 1
- 2
- GTK_SHRINK | GTK_FILL
-
-
-
-
-
- True
- True
- adjustment8
- 1
-
-
- 1
- 2
- 1
- 2
- GTK_SHRINK | GTK_FILL
-
-
-
-
-
- True
- True
- adjustment7
- 1
-
-
- 1
- 2
- 2
- 3
- GTK_SHRINK | GTK_FILL
-
-
-
-
-
- 1
-
-
-
-
- True
- False
- 0
- <b>Women</b>
- True
-
-
- 1
- False
-
-
-
-
- True
- False
- 12
- 3
- 2
- 6
- 6
-
-
- True
- False
- 0
- 2
- 2
- Mi_nimum age to father a child
- True
- True
- yngdad
-
-
-
-
-
-
-
- True
- False
- 0
- 2
- 2
- Ma_ximum age to father a child
- True
- True
- olddad
-
-
- 1
- 2
-
-
-
-
-
- True
- False
- 0
- 2
- 2
- Maximum number of chil_dren
- True
- True
- mxchilddad
-
-
- 2
- 3
-
-
-
-
-
- True
- True
- adjustment6
- 1
-
-
- 1
- 2
- 2
- 3
- GTK_SHRINK | GTK_FILL
-
-
-
-
-
- True
- True
- adjustment5
- 1
-
-
- 1
- 2
- 1
- 2
- GTK_SHRINK | GTK_FILL
-
-
-
-
-
- True
- True
- adjustment4
- 1
-
-
- 1
- 2
- GTK_SHRINK | GTK_FILL
-
-
-
-
-
- 2
-
-
-
-
- True
- False
- 0
- <b>Men</b>
- True
-
-
- 2
- False
-
-
-
-
- True
- False
- 12
- 3
- 2
- 6
- 6
-
-
- True
- True
- adjustment3
- 1
-
-
- 1
- 2
- GTK_EXPAND | GTK_SHRINK | GTK_FILL
-
-
-
-
-
- True
- True
- adjustment2
- 1
-
-
- 1
- 2
- 1
- 2
- GTK_EXPAND | GTK_SHRINK | GTK_FILL
-
-
-
-
-
- True
- True
- adjustment1
- 1
-
-
- 1
- 2
- 2
- 3
- GTK_EXPAND | GTK_SHRINK | GTK_FILL
-
-
-
-
-
- True
- False
- 0
- Maximum husband-wife age _difference
- True
- True
- hwdif
-
-
-
-
-
-
-
- True
- False
- 0
- Maximum number of years _between children
- True
- True
- cspace
-
-
- 1
- 2
-
-
-
-
-
- True
- False
- 0
- Maximum _span of years for all children
- True
- True
- cbspan
-
-
- 2
- 3
-
-
-
-
-
- 3
-
-
-
-
- True
- False
- 0
- <b>Families</b>
- True
-
-
- 3
- False
-
-
-
-
- True
- True
- 1
-
-
-
-
- False
- True
- 2
-
-
-
-
-
- helpbutton1
- button5
- button4
-
-
diff --git a/gramps/plugins/tool/verify.py b/gramps/plugins/tool/verify.py
index 51548b11b..0a7a0670f 100644
--- a/gramps/plugins/tool/verify.py
+++ b/gramps/plugins/tool/verify.py
@@ -28,13 +28,12 @@ A plugin to verify the data against user-adjusted tests.
This is the research tool, not the low-level data ingerity check.
"""
-from __future__ import division
+from __future__ import division, print_function
#------------------------------------------------------------------------
#
# standard python modules
#
#------------------------------------------------------------------------
-from __future__ import print_function
import os
import sys
@@ -72,7 +71,8 @@ from gramps.gui.display import display_help
from gramps.gui.managedwindow import ManagedWindow
from gramps.gen.updatecallback import UpdateCallback
from gramps.gui.plug import tool
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gui.glade import Glade
#-------------------------------------------------------------------------
@@ -127,7 +127,7 @@ def clear_cache():
# helper functions
#
#-------------------------------------------------------------------------
-def get_date_from_event_handle(db,event_handle,estimate=False):
+def get_date_from_event_handle(db, event_handle, estimate=False):
if not event_handle:
return 0
event = find_event(db,event_handle)
@@ -140,7 +140,7 @@ def get_date_from_event_handle(db,event_handle,estimate=False):
else:
return 0
-def get_date_from_event_type(db,person,event_type,estimate=False):
+def get_date_from_event_type(db, person, event_type, estimate=False):
if not person:
return 0
for event_ref in person.get_event_ref_list():
@@ -157,11 +157,11 @@ def get_date_from_event_type(db,person,event_type,estimate=False):
return date_obj.get_sort_value()
return 0
-def get_bapt_date(db,person,estimate=False):
+def get_bapt_date(db, person, estimate=False):
return get_date_from_event_type(db, person,
EventType.BAPTISM, estimate)
-def get_bury_date(db,person,estimate=False):
+def get_bury_date(db, person, estimate=False):
# check role on burial event
for event_ref in person.get_event_ref_list():
event = find_event(db, event_ref.ref)
@@ -170,7 +170,7 @@ def get_bury_date(db,person,estimate=False):
return get_date_from_event_type(db, person,
EventType.BURIAL, estimate)
-def get_birth_date(db,person,estimate=False):
+def get_birth_date(db, person, estimate=False):
if not person:
return 0
birth_ref = person.get_birth_ref()
@@ -182,7 +182,7 @@ def get_birth_date(db,person,estimate=False):
ret = get_bapt_date(db,person,estimate)
return ret
-def get_death_date(db,person,estimate=False):
+def get_death_date(db, person, estimate=False):
if not person:
return 0
death_ref = person.get_death_ref()
@@ -194,14 +194,14 @@ def get_death_date(db,person,estimate=False):
ret = get_bury_date(db,person,estimate)
return ret
-def get_age_at_death(db,person,estimate):
+def get_age_at_death(db, person, estimate):
birth_date = get_birth_date(db,person,estimate)
death_date = get_death_date(db,person,estimate)
if (birth_date > 0) and (death_date > 0):
return death_date - birth_date
return 0
-def get_father(db,family):
+def get_father(db, family):
if not family:
return None
father_handle = family.get_father_handle()
@@ -209,24 +209,24 @@ def get_father(db,family):
return find_person(db,father_handle)
return None
-def get_mother(db,family):
+def get_mother(db, family):
if not family:
return None
mother_handle = family.get_mother_handle()
if mother_handle:
- return find_person(db,mother_handle)
+ return find_person(db, mother_handle)
return None
-def get_child_birth_dates(db,family,estimate):
+def get_child_birth_dates(db, family, estimate):
dates = []
for child_ref in family.get_child_ref_list():
child = find_person(db,child_ref.ref)
- child_birth_date = get_birth_date(db,child,estimate)
+ child_birth_date = get_birth_date(db, child, estimate)
if child_birth_date > 0:
dates.append(child_birth_date)
return dates
-def get_n_children(db,person):
+def get_n_children(db, person):
n = 0
for family_handle in person.get_family_handle_list():
family = find_family(db,family_handle)
@@ -234,7 +234,7 @@ def get_n_children(db,person):
n += len(family.get_child_ref_list())
return n
-def get_marriage_date(db,family):
+def get_marriage_date(db, family):
if not family:
return 0
for event_ref in family.get_event_ref_list():
@@ -496,10 +496,10 @@ class VerifyResults(ManagedWindow):
self.renderer = Gtk.CellRendererText()
self.img_renderer = Gtk.CellRendererPixbuf()
self.bool_renderer = Gtk.CellRendererToggle()
- self.bool_renderer.connect('toggled',self.selection_toggled)
+ self.bool_renderer.connect('toggled', self.selection_toggled)
# Add ignore column
- ignore_column = Gtk.TreeViewColumn(_('Mark'),self.bool_renderer,
+ ignore_column = Gtk.TreeViewColumn(_('Mark'), self.bool_renderer,
active=VerifyResults.IGNORE_COL)
ignore_column.set_sort_column_id(VerifyResults.IGNORE_COL)
self.warn_tree.append_column(ignore_column)
@@ -588,13 +588,13 @@ class VerifyResults(ManagedWindow):
new_ignores[handle].add(rule_id)
return new_ignores
- def close(self,*obj):
+ def close(self, *obj):
new_ignores = self.get_new_marking()
self.save_ignored(new_ignores)
ManagedWindow.close(self,*obj)
- def hide_toggled(self,button):
+ def hide_toggled(self, button):
if button.get_active():
button.set_label(_("_Show all"))
self.filt_model = self.real_model.filter_new()
@@ -608,16 +608,16 @@ class VerifyResults(ManagedWindow):
self.warn_tree.set_model(self.sort_model)
button.set_label(_("_Hide marked"))
- def selection_toggled(self,cell,path_string):
+ def selection_toggled(self, cell, path_string):
sort_path = tuple(map(int, path_string.split(':')))
- filt_path = self.sort_model.convert_path_to_child_path(sort_path)
+ filt_path = self.sort_model.convert_path_to_child_path(Gtk.TreePath(sort_path))
real_path = self.filt_model.convert_path_to_child_path(filt_path)
row = self.real_model[real_path]
row[VerifyResults.IGNORE_COL] = not row[VerifyResults.IGNORE_COL]
row[VerifyResults.SHOW_COL] = not row[VerifyResults.IGNORE_COL]
self.real_model.row_changed(real_path,row.iter)
- def mark_clicked(self,mark_button):
+ def mark_clicked(self, mark_button):
for row_num in range(len(self.real_model)):
path = (row_num,)
row = self.real_model[path]
@@ -625,7 +625,7 @@ class VerifyResults(ManagedWindow):
row[VerifyResults.SHOW_COL] = False
self.filt_model.refilter()
- def unmark_clicked(self,unmark_button):
+ def unmark_clicked(self, unmark_button):
for row_num in range(len(self.real_model)):
path = (row_num,)
row = self.real_model[path]
@@ -633,7 +633,7 @@ class VerifyResults(ManagedWindow):
row[VerifyResults.SHOW_COL] = True
self.filt_model.refilter()
- def invert_clicked(self,invert_button):
+ def invert_clicked(self, invert_button):
for row_num in range(len(self.real_model)):
path = (row_num,)
row = self.real_model[path]
@@ -641,7 +641,7 @@ class VerifyResults(ManagedWindow):
row[VerifyResults.SHOW_COL] = not row[VerifyResults.SHOW_COL]
self.filt_model.refilter()
- def double_click(self, obj,event):
+ def double_click(self, obj, event):
if event.type == Gdk.EventType._2BUTTON_PRESS and event.button == 1:
(model, node) = self.selection.get_selected()
if not node:
diff --git a/gramps/plugins/view/citationlistview.py b/gramps/plugins/view/citationlistview.py
index e22fd7ff3..807a85172 100644
--- a/gramps/plugins/view/citationlistview.py
+++ b/gramps/plugins/view/citationlistview.py
@@ -48,7 +48,7 @@ from gi.repository import Gtk
from gramps.gui.views.treemodels.citationlistmodel import CitationListModel
from gramps.gen.plug import CATEGORY_QR_CITATION
from gramps.gen.lib import Citation, Source
-from gramps.gui.views.listview import ListView
+from gramps.gui.views.listview import ListView, TEXT, MARKUP, ICON
from gramps.gen.utils.db import get_citation_referents
from gramps.gui.views.bookmarks import CitationBookmarks
from gramps.gen.errors import WindowActiveError
@@ -63,7 +63,8 @@ from gramps.gui.merge import MergeCitation
# internationalization
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
@@ -79,42 +80,48 @@ class CitationListView(ListView):
sources as separate list entries).
"""
# The data items here have to correspond, in order, to the items in
- # src/giu.views/treemodels/citationlismodel.py
+ # src/giu/views/treemodels/citationlismodel.py
COL_TITLE_PAGE = 0
COL_ID = 1
COL_DATE = 2
COL_CONFIDENCE = 3
- COL_CHAN = 4
- COL_SRC_TITLE = 5
- COL_SRC_ID = 6
- COL_SRC_AUTH = 7
- COL_SRC_ABBR = 8
- COL_SRC_PINFO = 9
- COL_SRC_CHAN = 10
- # name of the columns
- COLUMN_NAMES = [
- _('Volume/Page'),
- _('ID'),
- _('Date'),
- _('Confidence'),
- _('Last Changed'),
- _('Source: Title'),
- _('Source: ID'),
- _('Source: Author'),
- _('Source: Abbreviation'),
- _('Source: Publication Information'),
- _('Source: Last Changed'),
+ COL_PRIV = 4
+ COL_TAGS = 5
+ COL_CHAN = 6
+ COL_SRC_TITLE = 7
+ COL_SRC_ID = 8
+ COL_SRC_AUTH = 9
+ COL_SRC_ABBR = 10
+ COL_SRC_PINFO = 11
+ COL_SRC_PRIV = 12
+ COL_SRC_CHAN = 13
+ # column definitions
+ COLUMNS = [
+ (_('Volume/Page'), TEXT, None),
+ (_('ID'), TEXT, None),
+ (_('Date'), MARKUP, None),
+ (_('Confidence'), TEXT, None),
+ (_('Private'), ICON, 'gramps-lock'),
+ (_('Tags'), TEXT, None),
+ (_('Last Changed'), TEXT, None),
+ (_('Source: Title'), TEXT, None),
+ (_('Source: ID'), TEXT, None),
+ (_('Source: Author'), TEXT, None),
+ (_('Source: Abbreviation'), TEXT, None),
+ (_('Source: Publication Information'), TEXT, None),
+ (_('Source: Private'), ICON, 'gramps-lock'),
+ (_('Source: Last Changed'), TEXT, None),
]
- # columns that contain markup
- MARKUP_COLS = [COL_DATE]
# default setting with visible columns, order of the col, and their size
CONFIGSETTINGS = (
('columns.visible', [COL_TITLE_PAGE, COL_ID, COL_DATE,
COL_CONFIDENCE]),
('columns.rank', [COL_TITLE_PAGE, COL_ID, COL_DATE, COL_CONFIDENCE,
- COL_CHAN, COL_SRC_TITLE, COL_SRC_ID, COL_SRC_AUTH,
- COL_SRC_ABBR, COL_SRC_PINFO, COL_SRC_CHAN]),
- ('columns.size', [200, 75, 100, 100, 100, 200, 75, 75, 100, 150, 100])
+ COL_PRIV, COL_TAGS, COL_CHAN, COL_SRC_TITLE,
+ COL_SRC_ID, COL_SRC_AUTH, COL_SRC_ABBR, COL_SRC_PINFO,
+ COL_SRC_PRIV, COL_SRC_CHAN]),
+ ('columns.size', [200, 75, 100, 100, 40, 100, 100, 200, 75, 75, 100,
+ 150, 40, 100])
)
ADD_MSG = _("Add a new citation and a new source")
ADD_SOURCE_MSG = _("Add a new source")
@@ -136,13 +143,10 @@ class CitationListView(ListView):
ListView.__init__(
self, _('Citation View'), pdata, dbstate, uistate,
- self.COLUMN_NAMES, len(self.COLUMN_NAMES),
CitationListModel, signal_map,
- dbstate.db.get_citation_bookmarks(),
CitationBookmarks, nav_group,
multiple=True,
- filter_class=CitationSidebarFilter,
- markup = CitationListView.MARKUP_COLS)
+ filter_class=CitationSidebarFilter)
self.func_list.update({
'J' : self.jump,
@@ -154,9 +158,6 @@ class CitationListView(ListView):
def navigation_type(self):
return 'Citation'
- def get_bookmarks(self):
- return self.dbstate.db.get_citation_bookmarks()
-
def drag_info(self):
return DdTargets.CITATION_LINK
@@ -336,6 +337,26 @@ class CitationListView(ListView):
else:
return None
+ def tag_updated(self, handle_list):
+ """
+ Update tagged rows when a tag color changes.
+ """
+ all_links = set([])
+ for tag_handle in handle_list:
+ links = set([link[1] for link in
+ self.dbstate.db.find_backlink_handles(tag_handle,
+ include_classes='Citation')])
+ all_links = all_links.union(links)
+ self.row_update(list(all_links))
+
+ def add_tag(self, transaction, citation_handle, tag_handle):
+ """
+ Add the given tag to the given citation.
+ """
+ citation = self.dbstate.db.get_citation_from_handle(citation_handle)
+ citation.add_tag(tag_handle)
+ self.dbstate.db.commit_citation(citation, transaction)
+
def get_default_gramplets(self):
"""
Define the default gramplets for the sidebar and bottombar.
diff --git a/gramps/plugins/view/citationtreeview.py b/gramps/plugins/view/citationtreeview.py
index b87e4293b..941fc1a5d 100644
--- a/gramps/plugins/view/citationtreeview.py
+++ b/gramps/plugins/view/citationtreeview.py
@@ -45,7 +45,7 @@ from gi.repository import Gtk
# Gramps modules
#
#-------------------------------------------------------------------------
-from gramps.gui.views.listview import LISTTREE
+from gramps.gui.views.listview import TEXT, MARKUP, ICON
from gramps.gui.views.treemodels.citationtreemodel import CitationTreeModel
from gramps.gen.plug import CATEGORY_QR_SOURCE_OR_CITATION
from gramps.gen.lib import Citation, Source
@@ -66,7 +66,8 @@ from gramps.gui.merge import MergeCitation, MergeSource
# Internationalization
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
@@ -78,25 +79,29 @@ class CitationTreeView(ListView):
A hierarchical view of sources with citations below them.
"""
# The data items here have to correspond, in order, to the items in
- # src/giu.views/treemodels/citationtreemodel.py
+ # src/giu/views/treemodels/citationtreemodel.py
COL_TITLE_PAGE = 0
COL_ID = 1
COL_DATE = 2
COL_CONFIDENCE = 3
- COL_CHAN = 4
- COL_SRC_AUTH = 5
- COL_SRC_ABBR = 6
- COL_SRC_PINFO = 7
- # name of the columns
- COLUMN_NAMES = [
- _('Title or Page'),
- _('ID'),
- _('Date'),
- _('Confidence'),
- _('Last Changed'),
- _('Source: Author'),
- _('Source: Abbreviation'),
- _('Source: Publication Information'),
+ COL_PRIV = 4
+ COL_TAGS = 5
+ COL_CHAN = 6
+ COL_SRC_AUTH = 7
+ COL_SRC_ABBR = 8
+ COL_SRC_PINFO = 9
+ # column definitions
+ COLUMNS = [
+ (_('Title or Page'), TEXT, None),
+ (_('ID'), TEXT, None),
+ (_('Date'), MARKUP, None),
+ (_('Confidence'), TEXT, None),
+ (_('Private'), ICON, 'gramps-lock'),
+ (_('Tags'), TEXT, None),
+ (_('Last Changed'), TEXT, None),
+ (_('Source: Author'), TEXT, None),
+ (_('Source: Abbreviation'), TEXT, None),
+ (_('Source: Publication Information'), TEXT, None),
]
COLUMN_FILTERABLE = [
COL_TITLE_PAGE,
@@ -106,16 +111,14 @@ class CitationTreeView(ListView):
COL_SRC_ABBR,
COL_SRC_PINFO
]
- # columns that contain markup
- MARKUP_COLS = [COL_DATE]
# default setting with visible columns, order of the col, and their size
CONFIGSETTINGS = (
('columns.visible', [COL_TITLE_PAGE, COL_ID, COL_SRC_AUTH,
COL_SRC_PINFO]),
('columns.rank', [COL_TITLE_PAGE, COL_ID, COL_DATE, COL_CONFIDENCE,
- COL_CHAN, COL_SRC_AUTH,
+ COL_PRIV, COL_TAGS, COL_CHAN, COL_SRC_AUTH,
COL_SRC_ABBR, COL_SRC_PINFO]),
- ('columns.size', [200, 75, 100, 75, 100, 150, 100, 150])
+ ('columns.size', [200, 75, 100, 75, 40, 100, 100, 150, 100, 150])
)
ADD_MSG = _("Add a new citation and a new source")
ADD_SOURCE_MSG = _("Add a new source")
@@ -141,13 +144,10 @@ class CitationTreeView(ListView):
ListView.__init__(
self, _('Citation Tree View'), pdata, dbstate, uistate,
- self.COLUMN_NAMES, len(self.COLUMN_NAMES),
CitationTreeModel, signal_map,
- dbstate.db.get_citation_bookmarks(),
CitationBookmarks, nav_group,
multiple=True,
- filter_class=SourceSidebarFilter,
- markup = CitationTreeView.MARKUP_COLS)
+ filter_class=SourceSidebarFilter)
self.func_list.update({
'J' : self.jump,
@@ -166,7 +166,7 @@ class CitationTreeView(ListView):
if i == 0:
return _('Title')
else:
- return self.colinfo[i]
+ return self.COLUMNS[i][0]
self.search_bar.setup_filter(
[(name(pair[1]), pair[1], pair[1] in self.exact_search())
@@ -222,9 +222,6 @@ class CitationTreeView(ListView):
def navigation_type(self):
return 'Citation'
- def get_bookmarks(self):
- return self.dbstate.db.get_citation_bookmarks()
-
def drag_info(self):
# Since drag only needs to work when just one row is selected, ideally,
# this should just return SOURCE_LINK if one source is selected and
@@ -244,12 +241,6 @@ class CitationTreeView(ListView):
else:
return DdTargets.CITATION_LINK
- def type_list(self):
- """
- set the listtype, this governs eg keybinding
- """
- return LISTTREE
-
def get_stock(self):
return 'gramps-citation'
@@ -561,6 +552,26 @@ class CitationTreeView(ListView):
else:
return None
+ def tag_updated(self, handle_list):
+ """
+ Update tagged rows when a tag color changes.
+ """
+ all_links = set([])
+ for tag_handle in handle_list:
+ links = set([link[1] for link in
+ self.dbstate.db.find_backlink_handles(tag_handle,
+ include_classes='Citation')])
+ all_links = all_links.union(links)
+ self.row_update(list(all_links))
+
+ def add_tag(self, transaction, citation_handle, tag_handle):
+ """
+ Add the given tag to the given citation.
+ """
+ citation = self.dbstate.db.get_citation_from_handle(citation_handle)
+ citation.add_tag(tag_handle)
+ self.dbstate.db.commit_citation(citation, transaction)
+
def get_default_gramplets(self):
"""
Define the default gramplets for the sidebar and bottombar.
diff --git a/gramps/plugins/view/grampletview.py b/gramps/plugins/view/dashboardview.py
similarity index 90%
rename from gramps/plugins/view/grampletview.py
rename to gramps/plugins/view/dashboardview.py
index 3de9344c5..625802e1f 100644
--- a/gramps/plugins/view/grampletview.py
+++ b/gramps/plugins/view/dashboardview.py
@@ -21,7 +21,7 @@
# $Id$
"""
-GrampletView interface.
+DashboardView interface.
"""
#-------------------------------------------------------------------------
@@ -37,19 +37,20 @@ from gi.repository import Gtk
#
#-------------------------------------------------------------------------
from gramps.gui.views.pageview import PageView
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
from gramps.gui.widgets.grampletpane import GrampletPane
-class GrampletView(PageView):
+class DashboardView(PageView):
"""
- GrampletView interface
+ DashboardView interface
"""
def __init__(self, pdata, dbstate, uistate):
"""
- Create a GrampletView, with the current dbstate and uistate
+ Create a DashboardView, with the current dbstate and uistate
"""
- PageView.__init__(self, _('Gramplets'), pdata, dbstate, uistate)
+ PageView.__init__(self, _('Dashboard'), pdata, dbstate, uistate)
self.ui_def = '''
@@ -72,7 +73,7 @@ class GrampletView(PageView):
the base class. Returns a gtk container widget.
"""
# load the user's gramplets and set columns, etc
- self.widget = GrampletPane("Gramplets_grampletview_gramplets", self,
+ self.widget = GrampletPane("Gramplets_dashboardview_gramplets", self,
self.dbstate, self.uistate)
return self.widget
diff --git a/gramps/plugins/view/eventview.py b/gramps/plugins/view/eventview.py
index 777430680..6ca110513 100644
--- a/gramps/plugins/view/eventview.py
+++ b/gramps/plugins/view/eventview.py
@@ -30,7 +30,8 @@ Provide the event view.
# Standard python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import logging
_LOG = logging.getLogger(".plugins.eventview")
@@ -47,7 +48,7 @@ from gi.repository import Gtk
#
#-------------------------------------------------------------------------
from gramps.gen.lib import Event
-from gramps.gui.views.listview import ListView
+from gramps.gui.views.listview import ListView, TEXT, MARKUP, ICON
from gramps.gui.views.treemodels import EventModel
from gramps.gen.errors import WindowActiveError
from gramps.gui.views.bookmarks import EventBookmarks
@@ -74,26 +75,28 @@ class EventView(ListView):
COL_TYPE = 2
COL_DATE = 3
COL_PLACE = 4
- COL_CHAN = 5
- COL_PARTIC = 6
- # name of the columns
- COLUMN_NAMES = [
- _('Description'),
- _('ID'),
- _('Type'),
- _('Date'),
- _('Place'),
- _('Last Changed'),
- _('Main Participants'),
+ COL_PRIV = 5
+ COL_TAGS = 6
+ COL_CHAN = 7
+ COL_PARTIC = 8
+ # column definitions
+ COLUMNS = [
+ (_('Description'), TEXT, None),
+ (_('ID'), TEXT, None),
+ (_('Type'), TEXT, None),
+ (_('Date'), MARKUP, None),
+ (_('Place'), TEXT, None),
+ (_('Private'), ICON, 'gramps-lock'),
+ (_('Tags'), TEXT, None),
+ (_('Last Changed'), TEXT, None),
+ (_('Main Participants'), TEXT, None),
]
- # columns that contain markup
- MARKUP_COLS = [COL_DATE]
# default setting with visible columns, order of the col, and their size
CONFIGSETTINGS = (
('columns.visible', [COL_DESCR, COL_ID, COL_TYPE, COL_DATE, COL_PLACE]),
('columns.rank', [COL_DESCR, COL_ID, COL_TYPE, COL_PARTIC, COL_DATE,
- COL_PLACE, COL_CHAN]),
- ('columns.size', [200, 75, 100, 230, 150, 200, 100])
+ COL_PLACE, COL_PRIV, COL_TAGS, COL_CHAN]),
+ ('columns.size', [200, 75, 100, 230, 150, 200, 40, 100, 100])
)
ADD_MSG = _("Add a new event")
EDIT_MSG = _("Edit the selected event")
@@ -115,13 +118,11 @@ class EventView(ListView):
ListView.__init__(
self, _('Events'), pdata, dbstate, uistate,
- EventView.COLUMN_NAMES, len(EventView.COLUMN_NAMES),
EventModel,
- signal_map, dbstate.db.get_event_bookmarks(),
+ signal_map,
EventBookmarks, nav_group,
multiple=True,
- filter_class=EventSidebarFilter,
- markup = EventView.MARKUP_COLS)
+ filter_class=EventSidebarFilter)
self.func_list.update({
'J' : self.jump,
@@ -135,12 +136,6 @@ class EventView(ListView):
def navigation_type(self):
return 'Event'
- def get_bookmarks(self):
- """
- Return the bookmark object
- """
- return self.dbstate.db.get_event_bookmarks()
-
def drag_info(self):
"""
Indicate that the drag type is an EVENT
@@ -274,6 +269,26 @@ class EventView(ListView):
else:
MergeEvent(self.dbstate, self.uistate, mlist[0], mlist[1])
+ def tag_updated(self, handle_list):
+ """
+ Update tagged rows when a tag color changes.
+ """
+ all_links = set([])
+ for tag_handle in handle_list:
+ links = set([link[1] for link in
+ self.dbstate.db.find_backlink_handles(tag_handle,
+ include_classes='Event')])
+ all_links = all_links.union(links)
+ self.row_update(list(all_links))
+
+ def add_tag(self, transaction, event_handle, tag_handle):
+ """
+ Add the given tag to the given event.
+ """
+ event = self.dbstate.db.get_event_from_handle(event_handle)
+ event.add_tag(tag_handle)
+ self.dbstate.db.commit_event(event, transaction)
+
def get_default_gramplets(self):
"""
Define the default gramplets for the sidebar and bottombar.
diff --git a/gramps/plugins/view/familyview.py b/gramps/plugins/view/familyview.py
index 46a5228ff..8a9ff9ebc 100644
--- a/gramps/plugins/view/familyview.py
+++ b/gramps/plugins/view/familyview.py
@@ -30,7 +30,8 @@ Family View.
# Standard python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import logging
_LOG = logging.getLogger(".plugins.eventview")
#-------------------------------------------------------------------------
@@ -46,7 +47,7 @@ from gi.repository import Gtk
#
#-------------------------------------------------------------------------
from gramps.gen.lib import Family
-from gramps.gui.views.listview import ListView
+from gramps.gui.views.listview import ListView, TEXT, MARKUP, ICON
from gramps.gui.views.treemodels import FamilyModel
from gramps.gui.editors import EditFamily
from gramps.gui.views.bookmarks import FamilyBookmarks
@@ -72,26 +73,27 @@ class FamilyView(ListView):
COL_MOTHER = 2
COL_REL = 3
COL_MARDATE = 4
- COL_TAGS = 5
- COL_CHAN = 6
- # name of the columns
- MARKUP_COLS = [COL_MARDATE]
- COLUMN_NAMES = [
- _('ID'),
- _('Father'),
- _('Mother'),
- _('Relationship'),
- _('Marriage Date'),
- _('Tags'),
- _('Last Changed'),
+ COL_PRIV = 5
+ COL_TAGS = 6
+ COL_CHAN = 7
+ # column definitions
+ COLUMNS = [
+ (_('ID'), TEXT, None),
+ (_('Father'), TEXT, None),
+ (_('Mother'), TEXT, None),
+ (_('Relationship'), TEXT, None),
+ (_('Marriage Date'), MARKUP, None),
+ (_('Private'), ICON, 'gramps-lock'),
+ (_('Tags'), TEXT, None),
+ (_('Last Changed'), TEXT, None),
]
#default setting with visible columns, order of the col, and their size
CONFIGSETTINGS = (
('columns.visible', [COL_ID, COL_FATHER, COL_MOTHER, COL_REL,
COL_MARDATE]),
('columns.rank', [COL_ID, COL_FATHER, COL_MOTHER, COL_REL,
- COL_MARDATE, COL_TAGS, COL_CHAN]),
- ('columns.size', [75, 200, 200, 100, 100, 100, 100])
+ COL_MARDATE, COL_PRIV, COL_TAGS, COL_CHAN]),
+ ('columns.size', [75, 200, 200, 100, 100, 40, 100, 100])
)
ADD_MSG = _("Add a new family")
@@ -108,18 +110,15 @@ class FamilyView(ListView):
'family-update' : self.row_update,
'family-delete' : self.row_delete,
'family-rebuild' : self.object_build,
- 'tag-update' : self.tag_updated
}
ListView.__init__(
self, _('Families'), pdata, dbstate, uistate,
- FamilyView.COLUMN_NAMES, len(FamilyView.COLUMN_NAMES),
FamilyModel,
- signal_map, dbstate.db.get_family_bookmarks(),
+ signal_map,
FamilyBookmarks, nav_group,
multiple=True,
- filter_class=FamilySidebarFilter,
- markup=FamilyView.MARKUP_COLS)
+ filter_class=FamilySidebarFilter)
self.func_list.update({
'J' : self.jump,
@@ -213,23 +212,6 @@ class FamilyView(ListView):
])
self._add_action_group(self.all_action)
- def set_active(self):
- """
- Called when the page is displayed.
- """
- ListView.set_active(self)
- self.uistate.viewmanager.tags.tag_enable()
-
- def set_inactive(self):
- """
- Called when the page is no longer displayed.
- """
- ListView.set_inactive(self)
- self.uistate.viewmanager.tags.tag_disable()
-
- def get_bookmarks(self):
- return self.dbstate.db.get_family_bookmarks()
-
def add_bookmark(self, obj):
mlist = self.selected_handles()
if mlist:
diff --git a/gramps/plugins/view/fanchartdescview.py b/gramps/plugins/view/fanchartdescview.py
index 27a813bf7..348118ee1 100644
--- a/gramps/plugins/view/fanchartdescview.py
+++ b/gramps/plugins/view/fanchartdescview.py
@@ -35,7 +35,8 @@
from gi.repository import Gdk
from gi.repository import Gtk
import cairo
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
@@ -72,7 +73,6 @@ class FanChartDescView(fanchartdesc.FanChartDescGrampsGUI, NavigationView):
NavigationView.__init__(self, _('Descendant Fan Chart'),
pdata, dbstate, uistate,
- dbstate.db.get_bookmarks(),
PersonBookmarks,
nav_group)
fanchartdesc.FanChartDescGrampsGUI.__init__(self, self.on_childmenu_changed)
@@ -200,7 +200,6 @@ class FanChartDescView(fanchartdesc.FanChartDescGrampsGUI, NavigationView):
def change_db(self, db):
self._change_db(db)
- self.bookmarks.update_bookmarks(self.dbstate.db.get_bookmarks())
if self.active:
self.bookmarks.redraw()
self.update()
diff --git a/gramps/plugins/view/fanchartview.py b/gramps/plugins/view/fanchartview.py
index 373330de6..3aafd4ed1 100644
--- a/gramps/plugins/view/fanchartview.py
+++ b/gramps/plugins/view/fanchartview.py
@@ -35,7 +35,8 @@
from gi.repository import Gdk
from gi.repository import Gtk
import cairo
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
@@ -71,7 +72,6 @@ class FanChartView(fanchart.FanChartGrampsGUI, NavigationView):
NavigationView.__init__(self, _('Fan Chart'),
pdata, dbstate, uistate,
- dbstate.db.get_bookmarks(),
PersonBookmarks,
nav_group)
fanchart.FanChartGrampsGUI.__init__(self, self.on_childmenu_changed)
@@ -198,7 +198,6 @@ class FanChartView(fanchart.FanChartGrampsGUI, NavigationView):
def change_db(self, db):
self._change_db(db)
- self.bookmarks.update_bookmarks(self.dbstate.db.get_bookmarks())
if self.active:
self.bookmarks.redraw()
self.update()
diff --git a/gramps/plugins/view/geoclose.py b/gramps/plugins/view/geoclose.py
index d5b18bfa1..595e06409 100644
--- a/gramps/plugins/view/geoclose.py
+++ b/gramps/plugins/view/geoclose.py
@@ -30,7 +30,8 @@ Geography for two persons
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import operator
from gi.repository import Gtk
from math import *
@@ -130,7 +131,6 @@ class GeoClose(GeoGraphyView):
def __init__(self, pdata, dbstate, uistate, nav_group=0):
GeoGraphyView.__init__(self, _("Have they been able to meet?"),
pdata, dbstate, uistate,
- dbstate.db.get_bookmarks(),
PersonBookmarks,
nav_group)
self.dbstate = dbstate
@@ -188,12 +188,6 @@ class GeoClose(GeoGraphyView):
"""
return 'Person'
- def get_bookmarks(self):
- """
- Return the bookmark object
- """
- return self.dbstate.db.get_bookmarks()
-
def goto_handle(self, handle=None):
"""
Rebuild the tree with the given person handle as the root.
@@ -216,12 +210,17 @@ class GeoClose(GeoGraphyView):
self._createmap(p1, color, self.place_list_active, False)
if self.refperson:
color = self._config.get('geography.color1')
- self.message_layer.add_message(_("Reference : %(name)s ( %(birth)s - %(death)s )") % {'name': _nd.display(self.refperson),
- 'birth': self.birth(self.refperson),
- 'death': self.death(self.refperson)})
- self.message_layer.add_message(_("The other : %(name)s ( %(birth)s - %(death)s )") % {'name': _nd.display(p1),
- 'birth': self.birth(p1),
- 'death': self.death(p1)})
+ self.message_layer.add_message(_("Reference : %(name)s ( %(birth)s - %(death)s )") % {
+ 'name': _nd.display(self.refperson),
+ 'birth': self.birth(self.refperson),
+ 'death': self.death(self.refperson)})
+ if p1:
+ self.message_layer.add_message(_("The other : %(name)s ( %(birth)s - %(death)s )") % {
+ 'name': _nd.display(p1),
+ 'birth': self.birth(p1),
+ 'death': self.death(p1)})
+ else:
+ self.message_layer.add_message(_("The other person is unknown"))
self._createmap(self.refperson, color, self.place_list_ref, True)
else:
self.message_layer.add_message(_("You must choose one reference person."))
@@ -301,7 +300,10 @@ class GeoClose(GeoGraphyView):
active = self.get_active()
person = self.dbstate.db.get_person_from_handle(active)
self.lifeway_layer.clear_ways()
- self.goto_handle(handle=person)
+ if person is None:
+ self.goto_handle(None)
+ else:
+ self.goto_handle(handle=person)
def draw(self, menu, marks, color, reference):
"""
diff --git a/gramps/plugins/view/geoevents.py b/gramps/plugins/view/geoevents.py
index 1a20fa434..4a2dd2778 100644
--- a/gramps/plugins/view/geoevents.py
+++ b/gramps/plugins/view/geoevents.py
@@ -30,7 +30,8 @@ Geography for events
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import os
import sys
import operator
@@ -111,7 +112,6 @@ class GeoEvents(GeoGraphyView):
def __init__(self, pdata, dbstate, uistate, nav_group=0):
GeoGraphyView.__init__(self, _('Events places map'),
pdata, dbstate, uistate,
- dbstate.db.get_event_bookmarks(),
EventBookmarks,
nav_group)
self.dbstate = dbstate
@@ -161,12 +161,6 @@ class GeoEvents(GeoGraphyView):
"""
return 'Event'
- def get_bookmarks(self):
- """
- Return the bookmark object
- """
- return self.dbstate.db.get_event_bookmarks()
-
def goto_handle(self, handle=None):
"""
Rebuild the tree with the given events handle as the root.
diff --git a/gramps/plugins/view/geofamclose.py b/gramps/plugins/view/geofamclose.py
index e62db184e..b456102fc 100644
--- a/gramps/plugins/view/geofamclose.py
+++ b/gramps/plugins/view/geofamclose.py
@@ -30,7 +30,8 @@ Geography for two families
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import operator
from gi.repository import Gtk
from math import *
@@ -128,7 +129,6 @@ class GeoFamClose(GeoGraphyView):
def __init__(self, pdata, dbstate, uistate, nav_group=0):
GeoGraphyView.__init__(self, _("Have these two families been able to meet?"),
pdata, dbstate, uistate,
- dbstate.db.get_bookmarks(),
FamilyBookmarks,
nav_group)
self.dbstate = dbstate
@@ -186,12 +186,6 @@ class GeoFamClose(GeoGraphyView):
"""
return 'Family'
- def get_bookmarks(self):
- """
- Return the bookmark object
- """
- return self.dbstate.db.get_bookmarks()
-
def family_label(self,family):
if family is None:
return "Unknown"
@@ -247,7 +241,10 @@ class GeoFamClose(GeoGraphyView):
color = self._config.get('geography.color1')
self._createmap(self.reffamily, color, self.place_list_ref, True)
self.message_layer.add_message(_("Family reference : %s" % self.family_label(self.reffamily)))
- self.message_layer.add_message(_("The other family : %s" % self.family_label(f1)))
+ if f1:
+ self.message_layer.add_message(_("The other family : %s" % self.family_label(f1)))
+ else:
+ self.message_layer.add_message(_("The other family : %s" % _("Unknown")))
else:
self.message_layer.add_message(_("You must choose one reference family."))
self.message_layer.add_message(_("Go to the family view and select "
diff --git a/gramps/plugins/view/geofamily.py b/gramps/plugins/view/geofamily.py
index a63ee5cdd..6443d672f 100644
--- a/gramps/plugins/view/geofamily.py
+++ b/gramps/plugins/view/geofamily.py
@@ -30,7 +30,8 @@ Geography for one family
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import os
import sys
import operator
@@ -111,7 +112,6 @@ class GeoFamily(GeoGraphyView):
def __init__(self, pdata, dbstate, uistate, nav_group=0):
GeoGraphyView.__init__(self, _('Family places map'),
pdata, dbstate, uistate,
- dbstate.db.get_family_bookmarks(),
FamilyBookmarks,
nav_group)
self.dbstate = dbstate
@@ -160,12 +160,6 @@ class GeoFamily(GeoGraphyView):
"""
return 'Family'
- def get_bookmarks(self):
- """
- Return the bookmark object
- """
- return self.dbstate.db.get_family_bookmarks()
-
def goto_handle(self, handle=None):
"""
Rebuild the tree with the given person handle as the root.
diff --git a/gramps/plugins/view/geography.gpr.py b/gramps/plugins/view/geography.gpr.py
index e8af790fe..9a976dabd 100644
--- a/gramps/plugins/view/geography.gpr.py
+++ b/gramps/plugins/view/geography.gpr.py
@@ -27,7 +27,7 @@
#
#------------------------------------------------------------------------
-MODULE_VERSION="4.0"
+MODULE_VERSION="4.1"
from gi import Repository
diff --git a/gramps/plugins/view/geomoves.py b/gramps/plugins/view/geomoves.py
index 2dc432a54..08722e227 100644
--- a/gramps/plugins/view/geomoves.py
+++ b/gramps/plugins/view/geomoves.py
@@ -30,7 +30,8 @@ Geography for one person and all his descendant
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import operator
from gi.repository import Gtk
from gi.repository import Gdk
@@ -38,6 +39,7 @@ from gi.repository import GObject
import time
import threading
from math import *
+from gi.repository import GLib
#-------------------------------------------------------------------------
#
@@ -131,7 +133,6 @@ class GeoMoves(GeoGraphyView):
def __init__(self, pdata, dbstate, uistate, nav_group=0):
GeoGraphyView.__init__(self, _("Descendance of the active person."),
pdata, dbstate, uistate,
- dbstate.db.get_bookmarks(),
PersonBookmarks,
nav_group)
self.dbstate = dbstate
@@ -189,12 +190,6 @@ class GeoMoves(GeoGraphyView):
"""
return 'Person'
- def get_bookmarks(self):
- """
- Return the bookmark object
- """
- return self.dbstate.db.get_bookmarks()
-
def goto_handle(self, handle=None):
"""
Rebuild the tree with the given family handle as reference.
@@ -471,7 +466,7 @@ class GeoMoves(GeoGraphyView):
return
self.message_layer.add_message(_("All descendance for %s" % _nd.display(person)))
color = Gdk.color_parse(self._config.get('geography.color_base'))
- GObject.timeout_add(int(self._config.get("geography.generation_interval")),
+ GLib.timeout_add(int(self._config.get("geography.generation_interval")),
self.animate_moves, 0, person, color)
def animate_moves(self, index, person, color):
@@ -539,7 +534,7 @@ class GeoMoves(GeoGraphyView):
time_to_wait = int(self._config.get("geography.generation_interval"))
self._create_markers()
# process next generation in a few milliseconds
- GObject.timeout_add(time_to_wait, self.animate_moves,
+ GLib.timeout_add(int(time_to_wait), self.animate_moves,
index+1, person, color)
else:
self.started = False
diff --git a/gramps/plugins/view/geoperson.py b/gramps/plugins/view/geoperson.py
index 160c372ec..43b6dd47f 100644
--- a/gramps/plugins/view/geoperson.py
+++ b/gramps/plugins/view/geoperson.py
@@ -30,7 +30,8 @@ Geography for one person
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import os
import sys
import operator
@@ -40,6 +41,7 @@ KEY_TAB = Gdk.KEY_Tab
import socket
from gi.repository import Gtk
from gi.repository import GObject
+from gi.repository import GLib
#-------------------------------------------------------------------------
#
@@ -140,7 +142,6 @@ class GeoPerson(GeoGraphyView):
def __init__(self, pdata, dbstate, uistate, nav_group=0):
GeoGraphyView.__init__(self, _("Person places map"),
pdata, dbstate, uistate,
- dbstate.db.get_bookmarks(),
PersonBookmarks,
nav_group)
self.dbstate = dbstate
@@ -189,12 +190,6 @@ class GeoPerson(GeoGraphyView):
"""
return 'Person'
- def get_bookmarks(self):
- """
- Return the bookmark object
- """
- return self.dbstate.db.get_bookmarks()
-
def goto_handle(self, handle=None):
"""
Rebuild the tree with the given person handle as the root.
@@ -282,7 +277,7 @@ class GeoPerson(GeoGraphyView):
# in this case, stepyear is >= 9000
# large move means longitude or latitude differences greater than geography.maximum_lon_lat
# degrees.
- GObject.timeout_add(self._config.get("geography.speed"), self.animate,
+ GLib.timeout_add(int(self._config.get("geography.speed")), self.animate,
menu, marks, i, stepyear)
return False
diff --git a/gramps/plugins/view/geoplaces.py b/gramps/plugins/view/geoplaces.py
index d303513fe..03c68a792 100644
--- a/gramps/plugins/view/geoplaces.py
+++ b/gramps/plugins/view/geoplaces.py
@@ -30,7 +30,8 @@ Geography for places
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import os
import sys
import time
@@ -111,7 +112,6 @@ class GeoPlaces(GeoGraphyView):
def __init__(self, pdata, dbstate, uistate, nav_group=0):
GeoGraphyView.__init__(self, _('Places places map'),
pdata, dbstate, uistate,
- dbstate.db.get_place_bookmarks(),
PlaceBookmarks,
nav_group)
self.dbstate = dbstate
@@ -161,12 +161,6 @@ class GeoPlaces(GeoGraphyView):
"""
return 'Place'
- def get_bookmarks(self):
- """
- Return the bookmark object
- """
- return self.dbstate.db.get_place_bookmarks()
-
def goto_handle(self, handle=None):
"""
Rebuild the tree with the given places handle as the root.
diff --git a/gramps/plugins/view/htmlrenderer.gpr.py b/gramps/plugins/view/htmlrenderer.gpr.py
index 9e8464fa1..a1c20d87e 100644
--- a/gramps/plugins/view/htmlrenderer.gpr.py
+++ b/gramps/plugins/view/htmlrenderer.gpr.py
@@ -68,7 +68,7 @@ if not (TOOLKIT == NOWEB):
name = _("Html View"),
description = _("A view showing html pages embedded in Gramps"),
version = '1.0',
- gramps_target_version = '4.0',
+ gramps_target_version = '4.1',
status = STABLE,
fname = 'htmlrenderer.py',
authors = ["The Gramps project"],
diff --git a/gramps/plugins/view/htmlrenderer.py b/gramps/plugins/view/htmlrenderer.py
index c5736a54e..4d48a48cd 100644
--- a/gramps/plugins/view/htmlrenderer.py
+++ b/gramps/plugins/view/htmlrenderer.py
@@ -32,7 +32,8 @@ Can use the Webkit or Gecko ( Mozilla ) library
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import os
import sys
import locale
diff --git a/gramps/plugins/view/locationview.py b/gramps/plugins/view/locationview.py
index 6e94994da..98cae37af 100644
--- a/gramps/plugins/view/locationview.py
+++ b/gramps/plugins/view/locationview.py
@@ -41,7 +41,7 @@ _LOG = logging.getLogger(".plugins.locationview")
#-------------------------------------------------------------------------
from gramps.gen.lib import Location
from gramps.gen.db import DbTxn
-from gramps.gui.views.listview import ListView
+from gramps.gui.views.listview import ListView, TEXT, MARKUP, ICON
from gramps.gui.views.treemodels import LocationTreeModel
from gramps.gen.errors import WindowActiveError
from gramps.gui.views.bookmarks import PlaceBookmarks
@@ -49,7 +49,6 @@ from gramps.gui.ddtargets import DdTargets
from gramps.gui.dialog import ErrorDialog
from gramps.gui.editors import EditLocation
from gramps.gen.plug import CATEGORY_QR_PLACE
-from gramps.gui.views.listview import LISTTREE
#-------------------------------------------------------------------------
#
@@ -66,16 +65,14 @@ class LocationView(ListView):
COL_LAT = 2
COL_LON = 3
COL_CHAN = 4
- # name of the columns
- COLUMN_NAMES = [
- _('Name'),
- _('Type'),
- _('Latitude'),
- _('Longitude'),
- _('Last Changed'),
+ # column definitions
+ COLUMNS = [
+ (_('Name'), TEXT, None),
+ (_('Type'), TEXT, None),
+ (_('Latitude'), TEXT, None),
+ (_('Longitude'), TEXT, None),
+ (_('Last Changed'), TEXT, None),
]
- # columns that contain markup
- #MARKUP_COLS = [COL_DATE]
# default setting with visible columns, order of the col, and their size
CONFIGSETTINGS = (
('columns.visible', [COL_NAME, COL_TYPE]),
@@ -102,9 +99,8 @@ class LocationView(ListView):
ListView.__init__(
self, _('Locations'), pdata, dbstate, uistate,
- LocationView.COLUMN_NAMES, len(LocationView.COLUMN_NAMES),
LocationTreeModel,
- signal_map, dbstate.db.get_place_bookmarks(),
+ signal_map,
PlaceBookmarks, nav_group,
multiple=True)
@@ -115,12 +111,6 @@ class LocationView(ListView):
self.additional_uis.append(self.additional_ui())
- def type_list(self):
- """
- set the listtype, this governs eg keybinding
- """
- return LISTTREE
-
def navigation_type(self):
return 'Place'
@@ -281,6 +271,12 @@ class LocationView(ListView):
"""
pass
+ def tag_updated(self, handle_list):
+ """
+ Update tagged rows when a tag color changes.
+ """
+ pass
+
def get_default_gramplets(self):
"""
Define the default gramplets for the sidebar and bottombar.
diff --git a/gramps/plugins/view/mediaview.py b/gramps/plugins/view/mediaview.py
index 9c1061cb4..89f29c32f 100644
--- a/gramps/plugins/view/mediaview.py
+++ b/gramps/plugins/view/mediaview.py
@@ -31,7 +31,8 @@ Media View.
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import os
import sys
if sys.version_info[0] < 3:
@@ -57,7 +58,7 @@ from gi.repository import Gtk
#
#-------------------------------------------------------------------------
from gramps.gui.utils import open_file_with_default_application
-from gramps.gui.views.listview import ListView
+from gramps.gui.views.listview import ListView, TEXT, MARKUP, ICON
from gramps.gui.views.treemodels import MediaModel
from gramps.gen.constfunc import win, cuni
from gramps.gen.config import config
@@ -94,25 +95,28 @@ class MediaView(ListView):
COL_TYPE = 2
COL_PATH = 3
COL_DATE = 4
- COL_TAGS = 5
- COL_CHAN = 6
- #name of the columns
- COLUMN_NAMES = [
- _('Title'),
- _('ID'),
- _('Type'),
- _('Path'),
- _('Date'),
- _('Tags'),
- _('Last Changed'),
+ COL_PRIV = 5
+ COL_TAGS = 6
+ COL_CHAN = 7
+
+ # column definitions
+ COLUMNS = [
+ (_('Title'), TEXT, None),
+ (_('ID'), TEXT, None),
+ (_('Type'), TEXT, None),
+ (_('Path'), TEXT, None),
+ (_('Date'), TEXT, None),
+ (_('Private'), ICON, 'gramps-lock'),
+ (_('Tags'), TEXT, None),
+ (_('Last Changed'), TEXT, None),
]
# default setting with visible columns, order of the col, and their size
CONFIGSETTINGS = (
('columns.visible', [COL_TITLE, COL_ID, COL_TYPE, COL_PATH,
COL_DATE]),
('columns.rank', [COL_TITLE, COL_ID, COL_TYPE, COL_PATH,
- COL_DATE, COL_TAGS, COL_CHAN]),
- ('columns.size', [200, 75, 100, 200, 150, 100, 150])
+ COL_DATE, COL_PRIV, COL_TAGS, COL_CHAN]),
+ ('columns.size', [200, 75, 100, 200, 150, 40, 100, 150])
)
ADD_MSG = _("Add a new media object")
@@ -129,14 +133,12 @@ class MediaView(ListView):
'media-update' : self.row_update,
'media-delete' : self.row_delete,
'media-rebuild' : self.object_build,
- 'tag-update' : self.tag_updated
}
ListView.__init__(
self, _('Media'), pdata, dbstate, uistate,
- MediaView.COLUMN_NAMES, len(MediaView.COLUMN_NAMES),
MediaModel,
- signal_map, dbstate.db.get_media_bookmarks(),
+ signal_map,
MediaBookmarks, nav_group,
filter_class=MediaSidebarFilter,
multiple=True)
@@ -192,7 +194,7 @@ class MediaView(ListView):
protocol, site, mfile, j, k, l = urlparse(clean_string)
if protocol == "file":
name = cuni(url2pathname(
- mfile.encode(sys.getfilesystemencoding())))
+ mfile.encode(glocale.getfilesystemencoding())))
mime = get_type(name)
if not is_valid_type(mime):
return
@@ -209,12 +211,6 @@ class MediaView(ListView):
self.dbstate.db.add_object(photo, trans)
widget.emit_stop_by_name('drag_data_received')
- def get_bookmarks(self):
- """
- Return the bookmarks associated with this view
- """
- return self.dbstate.db.get_media_bookmarks()
-
def define_actions(self):
"""
Defines the UIManager actions specific to Media View. We need to make
@@ -235,20 +231,6 @@ class MediaView(ListView):
self._add_action('QuickReport', None, _("Quick View"), None, None, None)
- def set_active(self):
- """
- Called when the page is displayed.
- """
- ListView.set_active(self)
- self.uistate.viewmanager.tags.tag_enable()
-
- def set_inactive(self):
- """
- Called when the page is no longer displayed.
- """
- ListView.set_inactive(self)
- self.uistate.viewmanager.tags.tag_disable()
-
def view_media(self, obj):
"""
Launch external viewers for the selected objects.
diff --git a/gramps/plugins/view/noteview.py b/gramps/plugins/view/noteview.py
index fad9d16b6..4744a6543 100644
--- a/gramps/plugins/view/noteview.py
+++ b/gramps/plugins/view/noteview.py
@@ -29,7 +29,8 @@ Note View.
# python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
import logging
_LOG = logging.getLogger(".plugins.noteview")
@@ -45,7 +46,7 @@ from gi.repository import Gtk
# gramps modules
#
#-------------------------------------------------------------------------
-from gramps.gui.views.listview import ListView
+from gramps.gui.views.listview import ListView, TEXT, MARKUP, ICON
from gramps.gui.views.treemodels import NoteModel
from gramps.gen.utils.db import get_note_referents
from gramps.gen.errors import WindowActiveError
@@ -71,21 +72,25 @@ class NoteView(ListView):
COL_PREVIEW = 0
COL_ID = 1
COL_TYPE = 2
- COL_TAGS = 3
- COL_CHAN = 4
+ COL_PRIV = 3
+ COL_TAGS = 4
+ COL_CHAN = 5
- COLUMN_NAMES = [
- _('Preview'),
- _('ID'),
- _('Type'),
- _('Tags'),
- _('Last Changed')
+ # column definitions
+ COLUMNS = [
+ (_('Preview'), TEXT, None),
+ (_('ID'), TEXT, None),
+ (_('Type'), TEXT, None),
+ (_('Private'), ICON, 'gramps-lock'),
+ (_('Tags'), TEXT, None),
+ (_('Last Changed'), TEXT, None),
]
# default setting with visible columns, order of the col, and their size
CONFIGSETTINGS = (
('columns.visible', [COL_PREVIEW, COL_ID, COL_TYPE]),
- ('columns.rank', [COL_PREVIEW, COL_ID, COL_TYPE, COL_TAGS, COL_CHAN]),
- ('columns.size', [350, 75, 100, 100, 100]))
+ ('columns.rank', [COL_PREVIEW, COL_ID, COL_TYPE, COL_PRIV, COL_TAGS,
+ COL_CHAN]),
+ ('columns.size', [350, 75, 100, 40, 100, 100]))
ADD_MSG = _("Add a new note")
EDIT_MSG = _("Edit the selected note")
@@ -101,13 +106,11 @@ class NoteView(ListView):
'note-update' : self.row_update,
'note-delete' : self.row_delete,
'note-rebuild' : self.object_build,
- 'tag-update' : self.tag_updated
}
ListView.__init__(
- self, _('Notes'), pdata, dbstate, uistate, NoteView.COLUMN_NAMES,
- len(NoteView.COLUMN_NAMES), NoteModel, signal_map,
- dbstate.db.get_note_bookmarks(),
+ self, _('Notes'), pdata, dbstate, uistate,
+ NoteModel, signal_map,
NoteBookmarks, nav_group,
filter_class=NoteSidebarFilter,
multiple=True)
@@ -122,12 +125,6 @@ class NoteView(ListView):
def navigation_type(self):
return 'Note'
- def get_bookmarks(self):
- """
- Return the bookmark object
- """
- return self.dbstate.db.get_note_bookmarks()
-
def drag_info(self):
"""
Indicate that the drag type is an EVENT
@@ -205,20 +202,6 @@ class NoteView(ListView):
callback=self.filter_editor,)
self._add_action('QuickReport', None, _("Quick View"), None, None, None)
- def set_active(self):
- """
- Called when the page is displayed.
- """
- ListView.set_active(self)
- self.uistate.viewmanager.tags.tag_enable()
-
- def set_inactive(self):
- """
- Called when the page is no longer displayed.
- """
- ListView.set_inactive(self)
- self.uistate.viewmanager.tags.tag_disable()
-
def get_handle_from_gramps_id(self, gid):
obj = self.dbstate.db.get_note_from_gramps_id(gid)
if obj:
diff --git a/gramps/plugins/view/pedigreeview.py b/gramps/plugins/view/pedigreeview.py
index 32475083c..a41065c53 100644
--- a/gramps/plugins/view/pedigreeview.py
+++ b/gramps/plugins/view/pedigreeview.py
@@ -31,8 +31,8 @@
#-------------------------------------------------------------------------
from __future__ import unicode_literals, division
-from gramps.gen.ggettext import sgettext as _
-from gramps.gen.ggettext import ngettext
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from cgi import escape
import math
import sys
@@ -209,7 +209,7 @@ class PersonBoxWidgetCairo(_PersonWidgetBase):
if image:
image_path = self.get_image(dbstate, person)
if sys.version_info[0] < 3 and isinstance(image_path, STRTYPE):
- image_path = image_path.encode(sys.getfilesystemencoding())
+ image_path = image_path.encode(glocale.getfilesystemencoding())
if image_path and os.path.exists(image_path):
self.img_surf = cairo.ImageSurface.create_from_png(image_path)
@@ -520,9 +520,7 @@ class PedigreeView(NavigationView):
def __init__(self, pdata, dbstate, uistate, nav_group=0):
NavigationView.__init__(self, _('Pedigree'), pdata, dbstate, uistate,
- dbstate.db.get_bookmarks(),
- PersonBookmarks,
- nav_group)
+ PersonBookmarks, nav_group)
self.func_list.update({
'F2' : self.kb_goto_home,
@@ -715,7 +713,6 @@ class PedigreeView(NavigationView):
from self.state.db
"""
self._change_db(db)
- self.bookmarks.update_bookmarks(self.dbstate.db.get_bookmarks())
if self.active:
self.bookmarks.redraw()
self.build_tree()
diff --git a/gramps/plugins/view/personlistview.py b/gramps/plugins/view/personlistview.py
index 3478ae679..c78c45076 100644
--- a/gramps/plugins/view/personlistview.py
+++ b/gramps/plugins/view/personlistview.py
@@ -31,7 +31,6 @@ Person list View
# Gramps modules
#
#-------------------------------------------------------------------------
-from gramps.gui.views.listview import LISTTREE
from gramps.plugins.lib.libpersonview import BasePersonView
from gramps.gui.views.treemodels.peoplemodel import PersonListModel
@@ -40,7 +39,8 @@ from gramps.gui.views.treemodels.peoplemodel import PersonListModel
# Internationalization
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/plugins/view/persontreeview.py b/gramps/plugins/view/persontreeview.py
index 05b26a016..a1dfbcbfb 100644
--- a/gramps/plugins/view/persontreeview.py
+++ b/gramps/plugins/view/persontreeview.py
@@ -38,7 +38,7 @@ from gi.repository import Gtk
# Gramps modules
#
#-------------------------------------------------------------------------
-from gramps.gui.views.listview import LISTTREE
+from gramps.gui.views.listview import TEXT, MARKUP, ICON
from gramps.plugins.lib.libpersonview import BasePersonView
from gramps.gui.views.treemodels.peoplemodel import PersonTreeModel
from gramps.gen.lib import Name, Person, Surname
@@ -51,7 +51,8 @@ from gramps.gen.utils.db import preset_name
# Internationalization
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
@@ -67,12 +68,6 @@ class PersonTreeView(BasePersonView):
_('People Tree View'), PersonTreeModel,
nav_group=nav_group)
- def type_list(self):
- """
- set the listtype, this governs eg keybinding
- """
- return LISTTREE
-
def get_viewtype_stock(self):
"""
Override the default icon. Set for hierarchical view.
@@ -175,9 +170,8 @@ class PersonTreeView(BasePersonView):
pathids = path.get_indices()
if len(pathids) == 1:
path = Gtk.TreePath((pathids[0], 0))
- nodeiter = model.do_get_iter(path)[1]
- node = model.get_node_from_iter(nodeiter)
- handle = model.get_handle(node)
+ iter_ = model.get_iter(path)
+ handle = model.get_handle_from_iter(iter_)
basepers = self.dbstate.db.get_person_from_handle(handle)
if basepers:
preset_name(basepers, name)
diff --git a/gramps/plugins/view/placelistview.py b/gramps/plugins/view/placelistview.py
index ba8c8232c..c14a3f9a0 100644
--- a/gramps/plugins/view/placelistview.py
+++ b/gramps/plugins/view/placelistview.py
@@ -36,7 +36,8 @@ from gramps.gui.views.treemodels.placemodel import PlaceListModel
# Internationalization
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
diff --git a/gramps/plugins/view/placetreeview.py b/gramps/plugins/view/placetreeview.py
index fb84f3769..08a47fbfb 100644
--- a/gramps/plugins/view/placetreeview.py
+++ b/gramps/plugins/view/placetreeview.py
@@ -30,7 +30,7 @@ from __future__ import unicode_literals
# Gramps modules
#
#-------------------------------------------------------------------------
-from gramps.gui.views.listview import LISTTREE
+from gramps.gui.views.listview import TEXT, MARKUP, ICON
from gramps.plugins.lib.libplaceview import PlaceBaseView
from gramps.gui.views.treemodels.placemodel import PlaceTreeModel, COUNTRYLEVELS
from gramps.gen.lib import Place
@@ -42,7 +42,8 @@ from gramps.gui.editors import EditPlace
# Internationalization
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
@@ -65,24 +66,28 @@ class PlaceTreeView(PlaceBaseView):
COL_PARISH = 9
COL_LAT = 10
COL_LON = 11
- COL_CHAN = 12
- COL_NAME = 13
- # name of the columns
- COLUMN_NAMES = [
- _('Place'),
- _('ID'),
- _('Street'),
- _('Locality'),
- _('City'),
- _('County'),
- _('State'),
- _('Country'),
- _('ZIP/Postal Code'),
- _('Church Parish'),
- _('Latitude'),
- _('Longitude'),
- _('Last Changed'),
- _('Place Name'),
+ COL_PRIV = 12
+ COL_TAGS = 13
+ COL_CHAN = 14
+ COL_NAME = 15
+ # column definitions
+ COLUMNS = [
+ (_('Place'), MARKUP, None),
+ (_('ID'), TEXT, None),
+ (_('Street'), TEXT, None),
+ (_('Locality'), TEXT, None),
+ (_('City'), TEXT, None),
+ (_('County'), TEXT, None),
+ (_('State'), TEXT, None),
+ (_('Country'), TEXT, None),
+ (_('ZIP/Postal Code'), TEXT, None),
+ (_('Church Parish'), TEXT, None),
+ (_('Latitude'), TEXT, None),
+ (_('Longitude'), TEXT, None),
+ (_('Private'), ICON, 'gramps-lock'),
+ (_('Tags'), TEXT, None),
+ (_('Last Changed'), TEXT, None),
+ (_('Place Name'), TEXT, None),
]
# default setting with visible columns, order of the col, and their size
CONFIGSETTINGS = (
@@ -90,21 +95,16 @@ class PlaceTreeView(PlaceBaseView):
COL_CITY, COL_COUNTY, COL_STATE]),
('columns.rank', [COL_PLACE, COL_ID, COL_STREET, COL_LOCALITY, COL_CITY,
COL_COUNTY, COL_STATE, COL_COUNTRY, COL_ZIP,
- COL_PARISH, COL_LAT, COL_LON, COL_CHAN, COL_NAME]),
+ COL_PARISH, COL_LAT, COL_LON, COL_PRIV, COL_TAGS,
+ COL_CHAN, COL_NAME]),
('columns.size', [250, 75, 150, 150, 150, 150, 100, 100, 100,
- 100, 150, 150, 100, 150])
+ 100, 150, 150, 40, 100, 100, 150])
)
def __init__(self, pdata, dbstate, uistate):
PlaceBaseView.__init__(self, pdata, dbstate, uistate,
_('Place Tree View'), PlaceTreeModel,
- nav_group=0, markup=PlaceBaseView.MARKUP_COLS)
-
- def type_list(self):
- """
- set the listtype, this governs eg keybinding
- """
- return LISTTREE
+ nav_group=0)
def get_viewtype_stock(self):
"""
@@ -203,34 +203,27 @@ class PlaceTreeView(PlaceBaseView):
level1 = level2 = level3 = ""
if len(pathlist) == 1:
path = pathlist[0]
- suc, node = model.do_get_iter(path)
- if suc:
- noden = model.get_node_from_iter(node)
+ iter_ = model.get_iter(path)
+ if iter_:
if len(path) == 1:
- level[0] = noden.name
+ level[0] = model.get_node_from_iter(iter_).name
elif len(path) == 2:
- level[1] = noden.name
- suc, parent = model.do_iter_parent(node)
- parentn = model.get_node_from_iter(parent)
- level[0] = parentn.name
+ level[1] = model.get_node_from_iter(iter_).name
+ parent = model.iter_parent(iter_)
+ level[0] = model.get_node_from_iter(parent).name
elif len(path) == 3:
- level[2] = noden.name
- suc, parent = model.do_iter_parent(node)
- parentn = model.get_node_from_iter(parent)
- level[1] = parentn.name
- suc, parent = model.do_iter_parent(parent)
- parentn = model.get_node_from_iter(parent)
- level[0] = parentn.name
+ level[2] = model.get_node_from_iter(iter_).name
+ parent = model.iter_parent(iter_)
+ level[1] = model.get_node_from_iter(parent).name
+ parent = model.iter_parent(parent)
+ level[0] = model.get_node_from_iter(parent).name
else:
- suc, parent = model.do_iter_parent(node)
- parentn = model.get_node_from_iter(parent)
- level[2] = parentn.name
- suc, parent = model.do_iter_parent(parent)
- parentn = model.get_node_from_iter(parent)
- level[1] = parentn.name
- suc, parent = model.do_iter_parent(parent)
- parentn = model.get_node_from_iter(parent)
- level[0] = parentn.name
+ parent = model.iter_parent(iter_)
+ level[2] = model.get_node_from_iter(parent).name
+ parent = model.iter_parent(parent)
+ level[1] = model.get_node_from_iter(parent).name
+ parent = model.iter_parent(parent)
+ level[0] = model.get_node_from_iter(parent).name
for ind in [0, 1, 2]:
if level[ind] and level[ind] == COUNTRYLEVELS['default'][ind+1]:
diff --git a/gramps/plugins/view/relview.py b/gramps/plugins/view/relview.py
index c8774465e..4886c6414 100644
--- a/gramps/plugins/view/relview.py
+++ b/gramps/plugins/view/relview.py
@@ -30,8 +30,9 @@ from __future__ import unicode_literals
# Python modules
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import sgettext as _
-from gramps.gen.ggettext import ngettext
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
+ngettext = glocale.get_translation().ngettext
import cgi
#-------------------------------------------------------------------------
@@ -148,7 +149,6 @@ class RelationshipView(NavigationView):
def __init__(self, pdata, dbstate, uistate, nav_group=0):
NavigationView.__init__(self, _('Relationships'),
pdata, dbstate, uistate,
- dbstate.db.get_bookmarks(),
PersonBookmarks,
nav_group)
@@ -454,7 +454,6 @@ class RelationshipView(NavigationView):
list(map(self.vbox.remove, self.vbox.get_children()))
list(map(self.header.remove, self.header.get_children()))
self.child = None
- self.bookmarks.update_bookmarks(db.get_bookmarks())
if self.active:
self.bookmarks.redraw()
self.redraw()
diff --git a/gramps/plugins/view/repoview.py b/gramps/plugins/view/repoview.py
index 85ef9d4dc..cd54616d5 100644
--- a/gramps/plugins/view/repoview.py
+++ b/gramps/plugins/view/repoview.py
@@ -37,7 +37,7 @@ from gi.repository import Gtk
#
#-------------------------------------------------------------------------
from gramps.gen.lib import Repository
-from gramps.gui.views.listview import ListView
+from gramps.gui.views.listview import ListView, TEXT, MARKUP, ICON
from gramps.gui.views.treemodels import RepositoryModel
from gramps.gui.views.bookmarks import RepoBookmarks
from gramps.gen.errors import WindowActiveError
@@ -54,7 +54,8 @@ from gramps.gen.plug import CATEGORY_QR_REPOSITORY
# internationalization
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
@@ -77,22 +78,27 @@ class RepositoryView(ListView):
COL_ZIP = 9
COL_EMAIL = 10
COL_SURL = 11
- COL_CHAN = 12
+ COL_PRIV = 12
+ COL_TAGS = 13
+ COL_CHAN = 14
- COLUMN_NAMES = [
- _('Name'),
- _('ID'),
- _('Type'),
- _('Home URL'),
- _('Street'),
- _('Locality'),
- _('City'),
- _('State/County'),
- _('Country'),
- _('ZIP/Postal Code'),
- _('Email'),
- _('Search URL'),
- _('Last Changed'),
+ # column definitions
+ COLUMNS = [
+ (_('Name'), TEXT, None),
+ (_('ID'), TEXT, None),
+ (_('Type'), TEXT, None),
+ (_('Home URL'), TEXT, None),
+ (_('Street'), TEXT, None),
+ (_('Locality'), TEXT, None),
+ (_('City'), TEXT, None),
+ (_('State/County'), TEXT, None),
+ (_('Country'), TEXT, None),
+ (_('ZIP/Postal Code'), TEXT, None),
+ (_('Email'), TEXT, None),
+ (_('Search URL'), TEXT, None),
+ (_('Private'), ICON, 'gramps-lock'),
+ (_('Tags'), TEXT, None),
+ (_('Last Changed'), TEXT, None),
]
# default setting with visible columns, order of the col, and their size
CONFIGSETTINGS = (
@@ -100,9 +106,10 @@ class RepositoryView(ListView):
]),
('columns.rank', [COL_NAME, COL_ID, COL_TYPE, COL_URL, COL_STREET,
COL_LOCALITY, COL_CITY, COL_STATE, COL_COUNTRY,
- COL_ZIP, COL_EMAIL, COL_SURL, COL_CHAN]),
+ COL_ZIP, COL_EMAIL, COL_SURL, COL_PRIV, COL_TAGS,
+ COL_CHAN]),
('columns.size', [200, 75, 100, 250, 100, 100, 100, 100, 100,
- 100, 100, 100, 100])
+ 100, 100, 100, 40, 100, 100])
)
ADD_MSG = _("Add a new repository")
EDIT_MSG = _("Edit the selected repository")
@@ -122,9 +129,7 @@ class RepositoryView(ListView):
ListView.__init__(
self, _('Repositories'), pdata, dbstate, uistate,
- RepositoryView.COLUMN_NAMES, len(RepositoryView.COLUMN_NAMES),
RepositoryModel, signal_map,
- dbstate.db.get_repo_bookmarks(),
RepoBookmarks, nav_group,
multiple=True,
filter_class=RepoSidebarFilter)
@@ -139,9 +144,6 @@ class RepositoryView(ListView):
def navigation_type(self):
return 'Repository'
- def get_bookmarks(self):
- return self.dbstate.db.get_repo_bookmarks()
-
def drag_info(self):
return DdTargets.REPO_LINK
@@ -258,6 +260,26 @@ class RepositoryView(ListView):
else:
return None
+ def tag_updated(self, handle_list):
+ """
+ Update tagged rows when a tag color changes.
+ """
+ all_links = set([])
+ for tag_handle in handle_list:
+ links = set([link[1] for link in
+ self.dbstate.db.find_backlink_handles(tag_handle,
+ include_classes='Repository')])
+ all_links = all_links.union(links)
+ self.row_update(list(all_links))
+
+ def add_tag(self, transaction, repo_handle, tag_handle):
+ """
+ Add the given tag to the given repository.
+ """
+ repo = self.dbstate.db.get_repository_from_handle(repo_handle)
+ repo.add_tag(tag_handle)
+ self.dbstate.db.commit_repository(repo, transaction)
+
def get_default_gramplets(self):
"""
Define the default gramplets for the sidebar and bottombar.
diff --git a/gramps/plugins/view/sourceview.py b/gramps/plugins/view/sourceview.py
index 21cadd6a5..9ec64e09c 100644
--- a/gramps/plugins/view/sourceview.py
+++ b/gramps/plugins/view/sourceview.py
@@ -41,7 +41,7 @@ LOG = logging.getLogger(".citation")
#-------------------------------------------------------------------------
from gramps.gen.lib import Source
from gramps.gen.config import config
-from gramps.gui.views.listview import ListView
+from gramps.gui.views.listview import ListView, TEXT, MARKUP, ICON
from gramps.gui.views.treemodels import SourceModel
from gramps.gen.utils.db import get_source_and_citation_referents
from gramps.gui.views.bookmarks import SourceBookmarks
@@ -58,7 +58,8 @@ from gramps.gen.plug import CATEGORY_QR_SOURCE
# internationalization
#
#-------------------------------------------------------------------------
-from gramps.gen.ggettext import gettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
@@ -74,22 +75,27 @@ class SourceView(ListView):
COL_AUTH = 2
COL_ABBR = 3
COL_PINFO = 4
- COL_CHAN = 5
- # name of the columns
- COLUMN_NAMES = [
- _('Title'),
- _('ID'),
- _('Author'),
- _('Abbreviation'),
- _('Publication Information'),
- _('Last Changed'),
+ COL_PRIV = 5
+ COL_TAGS = 6
+ COL_CHAN = 7
+
+ # column definitions
+ COLUMNS = [
+ (_('Title'), TEXT, None),
+ (_('ID'), TEXT, None),
+ (_('Author'), TEXT, None),
+ (_('Abbreviation'), TEXT, None),
+ (_('Publication Information'), TEXT, None),
+ (_('Private'), ICON, 'gramps-lock'),
+ (_('Tags'), TEXT, None),
+ (_('Last Changed'), TEXT, None),
]
# default setting with visible columns, order of the col, and their size
CONFIGSETTINGS = (
('columns.visible', [COL_TITLE, COL_ID, COL_AUTH, COL_PINFO]),
('columns.rank', [COL_TITLE, COL_ID, COL_AUTH, COL_ABBR, COL_PINFO,
- COL_CHAN]),
- ('columns.size', [200, 75, 150, 100, 150, 100])
+ COL_PRIV, COL_TAGS, COL_CHAN]),
+ ('columns.size', [200, 75, 150, 100, 150, 40, 100, 100])
)
ADD_MSG = _("Add a new source")
EDIT_MSG = _("Edit the selected source")
@@ -109,9 +115,7 @@ class SourceView(ListView):
ListView.__init__(
self, _('Sources'), pdata, dbstate, uistate,
- SourceView.COLUMN_NAMES, len(SourceView.COLUMN_NAMES),
SourceModel, signal_map,
- dbstate.db.get_source_bookmarks(),
SourceBookmarks, nav_group,
multiple=True,
filter_class=SourceSidebarFilter)
@@ -126,9 +130,6 @@ class SourceView(ListView):
def navigation_type(self):
return 'Source'
- def get_bookmarks(self):
- return self.dbstate.db.get_source_bookmarks()
-
def drag_info(self):
return DdTargets.SOURCE_LINK
@@ -242,6 +243,26 @@ class SourceView(ListView):
else:
return None
+ def tag_updated(self, handle_list):
+ """
+ Update tagged rows when a tag color changes.
+ """
+ all_links = set([])
+ for tag_handle in handle_list:
+ links = set([link[1] for link in
+ self.dbstate.db.find_backlink_handles(tag_handle,
+ include_classes='Source')])
+ all_links = all_links.union(links)
+ self.row_update(list(all_links))
+
+ def add_tag(self, transaction, source_handle, tag_handle):
+ """
+ Add the given tag to the given source.
+ """
+ source = self.dbstate.db.get_source_from_handle(source_handle)
+ source.add_tag(tag_handle)
+ self.dbstate.db.commit_source(source, transaction)
+
def get_default_gramplets(self):
"""
Define the default gramplets for the sidebar and bottombar.
diff --git a/gramps/plugins/view/view.gpr.py b/gramps/plugins/view/view.gpr.py
index be0e31f0a..3a3c160b2 100644
--- a/gramps/plugins/view/view.gpr.py
+++ b/gramps/plugins/view/view.gpr.py
@@ -35,7 +35,7 @@ id = 'eventview',
name = _("Events"),
description = _("The view showing all the events"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'eventview.py',
authors = ["The Gramps project"],
@@ -50,7 +50,7 @@ id = 'familyview',
name = _("Families"),
description = _("The view showing all families"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'familyview.py',
authors = ["The Gramps project"],
@@ -61,17 +61,17 @@ order = START,
)
register(VIEW,
-id = 'grampletview',
-name = _("Gramplets"),
+id = 'dashboardview',
+name = _("Dashboard"),
description = _("The view showing Gramplets"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
-fname = 'grampletview.py',
+fname = 'dashboardview.py',
authors = ["The Gramps project"],
authors_email = ["http://gramps-project.org"],
-category = ("Gramplets", _("Gramplets")),
-viewclass = 'GrampletView',
+category = ("Dashboard", _("Dashboard")),
+viewclass = 'DashboardView',
order = START,
)
@@ -80,7 +80,7 @@ id = 'mediaview',
name = _("Media"),
description = _("The view showing all the media objects"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'mediaview.py',
authors = ["The Gramps project"],
@@ -95,7 +95,7 @@ id = 'noteview',
name = _("Notes"),
description = _("The view showing all the notes"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'noteview.py',
authors = ["The Gramps project"],
@@ -110,7 +110,7 @@ id = 'relview',
name = _("Relationships"),
description = _("The view showing all relationships of the selected person"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'relview.py',
authors = ["The Gramps project"],
@@ -125,7 +125,7 @@ id = 'pedigreeview',
name = _("Pedigree"),
description = _("The view showing an ancestor pedigree of the selected person"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'pedigreeview.py',
authors = ["The Gramps project"],
@@ -142,7 +142,7 @@ name = _("Fan Chart"),
category = ("Ancestry", _("Charts")),
description = _("A view showing parents through a fanchart"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'fanchartview.py',
authors = ["Douglas S. Blank", "B. Malengier"],
@@ -157,7 +157,7 @@ name = _("Descendant Fan"),
category = ("Ancestry", _("Charts")),
description = _("Showing descendants through a fanchart"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'fanchartdescview.py',
authors = ["B. Malengier"],
@@ -172,7 +172,7 @@ name = _("Grouped People"),
description = _("The view showing all people in the family tree grouped per"
" family name"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'persontreeview.py',
authors = ["The Gramps project"],
@@ -189,7 +189,7 @@ name = _("People"),
description = _("The view showing all people in the family tree"
" in a flat list"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'personlistview.py',
authors = ["The Gramps project"],
@@ -205,7 +205,7 @@ id = 'placelistview',
name = _("Places"),
description = _("The view showing all the places of the family tree"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'placelistview.py',
authors = ["The Gramps project"],
@@ -221,7 +221,7 @@ stock_icon = 'gramps-tree-list',
#name = _("Place Tree"),
#description = _("A view displaying places in a tree format."),
#version = '1.0',
-#gramps_target_version = '4.0',
+#gramps_target_version = '4.1',
#status = STABLE,
#fname = 'placetreeview.py',
#authors = ["Donald N. Allingham", "Gary Burton", "Nick Hall"],
@@ -236,7 +236,7 @@ id = 'repoview',
name = _("Repositories"),
description = _("The view showing all the repositories"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'repoview.py',
authors = ["The Gramps project"],
@@ -251,7 +251,7 @@ id = 'sourceview',
name = _("Sources"),
description = _("The view showing all the sources"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'sourceview.py',
authors = ["The Gramps project"],
@@ -267,7 +267,7 @@ id = 'citationlistview',
name = _("Citations"),
description = _("The view showing all the citations"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'citationlistview.py',
authors = ["The Gramps project"],
@@ -282,7 +282,7 @@ id = 'citationtreeview',
name = _("Citation Tree"),
description = _("A view displaying citations and sources in a tree format."),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'citationtreeview.py',
authors = ["Tim G L Lyons", "Nick Hall"],
@@ -297,7 +297,7 @@ id = 'locationview',
name = _("Location View"),
description = _("The view showing all locations"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
status = STABLE,
fname = 'locationview.py',
authors = [u"The Gramps project"],
diff --git a/gramps/plugins/webreport/narrativeweb.py b/gramps/plugins/webreport/narrativeweb.py
index 2367e439d..00e749f8b 100644
--- a/gramps/plugins/webreport/narrativeweb.py
+++ b/gramps/plugins/webreport/narrativeweb.py
@@ -9,7 +9,7 @@
# Copyright (C) 2007-2009 Stephane Charette
# Copyright (C) 2008-2009 Brian G. Matherly
# Copyright (C) 2008 Jason M. Simanek
-# Copyright (C) 2008-2011 Rob G. Healey
+# Copyright (C) 2008-2011 Rob G. Healey
# Copyright (C) 2010 Doug Blank
# Copyright (C) 2010 Jakim Friant
# Copyright (C) 2010 Serge Noiraud
@@ -34,12 +34,39 @@
"""
Narrative Web Page generator.
+
+Classes:
+ NavWebReport - main class that produces the report. Entry point to produce
+ the report is write_report
+ NavWebptions - class that defines the options and provides the handling
+ interface
+
+ BasePage - super class for producing a web page. This class is instantiated
+ once for each page. Provdes various common functions.
+
+Classes for producing the web pages:
+ SurnamePage - creates list of individuals with same surname
+ FamilyPage - Family index page and individual Family pages
+ PlacePage - Place index page and individual Place pages
+ EventPage - Event index page and individual Event pages
+ SurnameListPage - Index for first letters of surname
+ IntroductionPage
+ HomePage
+ CitationPages - dummy
+ SourcePage - Source index page and individual Source pages
+ MediaPage - Media index page and individual Media pages
+ ThimbnailPreviewPage
+ DownloadPage
+ ContactPage
+ PersonPage - Person index page and individual `Person pages
+ RepositoryPage - Repository index page and individual Repository pages
+ AddressBookListPage
+ AddressBookPage
"""
#------------------------------------------------
# python modules
#------------------------------------------------
from __future__ import print_function, division
-
from functools import partial
import gc
import os
@@ -51,7 +78,6 @@ try:
except ImportError:
from md5 import md5
import time, datetime
-import locale
import shutil
import codecs
import tarfile
@@ -59,7 +85,7 @@ import tempfile
if sys.version_info[0] < 3:
from cStringIO import StringIO
else:
- from io import StringIO
+ from io import StringIO, BytesIO, TextIOWrapper
from textwrap import TextWrapper
from unicodedata import normalize
from collections import defaultdict
@@ -78,12 +104,14 @@ log = logging.getLogger(".NarrativeWeb")
#------------------------------------------------
# GRAMPS module
#------------------------------------------------
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
from gramps.gen.lib import (ChildRefType, Date, EventType, FamilyRelType, Name,
NameType, Person, UrlType, NoteType,
- EventRoleType)
+ EventRoleType, Family, Event, Place, Source,
+ Citation, MediaObject, Repository, Note, Tag)
from gramps.gen.lib.date import Today
-from gramps.gen.const import PROGRAM_NAME, URL_HOMEPAGE, USER_HOME, VERSION
+from gramps.gen.const import PROGRAM_NAME, URL_HOMEPAGE, VERSION
from gramps.gen.sort import Sort
from gramps.gen.plug.menu import PersonOption, NumberOption, StringOption, \
BooleanOption, EnumeratedListOption, FilterOption, \
@@ -91,13 +119,14 @@ from gramps.gen.plug.menu import PersonOption, NumberOption, StringOption, \
from gramps.gen.plug.report import ( Report, Bibliography)
from gramps.gen.plug.report import utils as ReportUtils
from gramps.gen.plug.report import MenuReportOptions
-
+
from gramps.gen.utils.config import get_researcher
from gramps.gen.utils.string import confidence
from gramps.gen.utils.file import media_path_full
+from gramps.gen.utils.alive import probably_alive
from gramps.gen.utils.db import get_source_and_citation_referents
-from gramps.gen.utils.cast import conv_unicode_tosrtkey, conv_tosrtkey
-from gramps.gen.constfunc import win, cuni, conv_to_unicode
+from gramps.gen.constfunc import win, cuni, conv_to_unicode, UNITYPE
+from gramps.gen.config import config
from gramps.gui.thumbnails import get_thumbnail_path, run_thumbnailer
from gramps.gen.utils.image import image_size, resize_to_jpeg_buffer
from gramps.gen.mime import get_description
@@ -113,11 +142,22 @@ from gramps.plugins.lib.libhtml import Html, xml_lang
from gramps.plugins.lib.libhtmlbackend import HtmlBackend, process_spaces
from gramps.plugins.lib.libgedcom import make_gedcom_date
-from gramps.gen.utils.alive import probably_alive
from gramps.gen.utils.place import conv_lat_lon
from gramps.gui.pluginmanager import GuiPluginManager
from gramps.gen.relationship import get_relationship_calculator
+
+# FIXME: This could be glocale.get_translation().language(), except that at the
+# moment, (1) that gives an empty string when LANG is set to something like
+# "sk_SK.UTF-8", and (2) it should be a language specific to collation, not just
+# the language for translation.
+import locale
+COLLATE_LANG = locale.getlocale()[0]
+SORT_KEY = glocale.sort_key
+#------------------------------------------------
+# Everything below this point is identical for gramps34 (post 3.4.2), gramps40 and trunk
+#------------------------------------------------
+
#------------------------------------------------
# constants
#------------------------------------------------
@@ -304,8 +344,8 @@ osm_markers = """
var wms = new OpenLayers.Layer.WMS(
"OpenLayers WMS",
- "http://maps.opengeo.org/geowebcache/service/wms",
- {'layers':"openstreetmap", 'format': "image/png"});
+ "http://vmap0.tiles.osgeo.org/wms/vmap0",
+ {'layers':'basic'});
map.addLayer(wms);
map.setCenter(new OpenLayers.LonLat(%s, %s), %d);
@@ -361,6 +401,7 @@ TEMPLE = _("Temple")
VHEAD = _("Value")
ALT_LOCATIONS = _("Alternate Locations")
_UNKNOWN = _("Unknown")
+_ABSENT = _("")
# Events that are usually a family event
_EVENTMAP = set(
@@ -446,7 +487,7 @@ strip_dict = dict.fromkeys(list(range(9))+list(range(11,13))+list(range(14, 32))
def name_to_md5(text):
"""This creates an MD5 hex string to be used as filename."""
- return md5(text).hexdigest()
+ return md5(text.encode('utf-8')).hexdigest()
def conf_priv(obj):
if obj.get_privacy() != 0:
@@ -538,7 +579,6 @@ class BasePage(object):
self.report = report
self.title_str = title
self.gid = gid
- self.src_list = {}
self.page_title = ""
@@ -615,16 +655,14 @@ class BasePage(object):
Html("li", hyper, inline = True)
)
- def display_relationships(self, individual, ppl_handle_list, place_lat_long):
+ def display_relationships(self, individual, place_lat_long):
"""
Displays a person's relationships ...
@param: family_handle_list -- families in this report database
- @param: ppl_handle_list -- people in this report database
- @param: place_lat_long -- for use in Family Map Pages
+ @param: place_lat_long -- for use in Family Map Pages. This will be None
+ if called from Family pages, which do not create a Family Map
"""
- birthorder = self.report.options["birthorder"]
-
family_list = individual.get_family_handle_list()
if not family_list:
return None
@@ -641,69 +679,145 @@ class BasePage(object):
for family_handle in family_list:
family = self.dbase_.get_family_from_handle(family_handle)
if family:
- self.display_spouse(family, table, ppl_handle_list, place_lat_long)
+ link = self.family_link(
+ family_handle,
+ self.report.obj_dict[Family][family_handle][1],
+ gid=family.get_gramps_id(), uplink=True)
+ trow = Html("tr", class_ ="BeginFamily") + (
+ Html("td", " ", class_ ="ColumnType", inline =True),
+ Html("td", " ", class_ ="ColumnAttribute", inline =True),
+ Html("td", link, class_ ="ColumnValue", inline =True)
+ )
+ table += trow
+ # find the spouse of the principal individual and
+ # display that person
+ spouse_handle = ReportUtils.find_spouse(individual, family)
+ if spouse_handle:
+ spouse = self.dbase_.get_person_from_handle(spouse_handle)
+ if spouse:
+ table += self.display_spouse(spouse, family,
+ place_lat_long)
- childlist = family.get_child_ref_list()
- if childlist:
- trow = Html("tr") + (
- Html("td", " ", class_ = "ColumnType", inline = True),
- Html("td", _("Children"), class_ = "ColumnAttribute", inline = True)
- )
- table += trow
-
- tcell = Html("td", class_ = "ColumnValue")
- trow += tcell
-
- ordered = Html("ol")
- tcell += ordered
- childlist = [child_ref.ref for child_ref in childlist]
-
- # add individual's children event places to family map...
- if self.familymappages:
- for handle in childlist:
- child = self.dbase_.get_person_from_handle(handle)
- if child:
- self._get_event_place(child, ppl_handle_list, place_lat_long)
-
- children = add_birthdate(self.dbase_, childlist)
- if birthorder:
- children = sorted(children)
-
- ordered.extend(
- (Html("li") +
- self.display_child_link(chandle, ppl_handle_list))
- for birth_date, chandle in children
- )
-
- # family LDS ordinance list
- family_lds_ordinance_list = family.get_lds_ord_list()
- if family_lds_ordinance_list:
- trow = Html("tr") + (
- Html("td", " ", class_ = "ColumnType", inline = True),
- Html("td", _("LDS Ordinance"), class_ = "ColumnAttribute", inline = True),
- Html("td", self.dump_ordinance(family, "Family"), class_ = "ColumnValue")
- )
- table += trow
-
- # Family Attribute list
- family_attribute_list = family.get_attribute_list()
- if family_attribute_list:
- trow = Html("tr") + (
- Html("td", " ", class_ ="ColumnType", inline =True),
- Html("td", _("Attributes"), class_ ="ColumnAttribute", inline =True)
- )
- table += trow
-
- tcell = Html("td", class_ = "ColumnValue")
- trow += tcell
-
- # we do not need the section variable for this instance of Attributes...
- dummy, attrtable = self.display_attribute_header()
- tcell += attrtable
- self.display_attr_list(family_attribute_list, attrtable)
+ details = self.display_family_details(family, place_lat_long)
+ if details is not None:
+ table += details
return section
- def complete_people(self, tcell, first_person, handle_list, ppl_handle_list, up =True):
+ def display_family_relationships(self, family, place_lat_long):
+ """
+ Displays a family's relationships ...
+
+ @param: family -- the family to be displayed
+ @param: place_lat_long -- for use in Family Map Pages. This will be None
+ if called from Family pages, which do not create a Family Map
+ """
+ with Html("div", class_ ="subsection", id ="families") as section:
+ section += Html("h4", _("Families"), inline =True)
+
+ table_class = "infolist"
+ with Html("table", class_ = table_class) as table:
+ section += table
+ for person_handle in [family.get_father_handle(), family.get_mother_handle()]:
+ person = self.dbase_.get_person_from_handle(person_handle)
+ if person:
+ table += self.display_spouse(person, family, place_lat_long)
+
+ details = self.display_family_details(family, place_lat_long)
+ if details is not None:
+ table += details
+ return section
+
+ def display_family_details(self, family, place_lat_long):
+ """
+ Display details about one family: family events, children, family LDS
+ ordinances, family attributes
+ """
+ table = None
+ birthorder = self.report.options["birthorder"]
+ # display family events; such as marriage and divorce...
+ family_events = family.get_event_ref_list()
+ if family_events:
+ trow = Html("tr") + (
+ Html("td", " ", class_ = "ColumnType", inline = True),
+ Html("td", " ", class_ = "ColumnAttribute", inline = True),
+ Html("td", self.format_family_events(family_events, place_lat_long), class_ = "ColumnValue")
+ )
+ table = trow
+
+ # If the families pages are not output, display family notes
+ if not self.inc_families:
+ notelist = family.get_note_list()
+ for notehandle in notelist:
+ note = self.dbase_.get_note_from_handle(notehandle)
+ if note:
+ trow = Html("tr") + (
+ Html("td", " ", class_ = "ColumnType", inline = True),
+ Html("td", "Narrative", class_ = "ColumnAttribute", inline = True),
+ Html("td", self.get_note_format(note, True), class_ = "ColumnValue")
+ )
+ table = table + trow if table is not None else trow
+
+ childlist = family.get_child_ref_list()
+ if childlist:
+ trow = Html("tr") + (
+ Html("td", " ", class_ = "ColumnType", inline = True),
+ Html("td", _("Children"), class_ = "ColumnAttribute", inline = True)
+ )
+ table = table + trow if table is not None else trow
+
+ tcell = Html("td", class_ = "ColumnValue")
+ trow += tcell
+
+ ordered = Html("ol")
+ tcell += ordered
+ childlist = [child_ref.ref for child_ref in childlist]
+
+ # add individual's children event places to family map...
+ if self.familymappages:
+ for handle in childlist:
+ child = self.dbase_.get_person_from_handle(handle)
+ if child:
+ self._get_event_place(child, place_lat_long)
+
+ children = add_birthdate(self.dbase_, childlist)
+ if birthorder:
+ children = sorted(children)
+
+ ordered.extend(
+ (Html("li") +
+ self.display_child_link(chandle))
+ for birth_date, chandle in children
+ )
+
+ # family LDS ordinance list
+ family_lds_ordinance_list = family.get_lds_ord_list()
+ if family_lds_ordinance_list:
+ trow = Html("tr") + (
+ Html("td", " ", class_ = "ColumnType", inline = True),
+ Html("td", _("LDS Ordinance"), class_ = "ColumnAttribute", inline = True),
+ Html("td", self.dump_ordinance(family, "Family"), class_ = "ColumnValue")
+ )
+ table = table + trow if table is not None else trow
+
+ # Family Attribute list
+ family_attribute_list = family.get_attribute_list()
+ if family_attribute_list:
+ trow = Html("tr") + (
+ Html("td", " ", class_ ="ColumnType", inline =True),
+ Html("td", _("Attributes"), class_ ="ColumnAttribute", inline =True)
+ )
+ table = table + trow if table is not None else trow
+
+ tcell = Html("td", class_ = "ColumnValue")
+ trow += tcell
+
+ # we do not need the section variable for this instance of Attributes...
+ dummy, attrtable = self.display_attribute_header()
+ tcell += attrtable
+ self.display_attr_list(family_attribute_list, attrtable)
+ return table
+
+ def complete_people(self, tcell, first_person, handle_list, up =True):
"""
completes the person column for classes EventListPage and EventPage
@@ -715,16 +829,8 @@ class BasePage(object):
# personal event
if classname == "Person":
- _obj = self.dbase_.get_person_from_handle(handle)
- if _obj:
- use_link = check_person_database(handle, ppl_handle_list)
- if use_link:
- url = self.report.build_url_fname_html(handle, "ppl", up)
- tcell += Html("span", self.person_link(url, _obj,
- _NAME_STYLE_DEFAULT, gid=_obj.get_gramps_id()), class_ ="person", inline =True)
- else:
- tcell += Html("span", self.get_name(_obj), class_="person",
- inline=True)
+ tcell += Html("span", self.new_person_link(handle, up),
+ class_="person", inline=True)
# family event
else:
@@ -732,35 +838,19 @@ class BasePage(object):
if _obj:
# husband and spouse in this example, are called father and mother
- husband, spouse = [False]*2
husband_handle = _obj.get_father_handle()
if husband_handle:
- husband = self.dbase_.get_person_from_handle(husband_handle)
+ hlink = self.new_person_link(husband_handle, up)
spouse_handle = _obj.get_mother_handle()
if spouse_handle:
- spouse = self.dbase_.get_person_from_handle(spouse_handle)
- if husband:
- use_link = check_person_database(husband_handle, ppl_handle_list)
- if use_link:
- url = self.report.build_url_fname_html(husband_handle, "ppl", up)
- hlink = self.person_link(url, husband, _NAME_STYLE_DEFAULT, gid = husband.get_gramps_id())
- else:
- hlink = self.get_name(husband)
+ slink = self.new_person_link(spouse_handle, up)
- if spouse:
- use_link = check_person_database(spouse_handle, ppl_handle_list)
- if use_link:
- url = self.report.build_url_fname_html(spouse_handle, "ppl", up)
- slink = self.person_link(url, spouse, _NAME_STYLE_DEFAULT, gid = spouse.get_gramps_id())
- else:
- slink = self.get_name(spouse)
-
- if spouse and husband:
+ if spouse_handle and husband_handle:
tcell += Html("span", hlink, class_ = "father", inline =True)
tcell += Html("span", slink, class_ = "mother", inline =True)
- elif spouse:
+ elif spouse_handle:
tcell += Html("span", slink, class_ = "mother", inline =True)
- elif husband:
+ elif husband_handle:
tcell += Html("span", hlink, class_ = "father", inline =True)
return tcell
@@ -790,26 +880,12 @@ class BasePage(object):
@param: citation_handle_list = list of gen/lib/Citation
"""
- lnk = (self.report.cur_fname, self.page_title, self.gid)
text = ""
for citation_handle in citation_handle_list:
citation = self.report.database.get_citation_from_handle(citation_handle)
if citation:
-
- # Add the source information to src_list for use when displaying the
- # Sources page
- source_handle = citation.get_reference_handle()
- if source_handle in self.src_list:
- if lnk not in self.src_list[source_handle]:
- self.src_list[source_handle].append(lnk)
- else:
- self.src_list[source_handle] = [lnk]
-
- # Add the citation information to the bibliography, and construct
- # the citation reference text
index, key = self.bibli.add_reference(citation)
id_ = "%d%s" % (index+1,key)
-
text += ' %s ' % (id_, id_)
return text
@@ -920,23 +996,16 @@ class BasePage(object):
@param: evt = Event object from report database
@param: evt_ref = event reference
- @param: place_lat_long -- for use in Family Map Pages
+ @param: place_lat_long -- for use in Family Map Pages. This will be None
+ if called from Family pages, which do not create a Family Map
@param: up = add [".."] * 3 for subdirectories or not
@param: hyperlink = add a hyperlink or not
@params: omit = role to be omitted in output
"""
event_gid = event.get_gramps_id()
- # check to see if place is already in self.place_list?
- lnk = (self.report.cur_fname, self.page_title, self.gid)
place_handle = event.get_place_handle()
if place_handle:
- if place_handle in self.place_list:
- if lnk not in self.place_list[place_handle]:
- self.place_list[place_handle].append(lnk)
- else:
- self.place_list[place_handle] = [lnk]
-
place = self.dbase_.get_place_from_handle(place_handle)
if place:
self.append_to_place_lat_long(place, event, place_lat_long)
@@ -995,7 +1064,12 @@ class BasePage(object):
def append_to_place_lat_long(self, place, event, place_lat_long):
"""
Create a list of places with coordinates.
+
+ @param: place_lat_long -- for use in Family Map Pages. This will be None
+ if called from Family pages, which do not create a Family Map
"""
+ if place_lat_long is None:
+ return
place_handle = place.get_handle()
# 0 = latitude, 1 = longitude, 2 - placetitle,
@@ -1016,17 +1090,19 @@ class BasePage(object):
EventType.MARRIAGE, EventType.DIVORCE]:
place_lat_long.append([latitude, longitude, placetitle, place_handle, event_date, etype])
- def _get_event_place(self, person, ppl_handle_list, place_lat_long):
+ def _get_event_place(self, person, place_lat_long):
"""
retrieve from a a person their events, and places for family map
@param: person - person object from the database
+ @param: place_lat_long -- for use in Family Map Pages. This will be None
+ if called from Family pages, which do not create a Family Map
"""
if not person:
return
# check to see if this person is in the report database?
- use_link = check_person_database(person.get_handle(), ppl_handle_list)
+ use_link = self.report.person_in_webreport(person.get_handle())
if use_link:
evt_ref_list = person.get_event_ref_list()
if evt_ref_list:
@@ -1045,12 +1121,19 @@ class BasePage(object):
create the url and link for FamilyPage
"""
name = html_escape(name)
- url = self.report.build_url_fname_html(family_handle, "fam", up = uplink)
-
- hyper = Html("a", name, href = url, title = name)
-
if not self.noid and gid:
- hyper += Html("span", " [%s]" % gid, class_ = "grampsid", inline = True)
+ gid_html = Html("span", " [%s]" % gid, class_ = "grampsid", inline = True)
+ else:
+ gid_html = ""
+
+ result = self.report.obj_dict.get(Family).get(family_handle)
+ if result is None:
+ # the family is not included in the webreport
+ return name + str(gid_html)
+
+ url = self.report.build_url_fname(result[0], up = uplink)
+ hyper = Html("a", name, href = url, title = name)
+ hyper += gid_html
return hyper
def get_family_string(self, family):
@@ -1100,6 +1183,8 @@ class BasePage(object):
displays the event row for events such as marriage and divorce
@param: eventlist - list of events
+ @param: place_lat_long -- for use in Family Map Pages. This will be None
+ if called from Family pages, which do not create a Family Map
"""
with Html("table", class_ = "infolist eventlist") as table:
thead = Html("thead")
@@ -1239,7 +1324,7 @@ class BasePage(object):
tbody = Html("tbody")
table += tbody
- for key in list(data_map.keys()):
+ for key in data_map.keys():
trow = Html("tr") + (
Html("td", self.fix(key), class_ = "ColumnAttribute", inline = True),
Html("td", self.fix(data_map[key]), class_ = "ColumnValue", inline = True)
@@ -1532,7 +1617,7 @@ class BasePage(object):
# optional "link-home" feature; see bug report #2736
if self.report.options['linkhome']:
center_person = self.report.database.get_person_from_gramps_id(self.report.options['pid'])
- if center_person and center_person.handle in self.report.person_handles:
+ if center_person and self.report.person_in_webreport(center_person.handle):
center_person_url = self.report.build_url_fname_html(
center_person.handle, "ppl", self.up)
@@ -1859,7 +1944,6 @@ class BasePage(object):
obj = self.report.database.get_object_from_gramps_id(pic_id)
if obj is None:
return None
- obj_handle = obj.handle
mime_type = obj.get_mime_type()
if mime_type and mime_type.startswith("image"):
try:
@@ -1913,7 +1997,7 @@ class BasePage(object):
_linkurl = "#"
if classname == "Person":
# Is this a person for whom we have built a page:
- if newhandle in self.report.person_handles:
+ if self.report.person_in_webreport(newhandle):
# If so, let's add a link to them:
_obj = self.dbase_.get_person_from_handle( newhandle )
if _obj:
@@ -2021,10 +2105,6 @@ class BasePage(object):
if mime_type:
- # add link reference to media
- lnkref = (self.report.cur_fname, self.page_title, self.gid)
- self.report.add_lnkref_to_photo(photo, lnkref)
-
region = self.media_ref_region_to_object(photo_handle, object)
if region:
@@ -2039,6 +2119,14 @@ class BasePage(object):
real_path, newpath = self.report.prepare_copy_media(photo)
newpath = self.report.build_url_fname(newpath, up = True)
+ # FIXME: There doesn't seem to be any point in highlighting
+ # a sub-region in the thumbnail and linking back to the
+ # person or whatever. First it is confusing when the link
+ # probably has nothing to do with the page on which the
+ # thumbnail is displayed, and second on a thumbnail it is
+ # probably too small to see, and third, on the thumbnail,
+ # the link is shown above the image (which is pretty
+ # useless!)
_region_items = self.media_ref_rect_regions(photo_handle)
if len(_region_items):
with Html("div", id = "GalleryDisplay") as mediadisplay:
@@ -2068,15 +2156,6 @@ class BasePage(object):
# begin hyperlink
snapshot += self.doc_link(photo_handle, descr, uplink = self.up, usedescr = False)
- lnk = (self.report.cur_fname, self.page_title, self.gid)
- # FIXME. Is it OK to add to the photo_list of report?
- photo_list = self.report.photo_list
- if photo_handle in photo_list:
- if lnk not in photo_list[photo_handle]:
- photo_list[photo_handle].append(lnk)
- else:
- photo_list[photo_handle] = [lnk]
-
# return snapshot division to its callers
return snapshot
@@ -2120,34 +2199,17 @@ class BasePage(object):
if mime_type:
try:
-
- lnkref = (self.report.cur_fname, self.page_title, self.gid)
- self.report.add_lnkref_to_photo(photo, lnkref)
- real_path, newpath = self.report.prepare_copy_media(photo)
-
# create thumbnail url
# extension needs to be added as it is not already there
url = self.report.build_url_fname(photo_handle, "thumb", True) + ".png"
-
# begin hyperlink
section += self.media_link(photo_handle, url, descr, uplink = self.up, usedescr = True)
-
except (IOError, OSError) as msg:
self.report.user.warn(_("Could not add photo to page"), str(msg))
else:
try:
-
# begin hyperlink
section += self.doc_link(photo_handle, descr, uplink = self.up)
-
- lnk = (self.report.cur_fname, self.page_title, self.gid)
- # FIXME. Is it OK to add to the photo_list of report?
- photo_list = self.report.photo_list
- if photo_handle in photo_list:
- if lnk not in photo_list[photo_handle]:
- photo_list[photo_handle].append(lnk)
- else:
- photo_list[photo_handle] = [lnk]
except (IOError, OSError) as msg:
self.report.user.warn(_("Could not add photo to page"), str(msg))
displayed.append(photo_handle)
@@ -2293,19 +2355,8 @@ class BasePage(object):
citationlist = bibli.get_citation_list()
for citation in citationlist:
cindex += 1
-
- # Add this source to the global list of sources to be displayed
- # on each source page.
- lnk = (self.report.cur_fname, self.page_title, self.gid)
- shandle = citation.get_source_handle()
- if shandle in self.src_list:
- if lnk not in self.src_list[shandle]:
- self.src_list[shandle].append(lnk)
- else:
- self.src_list[shandle] = [lnk]
-
# Add this source and its references to the page
- source = self.dbase_.get_source_from_handle(shandle)
+ source = self.dbase_.get_source_from_handle(citation.get_source_handle())
if source is not None:
list = Html("li", self.source_link(source.get_handle(), source.get_title(),
source.get_gramps_id(), cindex, uplink = self.up))
@@ -2326,6 +2377,24 @@ class BasePage(object):
[_("Confidence"), conf] ]:
if data:
tmp += Html("li", "%s: %s" % (label, data))
+ if self.create_media:
+ for media_ref in sref.get_media_list():
+ media_handle = media_ref.get_reference_handle()
+ media = self.dbase_.get_object_from_handle(media_handle)
+ if media:
+ mime_type = media.get_mime_type()
+ if mime_type:
+ if mime_type.startswith("image/"):
+ real_path, newpath = self.report.prepare_copy_media(media)
+ newpath = self.report.build_url_fname(newpath, up = self.up)
+
+ tmp += Html("li",
+ self.media_link(media_handle, newpath, media.get_description(),
+ self.up, usedescr = False), inline = True)
+
+ else:
+ tmp += Html("li", self.doc_link(media_handle, media.get_description(),
+ self.up, usedescr = False), inline = True)
for handle in sref.get_note_list():
this_note = self.dbase_.get_note_from_handle(handle)
if this_note is not None:
@@ -2355,15 +2424,24 @@ class BasePage(object):
ordered = Html("ol")
section += ordered
- sortlist = sorted(handlelist, key=lambda x:locale.strxfrm(x[1]))
+ sortlist = sorted(handlelist, key=lambda x:SORT_KEY(x[1]))
for (path, name, gid) in sortlist:
list = Html("li")
ordered += list
- # Note. 'path' already has a filename extension
- url = self.report.build_url_fname(path, None, self.up)
- list += self.person_link(url, name or _UNKNOWN, None, gid = gid)
+ name = name or _UNKNOWN
+ if (not self.noid and gid != ""):
+ gid_html = Html("span", " [%s]" % gid, class_ = "grampsid",
+ inline = True)
+ else:
+ gid_html = ""
+
+ if path != "":
+ url = self.report.build_url_fname(path, None, self.up)
+ list += Html("a", href=url) + name + gid_html
+ else:
+ list += name + str(gid_html)
# return references division to its caller
return section
@@ -2374,131 +2452,99 @@ class BasePage(object):
"""
return Html("a", _("Family Map"), href = url, title =_("Family Map"), class_ ="familymap", inline =True)
- def display_spouse(self, family, table, ppl_handle_list, place_lat_long):
+ def display_spouse(self, partner, family, place_lat_long):
"""
display an individual's partner
+ @param: place_lat_long -- for use in Family Map Pages. This will be None
+ if called from Family pages, which do not create a Family Map
"""
- gender = self.person.get_gender()
+ gender = partner.get_gender()
reltype = family.get_relationship()
if reltype == FamilyRelType.MARRIED:
if gender == Person.FEMALE:
- relstr = _("Husband")
- elif gender == Person.MALE:
relstr = _("Wife")
+ elif gender == Person.MALE:
+ relstr = _("Husband")
else:
relstr = _("Partner")
else:
relstr = _("Partner")
- spouse = False
- spouse_handle = ReportUtils.find_spouse(self.person, family)
- if spouse_handle:
- spouse = self.dbase_.get_person_from_handle(spouse_handle)
rtype = str(family.get_relationship())
# display family relationship status, and add spouse to FamilyMapPages
- if spouse:
- if self.familymappages:
- self._get_event_place(spouse, ppl_handle_list, place_lat_long)
-
- trow = Html("tr", class_ ="BeginFamily") + (
- Html("td", rtype, class_ ="ColumnType", inline =True),
- Html("td", relstr, class_ ="ColumnAttribute", inline =True)
- )
- table += trow
-
- tcell = Html("td", class_ ="ColumnValue")
- trow += tcell
-
- use_link = check_person_database(spouse_handle, ppl_handle_list)
- if use_link:
- url = self.report.build_url_fname_html(spouse_handle, "ppl", True)
- tcell += self.person_link(url, spouse, _NAME_STYLE_DEFAULT, gid =spouse.get_gramps_id())
- else:
- tcell += self.get_name(spouse)
-
- # display family events; such as marriage and divorce...
- family_events = family.get_event_ref_list()
- if family_events:
- trow = Html("tr") + (
- Html("td", " ", class_ = "ColumnType", inline = True),
- Html("td", " ", class_ = "ColumnAttribute", inline = True),
- Html("td", self.format_family_events(family_events, place_lat_long), class_ = "ColumnValue")
- )
- table += trow
+ if self.familymappages:
+ self._get_event_place(partner, place_lat_long)
- # If the families pages are not output, display family notes
- if not self.inc_families:
- notelist = family.get_note_list()
- for notehandle in notelist:
- note = self.dbase_.get_note_from_handle(notehandle)
- if note:
- trow = Html("tr") + (
- Html("td", " ", class_ = "ColumnType", inline = True),
- Html("td", "Narrative", class_ = "ColumnAttribute", inline = True),
- Html("td", self.get_note_format(note, True), class_ = "ColumnValue")
- )
- table += trow
+ trow = Html("tr", class_ ="BeginFamily") + (
+ Html("td", rtype, class_ ="ColumnType", inline =True),
+ Html("td", relstr, class_ ="ColumnAttribute", inline =True)
+ )
+
+ tcell = Html("td", class_ ="ColumnValue")
+ trow += tcell
+
+ tcell += self.new_person_link(partner.get_handle(), uplink=True,
+ person=partner)
+ return trow
-
- def display_child_link(self, chandle, ppl_handle_list):
+ def display_child_link(self, chandle):
"""
display child link ...
"""
- child = self.dbase_.get_person_from_handle(chandle)
+ return self.new_person_link(chandle, uplink=True)
- use_link = check_person_database(chandle, ppl_handle_list)
- if use_link:
- url = self.report.build_url_fname_html(chandle, "ppl", True)
- list = self.person_link(url, child, _NAME_STYLE_DEFAULT, gid =child.get_gramps_id())
- else:
- list = self.get_name(child)
- return list
-
- def person_link(self, url, person, name_style, first = True, gid = None, thumbnailUrl = None):
+ def new_person_link(self, person_handle, uplink=False, person=None,
+ name_style=_NAME_STYLE_DEFAULT):
"""
- creates a hyperlink for a person
+ creates a link for a person. If a page is generated for the person, a
+ hyperlink is created, else just the name of the person. The returned
+ vale will be an Html object if a hyperlink is generated, otherwise just
+ a string
- @param: person = person in database
- @param: namestyle = False -- first and suffix only
- = True -- name displayed in name_format variable
- = None -- person is name
- @param: first = show person's name and gramps id if requested and available
+ @param: person_handle = person in database
+ @param: uplink = If True, then "../../../" is inserted in front of the
+ result
+ @param: person = person object. This does not need to be passed. It
+ should be passed if the person object has already been retrieved, as
+ it will be used to improve performance
"""
- # the only place that this will ever equal False
- # is first there is more than one event for a person...
- if first:
+ result = self.report.obj_dict.get(Person).get(person_handle)
- # see above for explanation
- if name_style:
- person_name = self.get_name(person)
- elif name_style == False:
- person_name = _get_short_name(person.get_gender(), person.get_primary_name())
-
- elif name_style == None: # abnormal specialty situation
- person_name = person
-
- # 1. start building link to image or person
- hyper = Html("a", href = url)
-
- # 2. insert thumbnail if there is one, otherwise insert class = "noThumb"
- if thumbnailUrl:
- hyper += Html("span", class_ = "thumbnail") + (
- Html("img", src = thumbnailUrl, alt = "Image: " + person_name)
- )
+ # construct link, name and gid
+ if result is None:
+ # The person is not included in the webreport
+ link = ""
+ if person is None:
+ person = self.dbase_.get_person_from_handle(person_handle)
+ if person:
+ name = self.report.get_person_name(person)
+ gid = person.get_gramps_id()
else:
- hyper.attr += ' class = "noThumb"'
-
- # 3. insert the person's name
- hyper += person_name
-
- # 3. insert gramps ID if requested and available?
- if (not self.noid and gid):
- hyper += Html("span", " [%s]" % gid, class_ = "grampsid", inline = True)
-
+ name = _("Unknown")
+ gid = ""
else:
- hyper = " "
+ # The person has been encountered in the web report, but this does
+ # not necessarily mean that a page has been generated
+ (link, name, gid) = result
+
+ if name_style == _NAME_STYLE_FIRST and person:
+ name = _get_short_name(person.get_gender(), person.get_primary_name())
+ name = html_escape(name)
+ # construct the result
+ if (not self.noid and gid != ""):
+ gid_html = Html("span", " [%s]" % gid, class_ = "grampsid",
+ inline = True)
+ else:
+ gid_html = ""
+
+ if link != "":
+ url = self.report.build_url_fname(link, up=uplink)
+ hyper = Html("a", name, gid_html, href=url, inline=True)
+ else:
+ hyper = name + str(gid_html)
+
return hyper
def media_link(self, media_handle, img_url, name, uplink = False, usedescr = True):
@@ -2690,7 +2736,9 @@ class BasePage(object):
trow = Html("tr") + (
Html("th", _("Number"), class_ ="ColumnRowLabel", inline =True),
- Html("th", _("Title"), class_ ="ColumnName", inline =True)
+ Html("th", _("Title"), class_ ="ColumnName", inline =True),
+ Html("th", _("Type"), class_ ="ColumnName", inline =True),
+ Html("th", _("Call number"), class_ ="ColumnName", inline =True)
)
thead += trow
@@ -2705,7 +2753,9 @@ class BasePage(object):
trow = Html("tr") + (
Html("td", index, class_ ="ColumnRowLabel", inline =True),
Html("td", self.repository_link(repo_ref.ref, repository.get_name(),
- repository.get_gramps_id(), self.up))
+ repository.get_gramps_id(), self.up)),
+ Html("td", repo_ref.get_media_type(), class_ ="ColumnName"),
+ Html("td", repo_ref.get_call_number(), class_ ="ColumnName")
)
tbody += trow
index += 1
@@ -2747,6 +2797,47 @@ class BasePage(object):
# return information to its callers
return residence
+ def display_bkref(self, bkref_list, depth):
+ list_style = "1", "a", "I", "A", "i"
+ ordered = Html("ol", class_ = "Col1", role = "Volume-n-Page")
+ ordered.attr += "type = %s" % list_style[depth]
+ if depth > len(list_style):
+ return ""
+ # Sort by the name of the object at the bkref_class, bkref_handle
+ for (bkref_class, bkref_handle) in sorted(
+ bkref_list, key=lambda x:self.report.obj_dict[x[0]][x[1]][1]):
+ list = Html("li")
+ path = self.report.obj_dict[bkref_class][bkref_handle][0]
+ name = self.report.obj_dict[bkref_class][bkref_handle][1]
+ gid = self.report.obj_dict[bkref_class][bkref_handle][2]
+ ordered += list
+ if path == "":
+ list += name
+ list += self.display_bkref(
+ self.report.bkref_dict[bkref_class][bkref_handle],
+ depth+1)
+ else:
+ url = self.report.build_url_fname(path, up=self.up)
+ if gid != "":
+ gid_html = Html("span", " [%s]" % gid,
+ class_ = "grampsid", inline = True)
+ else:
+ gid_html = ""
+ list += Html("a", href=url) + name + gid_html
+ return ordered
+
+ def display_bkref_list(self, obj_class, obj_handle):
+ bkref_list = self.report.bkref_dict[obj_class][obj_handle]
+ if not bkref_list:
+ return None
+ # begin references division and title
+ with Html("div", class_ = "subsection", id = "references") as section:
+ section += Html("h4", _("References"), inline = True)
+ depth = 0
+ ordered = self.display_bkref(bkref_list, depth)
+ section += ordered
+ return section
+
# ---------------------------------------------------------------------------------------
# # Web Page Fortmatter and writer
# ---------------------------------------------------------------------------------------
@@ -2784,6 +2875,9 @@ class SurnamePage(BasePage):
showpartner = report.options['showpartner']
showparents = report.options['showparents']
+ if surname == '':
+ surname = _ABSENT
+
of, sio = self.report.create_file(name_to_md5(surname), "srn")
self.up = True
surnamepage, head, body = self.write_header("%s - %s" % (_("Surname"), surname))
@@ -2798,7 +2892,7 @@ class SurnamePage(BasePage):
# feature request 2356: avoid genitive form
msg = _("This page contains an index of all the individuals in the "
"database with the surname of %s. Selecting the person’s name "
- "will take you to that person’s individual page.") % surname
+ "will take you to that person’s individual page.") % html_escape(surname)
surnamedetail += Html("p", msg, id = "description")
# begin surname table and thead
@@ -2836,9 +2930,10 @@ class SurnamePage(BasePage):
tbody += trow
# firstname column
- url = self.report.build_url_fname_html(person.handle, "ppl", True)
- trow += Html("td", self.person_link(url, person, _NAME_STYLE_FIRST, gid = person.gramps_id),
- class_ = "ColumnName")
+ link = self.new_person_link(person_handle, uplink=True,
+ person=person,
+ name_style=_NAME_STYLE_FIRST)
+ trow += Html("td", link, class_ = "ColumnName")
# birth column
if showbirth:
@@ -2879,16 +2974,9 @@ class SurnamePage(BasePage):
family = self.dbase_.get_family_from_handle(family_handle)
partner_handle = ReportUtils.find_spouse(person, family)
if partner_handle:
- partner = self.dbase_.get_person_from_handle(partner_handle)
if not first_family:
tcell += ','
- use_link = check_person_database(partner_handle, ppl_handle_list)
- if use_link:
- url = self.report.build_url_fname_html(partner_handle, "ppl", True)
- tcell += self.person_link(url, partner, _NAME_STYLE_DEFAULT,
- gid = partner.get_gramps_id())
- else:
- tcell += self.get_name(partner)
+ tcell += self.new_person_link(partner_handle, uplink=True)
first_family = False
else:
tcell += " "
@@ -2950,119 +3038,29 @@ class FamilyPages(BasePage):
self.report = report
self.db = report.database
- def add_instance(self, family_handle, bkref_path, bkref_name, bkref_gid):
- self.family_dict[family_handle].add((bkref_path, bkref_name,
- bkref_gid))
+ def display_pages(self, title):
+ """
+ Generate and output the pages under the Family tab, namely the family
+ index and the individual family pages.
- family = self.db.get_family_from_handle(family_handle)
- # We need to assign self.dbase_, self.up and self.noid so that
- # get_family_string will work without having called __init__ of BasePage
- self.up = True
- self.dbase_ = self.db
- self.noid = self.report.options['nogid']
- family_name = _("Family of ") + self.get_family_string(family)
- self.up = False
- family_fname = self.report.build_url_fname(family_handle, "fam",
- False) + self.report.ext
-
- if self.report.inc_gallery:
- for media_ref in family.get_media_list():
- media_handle = media_ref.get_reference_handle()
- self.report.tab["Media"].add_instance(
- media_handle, family_fname,
- family_name, family.gramps_id)
-
- ############### Events section ##############
- for evt_ref in family.get_event_ref_list():
- event = self.db.get_event_from_handle(evt_ref.ref)
- place_handle = event.get_place_handle()
- if place_handle:
- self.report.tab["Place"].add_instance(
- place_handle, family_fname,
- family_name, family.gramps_id)
-
- if self.report.inc_events:
- # detail for family events are displayed on the events pages as
- # well as on this family page
- self.report.tab["Event"].add_instance(
- evt_ref.ref, family_fname,
- family_name, family.gramps_id)
- else:
- # There is no event page. Family events are displayed on the
- # family page, but the associated family event media may need to
- # be displayed on the media page
- if self.report.inc_gallery:
- for media_ref in event.get_media_list():
- media_handle = media_ref.get_reference_handle()
- self.report.tab["Media"].add_instance(
- media_handle, family_fname,
- family_name, family.gramps_id)
-
- ############### LDS Ordinance section ##############
- for lds_ord in family.get_lds_ord_list():
- for citation_handle in lds_ord.get_citation_list():
- self.report.tab["Citation"].add_instance(
- citation_handle, family_fname,
- family_name, family.gramps_id)
-
- ############### Attributes section ##############
- for attr in family.get_attribute_list():
- for citation_handle in attr.get_citation_list():
- self.report.tab["Citation"].add_instance(
- citation_handle, family_fname,
- family_name, family.gramps_id)
-
- ############### Sources section ##############
- for citation_handle in family.get_citation_list():
- self.report.tab["Citation"].add_instance(
- citation_handle, family_fname,
- family_name, family.gramps_id)
-
- # FIXME: At present, display_pages uses ind_list from report.ind_list,
- # which is passed in to display_pages. FamilyListPages sorts ind_list by
- # surname, then within surname by full name. it then loops through all
- # people (who are output to web pages) finding their families,
- # outputting them to the index page, and accumulating a list for
- # generating the Family pages themselves. However, the families have all
- # been identified, and passed to this function, so there is no need to
- # go through them again. Unfortunately, the way the index page is
- # generated from surnames makes it rather hard to do the same thing when
- # only the family_handle (and the backlink information) is passed in.
- # Either some clever coding is needed, or an alternative family index
- # page is needed.
-
- def display_pages(self, report, ind_list, place_list, place_lat_long,
- db_family_handles):
- # FIXME: Most of the parameters should be removed. report is (or should
- # be) passed to __init__, ind_list should be replaced by a different
- # algorithm for choosing all the families to be output,
- # db_family_handles is constructed in this display_pages, and used
- # outside to determine whether a page has been generated (it should be
- # replaced by a function in this class) and place_list and
- # place_lat_long violate modularity and should be removed.
- report.user.begin_progress(_("Narrated Web Site Report"),
+ @param: title -- the web site title
+ """
+ log.debug("obj_dict[Family]")
+ for item in self.report.obj_dict[Family].items():
+ log.debug(" %s" % str(item))
+
+ self.report.user.begin_progress(_("Narrated Web Site Report"),
_("Creating family pages..."),
- len(self.family_dict) + 1)
- self.FamilyListPage(report, report.title, ind_list,
- db_family_handles)
+ len(self.report.obj_dict[Family]) + 1)
+ self.FamilyListPage(self.report, title,
+ self.report.obj_dict[Family].keys())
- log.debug("family_dict")
- for item in self.family_dict.iteritems():
- log.debug(" %s" % str(item))
- log.debug("db_family_handles")
- for item in db_family_handles:
- log.debug(" %s" % str(item))
- if len(self.family_dict) != len(db_family_handles):
- log.debug("****** Length of list differs")
- log.debug("\n")
-
- for family_handle in db_family_handles:
- report.user.step_progress()
- self.FamilyPage(report, report.title, family_handle, place_list,
- ind_list, place_lat_long)
- report.user.end_progress()
+ for family_handle in self.report.obj_dict[Family]:
+ self.report.user.step_progress()
+ self.FamilyPage(self.report, title, family_handle)
+ self.report.user.end_progress()
- def FamilyListPage(self, report, title, ind_list, db_family_handles):
+ def FamilyListPage(self, report, title, fam_list):
self.dbase_ = report.database
BasePage.__init__(self, report, title)
@@ -3079,8 +3077,24 @@ class FamilyPages(BasePage):
"name will take you to their family/ relationship’s page.")
relationlist += Html("p", msg, id = "description")
+ # go through all the families, and construct a dictionary of all the
+ # people and the families thay are involved in. Note that the people
+ # in the list may be involved in OTHER families, that are not listed
+ # because they are not in the original family list.
+ pers_fam_dict = defaultdict(list)
+ for family_handle in fam_list:
+ family = self.dbase_.get_family_from_handle(family_handle)
+ if family:
+ husband_handle = family.get_father_handle()
+ spouse_handle = family.get_mother_handle()
+ if husband_handle:
+ pers_fam_dict[husband_handle].append(family)
+ if spouse_handle:
+ pers_fam_dict[spouse_handle].append(family)
+
# add alphabet navigation
- menu_set = get_first_letters(self.dbase_, ind_list, _KEYPERSON)
+ menu_set = get_first_letters(self.dbase_, pers_fam_dict.keys(),
+ _KEYPERSON)
alpha_nav, menu_set = alphabet_navigation(menu_set)
if alpha_nav:
relationlist += alpha_nav
@@ -3101,8 +3115,8 @@ class FamilyPages(BasePage):
Html("th", trans, class_ =colclass, inline =True)
for trans, colclass in [
(_("Letter"), "ColumnRowLabel"),
- (_("Partner 1"), "ColumnPartner"),
- (_("Partner 2"), "ColumnPartner"),
+ (_("Person"), "ColumnPartner"),
+ (_("Family"), "ColumnPartner"),
(_("Marriage"), "ColumnDate"),
(_("Divorce"), "ColumnDate")
]
@@ -3112,7 +3126,7 @@ class FamilyPages(BasePage):
table += tbody
# begin displaying index list
- ppl_handle_list = sort_people(self.dbase_, ind_list)
+ ppl_handle_list = sort_people(self.dbase_, pers_fam_dict.keys())
for (surname, handle_list) in ppl_handle_list:
if surname:
@@ -3124,88 +3138,70 @@ class FamilyPages(BasePage):
for person_handle in handle_list:
person = self.dbase_.get_person_from_handle(person_handle)
if person:
- family_handle_list = person.get_family_handle_list()
- if family_handle_list:
+ family_list = pers_fam_dict[person_handle]
+ first_family = True
+ for family in family_list:
+ trow = Html("tr")
+ tbody += trow
+
+ tcell = Html("td", class_="ColumnRowLabel")
+ trow += tcell
+
+ if letter not in ltrs_displayed:
+ trow.attr = 'class="BginLetter"'
+ tcell += Html("a", letter, name=letter,
+ title ="Families beginning with letter " + letter, inline =True)
+ ltrs_displayed[letter] = True
+ else:
+ tcell += ' '
+
+ tcell = Html("td", class_="ColumnPartner")
+ trow += tcell
- first_family = True
- for family_handle in family_handle_list:
+ if first_family:
+ trow.attr = 'class ="BeginFamily"'
- family = self.dbase_.get_family_from_handle(family_handle)
- if family:
+ tcell += self.new_person_link(person_handle, uplink=self.up)
- trow = Html("tr")
- tbody += trow
+ first_family = False
+ else:
+ tcell += ' '
- tcell = Html("td", class_ ="ColumnRowLabel")
- trow += tcell
+ tcell = Html("td", class_ ="ColumnPartner")
+ trow += tcell
- if letter not in ltrs_displayed:
- trow.attr = 'class ="BeginLetter"'
- tcell += Html("a", letter, name =letter,
- title ="Families beginning with letter " + letter, inline =True)
+ tcell += self.family_link(
+ family.get_handle(),
+ self.report.get_family_name(family),
+ family.get_gramps_id(), self.up)
- ltrs_displayed[letter] = True
- else:
- tcell += ' '
+ # family events; such as marriage and divorce events
+ fam_evt_ref_list = family.get_event_ref_list()
+ tcell1 = Html("td", class_ ="ColumnDate", inline =True)
+ tcell2 = Html("td", class_ ="ColumnDate", inline =True)
+ trow += (tcell1, tcell2)
- tcell = Html("td", class_ ="ColumnPartner")
- trow += tcell
+ if fam_evt_ref_list:
+ for evt_ref in fam_evt_ref_list:
+ event = self.dbase_.get_event_from_handle(evt_ref.ref)
+ if event:
+ evt_type = event.get_type()
+ if evt_type in [EventType.MARRIAGE,
+ EventType.DIVORCE]:
- if first_family:
- trow.attr = 'class ="BeginFamily"'
-
- tcell += self.family_link(family_handle, self.get_name(person),
- family.get_gramps_id(), self.up)
-
- first_family = False
- else:
- tcell += ' '
-
- tcell = Html("td", class_ ="ColumnPartner")
- trow += tcell
-
- # get partner if there is one listed?
- partner_handle = ReportUtils.find_spouse(person, family)
- if partner_handle:
- partner = self.dbase_.get_person_from_handle(partner_handle)
- if partner:
- use_link = check_person_database(partner_handle, ind_list)
- if use_link:
- tcell += self.family_link(family_handle, self.get_name(partner),
- family.get_gramps_id(), self.up)
+ if evt_type == EventType.MARRIAGE:
+ tcell1 += _dd.display(event.get_date_object())
else:
- tcell += self.get_name(partner)
- else:
- tcell += ' '
+ tcell1 += ' '
- # family events; such as marriage and divorce events
- fam_evt_ref_list = family.get_event_ref_list()
- tcell1 = Html("td", class_ ="ColumnDate", inline =True)
- tcell2 = Html("td", class_ ="ColumnDate", inline =True)
- trow += (tcell1, tcell2)
-
- if fam_evt_ref_list:
- for evt_ref in fam_evt_ref_list:
- event = self.dbase_.get_event_from_handle(evt_ref.ref)
- if event:
- evt_type = event.get_type()
- if evt_type in [EventType.MARRIAGE,
- EventType.DIVORCE]:
-
- if evt_type == EventType.MARRIAGE:
- tcell1 += _dd.display(event.get_date_object())
- else:
- tcell1 += ' '
-
- if evt_type == EventType.DIVORCE:
- tcell2 += _dd.display(event.get_date_object())
- else:
- tcell2 += ' '
- else:
- tcell1 += ' '
- tcell2 += ' '
- first_family = False
- db_family_handles.append(family_handle)
+ if evt_type == EventType.DIVORCE:
+ tcell2 += _dd.display(event.get_date_object())
+ else:
+ tcell2 += ' '
+ else:
+ tcell1 += ' '
+ tcell2 += ' '
+ first_family = False
# add clearline for proper styling
# add footer section
@@ -3216,7 +3212,7 @@ class FamilyPages(BasePage):
# and close the file
self.XHTMLWriter(familiesListPage, of, sio)
- def FamilyPage(self, report, title, family_handle, place_list, ppl_handle_list, place_lat_long):
+ def FamilyPage(self, report, title, family_handle):
self.dbase_ = report.database
family = self.dbase_.get_family_from_handle(family_handle)
if not family:
@@ -3224,23 +3220,20 @@ class FamilyPages(BasePage):
BasePage.__init__(self, report, title, family.get_gramps_id())
self.bibli = Bibliography()
- self.place_list = place_list
self.up = True
- # determine if husband and wife, husband only, or spouse only....
- self.page_title = _("Family of ") + self.get_family_string(family)
+ family_name = self.report.get_family_name(family)
+ self.page_title = family_name
- birthorder = report.options["birthorder"]
self.familymappages = report.options["familymappages"]
of, sio = self.report.create_file(family.get_handle(), "fam")
- familydetailpage, head, body = self.write_header(_("Family/ Relationship"))
+ familydetailpage, head, body = self.write_header(family_name)
# begin FamilyDetaill division
with Html("div", class_ ="content", id ="RelationshipDetail") as relationshipdetail:
body += relationshipdetail
# family media list for initial thumbnail
- # delete thumbnail so that it won't display again in the Gallery List later on...
if self.create_media:
media_list = family.get_media_list()
# If Event pages are not being created, then we need to display
@@ -3252,32 +3245,18 @@ class FamilyPages(BasePage):
thumbnail = self.display_first_image_as_thumbnail(media_list, family)
if thumbnail:
relationshipdetail += thumbnail
- media_list.remove(media_list[0])
- husband, spouse = [None]*2
- husband_handle = family.get_father_handle()
- spouse_handle = family.get_mother_handle()
- if husband_handle:
- husband = self.dbase_.get_person_from_handle(husband_handle)
+ self.person = None # no longer used
- if spouse_handle:
- spouse = self.dbase_.get_person_from_handle(spouse_handle)
-
- self.person = None
- if husband and spouse:
- self.person = husband
- elif husband:
- self.person = husband
- elif spouse_handle:
- self.person = spouse
-
- relationshipdetail += Html("h2", self.page_title, inline = True)
+ relationshipdetail += Html("h2", self.page_title, inline = True) +\
+ (Html('sup') +\
+ (Html('small') +
+ self.get_citation_links(family.get_citation_list())))
# display relationships
- if self.person:
- families = self.display_relationships(self.person, ppl_handle_list, place_lat_long)
- if families is not None:
- relationshipdetail += families
+ families = self.display_family_relationships(family, None)
+ if families is not None:
+ relationshipdetail += families
# display additional images as gallery
if (self.create_media and media_list):
@@ -3336,57 +3315,27 @@ class PlacePages(BasePage):
self.db = report.database
self.place_dict = defaultdict(set)
- def add_instance(self, place_handle, bkref_path, bkref_name, bkref_gid):
- self.place_dict[place_handle].add((bkref_path, bkref_name,
- bkref_gid))
- # FIXME: place_dict duplicates the function of report.place_list.
- # Eventually place_list needs to be removed. At present place_dict is
- # just used for test purposes - it is not actually used in the web page
- # construction
+ def display_pages(self, title):
+ """
+ Generate and output the pages under the Place tab, namely the place
+ index and the individual place pages.
- place = self.db.get_place_from_handle(place_handle)
- place_name = place.get_title()
- place_fname = self.report.build_url_fname(place_handle, "plc",
- False) + self.report.ext
-
- ############### Media section ##############
- if self.report.inc_gallery:
- for media_ref in place.get_media_list():
- media_handle = media_ref.get_reference_handle()
- self.report.tab["Media"].add_instance(
- media_handle, place_fname,
- place_name, place.gramps_id)
-
- ############### Sources section ##############
- for citation_handle in place.get_citation_list():
- self.report.tab["Citation"].add_instance(
- citation_handle, place_fname,
- place_name, place.gramps_id)
-
- def display_pages(self, report, title, place_list, source_list,
- db_place_handles):
- # FIXME: Most of the parameters should be removed. report is passed to
- # __init__, title appears not to be used and place_list, source_list and
- # db_place_handles violate modularity and should be removed.
- log.debug("place_dict")
- for item in self.place_dict.iteritems():
+ @param: title -- the web site title
+ """
+ log.debug("obj_dict[Place]")
+ for item in self.report.obj_dict[Place].items():
log.debug(" %s" % str(item))
- log.debug("place_list")
- for item in place_list.iteritems():
- log.debug(" %s" % str(item))
- if len(self.place_dict) != len(place_list):
- log.debug("****** Length of list differs")
- log.debug("\n")
- report.user.begin_progress(_("Narrated Web Site Report"),
+ self.report.user.begin_progress(_("Narrated Web Site Report"),
_("Creating place pages"),
- len(place_list) + 1)
+ len(self.report.obj_dict[Place]) + 1)
- self.PlaceListPage(report, title, place_list, db_place_handles)
+ self.PlaceListPage(self.report, title,
+ self.report.obj_dict[Place].keys())
- for place in place_list:
- report.user.step_progress()
- self.PlacePage(report, title, place, source_list, place_list, db_place_handles)
- report.user.end_progress()
+ for place_handle in self.report.obj_dict[Place]:
+ self.report.user.step_progress()
+ self.PlacePage(self.report, title, place_handle)
+ self.report.user.end_progress()
pass
def PlaceListPage(self, report, title, place_handles):
@@ -3490,7 +3439,6 @@ class PlacePages(BasePage):
else:
tcell1 += ' '
tcell2 += ' '
- db_place_handles.append(place_handles)
# add clearline for proper styling
# add footer section
@@ -3501,7 +3449,7 @@ class PlacePages(BasePage):
# and close the file
self.XHTMLWriter(placelistpage, of, sio)
- def PlacePage(self, report, title, place_handle, src_list, place_list):
+ def PlacePage(self, report, title, place_handle):
self.bibli = Bibliography()
self.dbase_ = report.database
place = self.dbase_.get_place_from_handle(place_handle)
@@ -3510,7 +3458,6 @@ class PlacePages(BasePage):
BasePage.__init__(self, report, title, place.get_gramps_id())
of, sio = self.report.create_file(place_handle, "plc")
- self.src_list = src_list
self.up = True
self.page_title = place.get_title()
placepage, head, body = self.write_header(_("Places"))
@@ -3557,11 +3504,6 @@ class PlacePages(BasePage):
if urllinks is not None:
placedetail += urllinks
- #for all plugins
- # if a place place_detail plugin
- # if plugin active
- # call_generate_page(report, title, place_handle, src_list, head, body, place, placedetail)
-
# add place map here
if self.placemappages:
if (place and (place.lat and place.long)):
@@ -3608,16 +3550,16 @@ class PlacePages(BasePage):
# add javascript function call to body element
body.attr +=' onload = "initialize();" '
- # place references
- reflist = self.display_references(place_list[place.handle])
- if reflist is not None:
- placedetail += reflist
-
# source references
srcrefs = self.display_ind_sources(place)
if srcrefs is not None:
placedetail += srcrefs
+ # References list
+ ref_list = self.display_bkref_list(Place, place_handle)
+ if ref_list is not None:
+ placedetail += ref_list
+
# add clearline for proper styling
# add footer section
footer = self.write_footer()
@@ -3649,72 +3591,33 @@ class EventPages(BasePage):
self.report = report
self.db = report.database
- def add_instance(self, event_handle, bkref_path, bkref_name, bkref_gid):
- self.event_dict[event_handle].add((bkref_path, bkref_name,
- bkref_gid))
+ def display_pages(self, title):
+ """
+ Generate and output the pages under the Event tab, namely the event
+ index and the individual event pages.
- #self.event_handle_list.append(event_handle)
- event = self.db.get_event_from_handle(event_handle)
- #self.event_types.append(str(event.get_type()))
- # I have no idea why all that is displayed for the back link is the
- # event type, but this can be seen in a Media page, where the Media is
- # linked from (for example) a birth event
- event_name = str(event.get_type())
- event_fname = self.report.build_url_fname(event_handle, "evt",
- False) + self.report.ext
- # FIXME: The event pages do not display the back references
-
- ############### Attribute section ##############
- for attr in event.get_attribute_list():
- for citation_handle in attr.get_citation_list():
- self.report.tab["Citation"].add_instance(
- citation_handle, event_fname,
- event_name, event.gramps_id)
-
- ############### Source section ##############
- for citation_handle in event.get_citation_list():
- self.report.tab["Citation"].add_instance(
- citation_handle, event_fname,
- event_name, event.gramps_id)
-
- ############### Media section ##############
- if self.report.inc_gallery:
- for media_ref in event.get_media_list():
- media_handle = media_ref.get_reference_handle()
- self.report.tab["Media"].add_instance(
- media_handle, event_fname,
- event_name, event.gramps_id)
-
-
- def display_pages(self, report, title, ind_list, db_event_handles):
- # FIXME: Most of the parameters should be removed. report is passed to
- # __init__, title appears not to be used and ind_list and
- # db_event_handles violate modularity and should be removed.
- event_handle_list, event_types = build_event_data_by_individuals(report.database, ind_list)
- log.debug("event_dict")
- for item in self.event_dict.iteritems():
+ @param: title -- the web site title
+ """
+ log.debug("obj_dict[Event]")
+ for item in self.report.obj_dict[Event].items():
log.debug(" %s" % str(item))
- log.debug("event_handle_list")
- for item in event_handle_list:
- log.debug(" %s" % str(item))
- if len(self.event_dict) != len(event_handle_list):
- log.debug("****** Length of list differs")
- log.debug("\n")
- report.user.begin_progress(_("Narrated Web Site Report"),
+ event_handle_list = self.report.obj_dict[Event].keys()
+ event_types = []
+ for event_handle in event_handle_list:
+ event = self.report.database.get_event_from_handle(event_handle)
+ event_types.append(str(event.get_type()))
+ self.report.user.begin_progress(_("Narrated Web Site Report"),
_("Creating event pages"),
len(event_handle_list) + 1)
- self.EventListPage(report, title, event_types,
- event_handle_list,
- ind_list, db_event_handles)
+ self.EventListPage(self.report, title, event_types, event_handle_list)
for event_handle in event_handle_list:
- report.user.step_progress()
- self.EventPage(report, title, event_handle, ind_list)
+ self.report.user.step_progress()
+ self.EventPage(self.report, title, event_handle)
- report.user.end_progress()
+ self.report.user.end_progress()
- def EventListPage(self, report, title, event_types, event_handle_list,
- ppl_handle_list, db_event_handles):
+ def EventListPage(self, report, title, event_types, event_handle_list):
"""
Will create the event list page
@@ -3850,11 +3753,10 @@ class EventPages(BasePage):
# get person(s) for ColumnPerson
self.complete_people(tcell, first_person, handle_list,
- ppl_handle_list, up =False)
+ up =False)
_EVENT_DISPLAYED.append(gid)
first_event = False
- db_event_handles.append(event_handle)
# add clearline for proper styling
# add footer section
@@ -3888,7 +3790,7 @@ class EventPages(BasePage):
# return hyperlink to its caller
return Html("a", grampsid, href = url, title = grampsid, inline = True)
- def EventPage(self, report, title, event_handle, ppl_handle_list):
+ def EventPage(self, report, title, event_handle):
"""
Creates the individual event page
@@ -3953,22 +3855,6 @@ class EventPages(BasePage):
)
tbody += trow
- trow = Html("tr") + (
- Html("td", _("Person(s)"), class_ = "ColumnAttribute", inline = True)
- )
- tbody += trow
-
- tcell = Html("td", class_ = "ColumnPerson")
- trow += tcell
-
- # Person(s) field
- handle_list = set(self.dbase_.find_backlink_handles(event_handle,
- include_classes = ['Family', 'Person'] if int(event.type) in _EVENTMAP else ['Person']))
- first_person = True
-
- # get person(s) for ColumnPerson
- self.complete_people(tcell, first_person, handle_list, ppl_handle_list)
-
# Narrative subsection
notelist = event.get_note_list()
notelist = self.display_note_list(notelist)
@@ -3993,6 +3879,11 @@ class EventPages(BasePage):
if addgallery:
eventdetail += addgallery
+ # References list
+ ref_list = self.display_bkref_list(Event, event_handle)
+ if ref_list is not None:
+ eventdetail += ref_list
+
# add clearline for proper styling
# add footer section
footer = self.write_footer()
@@ -4086,16 +3977,18 @@ class SurnameListPage(BasePage):
temp_list[index_val] = (surname, data_list)
ppl_handle_list = (temp_list[key]
- for key in sorted(temp_list, key = locale.strxfrm))
+ for key in sorted(temp_list, key = SORT_KEY))
last_letter = ''
last_surname = ''
for (surname, data_list) in ppl_handle_list:
- if len(surname) == 0:
- continue
-
letter = first_letter(surname)
+ if letter == ' ':
+ # if surname is an empty string, then first_letter
+ # returns a space
+ letter = ' '
+ surname = _ABSENT
trow = Html("tr")
tbody += trow
@@ -4117,7 +4010,7 @@ class SurnameListPage(BasePage):
last_surname = surname
- trow += Html("td", self.surname_link(name_to_md5(surname), surname),
+ trow += Html("td", self.surname_link(name_to_md5(surname), html_escape(surname)),
class_ = "ColumnSurname", inline = True)
trow += Html("td", len(data_list), class_ = "ColumnQuantity", inline = True)
@@ -4197,7 +4090,7 @@ class HomePage(BasePage):
# attach note
section += note_text
- # create clear line for proper styling
+ # create clear line for proper styling
# create footer section
footer = self.write_footer()
body += (fullclear, footer)
@@ -4219,16 +4112,6 @@ class CitationPages(BasePage):
self.report = report
self.db = report.database
- def add_instance(self, citation_handle, bkref_path, bkref_name, bkref_gid):
- citation = self.db.get_citation_from_handle(citation_handle)
- # If Page is none, we want to make sure that a tuple is generated for
- # the source backreference
- citation_name = citation.get_page() or ""
- source_handle = citation.get_reference_handle()
- self.report.tab["Source"].add_instance(source_handle, bkref_path,
- (bkref_name, citation_name),
- bkref_gid)
-
def display_pages(self):
pass
@@ -4252,66 +4135,27 @@ class SourcePages(BasePage):
self.report = report
self.db = report.database
- def add_instance(self, source_handle, bkref_path, bkref_name, bkref_gid):
- self.source_dict[source_handle].add((bkref_path, bkref_name,
- bkref_gid))
- # FIXME: source_dict duplicates the function of report.source_list.
- # Eventually source_list needs to be removed. At present, source_dict is
- # just for test purposes - it is not actually used in the web page
- # construction.
-
- source = self.db.get_source_from_handle(source_handle)
- source_name = source.get_title()
- source_fname = self.report.build_url_fname(source_handle, "src",
- False) + self.report.ext
-
- ############### Media section ##############
- if self.report.inc_gallery:
- for media_ref in source.get_media_list():
- media_handle = media_ref.get_reference_handle()
- self.report.tab["Media"].add_instance(
- media_handle, source_fname,
- source_name, source.gramps_id)
-
- ############### Repository section ##############
- if self.report.inc_repository:
- for repo_ref in source.get_reporef_list():
- repo_handle = repo_ref.get_reference_handle()
- self.report.tab["Repository"].add_instance(
- repo_handle, source_fname,
- source_name, source.gramps_id)
-
- def display_pages(self, report, title, source_list):
+ def display_pages(self, title):
"""
Generate and output the pages under the Sources tab, namely the sources
index and the individual sources pages.
- @param: report -- the instance of the main report class for this report
@param: title -- the web site title
- @param: source_list -- a dictionary object containg source handles as
- the key and (backlink filename, backlink page_title, backlink gid) as
- values -- now replaced by self.source_dict
"""
- # FIXME: Perhaps report and title should just be passed in to the class
- log.debug("source_dict")
- for item in self.source_dict.iteritems():
+ log.debug("obj_dict[Source]")
+ for item in self.report.obj_dict[Source].items():
log.debug(" %s" % str(item))
- log.debug("source_list")
- for item in source_list.iteritems():
- log.debug(" %s" % str(item))
- if len(self.source_dict) != len(source_list):
- log.debug("****** Length of list differs")
- log.debug("\n")
- report.user.begin_progress(_("Narrated Web Site Report"),
+ self.report.user.begin_progress(_("Narrated Web Site Report"),
_("Creating source pages"),
- len(self.source_dict) + 1)
- self.SourceListPage(report, title, list(self.source_dict.keys()))
+ len(self.report.obj_dict[Source]) + 1)
+ self.SourceListPage(self.report, title,
+ self.report.obj_dict[Source].keys())
- for item in self.source_dict.iteritems():
- report.user.step_progress()
- self.SourcePage(report, title, item)
+ for source_handle in self.report.obj_dict[Source]:
+ self.report.user.step_progress()
+ self.SourcePage(self.report, title, source_handle)
- report.user.end_progress()
+ self.report.user.end_progress()
def SourceListPage(self, report, title, source_handles):
"""
@@ -4341,7 +4185,7 @@ class SourcePages(BasePage):
key = source.get_title() + str(source.get_gramps_id())
source_dict[key] = (source, handle)
- keys = sorted(source_dict, key=locale.strxfrm)
+ keys = sorted(source_dict, key=SORT_KEY)
msg = _("This page contains an index of all the sources in the "
"database, sorted by their title. Clicking on a source’s "
@@ -4390,19 +4234,15 @@ class SourcePages(BasePage):
# and close the file
self.XHTMLWriter(sourcelistpage, of, sio)
- def SourcePage(self, report, title, item):
+ def SourcePage(self, report, title, source_handle):
"""
Generate and output an individual Source page.
@param: report -- the instance of the main report class for this report
@param: title -- the web site title
- @param: item -- a tuple containing the source handle and a list of
- back-references
+ @param: source_handle -- the handle of the source to be output
"""
- self.dbase_ = report.database # needed for dump_repository_ref_list
-
- (src_handle, bkref_list) = item
- source = self.db.get_source_from_handle(src_handle)
+ source = self.db.get_source_from_handle(source_handle)
if not source:
return
@@ -4413,7 +4253,7 @@ class SourcePages(BasePage):
self.navigation = self.report.options['navigation']
self.citationreferents = self.report.options['citationreferents']
- of, sio = self.report.create_file(src_handle, "src")
+ of, sio = self.report.create_file(source_handle, "src")
self.up = True
sourcepage, head, body = self.write_header("%s - %s" % (_('Sources'),
self.page_title))
@@ -4428,9 +4268,6 @@ class SourcePages(BasePage):
if thumbnail is not None:
sourcedetail += thumbnail
- # remove thumbnail from list of media...
- media_list.remove(media_list[0])
-
# add section title
sourcedetail += Html("h3", html_escape(source.get_title()), inline = True)
@@ -4479,50 +4316,10 @@ class SourcePages(BasePage):
if repo_list is not None:
sourcedetail += repo_list
- # Source refernces lsit
- # This would normally be simply:
- # reflist = self.display_references(bkref_list)
- # but that would simply give references to the citation page
- # (which we don't actually generate), so we bypass the citation,
- # and refer directly back to the object that referenced the
- # citation.
- # Re-order the list of back references into a dictionary keyed by
- # the Citation Volume/Page number
- bkref_dict = defaultdict(set)
- for bkref in bkref_list:
- (object_bkref_path, bkref_name, bkref_gid) = bkref
- (object_bkref_name, citation_bkref_name) = bkref_name
- bkref_dict[citation_bkref_name].add(
- (object_bkref_path, object_bkref_name, bkref_gid))
-
- if bkref_dict:
- # begin references division and title
- with Html("div", class_ = "subsection", id = "references") as section:
- section += Html("h4", _("References"), inline = True)
-
- ordered = Html("ol", class_ = "Col1",
- role = "Volume-n-Page")
- section += ordered
- # Loop round each Citation Volume/Page number
- for citation_bkref_name in sorted(bkref_dict,
- key=locale.strxfrm):
- list = Html("li")
- ordered += list
- list += citation_bkref_name
-
- ordered2 = Html("ol", type = "a")
- list += ordered2
- # Loop round each back reference sorted by the name for
- # this Volime/Page number
- for (path, name, gid) in sorted(
- bkref_dict[citation_bkref_name],
- key=lambda x:locale.strxfrm(x[1])):
- list2 = Html("li")
- ordered2 += list2
- # Note. 'path' already has a filename extension
- url = self.report.build_url_fname(path, None, self.up)
- list2 += self.person_link(url, name or _UNKNOWN, None, gid = gid)
- sourcedetail += section
+ # Source references list
+ ref_list = self.display_bkref_list(Source, source_handle)
+ if ref_list is not None:
+ sourcedetail += ref_list
# add clearline for proper styling
# add footer section
@@ -4553,73 +4350,36 @@ class MediaPages(BasePage):
self.report = report
self.db = report.database
- def add_instance(self, media_handle, bkref_path, bkref_name, bkref_gid):
- self.media_dict[media_handle].add((bkref_path, bkref_name,
- bkref_gid))
- # FIXME: media_dict duplicates the function of report.photo_list.
- # Eventually photo_list needs to be removed. At present, media_dict is
- # just for test purposes - it is not actually used in the web page
- # construction.
-
- media = self.db.get_object_from_handle(media_handle)
- media_name = "Media"
- media_fname = self.report.build_url_fname(media_handle, "img",
- False) + self.report.ext
-
- ############### Attribute section ##############
- for attr in media.get_attribute_list():
- for citation_handle in attr.get_citation_list():
- self.report.tab["Citation"].add_instance(
- citation_handle, media_fname,
- media_name, media.gramps_id)
-
- ############### Sources section ##############
- for citation_handle in media.get_citation_list():
- self.report.tab["Citation"].add_instance(
- citation_handle, media_fname,
- media_name, media.gramps_id)
-
- def display_pages(self, report, title):
+ def display_pages(self, title):
"""
Generate and output the pages under the Media tab, namely the media
index and the individual media pages.
- @param: report -- the instance of the main report class for this report
@param: title -- the web site title
"""
- # FIXME: Perhaps report and title should just be passed in to the class
- log.debug("media_dict")
- for item in self.media_dict.iteritems():
+ log.debug("obj_dict[Media]")
+ for item in self.report.obj_dict[MediaObject].items():
log.debug(" %s" % str(item))
- log.debug("photo_list")
- for item in report.photo_list.iteritems():
- log.debug(" %s" % str(item))
- if len(self.media_dict) != len(report.photo_list):
- log.debug("****** Length of list differs")
- log.debug("\n")
- report.user.begin_progress(_("Narrated Web Site Report"),
+ self.report.user.begin_progress(_("Narrated Web Site Report"),
_("Creating media pages"),
- len(report.photo_list) + 1)
+ len(self.report.obj_dict[MediaObject]) + 1)
- sort = Sort(report.database)
- sorted_media_handles = sorted(self.media_dict,
+ sort = Sort(self.report.database)
+ sorted_media_handles = sorted(self.report.obj_dict[MediaObject].keys(),
key=sort.by_media_title_key)
- self.MediaListPage(report, report.title, sorted_media_handles)
+ self.MediaListPage(self.report, title, sorted_media_handles)
prev = None
- total = len(self.media_dict)
+ total = len(sorted_media_handles)
index = 1
for handle in sorted_media_handles:
gc.collect() # Reduce memory usage when there are many images.
next = None if index == total else sorted_media_handles[index]
- # Notice. Here report.photo_list[photo_handle] is used not
- # report.photo_list
- report.user.step_progress()
- self.MediaPage(report, title, (handle, self.media_dict[handle]),
- (prev, next, index, total))
+ self.report.user.step_progress()
+ self.MediaPage(self.report, title, handle, (prev, next, index, total))
prev = handle
index += 1
- report.user.end_progress()
+ self.report.user.end_progress()
def MediaListPage(self, report, title, sorted_media_handles):
"""
@@ -4680,7 +4440,7 @@ class MediaPages(BasePage):
trow = Html("tr")
tbody += trow
-
+
media_data_row = [
[index, "ColumnRowLabel"],
[self.media_ref_link(media_handle, title), "ColumnName"],
@@ -4716,7 +4476,7 @@ class MediaPages(BasePage):
# return hyperlink to its callers
return hyper
- def MediaPage(self, report, title, item, info):
+ def MediaPage(self, report, title, media_handle, info):
"""
Generate and output an individual Media page.
@@ -4728,21 +4488,18 @@ class MediaPages(BasePage):
previous media, the current page number, and the total number of
media pages
"""
- (handle, my_media_list) = item
(prev, next, page_number, total_pages) = info
self.dbase_ = report.database
- media = self.dbase_.get_object_from_handle(handle)
- # TODO. How do we pass my_media_list down for use in BasePage?
+ media = self.dbase_.get_object_from_handle(media_handle)
BasePage.__init__(self, report, title, media.gramps_id)
# get media rectangles
- _region_items = self.media_ref_rect_regions(handle)
+ _region_items = self.media_ref_rect_regions(media_handle)
- of, sio = self.report.create_file(handle, "img")
+ of, sio = self.report.create_file(media_handle, "img")
self.up = True
-# self.src_list = src_list
self.bibli = Bibliography()
# get media type to be used primarily with "img" tags
@@ -4751,13 +4508,13 @@ class MediaPages(BasePage):
if mime_type:
note_only = False
- newpath = self.copy_source_file(handle, media)
+ newpath = self.copy_source_file(media_handle, media)
target_exists = newpath is not None
else:
note_only = True
target_exists = False
- copy_thumbnail(self.report, handle, media)
+ copy_thumbnail(self.report, media_handle, media)
self.page_title = media.get_description()
mediapage, head, body = self.write_header("%s - %s" % (_("Media"), self.page_title))
@@ -4831,7 +4588,7 @@ class MediaPages(BasePage):
os.close(filed)
self.report.archive.add(dest, initial_image_path)
else:
- filed = open(os.path.join(self.html_dir, initial_image_path), 'w')
+ filed = open(os.path.join(self.html_dir, initial_image_path), 'wb')
filed.write(initial_image_data)
filed.close()
else:
@@ -4956,7 +4713,7 @@ class MediaPages(BasePage):
mediadetail += srclist
# get media references
- reflist = self.display_references(my_media_list)
+ reflist = self.display_bkref_list(MediaObject, media_handle)
if reflist is not None:
mediadetail += reflist
@@ -5019,7 +4776,8 @@ class ThumbnailPreviewPage(BasePage):
self.create_thumbs_only = report.options['create_thumbs_only']
sort = Sort(self.dbase_)
- self.photo_keys = sorted(self.report.photo_list, key =sort.by_media_title_key)
+ self.photo_keys = sorted(self.report.obj_dict[MediaObject],
+ key=sort.by_media_title_key)
if not self.photo_keys:
return
@@ -5393,186 +5151,26 @@ class PersonPages(BasePage):
self.report = report
self.db = report.database
- def add_instance(self, person_handle, bkref_path, bkref_name, bkref_gid):
- # This function constructs self.ind_list which is used in display_pages
- # and the function also calls other Web Page plugins to tell them which
- # other pages to display.
+ def display_pages(self, title):
+ """
+ Generate and output the pages under the Individuals tab, namely the
+ individual index and the individual pages.
- # FIXME: ind_dict duplicates the function of report.ind_list.
- # Eventually ind_list needs to be removed. At present, ind_dict is
- # just for test purposes - it is not actually used in the web page
- # construction.
- self.ind_dict[person_handle].add((bkref_path, bkref_name,
- bkref_gid))
- person = self.db.get_person_from_handle(person_handle)
- person_name = self.get_name(person)
- person_fname = self.report.build_url_fname(person_handle, "ppl",
- False) + self.report.ext
-
- if person:
- ############### Header section ##############
- for citation_handle in person.get_citation_list():
- self.report.tab["Citation"].add_instance(
- citation_handle, person_fname,
- person_name, person.gramps_id)
-
- ############### Name section ##############
- for name in [person.get_primary_name()] + \
- person.get_alternate_names():
- for citation_handle in name.get_citation_list():
- self.report.tab["Citation"].add_instance(
- citation_handle, person_fname,
- person_name, person.gramps_id)
-
- ############### Events section ##############
- # Now tell the events tab to display the individual events
- evt_ref_list = person.get_event_ref_list()
- if evt_ref_list:
- for evt_ref in evt_ref_list:
- event = self.db.get_event_from_handle(evt_ref.ref)
- if event:
- self.report.tab["Event"].add_instance(
- evt_ref.ref, person_fname,
- person_name, person.gramps_id)
- place_handle = event.get_place_handle()
- if place_handle:
- self.report.tab["Place"].add_instance(
- place_handle, person_fname,
- person_name, person.gramps_id)
- # If event pages are not being output, then tell the
- # media tab to display the perosn's event media. If
- # events are being displayed, then the media are linked
- # from the event tab
- if not self.report.inc_events:
- for media_ref in event.get_media_list():
- media_handle = media_ref.get_reference_handle()
- self.report.tab["Media"].add_instance(
- media_handle, person_fname,
- person_name, person.gramps_id)
-
- for citation_handle in event.get_citation_list():
- self.report.tab["Citation"].add_instance(
- citation_handle, person_fname,
- person_name, person.gramps_id)
-
- ############### Families section ##############
- # Tell the families tab to display this individuals families
- family_handle_list = person.get_family_handle_list()
- if family_handle_list:
- for family_handle in person.get_family_handle_list():
- self.report.tab["Family"].add_instance(
- family_handle, person_fname,
- person_name, person.gramps_id)
-
- # Tell the events tab to display the family events which are
- # referenced from the individual page.
- family = self.db.get_family_from_handle(family_handle)
- if family:
- family_evt_ref_list = family.get_event_ref_list()
- if family_evt_ref_list:
- for evt_ref in family_evt_ref_list:
- event = self.db.get_event_from_handle(evt_ref.ref)
- if event:
- self.report.tab["Event"].add_instance(
- evt_ref.ref, person_fname,
- person_name, person.gramps_id)
- place_handle = event.get_place_handle()
- if place_handle:
- self.report.tab["Place"].add_instance(
- place_handle, person_fname,
- person_name, person.gramps_id)
- for citation_handle in event.get_citation_list():
- self.report.tab["Citation"].add_instance(
- citation_handle, person_fname,
- person_name, person.gramps_id)
- # add the family media and the family event media if the
- # families page is not being displayed (If it is displayed,
- # the media are linked from the families page)
- if not self.report.inc_families:
- for media_ref in event.get_media_list():
- media_handle = media_ref.get_reference_handle()
- self.report.tab["Media"].add_instance(
- media_handle, person_fname,
- person_name, person.gramps_id)
-
- for lds_ord in family.get_lds_ord_list():
- for citation_handle in lds_ord.get_citation_list():
- self.report.tab["Citation"].add_instance(
- citation_handle, person_fname,
- person_name, person.gramps_id)
-
- for attr in family.get_attribute_list():
- for citation_handle in attr.get_citation_list():
- self.report.tab["Citation"].add_instance(
- citation_handle, person_fname,
- person_name, person.gramps_id)
-
- if not self.report.inc_families:
- for media_ref in family.get_media_list():
- media_handle = media_ref.get_reference_handle()
- self.report.tab["Media"].add_instance(
- media_handle, person_fname,
- person_name, person.gramps_id)
-
- ############### LDS Ordinance section ##############
- for lds_ord in person.get_lds_ord_list():
- for citation_handle in lds_ord.get_citation_list():
- self.report.tab["Citation"].add_instance(
- citation_handle, person_fname,
- person_name, person.gramps_id)
-
- ############### Attribute section ##############
- for attr in person.get_lds_ord_list():
- for citation_handle in attr.get_citation_list():
- self.report.tab["Citation"].add_instance(
- citation_handle, person_fname,
- person_name, person.gramps_id)
-
- ############### Media section ##############
- # Now tell the Media tab which media objects to display
- # First the person's media objects
- for media_ref in person.get_media_list():
- media_handle = media_ref.get_reference_handle()
- self.report.tab["Media"].add_instance(media_handle, person_fname,
- person_name,
- person.gramps_id)
-
- ############### Associations section ##############
- for person_ref in person.get_person_ref_list():
- self.report.tab["Person"].add_instance(
- person_ref.ref, person_fname,
- person_name, person.gramps_id)
-
- def display_pages(self, report, title, ind_list, place_list, source_list,
- rel_class):
- # FIXME: Most of the parameters should be removed. report is passed to
- # __init__, title appears not to be used and place_list, source_list and
- # rel_class violate modularity and should be removed.
- log.debug("ind_dict")
- for item in self.ind_dict.iteritems():
+ @param: title -- the web site title
+ """
+ log.debug("obj_dict[Person]")
+ for item in self.report.obj_dict[Person].items():
log.debug(" %s" % str(item))
- log.debug("ind_list")
- for item in ind_list:
- log.debug(" %s" % str(item))
- if len(self.ind_dict) != len(ind_list):
- log.debug("****** Length of list differs")
- log.debug("\n")
- report.user.begin_progress(_("Narrated Web Site Report"),
+ self.report.user.begin_progress(_("Narrated Web Site Report"),
_('Creating individual pages'),
- len(ind_list) + 1)
- self.IndividualListPage(report, report.title, ind_list)
- for person_handle in ind_list:
-
- # clear other's places
- place_lat_long = []
-
- report.user.step_progress()
- person = report.database.get_person_from_handle(person_handle)
-
- self.IndividualPage(report, report.title, person, ind_list,
- place_list, source_list, place_lat_long,
- rel_class)
- report.user.end_progress()
+ len(self.report.obj_dict[Person]) + 1)
+ self.IndividualListPage(self.report, title,
+ self.report.obj_dict[Person].keys())
+ for person_handle in self.report.obj_dict[Person]:
+ self.report.user.step_progress()
+ person = self.report.database.get_person_from_handle(person_handle)
+ self.IndividualPage(self.report, title, person)
+ self.report.user.end_progress()
#################################################
#
@@ -5642,6 +5240,11 @@ class PersonPages(BasePage):
first = True
prev_letter = letter
letter = first_letter(surname)
+ if letter == ' ':
+ # if surname is an empty string, then first_letter
+ # returns a space
+ letter = ' '
+ surname = _ABSENT
for person_handle in handle_list:
person = self.dbase_.get_person_from_handle(person_handle)
@@ -5654,11 +5257,11 @@ class PersonPages(BasePage):
trow.attr = 'class = "BeginSurname"'
if surname:
if letter != prev_letter:
- tcell += Html("a", surname, name = letter,
+ tcell += Html("a", html_escape(surname), name = letter,
id_ = letter,
title = "Surname with letter " + letter)
else:
- tcell += Html("a", surname,
+ tcell += Html("a", html_escape(surname),
title = "Surname with letter " + letter)
else:
tcell += " "
@@ -5667,9 +5270,9 @@ class PersonPages(BasePage):
first = False
# firstname column
- url = self.report.build_url_fname_html(person.handle, "ppl")
- trow += Html("td", self.person_link(url, person, _NAME_STYLE_FIRST, gid = person.gramps_id),
- class_ = "ColumnName")
+ link = self.new_person_link(person_handle, person=person,
+ name_style=_NAME_STYLE_FIRST)
+ trow += Html("td", link, class_ = "ColumnName")
# birth column
if showbirth:
@@ -5701,30 +5304,34 @@ class PersonPages(BasePage):
# partner column
if showpartner:
- tcell = Html("td", class_ = "ColumnPartner")
- trow += tcell
family_list = person.get_family_handle_list()
first_family = True
partner_name = None
+ tcell = ()
if family_list:
for family_handle in family_list:
family = self.dbase_.get_family_from_handle(family_handle)
partner_handle = ReportUtils.find_spouse(person, family)
if partner_handle:
- partner = self.dbase_.get_person_from_handle(partner_handle)
if not first_family:
- tcell += ", "
- use_link = check_person_database(partner_handle, ppl_handle_list)
- if use_link:
- url = self.report.build_url_fname_html(partner_handle, "ppl")
- tcell += self.person_link(url, partner, _NAME_STYLE_DEFAULT,
- gid = partner.get_gramps_id())
- else:
- tcell += self.get_name(partner)
+ # have to do this to get the comma on
+ # the same line as the link
+ if isinstance(tcell[-1], Html):
+ # tcell is an instance of Html (or
+ # of a subclass thereof)
+ tcell[-1].inside += ","
+ else:
+ tcell = tcell[:-1] +\
+ ((tcell[-1] + ", "),)
+ # Have to manipulate as tuples so that
+ # subsequent people are not nested
+ # within the first link
+ tcell += (self.new_person_link(partner_handle),)
first_family = False
else:
- tcell += " "
+ tcell = " "
+ trow += Html("td", class_ = "ColumnPartner") + tcell
# parents column
if showparents:
@@ -5743,19 +5350,19 @@ class PersonPages(BasePage):
mother_name = self.get_name(mother)
samerow = False
if mother and father:
- tcell = Html("span", father_name, class_ = "father fatherNmother")
- tcell += Html("span", mother_name, class_ = "mother")
+ tcell = (Html("span", father_name, class_ = "father fatherNmother", inline=True),
+ Html("span", mother_name, class_ = "mother", inline=True))
elif mother:
- tcell = Html("span", mother_name, class_ = "mother")
+ tcell = Html("span", mother_name, class_ = "mother", inline=True)
elif father:
- tcell = Html("span", father_name, class_ = "father")
+ tcell = Html("span", father_name, class_ = "father", inline=True)
else:
tcell = " "
samerow = True
else:
tcell = " "
samerow = True
- trow += Html("td", tcell, class_ = "ColumnParents", inline = samerow)
+ trow += Html("td", class_ = "ColumnParents", inline = samerow) + tcell
# create clear line for proper styling
# create footer section
@@ -5777,15 +5384,13 @@ class PersonPages(BasePage):
Person.UNKNOWN : _('unknown'),
}
- def IndividualPage(self, report, title, person, ind_list, place_list, src_list, place_lat_long, rel_class):
+ def IndividualPage(self, report, title, person):
+ place_lat_long = []
self.dbase_ = report.database
BasePage.__init__(self, report, title, person.get_gramps_id())
self.person = person
- self.ind_list = ind_list
- self.src_list = src_list # Used by get_citation_links()
self.bibli = Bibliography()
- self.place_list = place_list
self.sort_name = self.get_name(person)
self.name = self.get_name(person)
@@ -5800,7 +5405,7 @@ class PersonPages(BasePage):
# get the Relationship Calculator so that we can determine
# bio, half, step- siblings for use in display_ind_parents() ...
- self.rel_class = rel_class
+ self.rel_class = self.report.rel_class
of, sio = self.report.create_file(person.get_handle(), "ppl")
self.up = True
@@ -5833,7 +5438,7 @@ class PersonPages(BasePage):
individualdetail += sect3
# display relationships
- relationships = self.display_relationships(self.person, ind_list, place_lat_long)
+ relationships = self.display_relationships(self.person, place_lat_long)
if relationships is not None:
individualdetail += relationships
@@ -6215,8 +5820,14 @@ class PersonPages(BasePage):
)
person_name = self.get_name(person)
- use_link = check_person_database(person.get_handle(), self.ind_list)
- if use_link:
+ # This does not use [new_]person_link because the requirements are
+ # unique
+ result = self.report.obj_dict.get(Person).get(person.handle)
+ if result is None or result[0] == "":
+ # The person is not included in the webreport or there is no link
+ # to them
+ boxbg += Html("span", person_name, class_ = "unlinked", inline = True)
+ else:
thumbnailUrl = None
if self.create_media and col < 5:
photolist = person.get_media_list()
@@ -6242,9 +5853,13 @@ class PersonPages(BasePage):
if win():
thumbnailUrl = thumbnailUrl.replace('\\',"/")
url = self.report.build_url_fname_html(person.handle, "ppl", True)
- boxbg += self.person_link(url, person, name_style = True, thumbnailUrl = thumbnailUrl)
- else:
- boxbg += Html("span", person_name, class_ = "unlinked", inline = True)
+ if thumbnailUrl is None:
+ boxbg += Html("a", href=url, class_="noThumb") + person_name
+ else:
+ thumb = Html("span", class_ = "thumbnail") + \
+ (Html("img", src = thumbnailUrl, alt = "Image: "
+ + person_name))
+ boxbg += Html("a", href=url) + thumb + person_name
shadow = Html("div", class_ = "shadow", inline = True, style="top: %dpx; left: %dpx;"
% (top + _SHADOW, xoff + _SHADOW))
@@ -6378,19 +5993,15 @@ class PersonPages(BasePage):
table += tbody
for person_ref in assoclist:
- if person_ref.ref not in self.report.person_handles:
- continue # TODO why skip persons?
trow = Html("tr")
tbody += trow
- person = self.report.database.get_person_from_handle(person_ref.ref)
- url = self.report.build_url_fname_html(person.handle, "ppl", True)
- person_link = self.person_link(url, person,
- _NAME_STYLE_DEFAULT, gid=person.get_gramps_id())
+ person_lnk = self.new_person_link(person_ref.ref,
+ uplink=True)
index = 0
for data in [
- person_link,
+ person_lnk,
person_ref.get_relation(),
self.dump_notes(person_ref.get_note_list()),
self.get_citation_links(person_ref.get_citation_list()),
@@ -6485,7 +6096,7 @@ class PersonPages(BasePage):
"""
self.page_title = self.sort_name
thumbnail = self.display_first_image_as_thumbnail(self.person.get_media_list(), self.person)
- section_title = Html("h3", self.page_title, inline =True) + \
+ section_title = Html("h3", html_escape(self.page_title), inline =True) + \
(Html('sup') +\
(Html('small') +
self.get_citation_links(self.person.get_citation_list())))
@@ -6505,7 +6116,7 @@ class PersonPages(BasePage):
# Names [and their sources]
for name in all_names:
- pname = _nd.display_name(name)
+ pname = html_escape(_nd.display_name(name))
# if name == primary_name:
# pname += self.get_citation_links(self.person.get_citation_list() )
pname += self.get_citation_links( name.get_citation_list() )
@@ -6613,7 +6224,8 @@ class PersonPages(BasePage):
"""
will create the events table
- @param: place_lat_long -- for use in Family Map Pages
+ @param: place_lat_long -- for use in Family Map Pages. This will be None
+ if called from Family pages, which do not create a Family Map
"""
event_ref_list = self.person.get_event_ref_list()
if not event_ref_list:
@@ -6650,16 +6262,10 @@ class PersonPages(BasePage):
"""
This will display a parent ...
"""
- person = self.dbase_.get_person_from_handle(handle)
tcell1 = Html("td", title, class_ = "ColumnAttribute", inline = True)
tcell2 = Html("td", class_ = "ColumnValue")
- use_link = check_person_database(handle, self.ind_list)
- if use_link:
- url = self.report.build_url_fname_html(handle, "ppl", True)
- tcell2 += self.person_link(url, person, _NAME_STYLE_DEFAULT, gid =person.get_gramps_id())
- else:
- tcell2 += self.get_name(person)
+ tcell2 += self.new_person_link(handle, uplink=True)
if rel and rel != ChildRefType(ChildRefType.BIRTH):
tcell2 += ''.join([' '] *3 + ['(%s)']) % str(rel)
@@ -6746,7 +6352,7 @@ class PersonPages(BasePage):
tcell = Html("td", class_ = "ColumnValue", inline = True)
tcell += " "
- tcell += self.display_child_link(child_handle, self.ind_list)
+ tcell += self.display_child_link(child_handle)
trow += tcell
tcell = Html("td", frelmrel, class_ = "ColumnValue",
inline = True)
@@ -6834,12 +6440,7 @@ class PersonPages(BasePage):
will produce a hyperlink for a pedigree person ...
"""
- use_link = check_person_database(person.get_handle(), self.ind_list)
- if use_link:
- url = self.report.build_url_fname_html(person.handle, "ppl", True)
- hyper = self.person_link(url, person, _NAME_STYLE_DEFAULT)
- else:
- hyper = self.get_name(person)
+ hyper = self.new_person_link(person.handle, person=person, uplink=True)
return hyper
def pedigree_family(self):
@@ -6904,67 +6505,46 @@ class RepositoryPages(BasePage):
# The base class 'BasePage' is initialised once for each page that is
# displayed.
- # The 'display_pages' function is passed place_list, source_list and
- # rel_class, but this violates modularity and independence, and eventually
- # these parameters should be removed.
def __init__(self, report):
self.repos_dict = defaultdict(set)
+ self.report = report
pass
- def add_instance(self, repos_handle, bkref_path, bkref_name, bkref_gid):
- self.repos_dict[repos_handle].add((bkref_path, bkref_name,
- bkref_gid))
- # FIXME: repos_dict duplicates the function of report.repolist.
- # Eventually repolist needs to be removed. At present, repos_dict is
- # just for test purposes - it is not actually used in the web page
- # construction.
+ def display_pages(self, title):
+ """
+ Generate and output the pages under the Repository tab, namely the
+ repository index and the individual repository pages.
- # Note that, at present, ALL repositories are output, rather than just
- # the repositories that are linked from other objects. This is done by
- # settng repolist from self.database.get_repository_handles()
-
- def display_pages(self, report, title, repolist, source_list,
- db_repository_handles):
- # FIXME: Most of the parameters should be removed. report is passed to
- # __init__, title appears not to be used and db_media_handles and
- # source_list violate modularity and should be removed.
- log.debug("repos_dict")
- for item in self.repos_dict.iteritems():
+ @param: title -- the web site title
+ """
+ log.debug("obj_dict[Person]")
+ for item in self.report.obj_dict[Repository].items():
log.debug(" %s" % str(item))
- log.debug("repolist")
- for item in repolist:
- log.debug(" %s" % str(item))
- if len(self.repos_dict) != len(repolist):
- log.debug("****** Length of list differs")
- log.debug("\n")
# set progress bar pass for Repositories
- report.user.begin_progress(_("Narrated Web Site Report"),
+ self.report.user.begin_progress(_("Narrated Web Site Report"),
_('Creating repository pages'),
- len(repolist) + 1)
- repos_dict = {}
-
+ len(self.report.obj_dict[Repository]) + 1)
# Sort the repositories
- for repository_handle in repolist:
- repository = report.database.get_repository_from_handle(repository_handle)
+ repos_dict = {}
+ for repository_handle in self.report.obj_dict[Repository]:
+ repository = self.report.database.get_repository_from_handle(repository_handle)
key = repository.get_name() + str(repository.get_gramps_id())
repos_dict[key] = (repository, repository_handle)
- keys = sorted(repos_dict, key = locale.strxfrm)
+ keys = sorted(repos_dict, key = SORT_KEY)
# RepositoryListPage Class
- self.RepositoryListPage(report, title, repos_dict, keys, db_repository_handles)
+ self.RepositoryListPage(self.report, title, repos_dict, keys)
for index, key in enumerate(keys):
(repo, handle) = repos_dict[key]
- report.user.step_progress()
- self.RepositoryPage(report, title, repo, handle, source_list)
- report.user.end_progress()
+ self.report.user.step_progress()
+ self.RepositoryPage(self.report, title, repo, handle)
+ self.report.user.end_progress()
-#class RepositoryListPage(BasePage):
- def RepositoryListPage(self, report, title, repos_dict, keys,
- db_repository_handles):
+ def RepositoryListPage(self, report, title, repos_dict, keys):
self.dbase_ = report.database
BasePage.__init__(self, report, title)
inc_repos = self.report.options["inc_repository"]
@@ -7018,7 +6598,6 @@ class RepositoryPages(BasePage):
repo.get_gramps_id(), self.up), class_ = "ColumnName")
else:
trow += Html("td", "[ untitled ]", class_ = "ColumnName")
- db_repository_handles.append(handle)
# add clearline for proper styling
# add footer section
@@ -7029,7 +6608,7 @@ class RepositoryPages(BasePage):
# and close the file
self.XHTMLWriter(repolistpage, of, sio)
- def RepositoryPage(self, report, title, repo, handle, source_list):
+ def RepositoryPage(self, report, title, repo, handle):
gid = repo.get_gramps_id()
BasePage.__init__(self, report, title, gid)
self.dbase_ = report.database
@@ -7081,7 +6660,9 @@ class RepositoryPages(BasePage):
repositorydetail += notelist
# display Repository Referenced Sources...
- repositorydetail += self.__write_referenced_sources(handle, source_list)
+ ref_list = self.display_bkref_list(Repository, repo.get_handle())
+ if ref_list is not None:
+ repositorydetail += ref_list
# add clearline for proper styling
# add footer section
@@ -7092,47 +6673,6 @@ class RepositoryPages(BasePage):
# and close the file
self.XHTMLWriter(repositorypage, of, sio)
- def __write_referenced_sources(self, handle, source_list):
- """
- This procedure writes out each of the sources related to the repository.
- """
- repository = self.dbase_.get_repository_from_handle(handle)
- if not repository:
- return None
-
- repository_source_handles = [handle for (object_type, handle) in
- self.dbase_.find_backlink_handles(handle, include_classes = ['Source'])]
-
- # begin Repository Referenced Sources...
- with Html("div", class_ ="Subsection", id ="referenced_sources") as section:
- section += Html("h4", _("Referenced Sources"), inline =True)
-
- source_nbr = 0
- for source_handle in repository_source_handles:
- source = self.dbase_.get_source_from_handle(source_handle)
- if source:
-
- # Get the list of references from this source to our repo
- # (can be more than one, technically)
- for reporef in source.get_reporef_list():
- if reporef.ref == repository.get_handle():
- source_nbr += 1
-
- if source_handle in source_list:
- source_name = self.source_link(source_handle, source.get_title(),
- source.get_gramps_id(), uplink = self.up)
- else:
- source_name = source.get_title()
-
- title = (('%(nbr)d. %(name)s (%(type)s) : %(call)s') %
- {'nbr' : source_nbr,
- 'name' : source_name,
- 'type' : str(reporef.get_media_type()),
- 'call' : reporef.get_call_number()})
- ordered = Html("ol", title)
- section += ordered
- return section
-
class AddressBookListPage(BasePage):
def __init__(self, report, title, has_url_addr_res):
self.dbase_ = report.database
@@ -7242,8 +6782,8 @@ class AddressBookPage(BasePage):
with Html("div", class_ = "content", id = "AddressBookDetail") as addressbookdetail:
body += addressbookdetail
- url = self.report.build_url_fname_html(person.handle, "ppl", True)
- addressbookdetail += Html("h3", self.person_link(url, person, _NAME_STYLE_DEFAULT))
+ link = self.new_person_link(person_handle, uplink=True, person=person)
+ addressbookdetail += Html("h3", link)
# individual has an address
if has_add:
@@ -7392,7 +6932,6 @@ class NavWebReport(Report):
else:
self.html_dir = self.target_path
self.warn_dir = True # Only give warning once.
- self.photo_list = {}
def write_report(self):
@@ -7450,10 +6989,12 @@ class NavWebReport(Report):
self.user.notify_error(_("Could not create %s") % self.target_path,
str(value))
return
+ config.set('paths.website-directory',
+ os.path.dirname(self.target_path) + os.sep)
# for use with discovering biological, half, and step siblings for use
# in display_ind_parents()...
- rel_class = get_relationship_calculator()
+ self.rel_class = get_relationship_calculator()
#################################################
#
@@ -7506,35 +7047,7 @@ class NavWebReport(Report):
#
#################################################
- # Build the person list, gets the person list and applies the requested
- # filter
- self.person_handles = {}
- ind_list = self.database.iter_person_handles()
-
- self.user.begin_progress(_("Narrated Web Site Report"),
- _('Applying Filter...'),
- self.database.get_number_of_people())
- ind_list = self.filter.apply(self.database, ind_list,
- self.user.step_progress)
- self.user.end_progress()
- # FIXME: Maybe person_handles could be removed as it just seems to
- # duplicate ind_list
- for handle in ind_list:
- self.person_handles[handle] = True
- # FIXME: It would be better if calling add_instance could be
- # incorporated into self.filter.apply, because then it would be included
- # within the progress bar, and would only entail one pass of the
- # ind_list, rather than two. This may not be possible, because
- # src/Filters/_GenericFilters.apply is not guaranteed to call
- # cb_progress for each element of id_list, but only "occasionally'.
-
- # FIXME: At present, person_handles has to be generated before calling
- # add_instance, because getting the web page file names which are used
- # in add_instance may need person_handles to exist.
- for handle in ind_list:
- # The back link references are not needed, because the Individual
- # pages do not have back links.
- self.tab["Person"].add_instance(handle, "", "", "" )
+ self._build_obj_dict()
#################################################
#
@@ -7542,73 +7055,47 @@ class NavWebReport(Report):
#
#################################################
- # initialize place_lat_long variable for use in Family Map Pages
- place_lat_long = []
- place_list = {}
- source_list = {}
-
self.base_pages()
# build classes IndividualListPage and IndividualPage
- self.tab["Person"].display_pages(self, self.title, ind_list, place_list,
- source_list, rel_class)
+ self.tab["Person"].display_pages(self.title)
- self.build_gendex(ind_list, place_list, source_list, place_lat_long,
- rel_class)
+ self.build_gendex(self.obj_dict[Person])
# build classes SurnameListPage and SurnamePage
- self.surname_pages(ind_list)
+ self.surname_pages(self.obj_dict[Person])
# build classes FamilyListPage and FamilyPage
- db_family_handles = []
if self.inc_families:
- self.tab["Family"].display_pages(self, ind_list, place_list,
- place_lat_long, db_family_handles)
-# self.family_pages(ind_list, place_list, place_lat_long, db_family_handles)
+ self.tab["Family"].display_pages(self.title)
# build classes EventListPage and EventPage
- db_event_handles = []
if self.inc_events:
- self.tab["Event"].display_pages(self, self.title, ind_list,
- db_event_handles)
-# self.event_pages(ind_list, db_event_handles)
+ self.tab["Event"].display_pages(self.title)
# build classes PlaceListPage and PlacePage
- db_place_handles = []
- self.tab["Place"].display_pages(self, self.title, place_list,
- source_list, db_place_handles)
+ self.tab["Place"].display_pages(self.title)
# build classes RepositoryListPage and RepositoryPage
- db_repository_handles = []
if self.inc_repository:
- repolist = self.database.get_repository_handles()
- if len(repolist):
- self.tab["Repository"].display_pages(self, self.title,
- repolist, source_list,
- db_repository_handles)
+ self.tab["Repository"].display_pages(self.title)
# build classes MediaListPage and MediaPage
- db_media_handles = []
if self.inc_gallery:
if not self.create_thumbs_only:
- self.tab["Media"].display_pages(self, self.title)
-# self.media_pages(source_list, db_media_handles)
+ self.tab["Media"].display_pages(self.title)
# build Thumbnail Preview Page...
self.thumbnail_preview_page()
# build classes AddressBookListPage and AddressBookPage
if self.inc_addressbook:
- self.addressbook_pages(ind_list)
-
- database_handles_list = (db_family_handles, db_event_handles, db_place_handles,
- db_repository_handles, db_media_handles)
+ self.addressbook_pages(self.obj_dict[Person])
# build classes SourceListPage and SourcePage
- # has been moved so that all Sources can be found before processing...
- self.tab["Source"].display_pages(self, self.title, source_list)
+ self.tab["Source"].display_pages(self.title)
- # copy all of the neccessary files for NarrativeWeb report...
+ # copy all of the neccessary files
self.copy_narrated_files()
# if an archive is being used, close it?
@@ -7623,24 +7110,391 @@ class NavWebReport(Report):
error += '\n ...'
self.user.warn(_("Missing media objects:"), error)
-# def build_person_list(self):
-# """
-# Builds the person list. Gets all the handles from the database
-# and then applies the chosen filter:
-# """
-# # gets the person list and applies the requested filter
-# self.person_handles = {}
-# ind_list = self.database.iter_person_handles()
-#
-# self.user.begin_progress(_("Narrated Web Site Report"),
-# _('Applying Filter...'),
-# self.database.get_number_of_people())
-# ind_list = self.filter.apply(self.database, ind_list,
-# self.user.step_progress)
-# self.user.end_progress()
-# for handle in ind_list:
-# self.person_handles[handle] = True
-# return ind_list
+ ###########################################################################
+ #
+ # Construct the dictionaries of objects to be included in the reports. There
+ # are two dictionaries, which have the same structure: they are two level
+ # dictionaries,the first key is the class of object (e.g. gen.lib.Person).
+ # The second key is the handle of the object.
+ #
+ # For the obj_dict, the value is a tuple containing the gramps_id, the text
+ # name for the object, and the file name for the display.
+ #
+ # For the bkref_dict, the value is a tuple containg the class of object and
+ # the handle for the object that refers to the 'key' object.
+ ###########################################################################
+
+ def _build_obj_dict(self):
+ _obj_class_list = (Person, Family, Event, Place, Source, Citation,
+ MediaObject, Repository, Note, Tag)
+
+ # setup a dictionary of the required structure
+ self.obj_dict = defaultdict(lambda: defaultdict(set))
+ self.bkref_dict = defaultdict(lambda: defaultdict(set))
+
+
+ # initialise the dictionary to empty in case no objects of any
+ # particular class are incuded in the web report
+ for obj_class in _obj_class_list:
+ self.obj_dict[obj_class] = defaultdict(set)
+
+ ind_list = self.database.iter_person_handles()
+ self.user.begin_progress(_("Narrated Web Site Report"),
+ _('Applying Person Filter...'),
+ self.database.get_number_of_people())
+ ind_list = self.filter.apply(self.database, ind_list,
+ self.user.step_progress)
+ self.user.end_progress()
+
+ self.user.begin_progress(_("Narrated Web Site Report"),
+ _('Constructing list of other objects...'),
+ sum(1 for _ in ind_list))
+ for handle in ind_list:
+ # FIXME work around bug that self.database.iter under python 3
+ # returns (binary) data rather than text
+ if not isinstance(handle, UNITYPE):
+ handle = handle.decode('utf-8')
+ self.user.step_progress()
+ self._add_person(handle, "", "")
+ self.user.end_progress()
+
+ log.debug("final object dictionary \n" +
+ "".join(("%s: %s\n" % item) for item in self.obj_dict.items()))
+
+ log.debug("final backref dictionary \n" +
+ "".join(("%s: %s\n" % item) for item in self.bkref_dict.items()))
+
+ def _add_person(self, person_handle, bkref_class, bkref_handle):
+ """
+ Add person_handle to the obj_dict, and recursively all referenced
+ objects
+ """
+ person = self.database.get_person_from_handle(person_handle)
+ person_name = self.get_person_name(person)
+ person_fname = self.build_url_fname(person_handle, "ppl",
+ False) + self.ext
+ self.obj_dict[Person][person_handle] = (person_fname, person_name,
+ person.gramps_id)
+ self.bkref_dict[Person][person_handle].add((bkref_class, bkref_handle))
+
+ if person:
+ ############### Header section ##############
+ for citation_handle in person.get_citation_list():
+ self._add_citation(citation_handle, Person, person_handle)
+
+ ############### Name section ##############
+ for name in [person.get_primary_name()] + \
+ person.get_alternate_names():
+ for citation_handle in name.get_citation_list():
+ self._add_citation(citation_handle, Person, person_handle)
+
+ ############### Events section ##############
+ # Now tell the events tab to display the individual events
+ evt_ref_list = person.get_event_ref_list()
+ if evt_ref_list:
+ for evt_ref in evt_ref_list:
+ event = self.database.get_event_from_handle(evt_ref.ref)
+ if event:
+ self._add_event(evt_ref.ref, Person, person_handle)
+ place_handle = event.get_place_handle()
+ if place_handle:
+ self._add_place(place_handle, Person, person_handle)
+ # If event pages are not being output, then tell the
+ # media tab to display the perosn's event media. If
+ # events are being displayed, then the media are linked
+ # from the event tab
+ if not self.inc_events:
+ for media_ref in event.get_media_list():
+ media_handle = media_ref.get_reference_handle()
+ self._add_media(media_handle, Person, person_handle)
+
+ for citation_handle in event.get_citation_list():
+ self._add_citation(citation_handle, Person, person_handle)
+
+ ############### Families section ##############
+ # Tell the families tab to display this individuals families
+ family_handle_list = person.get_family_handle_list()
+ if family_handle_list:
+ for family_handle in person.get_family_handle_list():
+ self._add_family(family_handle, Person, person_handle)
+
+ # Tell the events tab to display the family events which are
+ # referenced from the individual page.
+ family = self.database.get_family_from_handle(family_handle)
+ if family:
+ family_evt_ref_list = family.get_event_ref_list()
+ if family_evt_ref_list:
+ for evt_ref in family_evt_ref_list:
+ event = self.database.get_event_from_handle(evt_ref.ref)
+ if event:
+ self._add_event(evt_ref.ref, Person, person_handle)
+ place_handle = event.get_place_handle()
+ if place_handle:
+ self._add_place(place_handle, Person, person_handle)
+ for citation_handle in event.get_citation_list():
+ self._add_citation(
+ citation_handle, Person, person_handle)
+ # add the family media and the family event media if the
+ # families page is not being displayed (If it is displayed,
+ # the media are linked from the families page)
+ if not self.inc_families:
+ for media_ref in event.get_media_list():
+ media_handle = media_ref.get_reference_handle()
+ self._add_media(
+ media_handle, Person, person_handle)
+
+ for lds_ord in family.get_lds_ord_list():
+ for citation_handle in lds_ord.get_citation_list():
+ self._add_citation(citation_handle, Person, person_handle)
+
+ for attr in family.get_attribute_list():
+ for citation_handle in attr.get_citation_list():
+ self._add_citation(citation_handle, Person, person_handle)
+
+ if not self.inc_families:
+ for media_ref in family.get_media_list():
+ media_handle = media_ref.get_reference_handle()
+ self._add_media(media_handle, Person, person_handle)
+
+ ############### LDS Ordinance section ##############
+ for lds_ord in person.get_lds_ord_list():
+ for citation_handle in lds_ord.get_citation_list():
+ self._add_citation(citation_handle, Person, person_handle)
+
+ ############### Attribute section ##############
+ for attr in person.get_lds_ord_list():
+ for citation_handle in attr.get_citation_list():
+ self._add_citation(citation_handle, Person, person_handle)
+
+ ############### Media section ##############
+ # Now tell the Media tab which media objects to display
+ # First the person's media objects
+ for media_ref in person.get_media_list():
+ media_handle = media_ref.get_reference_handle()
+ self._add_media(media_handle, Person, person_handle)
+
+
+ def get_person_name(self, person):
+ """
+ Return a string containing the person's primary name in the name
+ format chosen in the web report options
+
+ @param: person -- person object from database
+ """
+ name_format = self.options['name_format']
+ primary_name = person.get_primary_name()
+ name = Name(primary_name)
+ name.set_display_as(name_format)
+ return _nd.display_name(name)
+
+ def _add_family(self, family_handle, bkref_class, bkref_handle):
+
+ family = self.database.get_family_from_handle(family_handle)
+ family_name = self.get_family_name(family)
+ if self.inc_families:
+ family_fname = self.build_url_fname(family_handle, "fam",
+ False) + self.ext
+ else:
+ family_fname = ""
+ self.obj_dict[Family][family_handle] = (family_fname, family_name,
+ family.gramps_id)
+ self.bkref_dict[Family][family_handle].add((bkref_class, bkref_handle))
+
+ if self.inc_gallery:
+ for media_ref in family.get_media_list():
+ media_handle = media_ref.get_reference_handle()
+ self._add_media(media_handle, Family, family_handle)
+
+ ############### Events section ##############
+ for evt_ref in family.get_event_ref_list():
+ event = self.database.get_event_from_handle(evt_ref.ref)
+ place_handle = event.get_place_handle()
+ if place_handle:
+ self._add_place(place_handle, Family, family_handle)
+
+ if self.inc_events:
+ # detail for family events are displayed on the events pages as
+ # well as on this family page
+ self._add_event(evt_ref.ref, Family, family_handle)
+ else:
+ # There is no event page. Family events are displayed on the
+ # family page, but the associated family event media may need to
+ # be displayed on the media page
+ if self.inc_gallery:
+ for media_ref in event.get_media_list():
+ media_handle = media_ref.get_reference_handle()
+ self._add_media(media_handle, Family, family_handle)
+
+ ############### LDS Ordinance section ##############
+ for lds_ord in family.get_lds_ord_list():
+ for citation_handle in lds_ord.get_citation_list():
+ self._add_citation(citation_handle, Family, family_handle)
+
+ ############### Attributes section ##############
+ for attr in family.get_attribute_list():
+ for citation_handle in attr.get_citation_list():
+ self._add_citation(citation_handle, Family, family_handle)
+
+ ############### Sources section ##############
+ for citation_handle in family.get_citation_list():
+ self._add_citation(citation_handle, Family, family_handle)
+
+ def get_family_name(self, family):
+ """
+ Return a string containing the name of the family (e.g. 'Family of John
+ Doe and Jane Doe')
+
+ @param: family -- family object from database
+ """
+ husband_handle = family.get_father_handle()
+ spouse_handle = family.get_mother_handle()
+
+ husband = self.database.get_person_from_handle(husband_handle)
+ spouse = self.database.get_person_from_handle(spouse_handle)
+
+ if husband and spouse:
+ husband_name = self.get_person_name(husband)
+ spouse_name = self.get_person_name(spouse)
+ title_str = _("Family of %s and %s") % (husband_name, spouse_name)
+ elif husband:
+ husband_name = self.get_person_name(husband)
+ # Only the name of the husband is known
+ title_str = _("Family of %s") % husband_name
+ elif spouse:
+ spouse_name = self.get_person_name(spouse)
+ # Only the name of the wife is known
+ title_str = _("Family of %s") % spouse_name
+ else:
+ title_str = ''
+
+ return title_str
+
+ def _add_event(self, event_handle, bkref_class, bkref_handle):
+ event = self.database.get_event_from_handle(event_handle)
+ event_name = event.get_description()
+ # The event description can be Y on import from GEDCOM. See the
+ # following quote from the GEDCOM spec: "The occurrence of an event is
+ # asserted by the presence of either a DATE tag and value or a PLACe tag
+ # and value in the event structure. When neither the date value nor the
+ # place value are known then a Y(es) value on the parent event tag line
+ # is required to assert that the event happened.""
+ if event_name == "" or event_name is None or event_name =='Y':
+ event_name = str(event.get_type())
+ if self.inc_events:
+ event_fname = self.build_url_fname(event_handle, "evt",
+ False) + self.ext
+ else:
+ event_fname = ""
+ self.obj_dict[Event][event_handle] = (event_fname, event_name,
+ event.gramps_id)
+ self.bkref_dict[Event][event_handle].add((bkref_class, bkref_handle))
+
+ ############### Attribute section ##############
+ for attr in event.get_attribute_list():
+ for citation_handle in attr.get_citation_list():
+ self._add_citation(citation_handle, Event, event_handle)
+
+ ############### Source section ##############
+ for citation_handle in event.get_citation_list():
+ self._add_citation(citation_handle, Event, event_handle)
+
+ ############### Media section ##############
+ if self.inc_gallery:
+ for media_ref in event.get_media_list():
+ media_handle = media_ref.get_reference_handle()
+ self._add_media(media_handle, Event, event_handle)
+
+ def _add_place(self, place_handle, bkref_class, bkref_handle):
+ place = self.database.get_place_from_handle(place_handle)
+ place_name = place.get_title()
+ place_fname = self.build_url_fname(place_handle, "plc",
+ False) + self.ext
+ self.obj_dict[Place][place_handle] = (place_fname, place_name,
+ place.gramps_id)
+ self.bkref_dict[Place][place_handle].add((bkref_class, bkref_handle))
+
+ ############### Media section ##############
+ if self.inc_gallery:
+ for media_ref in place.get_media_list():
+ media_handle = media_ref.get_reference_handle()
+ self._add_media(media_handle, Place, place_handle)
+
+ ############### Sources section ##############
+ for citation_handle in place.get_citation_list():
+ self._add_citation(citation_handle, Place, place_handle)
+
+ def _add_source(self, source_handle, bkref_class, bkref_handle):
+ source = self.database.get_source_from_handle(source_handle)
+ source_name = source.get_title()
+ source_fname = self.build_url_fname(source_handle, "src",
+ False) + self.ext
+ self.obj_dict[Source][source_handle] = (source_fname, source_name,
+ source.gramps_id)
+ self.bkref_dict[Source][source_handle].add((bkref_class, bkref_handle))
+
+ ############### Media section ##############
+ if self.inc_gallery:
+ for media_ref in source.get_media_list():
+ media_handle = media_ref.get_reference_handle()
+ self._add_media(media_handle, Source, source_handle)
+
+ ############### Repository section ##############
+ if self.inc_repository:
+ for repo_ref in source.get_reporef_list():
+ repo_handle = repo_ref.get_reference_handle()
+ self._add_repository(repo_handle, Source, source_handle)
+
+ def _add_citation(self, citation_handle, bkref_class, bkref_handle):
+ citation = self.database.get_citation_from_handle(citation_handle)
+ # If Page is none, we want to make sure that a tuple is generated for
+ # the source backreference
+ citation_name = citation.get_page() or ""
+ source_handle = citation.get_reference_handle()
+ self.obj_dict[Citation][citation_handle] = ("", citation_name,
+ citation.gramps_id)
+ self.bkref_dict[Citation][citation_handle].add((bkref_class, bkref_handle))
+
+ ############### Source section ##############
+ self._add_source(source_handle, Citation, citation_handle)
+
+ ############### Media section ##############
+ if self.inc_gallery:
+ for media_ref in citation.get_media_list():
+ media_handle = media_ref.get_reference_handle()
+ self._add_media(media_handle, Citation, citation_handle)
+
+ def _add_media(self, media_handle, bkref_class, bkref_handle):
+ media = self.database.get_object_from_handle(media_handle)
+ media_name = "Media"
+ if self.inc_gallery:
+ media_fname = self.build_url_fname(media_handle, "img",
+ False) + self.ext
+ else:
+ media_fname = ""
+ self.obj_dict[MediaObject][media_handle] = (media_fname, media_name,
+ media.gramps_id)
+ self.bkref_dict[MediaObject][media_handle].add((bkref_class, bkref_handle))
+
+ ############### Attribute section ##############
+ for attr in media.get_attribute_list():
+ for citation_handle in attr.get_citation_list():
+ self._add_citation(citation_handle, MediaObject, media_handle)
+
+ ############### Sources section ##############
+ for citation_handle in media.get_citation_list():
+ self._add_citation(citation_handle, MediaObject, media_handle)
+
+ def _add_repository(self, repos_handle, bkref_class, bkref_handle):
+ repos = self.database.get_repository_from_handle(repos_handle)
+ repos_name = repos.name
+ if self.inc_repository:
+ repos_fname = self.build_url_fname(repos_handle, "repo",
+ False) + self.ext
+ else:
+ repos_fname = ""
+ self.obj_dict[Repository][repos_handle] = (repos_fname, repos_name,
+ repos.gramps_id)
+ self.bkref_dict[Repository][repos_handle].add((bkref_class, bkref_handle))
def copy_narrated_files(self):
"""
@@ -7678,20 +7532,6 @@ class NavWebReport(Report):
fname = CSS["DropDown-Menus"]["filename"]
self.copy_file(fname, "narrative-menus.css", "css")
- # copy Animated Citations Drop Down Layout if being used, copy its style sheet
- # and its associated javascript file?
- if (self.css == _("Basic-Blue") or self.css == _("Visually Impaired")):
- if self.citationreferents == "DropDown":
- fname = CSS["Animated DropDown"]["javascript"]
- self.copy_file(fname, "jquery-1.7.1.min.js", "scripts")
-
- if self.citationreferents == "DropDown":
- fname = CSS["Animated DropDown"]["filename"]
- else:
- fname = CSS["Outline"]["filename"]
- self.copy_file(fname, "narrative-citations.css", "css")
-
-
# copy narrative-maps Style Sheet if Place or Family Map pages are being created?
if (self.placemappages or self.familymappages):
fname = CSS["NarrativeMaps"]["filename"]
@@ -7721,27 +7561,7 @@ class NavWebReport(Report):
fdir, fname = os.path.split(from_path)
self.copy_file(from_path, fname, "images")
-# def person_pages(self, ind_list, place_list, source_list, place_lat_long, rel_class):
-# """
-# creates IndividualListPage, IndividualPage, and gendex page
-# """
-# self.user.begin_progress(_("Narrated Web Site Report"),
-# _('Creating individual pages'),
-# len(ind_list) + 1)
-# IndividualListPage(self, self.title, ind_list)
-# for person_handle in ind_list:
-#
-# # clear other's places
-# place_lat_long = []
-#
-# self.user.step_progress()
-# person = self.database.get_person_from_handle(person_handle)
-#
-# IndividualPage(self, self.title, person, ind_list, place_list, source_list, place_lat_long, rel_class)
-# self.user.end_progress()
-
- def build_gendex(self, ind_list, place_list, source_list, place_lat_long,
- rel_class):
+ def build_gendex(self, ind_list):
if self.inc_gendex:
self.user.begin_progress(_("Narrated Web Site Report"),
_('Creating GENDEX file'), len(ind_list))
@@ -7802,123 +7622,16 @@ class NavWebReport(Report):
self.user.step_progress()
self.user.end_progress()
-# def family_pages(self, ppl_handle_list, place_list, place_lat_long, db_family_handles):
-# """
-# creates the FamiliesListPage and FamilyPages
-# """
-# FamilyListPage(self, self.title, ppl_handle_list, db_family_handles)
-#
-# self.user.begin_progress(_("Narrated Web Site Report"),
-# _("Creating family pages..."),
-# len(db_family_handles))
-#
-# for family_handle in db_family_handles:
-# FamilyPage(self, self.title, family_handle, place_list, ppl_handle_list, place_lat_long)
-# self.user.step_progress()
-# self.user.end_progress()
-
-# def place_pages(self, place_list, source_list, db_place_handles):
-# """
-# creates PlaceListPage and PlacePage
-# """
-# self.user.begin_progress(_("Narrated Web Site Report"),
-# _("Creating place pages"), len(place_list))
-#
-# PlaceListPage(self, self.title, place_list, db_place_handles)
-#
-# for place in place_list:
-# PlacePage(self, self.title, place, source_list, place_list)
-# self.user.step_progress()
-# self.user.end_progress()
-
-# def event_pages(self, ind_list, db_event_handles):
-# """
-# a dump of all the events sorted by event type, date, and surname
-# for classes EventListPage and EventPage
-# """
-# # get event types and the handles that go with that type by individuals
-# event_handle_list, event_types = build_event_data_by_individuals(self.database, ind_list)
-#
-# self.user.begin_progress(_("Narrated Web Site Report"),
-# _("Creating event pages"),
-# len(event_handle_list))
-# EventListPage(self, self.title, event_types, event_handle_list, ind_list, db_event_handles)
-#
-# for event_handle in event_handle_list:
-# EventPage(self, self.title, event_handle, ind_list)
-#
-# self.user.step_progress()
-# self.user.end_progress()
-
-# def media_pages(self, source_list, db_media_handles):
-# """
-# creates MediaListPage and MediaPage
-# """
-# self.user.begin_progress(_("Narrated Web Site Report"),
-# _("Creating media pages"),
-# len(self.photo_list))
-#
-# MediaListPage(self, self.title, db_media_handles)
-#
-# prev = None
-# total = len(self.photo_list)
-# sort = Sort.Sort(self.database)
-# photo_keys = sorted(self.photo_list, key =sort.by_media_title_key)
-#
-# index = 1
-# for photo_handle in photo_keys:
-# gc.collect() # Reduce memory usage when there are many images.
-# next = None if index == total else photo_keys[index]
-# # Notice. Here self.photo_list[photo_handle] is used not self.photo_list
-# MediaPage(self, self.title, photo_handle, source_list, self.photo_list[photo_handle],
-# (prev, next, index, total))
-# self.user.step_progress()
-# prev = photo_handle
-# index += 1
-# self.user.end_progress()
-
def thumbnail_preview_page(self):
"""
creates the thumbnail preview page
"""
self.user.begin_progress(_("Narrated Web Site Report"),
_("Creating thumbnail preview page..."),
- len(self.photo_list))
+ len(self.obj_dict[MediaObject]))
ThumbnailPreviewPage(self, self.title, self.user.step_progress)
self.user.end_progress()
-# def repository_pages(self, repolist, source_list):
-# """
-# will create RepositoryPage() and RepositoryListPage()
-# """
-# repos_dict = {}
-#
-# # Sort the repositories
-# for repository_handle in repolist:
-# repository = self.database.get_repository_from_handle(repository_handle)
-# key = repository.get_name() + str(repository.get_gramps_id())
-# repos_dict[key] = (repository, repository_handle)
-#
-# keys = sorted(repos_dict, key = locale.strxfrm)
-#
-# # set progress bar pass for Repositories
-# repository_size = len(repos_dict)
-#
-# self.user.begin_progress(_("Narrated Web Site Report"),
-# _('Creating repository pages'),
-# repository_size)
-# # RepositoryListPage Class
-# RepositoryListPage(self, self.title, repos_dict, keys)
-#
-# for index, key in enumerate(keys):
-# (repo, handle) = repos_dict[key]
-#
-# RepositoryPage(self, self.title, repo, handle, source_list)
-# self.user.step_progress()
-# self.user.end_progress()
-#
-# return repolist
-
def addressbook_pages(self, ind_list):
"""
Create a webpage with a list of address availability for each person
@@ -7963,21 +7676,6 @@ class NavWebReport(Report):
self.user.step_progress()
self.user.end_progress()
-# def source_pages(self, source_list, ppl_handle_list, database_handles_list):
-# """
-# creates SourceListPage and SourcePage
-# """
-# self.user.begin_progress(_("Narrated Web Site Report"),
-# _("Creating source pages"),
-# len(source_list))
-# SourceListPage(self, self.title, source_list.keys())
-#
-# for source_handle in source_list:
-# SourcePage(self, self.title, source_handle, source_list, ppl_handle_list, database_handles_list)
-#
-# self.user.step_progress()
-# self.user.end_progress()
-
def base_pages(self):
"""
creates HomePage, ContactPage, DownloadPage, and IntroductionPage
@@ -8068,7 +7766,7 @@ class NavWebReport(Report):
up = self.link_prefix_up
# handle, ppl
if obj_class == "Person":
- if handle in self.person_handles:
+ if self.person_in_webreport(handle):
return self.build_url_fname(handle, "ppl", up) + self.ext
else:
return None
@@ -8128,9 +7826,14 @@ class NavWebReport(Report):
else:
self.cur_fname = fname + ext
if self.archive:
- string_io = StringIO()
- of = codecs.EncodedFile(string_io, 'utf-8',
- self.encoding, 'xmlcharrefreplace')
+ if sys.version_info[0] < 3:
+ string_io = StringIO()
+ of = codecs.EncodedFile(string_io, 'utf-8', self.encoding,
+ 'xmlcharrefreplace')
+ else:
+ string_io = BytesIO()
+ of = TextIOWrapper(string_io, encoding=self.encoding,
+ errors='xmlcharrefreplace')
else:
string_io = None
if subdir:
@@ -8138,8 +7841,22 @@ class NavWebReport(Report):
if not os.path.isdir(subdir):
os.makedirs(subdir)
fname = os.path.join(self.html_dir, self.cur_fname)
- of = codecs.EncodedFile(open(fname, "w"), 'utf-8',
- self.encoding, 'xmlcharrefreplace')
+ if sys.version_info[0] < 3:
+ # In python 2.x, the data written by of.write() is genarally of
+ # type 'str' (i.e. 8-bit strings), except for cases where (at
+ # least) one of the objects being converted by a '%' operator is
+ # unicode (e.g. the "Generated by" line or the _META3 line), in
+ # which case the data being written is of type 'unicode' (See
+ # http://docs.python.org/2/library/stdtypes.html#string-
+ # formatting). The data written to the file is encoded according
+ # to self.encoding
+ of = codecs.EncodedFile(open(fname, 'w'), 'utf-8',
+ self.encoding, 'xmlcharrefreplace')
+ else:
+ # In python 3, the data that is written by of.write() is always
+ # of type 'str' (i.e. unicode text).
+ of = open(fname, 'w', encoding=self.encoding,
+ errors='xmlcharrefreplace')
return (of, string_io)
def close_file(self, of, string_io):
@@ -8148,6 +7865,8 @@ class NavWebReport(Report):
"""
if self.archive:
+ if sys.version_info[0] >= 3:
+ of.flush()
tarinfo = tarfile.TarInfo(self.cur_fname)
tarinfo.size = len(string_io.getvalue())
tarinfo.mtime = time.time()
@@ -8160,20 +7879,6 @@ class NavWebReport(Report):
else:
of.close()
- def add_lnkref_to_photo(self, photo, lnkref):
- """
- adds link reference to media object
- """
-
- handle = photo.get_handle()
- # FIXME. Is it OK to add to the photo_list of report?
- photo_list = self.photo_list
- if handle in photo_list:
- if lnkref not in photo_list[handle]:
- photo_list[handle].append(lnkref)
- else:
- photo_list[handle] = [lnkref]
-
def prepare_copy_media(self, photo):
"""
prepares a media object to copy
@@ -8224,6 +7929,9 @@ class NavWebReport(Report):
"web pages."))
self.warn_dir = False
+ def person_in_webreport(self, person_handle):
+ return person_handle in self.obj_dict[Person]
+
#################################################
#
# Creates the NarrativeWeb Report Menu Options
@@ -8269,8 +7977,11 @@ class NavWebOptions(MenuReportOptions):
addopt( "archive", self.__archive )
self.__archive.connect('value-changed', self.__archive_changed)
+ dbname = self.__db.get_dbname()
+ default_dir = dbname + "_" + "NAVWEB"
self.__target = DestinationOption(_("Destination"),
- os.path.join(USER_HOME, "NAVWEB"))
+ os.path.join(config.get('paths.website-directory'),
+ default_dir))
self.__target.set_help( _("The destination directory for the web "
"files"))
addopt( "target", self.__target )
@@ -8491,7 +8202,7 @@ class NavWebOptions(MenuReportOptions):
self.__incdownload.connect('value-changed', self.__download_changed)
self.__down_fname1 = DestinationOption(_("Download Filename"),
- os.path.join(USER_HOME, ""))
+ os.path.join(config.get('paths.website-directory'), ""))
self.__down_fname1.set_help(_("File to be used for downloading of database"))
addopt( "down_fname1", self.__down_fname1 )
@@ -8500,7 +8211,7 @@ class NavWebOptions(MenuReportOptions):
addopt( "dl_descr1", self.__dl_descr1 )
self.__down_fname2 = DestinationOption(_("Download Filename"),
- os.path.join(USER_HOME, ""))
+ os.path.join(config.get('paths.website-directory'), ""))
self.__down_fname2.set_help(_("File to be used for downloading of database"))
addopt( "down_fname2", self.__down_fname2 )
@@ -8771,14 +8482,12 @@ def sort_people(dbase, handle_list):
sorted_lists = []
# According to the comment in flatbasemodel: This list is sorted
- # ascending, via localized string sort. conv_unicode_tosrtkey which
- # uses strxfrm, which is apparently broken in Win ?? --> they should fix
- # base lib, we need strxfrm, fix it in the Utils module.
- temp_list = sorted(sname_sub, key=conv_unicode_tosrtkey)
+ # ascending, via localized string sort. SORT_KEY
+ temp_list = sorted(sname_sub, key=SORT_KEY)
for name in temp_list:
slist = sorted(((sortnames[x], x) for x in sname_sub[name]),
- key=lambda x:conv_unicode_tosrtkey(x[0]))
+ key=lambda x:SORT_KEY(x[0]))
entries = [x[1] for x in slist]
sorted_lists.append((name, entries))
@@ -8805,7 +8514,7 @@ def sort_event_types(dbase, event_types, event_handle_list):
sort_value = event.get_date_object().get_sort_value()
event_dict[event_type].append((sort_value, event_handle))
- for tup_list in list(event_dict.values()):
+ for tup_list in event_dict.values():
tup_list.sort()
# return a list of sorted tuples, one per event
@@ -8842,20 +8551,19 @@ def first_letter(string):
else:
letter = cuni(' ')
# See : http://www.gramps-project.org/bugs/view.php?id = 2933
- (lang_country, modifier ) = locale.getlocale()
- if lang_country == "sv_SE" and (letter == cuni('W') or letter == cuni('V')):
- letter = 'V,W'
+ if COLLATE_LANG == "sv_SE" and (letter == cuni('W') or letter == cuni('V')):
+ letter = cuni('V,W')
# See : http://www.gramps-project.org/bugs/view.php?id = 4423
- elif (lang_country == "cs_CZ" or lang_country == "sk_SK") and letter == cuni('C') and len(string) > 1:
- second_letter = normalize('NFKC', str(string))[1].upper()
+ elif (COLLATE_LANG == "cs_CZ" or COLLATE_LANG == "sk_SK") and letter == cuni('C') and len(string) > 1:
+ second_letter = normalize('NFKC', cuni(string))[1].upper()
if second_letter == cuni('H'):
letter += cuni('h')
- elif lang_country == "sk_SK" and letter == cuni('D') and len(string) > 1:
+ elif COLLATE_LANG == "sk_SK" and letter == cuni('D') and len(string) > 1:
second_letter = normalize('NFKC', cuni(string))[1].upper()
if second_letter == cuni('Z'):
letter += cuni('z')
- elif second_letter == cuni('≈Ω'):
- letter += cuni('ž')
+ elif second_letter == cuni('Ž'):
+ letter += cuni('ž')
return letter
def get_first_letters(dbase, menu_set, key):
@@ -8905,13 +8613,12 @@ def alphabet_navigation(menu_set):
#
# See : http://www.gramps-project.org/bugs/view.php?id = 2933
#
- (lang_country, modifier) = locale.getlocale()
for menu_item in menu_set:
sorted_set[menu_item] += 1
# remove the number of each occurance of each letter
- sorted_alpha_index = sorted(sorted_set, key = locale.strxfrm)
+ sorted_alpha_index = sorted(sorted_set, key = SORT_KEY)
# if no letters, return None to its callers
if not sorted_alpha_index:
@@ -8932,10 +8639,12 @@ def alphabet_navigation(menu_set):
while (cols <= num_of_cols and index < num_ltrs):
menu_item = sorted_alpha_index[index]
- if lang_country == "sv_SE" and menu_item == cuni('V'):
+ if COLLATE_LANG == "sv_SE" and menu_item == cuni('V'):
hyper = Html("a", "V,W", href = "#V,W", title = "V,W")
else:
# adding title to hyperlink menu for screen readers and braille writers
+ if menu_item == ' ':
+ menu_item = ' '
title_str = _("Alphabet Menu: %s") % menu_item
hyper = Html("a", menu_item, title = title_str, href = "#%s" % menu_item)
unordered.extend(
@@ -8963,14 +8672,11 @@ def add_birthdate(dbase, ppl_handle_list):
This will sort a list of child handles in birth order
"""
sortable_individuals = []
- birth_date = False
for person_handle in ppl_handle_list:
+ birth_date = 0 # dummy value in case none is found
person = dbase.get_person_from_handle(person_handle)
if person:
-
- # get birth date: if birth_date equals nothing, then generate a fake one?
birth_ref = person.get_birth_ref()
- birth_date = Date.EMPTY
if birth_ref:
birth = dbase.get_event_from_handle(birth_ref.ref)
if birth:
@@ -9064,11 +8770,3 @@ def build_event_data_by_individuals(dbase, ppl_handle_list):
# return event_handle_list and event types to its caller
return event_handle_list, event_types
-
-def check_person_database(person_handle, ppl_handle_list):
- """
- check to see if a person is in the report database
-
- @param: person -- person object from the database presumably
- """
- return any(person_handle == person_handle for person_handle in ppl_handle_list)
diff --git a/gramps/plugins/webreport/webcal.py b/gramps/plugins/webreport/webcal.py
index c70bab99a..d9659e1cc 100644
--- a/gramps/plugins/webreport/webcal.py
+++ b/gramps/plugins/webreport/webcal.py
@@ -36,9 +36,8 @@ Web Calendar generator.
from functools import partial
import os, codecs, shutil, re
import datetime, calendar
-from gramps.gen.ggettext import sgettext as _
-from gramps.gen.ggettext import ngettext
-
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
#------------------------------------------------------------------------
# Set up logging
@@ -53,6 +52,7 @@ from gramps.gen.lib import Date, Name, NameType, Person
from gramps.gen.lib.date import Today
from gramps.gen.const import PROGRAM_NAME, URL_HOMEPAGE, USER_HOME, VERSION
from gramps.gen.constfunc import win
+from gramps.gen.config import config
from gramps.gen.plug.report import Report
from gramps.gen.plug.report import utils as ReportUtils
from gramps.gen.plug.report import MenuReportOptions
@@ -250,6 +250,8 @@ class WebCalReport(Report):
"a different directory to store your generated "
"web pages."))
self.warn_dir = False
+ config.set('paths.website-directory',
+ os.path.dirname(self.html_dir) + os.sep)
def add_day_item(self, text, year, month, day, event):
"""
@@ -1302,8 +1304,11 @@ class WebCalOptions(MenuReportOptions):
"""
category_name = _("Report Options")
+ dbname = self.__db.get_dbname()
+ default_dir = dbname + "_WEBCAL"
target = DestinationOption( _("Destination"),
- os.path.join(USER_HOME, "WEBCAL"))
+ os.path.join(config.get('paths.website-directory'),
+ default_dir))
target.set_help( _("The destination directory for the web files"))
target.set_directory_entry(True)
menu.add_option(category_name, "target", target)
@@ -1421,7 +1426,9 @@ class WebCalOptions(MenuReportOptions):
start_dow.set_help(_("Select the first day of the week for the calendar"))
menu.add_option(category_name, "start_dow", start_dow)
- home_link = StringOption(_('Home link'), '../../NAVWEB/index.html')
+ dbname = self.__db.get_dbname()
+ default_link = '../../' + dbname + "_NAVWEB/index.html"
+ home_link = StringOption(_('Home link'), default_link)
home_link.set_help(_("The link to be included to direct the user to "
"the main page of the web site"))
menu.add_option(category_name, "home_link", home_link)
@@ -1522,7 +1529,9 @@ class WebCalOptions(MenuReportOptions):
menu.add_option(category_name, 'link_to_narweb', self.__links)
self.__links.connect('value-changed', self.__links_changed)
- self.__prefix = StringOption(_('Link prefix'), "../../NAVWEB/")
+ dbname = self.__db.get_dbname()
+ default_prefix = '../../' + dbname + "_NAVWEB/"
+ self.__prefix = StringOption(_('Link prefix'), default_prefix)
self.__prefix.set_help(_("A Prefix on the links to take you to "
"Narrated Web Report"))
menu.add_option(category_name, "prefix", self.__prefix)
@@ -1689,10 +1698,11 @@ def get_day_list(event_date, holiday_list, bday_anniv_list):
txt_str = _('%(couple)s, wedding ') % {
'couple' : text}
else:
- txt_str = (ngettext('%(couple)s, %(years)d'
- ' year anniversary',
- '%(couple)s, %(years)d'
- ' year anniversary', nyears)
+ txt_str = (glocale.get_translation().ngettext(
+ '%(couple)s, %(years)d'
+ ' year anniversary',
+ '%(couple)s, %(years)d'
+ ' year anniversary', nyears)
% {'couple' : text, 'years' : nyears})
txt_str = Html('span', txt_str, class_ = "yearsmarried")
diff --git a/gramps/plugins/webreport/webplugins.gpr.py b/gramps/plugins/webreport/webplugins.gpr.py
index 57172ccaf..84c9e9ca5 100644
--- a/gramps/plugins/webreport/webplugins.gpr.py
+++ b/gramps/plugins/webreport/webplugins.gpr.py
@@ -32,7 +32,7 @@ plg.name = _("Narrated Web Site")
plg.description = _("Produces web (HTML) pages for individuals, or a set of "
"individuals")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'narrativeweb.py'
plg.ptype = REPORT
@@ -55,7 +55,7 @@ plg.id = 'WebCal'
plg.name = _("Web Calendar")
plg.description = _("Produces web (HTML) calendars.")
plg.version = '1.0'
-plg.gramps_target_version = '4.0'
+plg.gramps_target_version = '4.1'
plg.status = STABLE
plg.fname = 'webcal.py'
plg.ptype = REPORT
diff --git a/gramps/plugins/webstuff/webstuff.gpr.py b/gramps/plugins/webstuff/webstuff.gpr.py
index b1207eaba..e4bb6a54a 100644
--- a/gramps/plugins/webstuff/webstuff.gpr.py
+++ b/gramps/plugins/webstuff/webstuff.gpr.py
@@ -33,7 +33,7 @@ category = "WEBSTUFF",
name = _("Webstuff"),
description = _("Provides a collection of resources for the web"),
version = '1.0',
-gramps_target_version = '4.0',
+gramps_target_version = '4.1',
fname = "webstuff.py",
load_on_reg = True,
process = "process_list",
diff --git a/gramps/plugins/webstuff/webstuff.py b/gramps/plugins/webstuff/webstuff.py
index 3220e367b..5be4ca0ee 100644
--- a/gramps/plugins/webstuff/webstuff.py
+++ b/gramps/plugins/webstuff/webstuff.py
@@ -26,7 +26,8 @@
#------------------------------------------------
import os
from gramps.gen.const import VERSION_DIR
-from gramps.gen.ggettext import sgettext as _
+from gramps.gen.const import GRAMPS_LOCALE as glocale
+_ = glocale.get_translation().sgettext
def make_css_dict(tup):
"""
diff --git a/gramps/webapp/dbdjango.py b/gramps/webapp/dbdjango.py
index 8216e9287..2b92ac27f 100644
--- a/gramps/webapp/dbdjango.py
+++ b/gramps/webapp/dbdjango.py
@@ -50,7 +50,7 @@ from gramps.gen.db import (PERSON_KEY,
NOTE_KEY)
from gramps.gen.utils.id import create_id
from gramps.gen.constfunc import STRTYPE
-from webapp.libdjango import DjangoInterface
+from gramps.webapp.libdjango import DjangoInterface
from django.db import transaction
class Cursor(object):
diff --git a/gramps/webapp/grampsdb/view/note.py b/gramps/webapp/grampsdb/view/note.py
index c816ccf49..5ccfe8cde 100644
--- a/gramps/webapp/grampsdb/view/note.py
+++ b/gramps/webapp/grampsdb/view/note.py
@@ -37,6 +37,13 @@ dji = DjangoInterface()
db = DbDjango()
snf = StyledNoteFormatter(db)
+# add a note to a person:
+# /note/add/person/c51759195496de06da3ca5ba2c1
+
+def process_note_on_name(request, action, handle, order):
+ # add, edit, delete
+ raise Exception("testing")
+
def process_note(request, context, handle, act, add_to=None): # view, edit, save
"""
Process act on person. Can return a redirect.
diff --git a/gramps/webapp/grampsdb/views.py b/gramps/webapp/grampsdb/views.py
index ee2bdc621..099005bd4 100644
--- a/gramps/webapp/grampsdb/views.py
+++ b/gramps/webapp/grampsdb/views.py
@@ -32,6 +32,7 @@ Each object can be operated on with the following actions:
import os
import sys
+import time
if sys.version_info[0] < 3:
import cPickle as pickle
else:
@@ -58,14 +59,15 @@ from django.utils import simplejson
# Gramps Modules
#
#------------------------------------------------------------------------
+from gramps.gen.const import VERSION
+
+# Gramps-connect imports:
import gramps.webapp
from gramps.webapp.utils import _, build_args
from gramps.webapp.grampsdb.models import *
from gramps.webapp.grampsdb.view import *
from gramps.webapp.dbdjango import DbDjango
-from gramps.cli.user import User
-from gramps.gen.const import VERSION_TUPLE
-from gramps.gen.utils.svn import get_svn_revision
+import gramps.cli.user
# Menu: (, //, | None, Need authentication )
MENU = [
@@ -100,7 +102,7 @@ def context_processor(request):
else:
context["css_theme"] = "Web_Mainz.css"
# Other things for all environments:
- context["gramps_version"] = ".".join([str(v) for v in VERSION_TUPLE]) + " " + get_svn_revision()
+ context["gramps_version"] = VERSION
context["views"] = VIEWS
context["menu"] = MENU
context["None"] = None
@@ -171,6 +173,12 @@ def user_page(request, username=None):
else:
raise Http404(_("Requested page is not accessible."))
+def timestamp():
+ """
+ Construct a string of current time for filenames.
+ """
+ return time.strftime("%Y-%m-%d:%H:%M:%S")
+
def send_file(request, filename, mimetype):
"""
Send a file through Django without loading the whole file into
@@ -189,6 +197,8 @@ def process_report_run(request, handle):
"""
Run a report or export.
"""
+ # can also use URL with %0A as newline and "=" is "=":
+ # http://localhost:8000/report/ex_gpkg/run?options=off=gpkg%0Ax=10
from gramps.webapp.reports import import_file, export_file, download
from gramps.cli.plug import run_report
import traceback
@@ -215,30 +225,31 @@ def process_report_run(request, handle):
args[key] = value
#############################################################################
if report.report_type == "report":
- filename = "/tmp/%s-%s.%s" % (str(profile.user.username), str(handle), args["off"])
+ filename = "/tmp/%s-%s-%s.%s" % (str(profile.user.username), str(handle), timestamp(), args["off"])
run_report(db, handle, of=filename, **args)
mimetype = 'application/%s' % args["off"]
elif report.report_type == "export":
- filename = "/tmp/%s-%s.%s" % (str(profile.user.username), str(handle), args["off"])
- export_file(db, filename, User()) # callback
+ filename = "/tmp/%s-%s-%s.%s" % (str(profile.user.username), str(handle), timestamp(), args["off"])
+ export_file(db, filename, gramps.cli.user.User()) # callback
mimetype = 'text/plain'
elif report.report_type == "import":
- filename = download(args["i"], "/tmp/%s-%s.%s" % (str(profile.user.username),
- str(handle),
- args["iff"]))
+ filename = download(args["i"], "/tmp/%s-%s-%s.%s" % (str(profile.user.username),
+ str(handle),
+ timestamp(),
+ args["iff"]))
if filename is not None:
if True: # run in background, with error handling
import threading
def background():
try:
- import_file(db, filename, User()) # callback
+ import_file(db, filename, gramps.cli.user.User()) # callback
except:
make_message(request, "import_file failed: " + traceback.format_exc())
threading.Thread(target=background).start()
make_message(request, "Your data is now being imported...")
return redirect("/report/")
else:
- success = import_file(db, filename, User()) # callback
+ success = import_file(db, filename, gramps.cli.user.User()) # callback
if not success:
make_message(request, "Failed to load imported.")
return redirect("/report/")
@@ -248,16 +259,20 @@ def process_report_run(request, handle):
else:
make_message(request, "Invalid report type '%s'" % report.report_type)
return redirect("/report/")
- if os.path.exists(filename):
- return send_file(request, filename, mimetype)
- else:
- context = RequestContext(request)
- make_message(request, "Failed: '%s' is not found" % filename)
- return redirect("/report/")
+ # need to wait for the file to exist:
+ start = time.time()
+ while not os.path.exists(filename):
+ # but let's not wait forever:
+ if time.time() - start > 10: # after 10 seconds, give up!
+ context = RequestContext(request)
+ make_message(request, "Failed: '%s' is not found" % filename)
+ return redirect("/report/")
+ time.sleep(1)
+ return send_file(request, filename, mimetype)
# If failure, just fail for now:
context = RequestContext(request)
- context["message"] = "You need to be logged in."
- return render_to_response("process_action.html", context)
+ context["message"] = "You need to be logged in to run reports."
+ return render_to_response("main_page.html", context)
def view_list(request, view):
"""
@@ -1365,6 +1380,7 @@ def process_list_item(request, view, handle, act, item, index):
"eventref": "#tab-events",
"citationref": "#tab-citations",
"repositoryref": "#tab-repositories",
+ "noteref": "#tab-notes",
"attribute": "#tab-attributes",
"media": "#tab-media",
"lds": "#tab-lds",
@@ -1394,6 +1410,9 @@ def process_list_item(request, view, handle, act, item, index):
elif item == "repositoryref":
refs = dji.RepositoryRef.filter(object_id=obj.id,
object_type=obj_type).order_by("order")
+ elif item == "noteref":
+ refs = dji.NoteRef.filter(object_id=obj.id,
+ object_type=obj_type).order_by("order")
elif item == "parentfamily":
refs = dji.MyParentFamilies.filter(person=obj).order_by("order")
elif item == "family":
diff --git a/gramps/webapp/libdjango.py b/gramps/webapp/libdjango.py
index d5e44f3b0..e8678c870 100644
--- a/gramps/webapp/libdjango.py
+++ b/gramps/webapp/libdjango.py
@@ -35,6 +35,7 @@ if sys.version_info[0] < 3:
else:
import pickle
import base64
+import collections
#------------------------------------------------------------------------
#
@@ -52,7 +53,7 @@ from django.db import transaction
import gramps.webapp.grampsdb.models as models
from gramps.gen.lib import Name
from gramps.gen.utils.id import create_id
-import collections
+from gramps.gen.utils.file import fix_encoding
# To get a django person from a django database:
# djperson = dji.Person.get(handle='djhgsdh324hjg234hj24')
@@ -432,9 +433,9 @@ class DjangoInterface(object):
date = self.get_date(media)
return (str(media.handle),
media.gramps_id,
- media.path,
- media.mime,
- media.desc,
+ fix_encoding(media.path),
+ str(media.mime),
+ fix_encoding(media.desc),
attribute_list,
citation_list,
note_list,
diff --git a/gramps/webapp/settings.py b/gramps/webapp/settings.py
index 6c8806588..d3821aae3 100644
--- a/gramps/webapp/settings.py
+++ b/gramps/webapp/settings.py
@@ -60,6 +60,7 @@ SECRET_KEY = 'zd@%vslj5sqhx94_8)0hsx*rk9tj3^ly$x+^*tq4bggr&uh$ac'
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader', # 1.4
+ 'django.template.loaders.app_directories.Loader', # 1.4
#'django.template.loaders.filesystem.load_template_source',
#'django.template.loaders.app_directories.load_template_source',
)
@@ -69,10 +70,12 @@ MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
+ 'django.contrib.messages.middleware.MessageMiddleware',
# 'debug_toolbar.middleware.DebugToolbarMiddleware',
)
ROOT_URLCONF = 'gramps.webapp.urls'
+STATIC_URL = '/static/' # 1.4
TEMPLATE_DIRS = (
# Use absolute paths, not relative paths.
@@ -81,6 +84,7 @@ TEMPLATE_DIRS = (
TEMPLATE_CONTEXT_PROCESSORS = (
"django.contrib.auth.context_processors.auth", # 1.4
+ "django.contrib.messages.context_processors.messages", # 1.4
# "django.core.context_processors.auth",
# "django.core.context_processors.debug",
"django.core.context_processors.i18n",
@@ -93,6 +97,7 @@ INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
+ 'django.contrib.messages', # 1.4
'django.contrib.sites',
'django.contrib.admin',
'gramps.webapp.grampsdb',
diff --git a/gramps/webapp/shell.py b/gramps/webapp/shell.py
index d359b4dec..b5f9f39e0 100644
--- a/gramps/webapp/shell.py
+++ b/gramps/webapp/shell.py
@@ -37,15 +37,15 @@ except RuntimeError:
# already configured; ignore
pass
-from .grampsdb.models import *
-from .grampsdb.forms import *
-from .dbdjango import DbDjango
-from .reports import import_file
-from .libdjango import DjangoInterface, totime, todate
+from gramps.webapp.grampsdb.models import *
+from gramps.webapp.grampsdb.forms import *
+from gramps.webapp.dbdjango import DbDjango
+from gramps.webapp.reports import import_file
+from gramps.webapp.libdjango import DjangoInterface, totime, todate
from gramps.gen.datehandler import displayer, parser
-from .utils import StyledNoteFormatter, parse_styled_text
+from gramps.webapp.utils import StyledNoteFormatter, parse_styled_text
from gramps.gen.lib import StyledText
-from gramps.cli.user import User
+#from gramps.cli.user import User
db = DbDjango()
dji = DjangoInterface()
diff --git a/gramps/webapp/urls.py b/gramps/webapp/urls.py
index 6a1559a5d..c9adbe0e2 100644
--- a/gramps/webapp/urls.py
+++ b/gramps/webapp/urls.py
@@ -36,6 +36,7 @@ import os
from gramps.gen.const import IMAGE_DIR, ROOT_DIR
from django.conf.urls.defaults import *
from django.contrib import admin
+
admin.autodiscover()
from gramps.webapp.grampsdb.views import *
@@ -95,6 +96,8 @@ urlpatterns += patterns('',
(r'^family/(?P(\w+))/(?P(\w+))/child/(?P(\w+))$', process_child),
(r'^(?P(\w+))/(?P(\w+))/(?P(\w+))/(?P- (\w+))/(?P
(\w+))$',
process_list_item),
+ (r'^note/(?P(\w+))/person/(?P(\w+))/name/(?P(\w+))$',
+ process_note_on_name),
)
# In urls:
diff --git a/gramps/webapp/utils.py b/gramps/webapp/utils.py
index 86404737b..ec289df49 100644
--- a/gramps/webapp/utils.py
+++ b/gramps/webapp/utils.py
@@ -648,19 +648,28 @@ def note_table(obj, user, act, url=None, *args):
cssid = "tab-notes"
table = Table("note_table")
table.columns(
+ "",
_("ID"),
_("Type"),
_("Note"))
+ table.column_widths = [11, 10, 20, 59]
if user.is_authenticated() or obj.public:
obj_type = ContentType.objects.get_for_model(obj)
note_refs = dji.NoteRef.filter(object_type=obj_type,
- object_id=obj.id)
+ object_id=obj.id).order_by("order")
+ links = []
+ count = 1
for note_ref in note_refs:
note = note_ref.ref_object
- table.row(note,
+ table.row(Link("{{[[x%d]][[^%d]][[v%d]]}}" % (count, count, count)) if user.is_superuser else "",
+ note.gramps_id,
str(note.note_type),
- note.text[:50])
+ note.text[:50]
+ )
+ links.append(('URL', note_ref.get_url()))
has_data = True
+ count += 1
+ table.links(links)
retval += """"""
if user.is_superuser and url and act == "view":
retval += make_button(_("+Add New Note"), (url % args).replace("$act", "add"))
@@ -668,7 +677,18 @@ def note_table(obj, user, act, url=None, *args):
else:
retval += nbsp("") # to keep tabs same height
retval += """
"""
- retval += table.get_html()
+ text = table.get_html()
+ text = text.replace("{{", """""")
+ text = text.replace("}}", """
""")
+ if user.is_authenticated() or obj.public:
+ count = 1
+ for note_ref in note_refs:
+ item = obj.__class__.__name__.lower()
+ text = text.replace("[[x%d]]" % count, make_button("x", "/%s/%s/remove/noteref/%d" % (item, obj.handle, count)))
+ text = text.replace("[[^%d]]" % count, make_button("^", "/%s/%s/up/noteref/%d" % (item, obj.handle, count)))
+ text = text.replace("[[v%d]]" % count, make_button("v", "/%s/%s/down/noteref/%d" % (item, obj.handle, count)))
+ count += 1
+ retval += text
if has_data:
retval += """ \n""" % cssid
return retval
diff --git a/gramps/images/16x16/geo-fixed-zoom.png b/images/16x16/geo-fixed-zoom.png
similarity index 100%
rename from gramps/images/16x16/geo-fixed-zoom.png
rename to images/16x16/geo-fixed-zoom.png
diff --git a/gramps/images/16x16/geo-free-zoom.png b/images/16x16/geo-free-zoom.png
similarity index 100%
rename from gramps/images/16x16/geo-free-zoom.png
rename to images/16x16/geo-free-zoom.png
diff --git a/gramps/images/16x16/geo-place-add.png b/images/16x16/geo-place-add.png
similarity index 100%
rename from gramps/images/16x16/geo-place-add.png
rename to images/16x16/geo-place-add.png
diff --git a/gramps/images/16x16/geo-place-link.png b/images/16x16/geo-place-link.png
similarity index 100%
rename from gramps/images/16x16/geo-place-link.png
rename to images/16x16/geo-place-link.png
diff --git a/gramps/images/16x16/geo-show-event.png b/images/16x16/geo-show-event.png
similarity index 100%
rename from gramps/images/16x16/geo-show-event.png
rename to images/16x16/geo-show-event.png
diff --git a/gramps/images/16x16/geo-show-family.png b/images/16x16/geo-show-family.png
similarity index 100%
rename from gramps/images/16x16/geo-show-family.png
rename to images/16x16/geo-show-family.png
diff --git a/gramps/images/16x16/geo-show-person.png b/images/16x16/geo-show-person.png
similarity index 100%
rename from gramps/images/16x16/geo-show-person.png
rename to images/16x16/geo-show-person.png
diff --git a/gramps/images/16x16/geo-show-place.png b/images/16x16/geo-show-place.png
similarity index 100%
rename from gramps/images/16x16/geo-show-place.png
rename to images/16x16/geo-show-place.png
diff --git a/gramps/images/16x16/gramps-address.png b/images/16x16/gramps-address.png
similarity index 100%
rename from gramps/images/16x16/gramps-address.png
rename to images/16x16/gramps-address.png
diff --git a/gramps/images/16x16/gramps-attribute.png b/images/16x16/gramps-attribute.png
similarity index 100%
rename from gramps/images/16x16/gramps-attribute.png
rename to images/16x16/gramps-attribute.png
diff --git a/gramps/images/16x16/gramps-bookmark-delete.png b/images/16x16/gramps-bookmark-delete.png
similarity index 100%
rename from gramps/images/16x16/gramps-bookmark-delete.png
rename to images/16x16/gramps-bookmark-delete.png
diff --git a/gramps/images/16x16/gramps-bookmark-edit.png b/images/16x16/gramps-bookmark-edit.png
similarity index 100%
rename from gramps/images/16x16/gramps-bookmark-edit.png
rename to images/16x16/gramps-bookmark-edit.png
diff --git a/gramps/images/16x16/gramps-bookmark-new.png b/images/16x16/gramps-bookmark-new.png
similarity index 100%
rename from gramps/images/16x16/gramps-bookmark-new.png
rename to images/16x16/gramps-bookmark-new.png
diff --git a/gramps/images/16x16/gramps-bookmark.png b/images/16x16/gramps-bookmark.png
similarity index 100%
rename from gramps/images/16x16/gramps-bookmark.png
rename to images/16x16/gramps-bookmark.png
diff --git a/gramps/images/16x16/gramps-citation.png b/images/16x16/gramps-citation.png
similarity index 100%
rename from gramps/images/16x16/gramps-citation.png
rename to images/16x16/gramps-citation.png
diff --git a/gramps/images/16x16/gramps-config.png b/images/16x16/gramps-config.png
similarity index 100%
rename from gramps/images/16x16/gramps-config.png
rename to images/16x16/gramps-config.png
diff --git a/gramps/images/16x16/gramps-date-edit.png b/images/16x16/gramps-date-edit.png
similarity index 100%
rename from gramps/images/16x16/gramps-date-edit.png
rename to images/16x16/gramps-date-edit.png
diff --git a/gramps/images/16x16/gramps-date.png b/images/16x16/gramps-date.png
similarity index 100%
rename from gramps/images/16x16/gramps-date.png
rename to images/16x16/gramps-date.png
diff --git a/gramps/images/16x16/gramps-event.png b/images/16x16/gramps-event.png
similarity index 100%
rename from gramps/images/16x16/gramps-event.png
rename to images/16x16/gramps-event.png
diff --git a/gramps/images/16x16/gramps-family.png b/images/16x16/gramps-family.png
similarity index 100%
rename from gramps/images/16x16/gramps-family.png
rename to images/16x16/gramps-family.png
diff --git a/gramps/images/16x16/gramps-fanchart.png b/images/16x16/gramps-fanchart.png
similarity index 100%
rename from gramps/images/16x16/gramps-fanchart.png
rename to images/16x16/gramps-fanchart.png
diff --git a/gramps/images/16x16/gramps-fanchartdesc.png b/images/16x16/gramps-fanchartdesc.png
similarity index 100%
rename from gramps/images/16x16/gramps-fanchartdesc.png
rename to images/16x16/gramps-fanchartdesc.png
diff --git a/gramps/images/16x16/gramps-font-bgcolor.png b/images/16x16/gramps-font-bgcolor.png
similarity index 100%
rename from gramps/images/16x16/gramps-font-bgcolor.png
rename to images/16x16/gramps-font-bgcolor.png
diff --git a/gramps/images/16x16/gramps-font-color.png b/images/16x16/gramps-font-color.png
similarity index 100%
rename from gramps/images/16x16/gramps-font-color.png
rename to images/16x16/gramps-font-color.png
diff --git a/gramps/images/16x16/gramps-font.png b/images/16x16/gramps-font.png
similarity index 100%
rename from gramps/images/16x16/gramps-font.png
rename to images/16x16/gramps-font.png
diff --git a/gramps/images/16x16/gramps-geo.png b/images/16x16/gramps-geo.png
similarity index 100%
rename from gramps/images/16x16/gramps-geo.png
rename to images/16x16/gramps-geo.png
diff --git a/gramps/images/16x16/gramps-gramplet.png b/images/16x16/gramps-gramplet.png
similarity index 100%
rename from gramps/images/16x16/gramps-gramplet.png
rename to images/16x16/gramps-gramplet.png
diff --git a/gramps/images/16x16/gramps-lock.png b/images/16x16/gramps-lock.png
similarity index 100%
rename from gramps/images/16x16/gramps-lock.png
rename to images/16x16/gramps-lock.png
diff --git a/gramps/images/16x16/gramps-media.png b/images/16x16/gramps-media.png
similarity index 100%
rename from gramps/images/16x16/gramps-media.png
rename to images/16x16/gramps-media.png
diff --git a/gramps/images/16x16/gramps-merge.png b/images/16x16/gramps-merge.png
similarity index 100%
rename from gramps/images/16x16/gramps-merge.png
rename to images/16x16/gramps-merge.png
diff --git a/gramps/images/16x16/gramps-notes.png b/images/16x16/gramps-notes.png
similarity index 100%
rename from gramps/images/16x16/gramps-notes.png
rename to images/16x16/gramps-notes.png
diff --git a/gramps/images/16x16/gramps-parents-add.png b/images/16x16/gramps-parents-add.png
similarity index 100%
rename from gramps/images/16x16/gramps-parents-add.png
rename to images/16x16/gramps-parents-add.png
diff --git a/gramps/images/16x16/gramps-parents-open.png b/images/16x16/gramps-parents-open.png
similarity index 100%
rename from gramps/images/16x16/gramps-parents-open.png
rename to images/16x16/gramps-parents-open.png
diff --git a/gramps/images/16x16/gramps-parents.png b/images/16x16/gramps-parents.png
similarity index 100%
rename from gramps/images/16x16/gramps-parents.png
rename to images/16x16/gramps-parents.png
diff --git a/gramps/images/16x16/gramps-pedigree.png b/images/16x16/gramps-pedigree.png
similarity index 100%
rename from gramps/images/16x16/gramps-pedigree.png
rename to images/16x16/gramps-pedigree.png
diff --git a/gramps/images/16x16/gramps-person.png b/images/16x16/gramps-person.png
similarity index 100%
rename from gramps/images/16x16/gramps-person.png
rename to images/16x16/gramps-person.png
diff --git a/gramps/images/16x16/gramps-place.png b/images/16x16/gramps-place.png
similarity index 100%
rename from gramps/images/16x16/gramps-place.png
rename to images/16x16/gramps-place.png
diff --git a/gramps/images/16x16/gramps-relation.png b/images/16x16/gramps-relation.png
similarity index 100%
rename from gramps/images/16x16/gramps-relation.png
rename to images/16x16/gramps-relation.png
diff --git a/gramps/images/16x16/gramps-reports.png b/images/16x16/gramps-reports.png
similarity index 100%
rename from gramps/images/16x16/gramps-reports.png
rename to images/16x16/gramps-reports.png
diff --git a/gramps/images/16x16/gramps-repository.png b/images/16x16/gramps-repository.png
similarity index 100%
rename from gramps/images/16x16/gramps-repository.png
rename to images/16x16/gramps-repository.png
diff --git a/gramps/images/16x16/gramps-source.png b/images/16x16/gramps-source.png
similarity index 100%
rename from gramps/images/16x16/gramps-source.png
rename to images/16x16/gramps-source.png
diff --git a/gramps/images/16x16/gramps-spouse.png b/images/16x16/gramps-spouse.png
similarity index 100%
rename from gramps/images/16x16/gramps-spouse.png
rename to images/16x16/gramps-spouse.png
diff --git a/gramps/images/16x16/gramps-tag-new.png b/images/16x16/gramps-tag-new.png
similarity index 100%
rename from gramps/images/16x16/gramps-tag-new.png
rename to images/16x16/gramps-tag-new.png
diff --git a/gramps/images/16x16/gramps-tag.png b/images/16x16/gramps-tag.png
similarity index 100%
rename from gramps/images/16x16/gramps-tag.png
rename to images/16x16/gramps-tag.png
diff --git a/gramps/images/16x16/gramps-tools.png b/images/16x16/gramps-tools.png
similarity index 100%
rename from gramps/images/16x16/gramps-tools.png
rename to images/16x16/gramps-tools.png
diff --git a/gramps/images/16x16/gramps-tree-group.png b/images/16x16/gramps-tree-group.png
similarity index 100%
rename from gramps/images/16x16/gramps-tree-group.png
rename to images/16x16/gramps-tree-group.png
diff --git a/gramps/images/16x16/gramps-tree-list.png b/images/16x16/gramps-tree-list.png
similarity index 100%
rename from gramps/images/16x16/gramps-tree-list.png
rename to images/16x16/gramps-tree-list.png
diff --git a/gramps/images/16x16/gramps-tree-select.png b/images/16x16/gramps-tree-select.png
similarity index 100%
rename from gramps/images/16x16/gramps-tree-select.png
rename to images/16x16/gramps-tree-select.png
diff --git a/gramps/images/16x16/gramps-unlock.png b/images/16x16/gramps-unlock.png
similarity index 100%
rename from gramps/images/16x16/gramps-unlock.png
rename to images/16x16/gramps-unlock.png
diff --git a/gramps/images/16x16/gramps-view.png b/images/16x16/gramps-view.png
similarity index 100%
rename from gramps/images/16x16/gramps-view.png
rename to images/16x16/gramps-view.png
diff --git a/gramps/images/16x16/gramps-viewmedia.png b/images/16x16/gramps-viewmedia.png
similarity index 100%
rename from gramps/images/16x16/gramps-viewmedia.png
rename to images/16x16/gramps-viewmedia.png
diff --git a/gramps/images/16x16/gramps-zoom-best-fit.png b/images/16x16/gramps-zoom-best-fit.png
similarity index 100%
rename from gramps/images/16x16/gramps-zoom-best-fit.png
rename to images/16x16/gramps-zoom-best-fit.png
diff --git a/gramps/images/16x16/gramps-zoom-fit-width.png b/images/16x16/gramps-zoom-fit-width.png
similarity index 100%
rename from gramps/images/16x16/gramps-zoom-fit-width.png
rename to images/16x16/gramps-zoom-fit-width.png
diff --git a/gramps/images/16x16/gramps-zoom-in.png b/images/16x16/gramps-zoom-in.png
similarity index 100%
rename from gramps/images/16x16/gramps-zoom-in.png
rename to images/16x16/gramps-zoom-in.png
diff --git a/gramps/images/16x16/gramps-zoom-out.png b/images/16x16/gramps-zoom-out.png
similarity index 100%
rename from gramps/images/16x16/gramps-zoom-out.png
rename to images/16x16/gramps-zoom-out.png
diff --git a/gramps/images/16x16/gramps.png b/images/16x16/gramps.png
similarity index 100%
rename from gramps/images/16x16/gramps.png
rename to images/16x16/gramps.png
diff --git a/gramps/images/16x16/source/gramps-geo.svg b/images/16x16/source/gramps-geo.svg
similarity index 100%
rename from gramps/images/16x16/source/gramps-geo.svg
rename to images/16x16/source/gramps-geo.svg
diff --git a/gramps/images/16x16/source/gramps-tree-group.svg b/images/16x16/source/gramps-tree-group.svg
similarity index 100%
rename from gramps/images/16x16/source/gramps-tree-group.svg
rename to images/16x16/source/gramps-tree-group.svg
diff --git a/gramps/images/16x16/source/gramps-tree-list.svg b/images/16x16/source/gramps-tree-list.svg
similarity index 100%
rename from gramps/images/16x16/source/gramps-tree-list.svg
rename to images/16x16/source/gramps-tree-list.svg
diff --git a/gramps/images/16x16/source/gramps-tree-select.svg b/images/16x16/source/gramps-tree-select.svg
similarity index 100%
rename from gramps/images/16x16/source/gramps-tree-select.svg
rename to images/16x16/source/gramps-tree-select.svg
diff --git a/gramps/images/22x22/geo-fixed-zoom.png b/images/22x22/geo-fixed-zoom.png
similarity index 100%
rename from gramps/images/22x22/geo-fixed-zoom.png
rename to images/22x22/geo-fixed-zoom.png
diff --git a/gramps/images/22x22/geo-free-zoom.png b/images/22x22/geo-free-zoom.png
similarity index 100%
rename from gramps/images/22x22/geo-free-zoom.png
rename to images/22x22/geo-free-zoom.png
diff --git a/gramps/images/22x22/geo-place-add.png b/images/22x22/geo-place-add.png
similarity index 100%
rename from gramps/images/22x22/geo-place-add.png
rename to images/22x22/geo-place-add.png
diff --git a/gramps/images/22x22/geo-place-link.png b/images/22x22/geo-place-link.png
similarity index 100%
rename from gramps/images/22x22/geo-place-link.png
rename to images/22x22/geo-place-link.png
diff --git a/gramps/images/22x22/geo-show-event.png b/images/22x22/geo-show-event.png
similarity index 100%
rename from gramps/images/22x22/geo-show-event.png
rename to images/22x22/geo-show-event.png
diff --git a/gramps/images/22x22/geo-show-family.png b/images/22x22/geo-show-family.png
similarity index 100%
rename from gramps/images/22x22/geo-show-family.png
rename to images/22x22/geo-show-family.png
diff --git a/gramps/images/22x22/geo-show-person.png b/images/22x22/geo-show-person.png
similarity index 100%
rename from gramps/images/22x22/geo-show-person.png
rename to images/22x22/geo-show-person.png
diff --git a/gramps/images/22x22/geo-show-place.png b/images/22x22/geo-show-place.png
similarity index 100%
rename from gramps/images/22x22/geo-show-place.png
rename to images/22x22/geo-show-place.png
diff --git a/gramps/images/22x22/gramps-address.png b/images/22x22/gramps-address.png
similarity index 100%
rename from gramps/images/22x22/gramps-address.png
rename to images/22x22/gramps-address.png
diff --git a/gramps/images/22x22/gramps-attribute.png b/images/22x22/gramps-attribute.png
similarity index 100%
rename from gramps/images/22x22/gramps-attribute.png
rename to images/22x22/gramps-attribute.png
diff --git a/gramps/images/22x22/gramps-bookmark-delete.png b/images/22x22/gramps-bookmark-delete.png
similarity index 100%
rename from gramps/images/22x22/gramps-bookmark-delete.png
rename to images/22x22/gramps-bookmark-delete.png
diff --git a/gramps/images/22x22/gramps-bookmark-edit.png b/images/22x22/gramps-bookmark-edit.png
similarity index 100%
rename from gramps/images/22x22/gramps-bookmark-edit.png
rename to images/22x22/gramps-bookmark-edit.png
diff --git a/gramps/images/22x22/gramps-bookmark-new.png b/images/22x22/gramps-bookmark-new.png
similarity index 100%
rename from gramps/images/22x22/gramps-bookmark-new.png
rename to images/22x22/gramps-bookmark-new.png
diff --git a/gramps/images/22x22/gramps-bookmark.png b/images/22x22/gramps-bookmark.png
similarity index 100%
rename from gramps/images/22x22/gramps-bookmark.png
rename to images/22x22/gramps-bookmark.png
diff --git a/gramps/images/22x22/gramps-citation.png b/images/22x22/gramps-citation.png
similarity index 100%
rename from gramps/images/22x22/gramps-citation.png
rename to images/22x22/gramps-citation.png
diff --git a/gramps/images/22x22/gramps-config.png b/images/22x22/gramps-config.png
similarity index 100%
rename from gramps/images/22x22/gramps-config.png
rename to images/22x22/gramps-config.png
diff --git a/gramps/images/22x22/gramps-date-edit.png b/images/22x22/gramps-date-edit.png
similarity index 100%
rename from gramps/images/22x22/gramps-date-edit.png
rename to images/22x22/gramps-date-edit.png
diff --git a/gramps/images/22x22/gramps-date.png b/images/22x22/gramps-date.png
similarity index 100%
rename from gramps/images/22x22/gramps-date.png
rename to images/22x22/gramps-date.png
diff --git a/gramps/images/22x22/gramps-event.png b/images/22x22/gramps-event.png
similarity index 100%
rename from gramps/images/22x22/gramps-event.png
rename to images/22x22/gramps-event.png
diff --git a/gramps/images/22x22/gramps-family.png b/images/22x22/gramps-family.png
similarity index 100%
rename from gramps/images/22x22/gramps-family.png
rename to images/22x22/gramps-family.png
diff --git a/gramps/images/22x22/gramps-fanchart.png b/images/22x22/gramps-fanchart.png
similarity index 100%
rename from gramps/images/22x22/gramps-fanchart.png
rename to images/22x22/gramps-fanchart.png
diff --git a/gramps/images/22x22/gramps-fanchartdesc.png b/images/22x22/gramps-fanchartdesc.png
similarity index 100%
rename from gramps/images/22x22/gramps-fanchartdesc.png
rename to images/22x22/gramps-fanchartdesc.png
diff --git a/gramps/images/22x22/gramps-font-bgcolor.png b/images/22x22/gramps-font-bgcolor.png
similarity index 100%
rename from gramps/images/22x22/gramps-font-bgcolor.png
rename to images/22x22/gramps-font-bgcolor.png
diff --git a/gramps/images/22x22/gramps-font-color.png b/images/22x22/gramps-font-color.png
similarity index 100%
rename from gramps/images/22x22/gramps-font-color.png
rename to images/22x22/gramps-font-color.png
diff --git a/gramps/images/22x22/gramps-font.png b/images/22x22/gramps-font.png
similarity index 100%
rename from gramps/images/22x22/gramps-font.png
rename to images/22x22/gramps-font.png
diff --git a/gramps/images/22x22/gramps-geo-altmap.png b/images/22x22/gramps-geo-altmap.png
similarity index 100%
rename from gramps/images/22x22/gramps-geo-altmap.png
rename to images/22x22/gramps-geo-altmap.png
diff --git a/gramps/images/22x22/gramps-geo-birth.png b/images/22x22/gramps-geo-birth.png
similarity index 100%
rename from gramps/images/22x22/gramps-geo-birth.png
rename to images/22x22/gramps-geo-birth.png
diff --git a/gramps/images/22x22/gramps-geo-death.png b/images/22x22/gramps-geo-death.png
similarity index 100%
rename from gramps/images/22x22/gramps-geo-death.png
rename to images/22x22/gramps-geo-death.png
diff --git a/gramps/images/22x22/gramps-geo-mainmap.png b/images/22x22/gramps-geo-mainmap.png
similarity index 100%
rename from gramps/images/22x22/gramps-geo-mainmap.png
rename to images/22x22/gramps-geo-mainmap.png
diff --git a/gramps/images/22x22/gramps-geo-marriage.png b/images/22x22/gramps-geo-marriage.png
similarity index 100%
rename from gramps/images/22x22/gramps-geo-marriage.png
rename to images/22x22/gramps-geo-marriage.png
diff --git a/gramps/images/22x22/gramps-geo.png b/images/22x22/gramps-geo.png
similarity index 100%
rename from gramps/images/22x22/gramps-geo.png
rename to images/22x22/gramps-geo.png
diff --git a/gramps/images/22x22/gramps-gramplet.png b/images/22x22/gramps-gramplet.png
similarity index 100%
rename from gramps/images/22x22/gramps-gramplet.png
rename to images/22x22/gramps-gramplet.png
diff --git a/gramps/images/22x22/gramps-lock.png b/images/22x22/gramps-lock.png
similarity index 100%
rename from gramps/images/22x22/gramps-lock.png
rename to images/22x22/gramps-lock.png
diff --git a/gramps/images/22x22/gramps-media.png b/images/22x22/gramps-media.png
similarity index 100%
rename from gramps/images/22x22/gramps-media.png
rename to images/22x22/gramps-media.png
diff --git a/gramps/images/22x22/gramps-merge.png b/images/22x22/gramps-merge.png
similarity index 100%
rename from gramps/images/22x22/gramps-merge.png
rename to images/22x22/gramps-merge.png
diff --git a/gramps/images/22x22/gramps-notes.png b/images/22x22/gramps-notes.png
similarity index 100%
rename from gramps/images/22x22/gramps-notes.png
rename to images/22x22/gramps-notes.png
diff --git a/gramps/images/22x22/gramps-parents-add.png b/images/22x22/gramps-parents-add.png
similarity index 100%
rename from gramps/images/22x22/gramps-parents-add.png
rename to images/22x22/gramps-parents-add.png
diff --git a/gramps/images/22x22/gramps-parents-open.png b/images/22x22/gramps-parents-open.png
similarity index 100%
rename from gramps/images/22x22/gramps-parents-open.png
rename to images/22x22/gramps-parents-open.png
diff --git a/gramps/images/22x22/gramps-parents.png b/images/22x22/gramps-parents.png
similarity index 100%
rename from gramps/images/22x22/gramps-parents.png
rename to images/22x22/gramps-parents.png
diff --git a/gramps/images/22x22/gramps-pedigree.png b/images/22x22/gramps-pedigree.png
similarity index 100%
rename from gramps/images/22x22/gramps-pedigree.png
rename to images/22x22/gramps-pedigree.png
diff --git a/gramps/images/22x22/gramps-person.png b/images/22x22/gramps-person.png
similarity index 100%
rename from gramps/images/22x22/gramps-person.png
rename to images/22x22/gramps-person.png
diff --git a/gramps/images/22x22/gramps-place.png b/images/22x22/gramps-place.png
similarity index 100%
rename from gramps/images/22x22/gramps-place.png
rename to images/22x22/gramps-place.png
diff --git a/gramps/images/22x22/gramps-relation.png b/images/22x22/gramps-relation.png
similarity index 100%
rename from gramps/images/22x22/gramps-relation.png
rename to images/22x22/gramps-relation.png
diff --git a/gramps/images/22x22/gramps-reports.png b/images/22x22/gramps-reports.png
similarity index 100%
rename from gramps/images/22x22/gramps-reports.png
rename to images/22x22/gramps-reports.png
diff --git a/gramps/images/22x22/gramps-repository.png b/images/22x22/gramps-repository.png
similarity index 100%
rename from gramps/images/22x22/gramps-repository.png
rename to images/22x22/gramps-repository.png
diff --git a/gramps/images/22x22/gramps-source.png b/images/22x22/gramps-source.png
similarity index 100%
rename from gramps/images/22x22/gramps-source.png
rename to images/22x22/gramps-source.png
diff --git a/gramps/images/22x22/gramps-spouse.png b/images/22x22/gramps-spouse.png
similarity index 100%
rename from gramps/images/22x22/gramps-spouse.png
rename to images/22x22/gramps-spouse.png
diff --git a/gramps/images/22x22/gramps-tag-new.png b/images/22x22/gramps-tag-new.png
similarity index 100%
rename from gramps/images/22x22/gramps-tag-new.png
rename to images/22x22/gramps-tag-new.png
diff --git a/gramps/images/22x22/gramps-tag.png b/images/22x22/gramps-tag.png
similarity index 100%
rename from gramps/images/22x22/gramps-tag.png
rename to images/22x22/gramps-tag.png
diff --git a/gramps/images/22x22/gramps-tools.png b/images/22x22/gramps-tools.png
similarity index 100%
rename from gramps/images/22x22/gramps-tools.png
rename to images/22x22/gramps-tools.png
diff --git a/gramps/images/22x22/gramps-tree-group.png b/images/22x22/gramps-tree-group.png
similarity index 100%
rename from gramps/images/22x22/gramps-tree-group.png
rename to images/22x22/gramps-tree-group.png
diff --git a/gramps/images/22x22/gramps-tree-list.png b/images/22x22/gramps-tree-list.png
similarity index 100%
rename from gramps/images/22x22/gramps-tree-list.png
rename to images/22x22/gramps-tree-list.png
diff --git a/gramps/images/22x22/gramps-tree-select.png b/images/22x22/gramps-tree-select.png
similarity index 100%
rename from gramps/images/22x22/gramps-tree-select.png
rename to images/22x22/gramps-tree-select.png
diff --git a/gramps/images/22x22/gramps-unlock.png b/images/22x22/gramps-unlock.png
similarity index 100%
rename from gramps/images/22x22/gramps-unlock.png
rename to images/22x22/gramps-unlock.png
diff --git a/gramps/images/22x22/gramps-view.png b/images/22x22/gramps-view.png
similarity index 100%
rename from gramps/images/22x22/gramps-view.png
rename to images/22x22/gramps-view.png
diff --git a/gramps/images/22x22/gramps-viewmedia.png b/images/22x22/gramps-viewmedia.png
similarity index 100%
rename from gramps/images/22x22/gramps-viewmedia.png
rename to images/22x22/gramps-viewmedia.png
diff --git a/gramps/images/22x22/gramps-zoom-best-fit.png b/images/22x22/gramps-zoom-best-fit.png
similarity index 100%
rename from gramps/images/22x22/gramps-zoom-best-fit.png
rename to images/22x22/gramps-zoom-best-fit.png
diff --git a/gramps/images/22x22/gramps-zoom-fit-width.png b/images/22x22/gramps-zoom-fit-width.png
similarity index 100%
rename from gramps/images/22x22/gramps-zoom-fit-width.png
rename to images/22x22/gramps-zoom-fit-width.png
diff --git a/gramps/images/22x22/gramps-zoom-in.png b/images/22x22/gramps-zoom-in.png
similarity index 100%
rename from gramps/images/22x22/gramps-zoom-in.png
rename to images/22x22/gramps-zoom-in.png
diff --git a/gramps/images/22x22/gramps-zoom-out.png b/images/22x22/gramps-zoom-out.png
similarity index 100%
rename from gramps/images/22x22/gramps-zoom-out.png
rename to images/22x22/gramps-zoom-out.png
diff --git a/gramps/images/22x22/gramps.png b/images/22x22/gramps.png
similarity index 100%
rename from gramps/images/22x22/gramps.png
rename to images/22x22/gramps.png
diff --git a/gramps/images/48x48/geo-fixed-zoom.png b/images/48x48/geo-fixed-zoom.png
similarity index 100%
rename from gramps/images/48x48/geo-fixed-zoom.png
rename to images/48x48/geo-fixed-zoom.png
diff --git a/gramps/images/48x48/geo-free-zoom.png b/images/48x48/geo-free-zoom.png
similarity index 100%
rename from gramps/images/48x48/geo-free-zoom.png
rename to images/48x48/geo-free-zoom.png
diff --git a/gramps/images/48x48/geo-place-add.png b/images/48x48/geo-place-add.png
similarity index 100%
rename from gramps/images/48x48/geo-place-add.png
rename to images/48x48/geo-place-add.png
diff --git a/gramps/images/48x48/geo-place-link.png b/images/48x48/geo-place-link.png
similarity index 100%
rename from gramps/images/48x48/geo-place-link.png
rename to images/48x48/geo-place-link.png
diff --git a/gramps/images/48x48/geo-show-event.png b/images/48x48/geo-show-event.png
similarity index 100%
rename from gramps/images/48x48/geo-show-event.png
rename to images/48x48/geo-show-event.png
diff --git a/gramps/images/48x48/geo-show-family.png b/images/48x48/geo-show-family.png
similarity index 100%
rename from gramps/images/48x48/geo-show-family.png
rename to images/48x48/geo-show-family.png
diff --git a/gramps/images/48x48/geo-show-person.png b/images/48x48/geo-show-person.png
similarity index 100%
rename from gramps/images/48x48/geo-show-person.png
rename to images/48x48/geo-show-person.png
diff --git a/gramps/images/48x48/geo-show-place.png b/images/48x48/geo-show-place.png
similarity index 100%
rename from gramps/images/48x48/geo-show-place.png
rename to images/48x48/geo-show-place.png
diff --git a/gramps/images/48x48/gramps-address.png b/images/48x48/gramps-address.png
similarity index 100%
rename from gramps/images/48x48/gramps-address.png
rename to images/48x48/gramps-address.png
diff --git a/gramps/images/48x48/gramps-attribute.png b/images/48x48/gramps-attribute.png
similarity index 100%
rename from gramps/images/48x48/gramps-attribute.png
rename to images/48x48/gramps-attribute.png
diff --git a/gramps/images/48x48/gramps-bookmark-delete.png b/images/48x48/gramps-bookmark-delete.png
similarity index 100%
rename from gramps/images/48x48/gramps-bookmark-delete.png
rename to images/48x48/gramps-bookmark-delete.png
diff --git a/gramps/images/48x48/gramps-bookmark-edit.png b/images/48x48/gramps-bookmark-edit.png
similarity index 100%
rename from gramps/images/48x48/gramps-bookmark-edit.png
rename to images/48x48/gramps-bookmark-edit.png
diff --git a/gramps/images/48x48/gramps-bookmark-new.png b/images/48x48/gramps-bookmark-new.png
similarity index 100%
rename from gramps/images/48x48/gramps-bookmark-new.png
rename to images/48x48/gramps-bookmark-new.png
diff --git a/gramps/images/48x48/gramps-bookmark.png b/images/48x48/gramps-bookmark.png
similarity index 100%
rename from gramps/images/48x48/gramps-bookmark.png
rename to images/48x48/gramps-bookmark.png
diff --git a/gramps/images/48x48/gramps-citation.png b/images/48x48/gramps-citation.png
similarity index 100%
rename from gramps/images/48x48/gramps-citation.png
rename to images/48x48/gramps-citation.png
diff --git a/gramps/images/48x48/gramps-config.png b/images/48x48/gramps-config.png
similarity index 100%
rename from gramps/images/48x48/gramps-config.png
rename to images/48x48/gramps-config.png
diff --git a/gramps/images/48x48/gramps-date-edit.png b/images/48x48/gramps-date-edit.png
similarity index 100%
rename from gramps/images/48x48/gramps-date-edit.png
rename to images/48x48/gramps-date-edit.png
diff --git a/gramps/images/48x48/gramps-date.png b/images/48x48/gramps-date.png
similarity index 100%
rename from gramps/images/48x48/gramps-date.png
rename to images/48x48/gramps-date.png
diff --git a/gramps/images/48x48/gramps-event.png b/images/48x48/gramps-event.png
similarity index 100%
rename from gramps/images/48x48/gramps-event.png
rename to images/48x48/gramps-event.png
diff --git a/gramps/images/48x48/gramps-family.png b/images/48x48/gramps-family.png
similarity index 100%
rename from gramps/images/48x48/gramps-family.png
rename to images/48x48/gramps-family.png
diff --git a/gramps/images/48x48/gramps-fanchart.png b/images/48x48/gramps-fanchart.png
similarity index 100%
rename from gramps/images/48x48/gramps-fanchart.png
rename to images/48x48/gramps-fanchart.png
diff --git a/gramps/images/48x48/gramps-fanchartdesc.png b/images/48x48/gramps-fanchartdesc.png
similarity index 100%
rename from gramps/images/48x48/gramps-fanchartdesc.png
rename to images/48x48/gramps-fanchartdesc.png
diff --git a/gramps/images/48x48/gramps-font-bgcolor.png b/images/48x48/gramps-font-bgcolor.png
similarity index 100%
rename from gramps/images/48x48/gramps-font-bgcolor.png
rename to images/48x48/gramps-font-bgcolor.png
diff --git a/gramps/images/48x48/gramps-font-color.png b/images/48x48/gramps-font-color.png
similarity index 100%
rename from gramps/images/48x48/gramps-font-color.png
rename to images/48x48/gramps-font-color.png
diff --git a/gramps/images/48x48/gramps-font.png b/images/48x48/gramps-font.png
similarity index 100%
rename from gramps/images/48x48/gramps-font.png
rename to images/48x48/gramps-font.png
diff --git a/gramps/images/48x48/gramps-geo-altmap.png b/images/48x48/gramps-geo-altmap.png
similarity index 100%
rename from gramps/images/48x48/gramps-geo-altmap.png
rename to images/48x48/gramps-geo-altmap.png
diff --git a/gramps/images/48x48/gramps-geo-birth.png b/images/48x48/gramps-geo-birth.png
similarity index 100%
rename from gramps/images/48x48/gramps-geo-birth.png
rename to images/48x48/gramps-geo-birth.png
diff --git a/gramps/images/48x48/gramps-geo-death.png b/images/48x48/gramps-geo-death.png
similarity index 100%
rename from gramps/images/48x48/gramps-geo-death.png
rename to images/48x48/gramps-geo-death.png
diff --git a/gramps/images/48x48/gramps-geo-mainmap.png b/images/48x48/gramps-geo-mainmap.png
similarity index 100%
rename from gramps/images/48x48/gramps-geo-mainmap.png
rename to images/48x48/gramps-geo-mainmap.png
diff --git a/gramps/images/48x48/gramps-geo-marriage.png b/images/48x48/gramps-geo-marriage.png
similarity index 100%
rename from gramps/images/48x48/gramps-geo-marriage.png
rename to images/48x48/gramps-geo-marriage.png
diff --git a/gramps/images/48x48/gramps-geo.png b/images/48x48/gramps-geo.png
similarity index 100%
rename from gramps/images/48x48/gramps-geo.png
rename to images/48x48/gramps-geo.png
diff --git a/gramps/images/48x48/gramps-gramplet.png b/images/48x48/gramps-gramplet.png
similarity index 100%
rename from gramps/images/48x48/gramps-gramplet.png
rename to images/48x48/gramps-gramplet.png
diff --git a/gramps/images/48x48/gramps-lock.png b/images/48x48/gramps-lock.png
similarity index 100%
rename from gramps/images/48x48/gramps-lock.png
rename to images/48x48/gramps-lock.png
diff --git a/gramps/images/48x48/gramps-media.png b/images/48x48/gramps-media.png
similarity index 100%
rename from gramps/images/48x48/gramps-media.png
rename to images/48x48/gramps-media.png
diff --git a/gramps/images/48x48/gramps-merge.png b/images/48x48/gramps-merge.png
similarity index 100%
rename from gramps/images/48x48/gramps-merge.png
rename to images/48x48/gramps-merge.png
diff --git a/gramps/images/48x48/gramps-notes.png b/images/48x48/gramps-notes.png
similarity index 100%
rename from gramps/images/48x48/gramps-notes.png
rename to images/48x48/gramps-notes.png
diff --git a/gramps/images/48x48/gramps-parents-add.png b/images/48x48/gramps-parents-add.png
similarity index 100%
rename from gramps/images/48x48/gramps-parents-add.png
rename to images/48x48/gramps-parents-add.png
diff --git a/gramps/images/48x48/gramps-parents-open.png b/images/48x48/gramps-parents-open.png
similarity index 100%
rename from gramps/images/48x48/gramps-parents-open.png
rename to images/48x48/gramps-parents-open.png
diff --git a/gramps/images/48x48/gramps-parents.png b/images/48x48/gramps-parents.png
similarity index 100%
rename from gramps/images/48x48/gramps-parents.png
rename to images/48x48/gramps-parents.png
diff --git a/gramps/images/48x48/gramps-pedigree.png b/images/48x48/gramps-pedigree.png
similarity index 100%
rename from gramps/images/48x48/gramps-pedigree.png
rename to images/48x48/gramps-pedigree.png
diff --git a/gramps/images/48x48/gramps-person.png b/images/48x48/gramps-person.png
similarity index 100%
rename from gramps/images/48x48/gramps-person.png
rename to images/48x48/gramps-person.png
diff --git a/gramps/images/48x48/gramps-place.png b/images/48x48/gramps-place.png
similarity index 100%
rename from gramps/images/48x48/gramps-place.png
rename to images/48x48/gramps-place.png
diff --git a/gramps/images/48x48/gramps-relation.png b/images/48x48/gramps-relation.png
similarity index 100%
rename from gramps/images/48x48/gramps-relation.png
rename to images/48x48/gramps-relation.png
diff --git a/gramps/images/48x48/gramps-reports.png b/images/48x48/gramps-reports.png
similarity index 100%
rename from gramps/images/48x48/gramps-reports.png
rename to images/48x48/gramps-reports.png
diff --git a/gramps/images/48x48/gramps-repository.png b/images/48x48/gramps-repository.png
similarity index 100%
rename from gramps/images/48x48/gramps-repository.png
rename to images/48x48/gramps-repository.png
diff --git a/gramps/images/48x48/gramps-source.png b/images/48x48/gramps-source.png
similarity index 100%
rename from gramps/images/48x48/gramps-source.png
rename to images/48x48/gramps-source.png
diff --git a/gramps/images/48x48/gramps-spouse.png b/images/48x48/gramps-spouse.png
similarity index 100%
rename from gramps/images/48x48/gramps-spouse.png
rename to images/48x48/gramps-spouse.png
diff --git a/gramps/images/48x48/gramps-tag-new.png b/images/48x48/gramps-tag-new.png
similarity index 100%
rename from gramps/images/48x48/gramps-tag-new.png
rename to images/48x48/gramps-tag-new.png
diff --git a/gramps/images/48x48/gramps-tag.png b/images/48x48/gramps-tag.png
similarity index 100%
rename from gramps/images/48x48/gramps-tag.png
rename to images/48x48/gramps-tag.png
diff --git a/gramps/images/48x48/gramps-tools.png b/images/48x48/gramps-tools.png
similarity index 100%
rename from gramps/images/48x48/gramps-tools.png
rename to images/48x48/gramps-tools.png
diff --git a/gramps/images/48x48/gramps-tree-group.png b/images/48x48/gramps-tree-group.png
similarity index 100%
rename from gramps/images/48x48/gramps-tree-group.png
rename to images/48x48/gramps-tree-group.png
diff --git a/gramps/images/48x48/gramps-tree-list.png b/images/48x48/gramps-tree-list.png
similarity index 100%
rename from gramps/images/48x48/gramps-tree-list.png
rename to images/48x48/gramps-tree-list.png
diff --git a/gramps/images/48x48/gramps-tree-select.png b/images/48x48/gramps-tree-select.png
similarity index 100%
rename from gramps/images/48x48/gramps-tree-select.png
rename to images/48x48/gramps-tree-select.png
diff --git a/gramps/images/48x48/gramps-unlock.png b/images/48x48/gramps-unlock.png
similarity index 100%
rename from gramps/images/48x48/gramps-unlock.png
rename to images/48x48/gramps-unlock.png
diff --git a/gramps/images/48x48/gramps-view.png b/images/48x48/gramps-view.png
similarity index 100%
rename from gramps/images/48x48/gramps-view.png
rename to images/48x48/gramps-view.png
diff --git a/gramps/images/48x48/gramps-viewmedia.png b/images/48x48/gramps-viewmedia.png
similarity index 100%
rename from gramps/images/48x48/gramps-viewmedia.png
rename to images/48x48/gramps-viewmedia.png
diff --git a/gramps/images/48x48/gramps-zoom-best-fit.png b/images/48x48/gramps-zoom-best-fit.png
similarity index 100%
rename from gramps/images/48x48/gramps-zoom-best-fit.png
rename to images/48x48/gramps-zoom-best-fit.png
diff --git a/gramps/images/48x48/gramps-zoom-fit-width.png b/images/48x48/gramps-zoom-fit-width.png
similarity index 100%
rename from gramps/images/48x48/gramps-zoom-fit-width.png
rename to images/48x48/gramps-zoom-fit-width.png
diff --git a/gramps/images/48x48/gramps-zoom-in.png b/images/48x48/gramps-zoom-in.png
similarity index 100%
rename from gramps/images/48x48/gramps-zoom-in.png
rename to images/48x48/gramps-zoom-in.png
diff --git a/gramps/images/48x48/gramps-zoom-out.png b/images/48x48/gramps-zoom-out.png
similarity index 100%
rename from gramps/images/48x48/gramps-zoom-out.png
rename to images/48x48/gramps-zoom-out.png
diff --git a/gramps/images/48x48/gramps.png b/images/48x48/gramps.png
similarity index 100%
rename from gramps/images/48x48/gramps.png
rename to images/48x48/gramps.png
diff --git a/gramps/images/add.png b/images/add.png
similarity index 100%
rename from gramps/images/add.png
rename to images/add.png
diff --git a/gramps/images/bad.png b/images/bad.png
similarity index 100%
rename from gramps/images/bad.png
rename to images/bad.png
diff --git a/gramps/images/caution.png b/images/caution.png
similarity index 100%
rename from gramps/images/caution.png
rename to images/caution.png
diff --git a/gramps/images/document.png b/images/document.png
similarity index 100%
rename from gramps/images/document.png
rename to images/document.png
diff --git a/gramps/images/down.png b/images/down.png
similarity index 100%
rename from gramps/images/down.png
rename to images/down.png
diff --git a/gramps/images/good.png b/images/good.png
similarity index 100%
rename from gramps/images/good.png
rename to images/good.png
diff --git a/gramps/images/gramps-export.png b/images/gramps-export.png
similarity index 100%
rename from gramps/images/gramps-export.png
rename to images/gramps-export.png
diff --git a/gramps/images/gramps-import.png b/images/gramps-import.png
similarity index 100%
rename from gramps/images/gramps-import.png
rename to images/gramps-import.png
diff --git a/gramps/images/gramps-undo-history.png b/images/gramps-undo-history.png
similarity index 100%
rename from gramps/images/gramps-undo-history.png
rename to images/gramps-undo-history.png
diff --git a/gramps/images/gramps-url.png b/images/gramps-url.png
similarity index 100%
rename from gramps/images/gramps-url.png
rename to images/gramps-url.png
diff --git a/gramps/images/gramps.png b/images/gramps.png
similarity index 100%
rename from gramps/images/gramps.png
rename to images/gramps.png
diff --git a/gramps/images/gramps.svg b/images/gramps.svg
similarity index 100%
rename from gramps/images/gramps.svg
rename to images/gramps.svg
diff --git a/gramps/images/gtk-remove.png b/images/gtk-remove.png
similarity index 100%
rename from gramps/images/gtk-remove.png
rename to images/gtk-remove.png
diff --git a/gramps/images/image-missing.png b/images/image-missing.png
similarity index 100%
rename from gramps/images/image-missing.png
rename to images/image-missing.png
diff --git a/gramps/images/logo.png b/images/logo.png
similarity index 100%
rename from gramps/images/logo.png
rename to images/logo.png
diff --git a/gramps/images/next.png b/images/next.png
similarity index 100%
rename from gramps/images/next.png
rename to images/next.png
diff --git a/gramps/images/ped24.ico b/images/ped24.ico
similarity index 100%
rename from gramps/images/ped24.ico
rename to images/ped24.ico
diff --git a/gramps/images/previous.png b/images/previous.png
similarity index 100%
rename from gramps/images/previous.png
rename to images/previous.png
diff --git a/gramps/images/scalable/add-parent-existing-family.svg b/images/scalable/add-parent-existing-family.svg
similarity index 100%
rename from gramps/images/scalable/add-parent-existing-family.svg
rename to images/scalable/add-parent-existing-family.svg
diff --git a/gramps/images/scalable/geo-fixed-zoom.svg b/images/scalable/geo-fixed-zoom.svg
similarity index 100%
rename from gramps/images/scalable/geo-fixed-zoom.svg
rename to images/scalable/geo-fixed-zoom.svg
diff --git a/gramps/images/scalable/geo-free-zoom.svg b/images/scalable/geo-free-zoom.svg
similarity index 100%
rename from gramps/images/scalable/geo-free-zoom.svg
rename to images/scalable/geo-free-zoom.svg
diff --git a/gramps/images/scalable/geo-place-add.svg b/images/scalable/geo-place-add.svg
similarity index 100%
rename from gramps/images/scalable/geo-place-add.svg
rename to images/scalable/geo-place-add.svg
diff --git a/gramps/images/scalable/geo-place-link.svg b/images/scalable/geo-place-link.svg
similarity index 100%
rename from gramps/images/scalable/geo-place-link.svg
rename to images/scalable/geo-place-link.svg
diff --git a/gramps/images/scalable/geo-show-event.svg b/images/scalable/geo-show-event.svg
similarity index 100%
rename from gramps/images/scalable/geo-show-event.svg
rename to images/scalable/geo-show-event.svg
diff --git a/gramps/images/scalable/geo-show-family.svg b/images/scalable/geo-show-family.svg
similarity index 100%
rename from gramps/images/scalable/geo-show-family.svg
rename to images/scalable/geo-show-family.svg
diff --git a/gramps/images/scalable/geo-show-person.svg b/images/scalable/geo-show-person.svg
similarity index 100%
rename from gramps/images/scalable/geo-show-person.svg
rename to images/scalable/geo-show-person.svg
diff --git a/gramps/images/scalable/geo-show-place.svg b/images/scalable/geo-show-place.svg
similarity index 100%
rename from gramps/images/scalable/geo-show-place.svg
rename to images/scalable/geo-show-place.svg
diff --git a/gramps/images/scalable/gramps-address.svg b/images/scalable/gramps-address.svg
similarity index 100%
rename from gramps/images/scalable/gramps-address.svg
rename to images/scalable/gramps-address.svg
diff --git a/gramps/images/scalable/gramps-attribute.svg b/images/scalable/gramps-attribute.svg
similarity index 100%
rename from gramps/images/scalable/gramps-attribute.svg
rename to images/scalable/gramps-attribute.svg
diff --git a/gramps/images/scalable/gramps-bookmark-delete.svg b/images/scalable/gramps-bookmark-delete.svg
similarity index 100%
rename from gramps/images/scalable/gramps-bookmark-delete.svg
rename to images/scalable/gramps-bookmark-delete.svg
diff --git a/gramps/images/scalable/gramps-bookmark-edit.svg b/images/scalable/gramps-bookmark-edit.svg
similarity index 100%
rename from gramps/images/scalable/gramps-bookmark-edit.svg
rename to images/scalable/gramps-bookmark-edit.svg
diff --git a/gramps/images/scalable/gramps-bookmark-new.svg b/images/scalable/gramps-bookmark-new.svg
similarity index 100%
rename from gramps/images/scalable/gramps-bookmark-new.svg
rename to images/scalable/gramps-bookmark-new.svg
diff --git a/gramps/images/scalable/gramps-bookmark.svg b/images/scalable/gramps-bookmark.svg
similarity index 100%
rename from gramps/images/scalable/gramps-bookmark.svg
rename to images/scalable/gramps-bookmark.svg
diff --git a/gramps/images/scalable/gramps-citation.svg b/images/scalable/gramps-citation.svg
similarity index 100%
rename from gramps/images/scalable/gramps-citation.svg
rename to images/scalable/gramps-citation.svg
diff --git a/gramps/images/scalable/gramps-config.svg b/images/scalable/gramps-config.svg
similarity index 100%
rename from gramps/images/scalable/gramps-config.svg
rename to images/scalable/gramps-config.svg
diff --git a/gramps/images/scalable/gramps-date-edit.svg b/images/scalable/gramps-date-edit.svg
similarity index 100%
rename from gramps/images/scalable/gramps-date-edit.svg
rename to images/scalable/gramps-date-edit.svg
diff --git a/gramps/images/scalable/gramps-date.svg b/images/scalable/gramps-date.svg
similarity index 100%
rename from gramps/images/scalable/gramps-date.svg
rename to images/scalable/gramps-date.svg
diff --git a/gramps/images/scalable/gramps-event.svg b/images/scalable/gramps-event.svg
similarity index 100%
rename from gramps/images/scalable/gramps-event.svg
rename to images/scalable/gramps-event.svg
diff --git a/gramps/images/scalable/gramps-family.svg b/images/scalable/gramps-family.svg
similarity index 100%
rename from gramps/images/scalable/gramps-family.svg
rename to images/scalable/gramps-family.svg
diff --git a/gramps/images/scalable/gramps-fanchart.svg b/images/scalable/gramps-fanchart.svg
similarity index 100%
rename from gramps/images/scalable/gramps-fanchart.svg
rename to images/scalable/gramps-fanchart.svg
diff --git a/gramps/images/scalable/gramps-fanchartdesc.svg b/images/scalable/gramps-fanchartdesc.svg
similarity index 100%
rename from gramps/images/scalable/gramps-fanchartdesc.svg
rename to images/scalable/gramps-fanchartdesc.svg
diff --git a/gramps/images/scalable/gramps-font-bgcolor.svg b/images/scalable/gramps-font-bgcolor.svg
similarity index 100%
rename from gramps/images/scalable/gramps-font-bgcolor.svg
rename to images/scalable/gramps-font-bgcolor.svg
diff --git a/gramps/images/scalable/gramps-font-color.svg b/images/scalable/gramps-font-color.svg
similarity index 100%
rename from gramps/images/scalable/gramps-font-color.svg
rename to images/scalable/gramps-font-color.svg
diff --git a/gramps/images/scalable/gramps-font.svg b/images/scalable/gramps-font.svg
similarity index 100%
rename from gramps/images/scalable/gramps-font.svg
rename to images/scalable/gramps-font.svg
diff --git a/gramps/images/scalable/gramps-geo-altmap.svg b/images/scalable/gramps-geo-altmap.svg
similarity index 100%
rename from gramps/images/scalable/gramps-geo-altmap.svg
rename to images/scalable/gramps-geo-altmap.svg
diff --git a/gramps/images/scalable/gramps-geo-birth.svg b/images/scalable/gramps-geo-birth.svg
similarity index 100%
rename from gramps/images/scalable/gramps-geo-birth.svg
rename to images/scalable/gramps-geo-birth.svg
diff --git a/gramps/images/scalable/gramps-geo-death.svg b/images/scalable/gramps-geo-death.svg
similarity index 100%
rename from gramps/images/scalable/gramps-geo-death.svg
rename to images/scalable/gramps-geo-death.svg
diff --git a/gramps/images/scalable/gramps-geo-mainmap.svg b/images/scalable/gramps-geo-mainmap.svg
similarity index 100%
rename from gramps/images/scalable/gramps-geo-mainmap.svg
rename to images/scalable/gramps-geo-mainmap.svg
diff --git a/gramps/images/scalable/gramps-geo-marriage.svg b/images/scalable/gramps-geo-marriage.svg
similarity index 100%
rename from gramps/images/scalable/gramps-geo-marriage.svg
rename to images/scalable/gramps-geo-marriage.svg
diff --git a/gramps/images/scalable/gramps-geo.svg b/images/scalable/gramps-geo.svg
similarity index 100%
rename from gramps/images/scalable/gramps-geo.svg
rename to images/scalable/gramps-geo.svg
diff --git a/gramps/images/scalable/gramps-gramplet.svg b/images/scalable/gramps-gramplet.svg
similarity index 100%
rename from gramps/images/scalable/gramps-gramplet.svg
rename to images/scalable/gramps-gramplet.svg
diff --git a/gramps/images/scalable/gramps-lock.svg b/images/scalable/gramps-lock.svg
similarity index 100%
rename from gramps/images/scalable/gramps-lock.svg
rename to images/scalable/gramps-lock.svg
diff --git a/gramps/images/scalable/gramps-media.svg b/images/scalable/gramps-media.svg
similarity index 100%
rename from gramps/images/scalable/gramps-media.svg
rename to images/scalable/gramps-media.svg
diff --git a/gramps/images/scalable/gramps-merge.svg b/images/scalable/gramps-merge.svg
similarity index 100%
rename from gramps/images/scalable/gramps-merge.svg
rename to images/scalable/gramps-merge.svg
diff --git a/gramps/images/scalable/gramps-notes.svg b/images/scalable/gramps-notes.svg
similarity index 100%
rename from gramps/images/scalable/gramps-notes.svg
rename to images/scalable/gramps-notes.svg
diff --git a/gramps/images/scalable/gramps-parents-add.svg b/images/scalable/gramps-parents-add.svg
similarity index 100%
rename from gramps/images/scalable/gramps-parents-add.svg
rename to images/scalable/gramps-parents-add.svg
diff --git a/gramps/images/scalable/gramps-parents-open.svg b/images/scalable/gramps-parents-open.svg
similarity index 100%
rename from gramps/images/scalable/gramps-parents-open.svg
rename to images/scalable/gramps-parents-open.svg
diff --git a/gramps/images/scalable/gramps-parents.svg b/images/scalable/gramps-parents.svg
similarity index 100%
rename from gramps/images/scalable/gramps-parents.svg
rename to images/scalable/gramps-parents.svg
diff --git a/gramps/images/scalable/gramps-pedigree.svg b/images/scalable/gramps-pedigree.svg
similarity index 100%
rename from gramps/images/scalable/gramps-pedigree.svg
rename to images/scalable/gramps-pedigree.svg
diff --git a/gramps/images/scalable/gramps-person.svg b/images/scalable/gramps-person.svg
similarity index 100%
rename from gramps/images/scalable/gramps-person.svg
rename to images/scalable/gramps-person.svg
diff --git a/gramps/images/scalable/gramps-place.svg b/images/scalable/gramps-place.svg
similarity index 100%
rename from gramps/images/scalable/gramps-place.svg
rename to images/scalable/gramps-place.svg
diff --git a/gramps/images/scalable/gramps-relation.svg b/images/scalable/gramps-relation.svg
similarity index 100%
rename from gramps/images/scalable/gramps-relation.svg
rename to images/scalable/gramps-relation.svg
diff --git a/gramps/images/scalable/gramps-reports.svg b/images/scalable/gramps-reports.svg
similarity index 100%
rename from gramps/images/scalable/gramps-reports.svg
rename to images/scalable/gramps-reports.svg
diff --git a/gramps/images/scalable/gramps-repository.svg b/images/scalable/gramps-repository.svg
similarity index 100%
rename from gramps/images/scalable/gramps-repository.svg
rename to images/scalable/gramps-repository.svg
diff --git a/gramps/images/scalable/gramps-source.svg b/images/scalable/gramps-source.svg
similarity index 100%
rename from gramps/images/scalable/gramps-source.svg
rename to images/scalable/gramps-source.svg
diff --git a/gramps/images/scalable/gramps-spouse.svg b/images/scalable/gramps-spouse.svg
similarity index 100%
rename from gramps/images/scalable/gramps-spouse.svg
rename to images/scalable/gramps-spouse.svg
diff --git a/gramps/images/scalable/gramps-tag-new.svg b/images/scalable/gramps-tag-new.svg
similarity index 100%
rename from gramps/images/scalable/gramps-tag-new.svg
rename to images/scalable/gramps-tag-new.svg
diff --git a/gramps/images/scalable/gramps-tag.svg b/images/scalable/gramps-tag.svg
similarity index 100%
rename from gramps/images/scalable/gramps-tag.svg
rename to images/scalable/gramps-tag.svg
diff --git a/gramps/images/scalable/gramps-tools.svg b/images/scalable/gramps-tools.svg
similarity index 100%
rename from gramps/images/scalable/gramps-tools.svg
rename to images/scalable/gramps-tools.svg
diff --git a/gramps/images/scalable/gramps-tree-group.svg b/images/scalable/gramps-tree-group.svg
similarity index 100%
rename from gramps/images/scalable/gramps-tree-group.svg
rename to images/scalable/gramps-tree-group.svg
diff --git a/gramps/images/scalable/gramps-tree-list.svg b/images/scalable/gramps-tree-list.svg
similarity index 100%
rename from gramps/images/scalable/gramps-tree-list.svg
rename to images/scalable/gramps-tree-list.svg
diff --git a/gramps/images/scalable/gramps-tree-select.svg b/images/scalable/gramps-tree-select.svg
similarity index 100%
rename from gramps/images/scalable/gramps-tree-select.svg
rename to images/scalable/gramps-tree-select.svg
diff --git a/gramps/images/scalable/gramps-unlock.svg b/images/scalable/gramps-unlock.svg
similarity index 100%
rename from gramps/images/scalable/gramps-unlock.svg
rename to images/scalable/gramps-unlock.svg
diff --git a/gramps/images/scalable/gramps-view.svg b/images/scalable/gramps-view.svg
similarity index 100%
rename from gramps/images/scalable/gramps-view.svg
rename to images/scalable/gramps-view.svg
diff --git a/gramps/images/scalable/gramps-viewmedia.svg b/images/scalable/gramps-viewmedia.svg
similarity index 100%
rename from gramps/images/scalable/gramps-viewmedia.svg
rename to images/scalable/gramps-viewmedia.svg
diff --git a/gramps/images/scalable/gramps-zoom-best-fit.svg b/images/scalable/gramps-zoom-best-fit.svg
similarity index 100%
rename from gramps/images/scalable/gramps-zoom-best-fit.svg
rename to images/scalable/gramps-zoom-best-fit.svg
diff --git a/gramps/images/scalable/gramps-zoom-fit-width.svg b/images/scalable/gramps-zoom-fit-width.svg
similarity index 100%
rename from gramps/images/scalable/gramps-zoom-fit-width.svg
rename to images/scalable/gramps-zoom-fit-width.svg
diff --git a/gramps/images/scalable/gramps-zoom-in.svg b/images/scalable/gramps-zoom-in.svg
similarity index 100%
rename from gramps/images/scalable/gramps-zoom-in.svg
rename to images/scalable/gramps-zoom-in.svg
diff --git a/gramps/images/scalable/gramps-zoom-out.svg b/images/scalable/gramps-zoom-out.svg
similarity index 100%
rename from gramps/images/scalable/gramps-zoom-out.svg
rename to images/scalable/gramps-zoom-out.svg
diff --git a/gramps/images/scalable/gramps.svg b/images/scalable/gramps.svg
similarity index 100%
rename from gramps/images/scalable/gramps.svg
rename to images/scalable/gramps.svg
diff --git a/gramps/images/splash.jpg b/images/splash.jpg
similarity index 100%
rename from gramps/images/splash.jpg
rename to images/splash.jpg
diff --git a/gramps/images/stock_index_24.png b/images/stock_index_24.png
similarity index 100%
rename from gramps/images/stock_index_24.png
rename to images/stock_index_24.png
diff --git a/gramps/images/stock_link.png b/images/stock_link.png
similarity index 100%
rename from gramps/images/stock_link.png
rename to images/stock_link.png
diff --git a/gramps/images/stock_new-html.png b/images/stock_new-html.png
similarity index 100%
rename from gramps/images/stock_new-html.png
rename to images/stock_new-html.png
diff --git a/gramps/images/stock_notes.png b/images/stock_notes.png
similarity index 100%
rename from gramps/images/stock_notes.png
rename to images/stock_notes.png
diff --git a/gramps/images/text-editor.png b/images/text-editor.png
similarity index 100%
rename from gramps/images/text-editor.png
rename to images/text-editor.png
diff --git a/gramps/images/up.png b/images/up.png
similarity index 100%
rename from gramps/images/up.png
rename to images/up.png
diff --git a/mac/gramps.bundle b/mac/gramps.bundle
index 9db6ab404..2a8e5a34f 100644
--- a/mac/gramps.bundle
+++ b/mac/gramps.bundle
@@ -6,6 +6,9 @@
${env:HOME}/Desktop
${project}/gramps.launcher
+
+ gtk+-3.0
${project}/Info.plist
@@ -27,23 +30,18 @@
${prefix}/lib/gdk-pixbuf-2.0/${pkg:gdk-pixbuf-2.0:gdk_pixbuf_binary_version}/
-
+
- ${prefix}/lib/gtk-2.0/${pkg:gtk+-2.0:gtk_binary_version}/engines/*.so
+ ${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/immodules/*.so
- ${prefix}/lib/gtk-2.0/${pkg:gtk+-2.0:gtk_binary_version}/printbackends/*.so
+ ${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/printbackends/*.so
- ${prefix}/lib/pango/${pkg:pango:pango_module_version}/modules/pango-basic-fc.so
-
-
-
-
- ${prefix}/lib/libpyglib-2.0-python.0.dylib
+ ${prefix}/lib/pango/${pkg:pango:pango_module_version}/modules/*.so
@@ -59,15 +57,7 @@
- ${prefix}/lib/libgoocanvas.3.dylib
-
-
-
- ${prefix}/lib/libgtkmacintegration.0.dylib
-
-
-
- ${prefix}/lib/libart_lgpl_2.2.dylib
+ ${prefix}/lib/libgtkmacintegration.2.dylib
@@ -87,7 +77,7 @@
- ${prefix}/lib/libosmgpsmap.2.dylib
+ ${prefix}/lib/libosmgpsmap.3.dylib
@@ -110,7 +100,27 @@
want to copy in to the bundle. The "dest" attribute is
optional, as usual. Bundler will find all translations of that
library/program under the indicated directory and copy them.-->
-
+
+ ${prefix}/share/locale
+
+
+
+ ${prefix}/share/locale
+
+
+
+ ${prefix}/share/locale
+
+
+
+ ${prefix}/share/locale
+
+
+
+ ${prefix}/share/locale
+
+
+
${prefix}/share/locale
@@ -121,7 +131,11 @@
-
+
+ ${prefix}/share/glib-2.0/schemas
+
+
+
${prefix}/lib/python2.7/*.py
@@ -134,7 +148,7 @@
- ${prefix}/share/gramps/
+ ${prefix}/lib/girepository-1.0/
-
-
- ${project}/gtkrc
-
-
-
+
${project}/gramps.accel
diff --git a/mac/gramps.launcher b/mac/gramps.launcher
index 54d48e548..6739e7573 100755
--- a/mac/gramps.launcher
+++ b/mac/gramps.launcher
@@ -21,9 +21,11 @@ export GTK_EXE_PREFIX="$bundle_res"
export GTK_PATH="$bundle_res"
export PANGO_RC_FILE="$bundle_etc/pango/pangorc"
-export GDK_PIXBUF_MODULE_FILE="$bundle_etc/gtk-2.0/gdk-pixbuf.loaders"
-export GTK_IM_MODULE_FILE="$bundle_etc/gtk-2.0/gtk.immodules"
-export GTK2_RC_FILES="$bundle_etc/gtk-2.0/gtkrc"
+export PANGO_SYSCONFDIR="$bundle_etc"
+export PANGO_LIBDIR="$bundle_lib"
+export GDK_PIXBUF_MODULE_FILE="$bundle_etc/gtk-3.0/gdk-pixbuf.loaders"
+export GTK_IM_MODULE_FILE="$bundle_etc/gtk-3.0/gtk.immodules"
+export GI_TYPELIB_PATH="$bundle_lib/girepository-1.0"
export GVBINDIR="$bundle_lib/graphviz"
@@ -31,10 +33,8 @@ export GVBINDIR="$bundle_lib/graphviz"
PYVER=2.7
export PYTHON="$bundle_contents/MacOS/python"
export PYTHONHOME="$bundle_res"
-PYTHONPATH="$bundle_lib/python$PYVER/site-packages/pyenchant-1.6.1-py$PYVER.egg:$PYTHONPATH"
-export PYTHONPATH="$bundle_lib/python$PYVER/site-packages/gtk-2.0:$PYTHONPATH"
-export GRAMPSDIR="$bundle_data"/gramps
+export GRAMPSDIR="$bundle_lib/python$PYVER/site-packages/gramps"
export GRAMPSI18N="$bundle_data"/locale
export GRAMPSHOME="$HOME/Library/Application Support"
@@ -42,5 +42,5 @@ export GRAMPSHOME="$HOME/Library/Application Support"
if /bin/expr "x$1" : '^x-psn_' > /dev/null; then
shift 1
fi
-exec "$PYTHON" -O "$GRAMPSDIR/gramps.py" "$@"
+exec "$PYTHON" -O "$bundle_contents/MacOS/Gramps-bin" "$@"
diff --git a/mac/gramps.modules b/mac/gramps.modules
index 4cb2c2e63..5fdfff6b3 100644
--- a/mac/gramps.modules
+++ b/mac/gramps.modules
@@ -14,7 +14,7 @@
+ href="http://svn.code.sf.net/p/gramps/code/"/>
-
+
-
+
-
-
-
+
+
@@ -75,6 +75,7 @@ gtk-mac-bundler gtk-osx-build/projects/gramps/gramps.bundle
+
@@ -89,6 +90,16 @@ gtk-mac-bundler gtk-osx-build/projects/gramps/gramps.bundle
+
+
+
+
+
+
+
+
@@ -115,7 +126,7 @@ gtk-mac-bundler gtk-osx-build/projects/gramps/gramps.bundle
-
+
@@ -127,18 +138,31 @@ gtk-mac-bundler gtk-osx-build/projects/gramps/gramps.bundle
version="0.7.3"/>
-
-
-
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
-
-
+
@@ -147,8 +171,8 @@ gtk-mac-bundler gtk-osx-build/projects/gramps/gramps.bundle
-
+
@@ -168,7 +192,22 @@ gtk-mac-bundler gtk-osx-build/projects/gramps/gramps.bundle
-
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/po/POTFILES.in b/po/POTFILES.in
index f1b2da9fa..a88a9b596 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -95,6 +95,7 @@ gramps/gen/filters/rules/family/_hasreltype.py
gramps/gen/filters/rules/family/_hassourcecount.py
gramps/gen/filters/rules/family/_hassourceof.py
gramps/gen/filters/rules/family/_hastag.py
+gramps/gen/filters/rules/family/_hastwins.py
gramps/gen/filters/rules/family/_isbookmarked.py
gramps/gen/filters/rules/family/_matchesfilter.py
gramps/gen/filters/rules/family/_matchessourceconfidence.py
@@ -129,6 +130,7 @@ gramps/gen/filters/rules/note/_hasidof.py
gramps/gen/filters/rules/note/_hasnote.py
gramps/gen/filters/rules/note/_hasreferencecountof.py
gramps/gen/filters/rules/note/_hastag.py
+gramps/gen/filters/rules/note/_hastype.py
gramps/gen/filters/rules/note/_matchesfilter.py
gramps/gen/filters/rules/note/_matchesregexpof.py
gramps/gen/filters/rules/note/_matchessubstringof.py
@@ -283,7 +285,6 @@ gramps/gen/merge/mergepersonquery.py
gramps/gen/merge/mergeplacequery.py
gramps/gen/merge/mergerepositoryquery.py
gramps/gen/merge/mergesourcequery.py
-gramps/gen/mime/_gnomemime.py
gramps/gen/mime/_pythonmime.py
gramps/gen/mime/_winmime.py
gramps/gen/plug/_gramplet.py
@@ -305,7 +306,7 @@ gramps/gen/utils/keyword.py
gramps/gen/utils/lds.py
gramps/gen/utils/place.py
gramps/gen/utils/string.py
-gramps/gen/utils/trans.py
+gramps/gen/utils/grampslocale.py
gramps/gen/utils/unknown.py
gramps/grampsapp.py
gramps/gui/aboutdialog.py
@@ -425,7 +426,6 @@ gramps/gui/glade/rule.glade
gramps/gui/glade/styleeditor.glade
gramps/gui/glade/tipofday.glade
gramps/gui/glade/updateaddons.glade
-gramps/gui/grampsbar.py
gramps/gui/grampsgui.py
gramps/gui/logger/_errorreportassistant.py
gramps/gui/logger/_errorview.py
@@ -481,6 +481,7 @@ gramps/gui/views/treemodels/placemodel.py
gramps/gui/views/treemodels/treebasemodel.py
gramps/gui/widgets/buttons.py
gramps/gui/widgets/expandcollapsearrow.py
+gramps/gui/widgets/grampletbar.py
gramps/gui/widgets/grampletpane.py
gramps/gui/widgets/labels.py
gramps/gui/widgets/monitoredwidgets.py
@@ -571,8 +572,9 @@ gramps/plugins/lib/libplaceview.py
gramps/plugins/lib/libplugins.gpr.py
gramps/plugins/lib/librecords.py
gramps/plugins/lib/libtranslate.py
+gramps/plugins/lib/libtreebase.py
gramps/plugins/lib/maps/geography.py
-gramps/plugins/lib/maps/osmGps.py
+gramps/plugins/lib/maps/osmgps.py
gramps/plugins/lib/maps/placeselection.py
gramps/plugins/mapservices/eniroswedenmap.py
gramps/plugins/mapservices/mapservice.gpr.py
@@ -590,6 +592,10 @@ gramps/plugins/quickview/reporef.py
gramps/plugins/quickview/samesurnames.py
gramps/plugins/quickview/siblings.py
gramps/plugins/rel/relplugins.gpr.py
+gramps/plugins/sidebar/categorysidebar.py
+gramps/plugins/sidebar/dropdownsidebar.py
+gramps/plugins/sidebar/expandersidebar.py
+gramps/plugins/sidebar/sidebar.gpr.py
gramps/plugins/textreport/alphabeticalindex.py
gramps/plugins/textreport/ancestorreport.py
gramps/plugins/textreport/birthdayreport.py
@@ -651,6 +657,7 @@ gramps/plugins/tool/verify.glade
gramps/plugins/tool/verify.py
gramps/plugins/view/citationlistview.py
gramps/plugins/view/citationtreeview.py
+gramps/plugins/view/dashboardview.py
gramps/plugins/view/eventview.py
gramps/plugins/view/familyview.py
gramps/plugins/view/fanchartdescview.py
@@ -663,7 +670,6 @@ gramps/plugins/view/geography.gpr.py
gramps/plugins/view/geomoves.py
gramps/plugins/view/geoperson.py
gramps/plugins/view/geoplaces.py
-gramps/plugins/view/grampletview.py
gramps/plugins/view/htmlrenderer.gpr.py
gramps/plugins/view/htmlrenderer.py
gramps/plugins/view/mediaview.py
@@ -699,4 +705,4 @@ gramps/webapp/grampsdb/views.py
data/gramps.desktop.in
data/gramps.keys.in
data/gramps.xml.in
-gramps/data/tips.xml.in
+data/tips.xml.in
diff --git a/po/POTFILES.skip b/po/POTFILES.skip
index 42f5858d9..dad7955d9 100644
--- a/po/POTFILES.skip
+++ b/po/POTFILES.skip
@@ -264,9 +264,9 @@ gramps/gen/utils/test/callback_test.py
# gen.utils.docgen
#
gramps/gen/utils/docgen/__init__.py
-gramps/gen/utils/docgen/CSVTab.py
-gramps/gen/utils/docgen/ODSTab.py
-gramps/gen/utils/docgen/TabbedDoc.py
+gramps/gen/utils/docgen/csvtab.py
+gramps/gen/utils/docgen/odstab.py
+gramps/gen/utils/docgen/tabbeddoc.py
#
# gui - GUI code
#
@@ -424,7 +424,7 @@ gramps/plugins/drawreport/__init__.py
#
gramps/plugins/export/exportftree.py
gramps/plugins/export/__init__.py
-gramps/plugins/export/test/exportVCard_test.py
+gramps/plugins/export/test/exportvcard_test.py
#
# plugins/lib directory
#
@@ -464,7 +464,7 @@ gramps/plugins/quickview/__init__.py
# plugins/import directory
#
gramps/plugins/importer/__init__.py
-gramps/plugins/importer/test/importVCard_test.py
+gramps/plugins/importer/test/importvcard_test.py
#
# plugins/gramplet directory
#
@@ -543,6 +543,7 @@ gramps/test/utils_test.py
gramps/webapp/connection.py
gramps/webapp/context.py
gramps/webapp/dbdjango.py
+gramps/webapp/utils.py
gramps/webapp/grampsdb/admin.py
gramps/webapp/grampsdb/forms.py
gramps/webapp/grampsdb/__init__.py
diff --git a/po/check_po b/po/check_po
index a309c99d8..20a83fc86 100755
--- a/po/check_po
+++ b/po/check_po
@@ -41,555 +41,558 @@ all_coverage = {}
all_template_coverage = {}
def strip_quotes(st):
- if len(st) >= 2 and st[0] == '"' and st[len(st)-1] == '"':
- st = st.strip()[1:-1]
- return st
+ if len(st) >= 2 and st[0] == '"' and st[len(st)-1] == '"':
+ st = st.strip()[1:-1]
+ return st
class CheckException( Exception ):
- pass
+ pass
# This is a base class for all checks
class Check:
- def __init__( self ):
- self.msgs = []
- def diag( self ):
- if len( self.msgs ):
- print
- print self.diag_header
- for m in self.msgs:
- m.diag()
- def summary( self ):
- print "%-20s%d" % ( self.summary_text, len(self.msgs) )
+ def __init__( self ):
+ self.msgs = []
+ def diag( self ):
+ if len( self.msgs ):
+ print
+ print(self.diag_header)
+ for m in self.msgs:
+ m.diag()
+ def summary( self ):
+ print("%-20s%d" % ( self.summary_text, len(self.msgs) ))
class Check_fmt( Check ):
- def __init__( self, fmt ):
- Check.__init__( self )
- self.diag_header = "-------- %s mismatches --------------" % fmt
- self.summary_text = "%s mismatches:" % fmt
- self.fmt = fmt
+ def __init__( self, fmt ):
+ Check.__init__( self )
+ self.diag_header = "-------- %s mismatches --------------" % fmt
+ self.summary_text = "%s mismatches:" % fmt
+ self.fmt = fmt
- def __process( self, msg, msgid, msgstr ):
- cnt1 = msgid.count( self.fmt )
- cnt2 = msgstr.count( self.fmt )
- if cnt1 != cnt2:
- self.msgs.append( msg )
+ def __process( self, msg, msgid, msgstr ):
+ cnt1 = msgid.count( self.fmt )
+ cnt2 = msgstr.count( self.fmt )
+ if cnt1 != cnt2:
+ self.msgs.append( msg )
- def process( self, msg ):
- msgid = msg.msgid
- msgstr = msg.msgstr[0]
- self.__process( msg, msgid, msgstr )
+ def process( self, msg ):
+ msgid = msg.msgid
+ msgstr = msg.msgstr[0]
+ self.__process( msg, msgid, msgstr )
- if msg.msgidp and len(msg.msgstr) >= 2:
- msgid = msg.msgidp
- msgstr = msg.msgstr[1]
- self.__process( msg, msgid, msgstr )
+ if msg.msgidp and len(msg.msgstr) >= 2:
+ msgid = msg.msgidp
+ msgstr = msg.msgstr[1]
+ self.__process( msg, msgid, msgstr )
class Check_named_fmt( Check ):
- # A pattern to find all %()
- find_named_fmt_pat = re.compile('% \( \w+ \) \d* \D', re.VERBOSE)
+ # A pattern to find all %()
+ find_named_fmt_pat = re.compile('% \( \w+ \) \d* \D', re.VERBOSE)
- def __init__( self ):
- Check.__init__( self )
- self.diag_header = "-------- %() name mismatches --------------"
- self.summary_text = "%() name mismatches:"
+ def __init__( self ):
+ Check.__init__( self )
+ self.diag_header = "-------- %() name mismatches --------------"
+ self.summary_text = "%() name mismatches:"
- def __process( self, msg, msgid, msgstr ):
- # Same number of named formats?
- fmts1 = self.find_named_fmt_pat.findall( msgid )
- fmts2 = self.find_named_fmt_pat.findall( msgstr )
- if len( fmts1 ) != len( fmts2 ):
- self.msgs.append( msg )
- else:
- # Do we have the same named formats?
- fmts1.sort()
- fmts2.sort()
- if fmts1 != fmts2:
- self.msgs.append( msg )
+ def __process( self, msg, msgid, msgstr ):
+ # Same number of named formats?
+ fmts1 = self.find_named_fmt_pat.findall( msgid )
+ fmts2 = self.find_named_fmt_pat.findall( msgstr )
+ if len( fmts1 ) != len( fmts2 ):
+ self.msgs.append( msg )
+ else:
+ # Do we have the same named formats?
+ fmts1.sort()
+ fmts2.sort()
+ if fmts1 != fmts2:
+ self.msgs.append( msg )
- def process( self, msg ):
- msgid = msg.msgid
- msgstr = msg.msgstr[0]
- self.__process( msg, msgid, msgstr )
+ def process( self, msg ):
+ msgid = msg.msgid
+ msgstr = msg.msgstr[0]
+ self.__process( msg, msgid, msgstr )
- if msg.msgidp and len(msg.msgstr) >= 2:
- msgid = msg.msgidp
- msgstr = msg.msgstr[1]
- self.__process( msg, msgid, msgstr )
+ if msg.msgidp and len(msg.msgstr) >= 2:
+ msgid = msg.msgidp
+ msgstr = msg.msgstr[1]
+ self.__process( msg, msgid, msgstr )
class Check_missing_sd( Check ):
- # A pattern to find %() without s or d
- # Here is a command to use for testing
- # print re.compile('% \( \w+ \) \d* (\D|$)', re.VERBOSE).findall( '%(event_name)s: %(place)s%(endnotes)s. ' )
- find_named_fmt_pat2 = re.compile('% \( \w+ \) \d* (\D|$)', re.VERBOSE)
+ # A pattern to find %() without s or d
+ # Here is a command to use for testing
+ # print(re.compile('% \( \w+ \) \d* (\D|$)', re.VERBOSE).findall( '%(event_name)s: %(place)s%(endnotes)s. ' ))
+ find_named_fmt_pat2 = re.compile('% \( \w+ \) \d* (\D|$)', re.VERBOSE)
- def __init__( self ):
- Check.__init__( self )
- self.diag_header = "-------- %() without 's' or 'd' mismatches --------------"
- self.summary_text = "%() missing s/d:"
- def process( self, msg ):
- for msgstr in msg.msgstr:
- fmts = self.find_named_fmt_pat2.findall( msgstr )
- for f in fmts:
- if not f in ('s', 'd'):
- self.msgs.append( msg )
- break
+ def __init__( self ):
+ Check.__init__( self )
+ self.diag_header = "-------- %() without 's' or 'd' mismatches --------------"
+ self.summary_text = "%() missing s/d:"
+ def process( self, msg ):
+ for msgstr in msg.msgstr:
+ fmts = self.find_named_fmt_pat2.findall( msgstr )
+ for f in fmts:
+ if not f in ('s', 'd'):
+ self.msgs.append( msg )
+ break
class Check_runaway( Check ):
- def __init__( self ):
- Check.__init__( self )
- self.diag_header = "-------- Runaway context in translation ---------"
- self.summary_text = "Runaway context:"
+ def __init__( self ):
+ Check.__init__( self )
+ self.diag_header = "-------- Runaway context in translation ---------"
+ self.summary_text = "Runaway context:"
- def __process( self, msg, msgid, msgstr ):
- # Runaway context. In the translated part we only to see
- # the translation of the word after the |
- if msgid.count('|') > 0 and msgstr.count('|') > 0 and msgid != msgstr:
- self.msgs.append( msg )
+ def __process( self, msg, msgid, msgstr ):
+ # Runaway context. In the translated part we only to see
+ # the translation of the word after the |
+ if msgid.count('|') > 0 and msgstr.count('|') > 0 and msgid != msgstr:
+ self.msgs.append( msg )
- def process( self, msg ):
- msgid = msg.msgid
- msgstr = msg.msgstr[0]
- self.__process( msg, msgid, msgstr )
+ def process( self, msg ):
+ msgid = msg.msgid
+ msgstr = msg.msgstr[0]
+ self.__process( msg, msgid, msgstr )
- if msg.msgidp and len(msg.msgstr) >= 2:
- msgid = msg.msgidp
- msgstr = msg.msgstr[1]
- self.__process( msg, msgid, msgstr )
+ if msg.msgidp and len(msg.msgstr) >= 2:
+ msgid = msg.msgidp
+ msgstr = msg.msgstr[1]
+ self.__process( msg, msgid, msgstr )
class Check_xml_chars( Check ):
- # Special XML characters
- # It is not allowed to have a quote, an ampersand or an angle bracket
- xml_chars_pat = re.compile( r'<(?!(b>|/b>|i>|/i>|br/>)) | (?<=!( | " | & (?!(quot|nbsp|gt|amp);)', re.VERBOSE )
+ # Special XML characters
+ # It is not allowed to have a quote, an ampersand or an angle bracket
+ xml_chars_pat = re.compile( r'<(?!(b>|/b>|i>|/i>|br/>)) | (?<=!( | " | & (?!(quot|nbsp|gt|amp);)', re.VERBOSE )
- def __init__( self ):
- Check.__init__( self )
- self.diag_header = "-------- unescaped XML special characters ---------"
- self.summary_text = "XML special chars:"
+ def __init__( self ):
+ Check.__init__( self )
+ self.diag_header = "-------- unescaped XML special characters ---------"
+ self.summary_text = "XML special chars:"
- def process( self, msg ):
- msgid = msg.msgid
- msgstr = msg.msgstr[0]
+ def process( self, msg ):
+ msgid = msg.msgid
+ msgstr = msg.msgstr[0]
- # XML errors
- # Only look at messages in the tips.xml
- if msg.is_tips_xml:
- if self.xml_chars_pat.search( msgstr ):
- self.msgs.append( msg )
+ # XML errors
+ # Only look at messages in the tips.xml
+ if msg.is_tips_xml:
+ if self.xml_chars_pat.search( msgstr ):
+ self.msgs.append( msg )
class Check_last_char( Check ):
- def __init__( self ):
- Check.__init__( self )
- self.diag_header = "-------- last character not identical ---------"
- self.summary_text = "Last character:"
+ def __init__( self ):
+ Check.__init__( self )
+ self.diag_header = "-------- last character not identical ---------"
+ self.summary_text = "Last character:"
- def __process( self, msg, msgid, msgstr ):
- msgid_last = msgid[-1:]
- msgstr_last = msgstr[-1:]
- if msgid_last.isspace() != msgstr_last.isspace():
- self.msgs.append( msg )
- elif (msgid_last == '.') != (msgstr_last == '.'):
- self.msgs.append( msg )
+ def __process( self, msg, msgid, msgstr ):
+ msgid_last = msgid[-1:]
+ msgstr_last = msgstr[-1:]
+ if msgid_last.isspace() != msgstr_last.isspace():
+ self.msgs.append( msg )
+ elif (msgid_last == '.') != (msgstr_last == '.'):
+ self.msgs.append( msg )
- def process( self, msg ):
- # Last character of msgid? White space? Period?
- if msg.is_fuzzy:
- return
- msgid = msg.msgid
- msgstr = msg.msgstr[0]
- self.__process( msg, msgid, msgstr )
+ def process( self, msg ):
+ # Last character of msgid? White space? Period?
+ if msg.is_fuzzy:
+ return
+ msgid = msg.msgid
+ msgstr = msg.msgstr[0]
+ self.__process( msg, msgid, msgstr )
- if msg.msgidp and len(msg.msgstr) >= 2:
- msgid = msg.msgidp
- msgstr = msg.msgstr[1]
- self.__process( msg, msgid, msgstr )
+ if msg.msgidp and len(msg.msgstr) >= 2:
+ msgid = msg.msgidp
+ msgstr = msg.msgstr[1]
+ self.__process( msg, msgid, msgstr )
class Check_shortcut_trans( Check ):
- def __init__( self ):
- Check.__init__( self )
- self.diag_header = "-------- shortcut key in translation ---------"
- self.summary_text = "Shortcut in msgstr:"
+ def __init__( self ):
+ Check.__init__( self )
+ self.diag_header = "-------- shortcut key in translation ---------"
+ self.summary_text = "Shortcut in msgstr:"
- def __process( self, msg, msgid, msgstr ):
- if msgid.count('_') == 0 and msgstr.count('_') > 0:
- self.msgs.append( msg )
+ def __process( self, msg, msgid, msgstr ):
+ if msgid.count('_') == 0 and msgstr.count('_') > 0:
+ self.msgs.append( msg )
- def process( self, msg ):
- msgid = msg.msgid
- msgstr = msg.msgstr[0]
- self.__process( msg, msgid, msgstr )
+ def process( self, msg ):
+ msgid = msg.msgid
+ msgstr = msg.msgstr[0]
+ self.__process( msg, msgid, msgstr )
- if msg.msgidp and len(msg.msgstr) >= 2:
- msgid = msg.msgidp
- msgstr = msg.msgstr[1]
- self.__process( msg, msgid, msgstr )
+ if msg.msgidp and len(msg.msgstr) >= 2:
+ msgid = msg.msgidp
+ msgstr = msg.msgstr[1]
+ self.__process( msg, msgid, msgstr )
class Msgid:
- fuzzy_pat = re.compile( 'fuzzy' )
- tips_xml_pat = re.compile( r'tips\.xml' )
- def __init__( self, msgnr, lineno ):
- self._msgid = [] # For debugging purpose the original text
- self._msgidp = [] # For debugging purpose the original text
- self._msgstr = [] # For debugging purpose the original text
- self.msgid = ''
- self.msgidp = ''
- self.msgstr = [] # This is a list to support plural
- self._cmnt = []
- self.nr = msgnr
- self.lineno = lineno
- self.is_fuzzy = 0
- self.is_tips_xml = 0
+ fuzzy_pat = re.compile( 'fuzzy' )
+ tips_xml_pat = re.compile( r'tips\.xml' )
+ def __init__( self, msgnr, lineno ):
+ self._msgid = [] # For debugging purpose the original text
+ self._msgidp = [] # For debugging purpose the original text
+ self._msgstr = [] # For debugging purpose the original text
+ self.msgid = ''
+ self.msgidp = ''
+ self.msgstr = [] # This is a list to support plural
+ self._cmnt = []
+ self.nr = msgnr
+ self.lineno = lineno
+ self.is_fuzzy = 0
+ self.is_tips_xml = 0
- def diag( self ):
- print
- print "msg nr: %d, lineno: %d%s" % ( self.nr, self.lineno, self.is_fuzzy and " (fuzzy)" or "" )
- sys.stdout.write( ''.join( self._msgid ) )
- sys.stdout.write( ''.join( self._msgidp ) )
- sys.stdout.write( ''.join( self._msgstr ) )
+ def diag( self ):
+ print
+ print("msg nr: %d, lineno: %d%s" % ( self.nr, self.lineno, self.is_fuzzy and " (fuzzy)" or "" ))
+ sys.stdout.write( ''.join( self._msgid ) )
+ sys.stdout.write( ''.join( self._msgidp ) )
+ sys.stdout.write( ''.join( self._msgstr ) )
- def add_msgid( self, line, lineno ):
- self._msgid.append( line )
- line = re.sub( r'msgid\s+', '', line )
- line = line.strip()
- if line[0] != '"' or line[-1:] != '"':
- print "ERROR at line %d: Missing quote." % lineno
- line = strip_quotes( line )
- self.msgid += line
+ def add_msgid( self, line, lineno ):
+ self._msgid.append( line )
+ line = re.sub( r'msgid\s+', '', line )
+ line = line.strip()
+ if line[0] != '"' or line[-1:] != '"':
+ print("ERROR at line %d: Missing quote." % lineno)
+ line = strip_quotes( line )
+ self.msgid += line
- def add_msgidp( self, line, lineno ):
- self._msgidp.append( line )
- line = re.sub( r'msgid_plural\s+', '', line )
- line = line.strip()
- if line[0] != '"' or line[-1:] != '"':
- print "ERROR at line %d: Missing quote." % lineno
- line = strip_quotes( line )
- self.msgidp += line
+ def add_msgidp( self, line, lineno ):
+ self._msgidp.append( line )
+ line = re.sub( r'msgid_plural\s+', '', line )
+ line = line.strip()
+ if line[0] != '"' or line[-1:] != '"':
+ print("ERROR at line %d: Missing quote." % lineno)
+ line = strip_quotes( line )
+ self.msgidp += line
- def add_new_msgstr( self, line, lineno ):
- self.msgstr.append( '' ) # Start a new msgstr
- self.add_msgstr( line, lineno )
+ def add_new_msgstr( self, line, lineno ):
+ self.msgstr.append( '' ) # Start a new msgstr
+ self.add_msgstr( line, lineno )
- def add_msgstr( self, line, lineno ):
- self._msgstr.append( line )
- line = re.sub( r'msgstr(\[\d\])?\s+', '', line )
- line = line.strip()
- if line[0] != '"' or line[-1:] != '"':
- print "ERROR at line %d: Missing quote." % lineno
- line = strip_quotes( line )
- self.msgstr[-1] += line
+ def add_msgstr( self, line, lineno ):
+ self._msgstr.append( line )
+ line = re.sub( r'msgstr(\[\d\])?\s+', '', line )
+ line = line.strip()
+ if line[0] != '"' or line[-1:] != '"':
+ print("ERROR at line %d: Missing quote." % lineno)
+ line = strip_quotes( line )
+ self.msgstr[-1] += line
- def add_cmnt( self, line ):
- self._cmnt.append( line )
- if not self.is_fuzzy and self.fuzzy_pat.search( line ):
- self.is_fuzzy = 1
- if not self.is_tips_xml and self.tips_xml_pat.search( line ):
- self.is_tips_xml = 1
+ def add_cmnt( self, line ):
+ self._cmnt.append( line )
+ if not self.is_fuzzy and self.fuzzy_pat.search( line ):
+ self.is_fuzzy = 1
+ if not self.is_tips_xml and self.tips_xml_pat.search( line ):
+ self.is_tips_xml = 1
def create_new_Msgid( msgs, lineno ):
- msg = Msgid( len(msgs), lineno )
- msgs.append( msg )
- return msg
+ msg = Msgid( len(msgs), lineno )
+ msgs.append( msg )
+ return msg
def read_msgs( fname ):
- empty_pat = re.compile( r'^ \s* $', re.VERBOSE )
- comment_pat = re.compile( r'\#', re.VERBOSE )
- msgid_pat = re.compile( r'msgid \s+ "', re.VERBOSE )
- msgid_plural_pat = re.compile( r'msgid_plural \s+ "', re.VERBOSE )
- msgstr_pat = re.compile( r'msgstr (\[\d\])? \s+ "', re.VERBOSE )
- str_pat = re.compile( r'"', re.VERBOSE )
- old_pat = re.compile( r'\#~ \s+ ', re.VERBOSE )
+ empty_pat = re.compile( r'^ \s* $', re.VERBOSE )
+ comment_pat = re.compile( r'\#', re.VERBOSE )
+ msgid_pat = re.compile( r'msgid \s+ "', re.VERBOSE )
+ msgid_plural_pat = re.compile( r'msgid_plural \s+ "', re.VERBOSE )
+ msgstr_pat = re.compile( r'msgstr (\[\d\])? \s+ "', re.VERBOSE )
+ str_pat = re.compile( r'"', re.VERBOSE )
+ old_pat = re.compile( r'\#~ \s+ ', re.VERBOSE )
- f = open( fname )
- lines = f.readlines()
-
- # parse it like a statemachine
- NONE = 'NONE' # Nothing detected, yet
- CMNT = 'CMNT' # Inside comment part
- MSGID = 'msgid' # Inside msgid part
- MSGIDP = 'msgid_plural' # Inside msgid_plural part
- MSGSTR = 'msgstr' # Inside msgstr part
- STR = 'STR' # A continuation string
- OLD = 'OLD' # An old pattern with #~
+ f = open( fname )
+ lines = f.readlines()
- global msgs
- state = NONE
- msg = None
+ # parse it like a statemachine
+ NONE = 'NONE' # Nothing detected, yet
+ CMNT = 'CMNT' # Inside comment part
+ MSGID = 'msgid' # Inside msgid part
+ MSGIDP = 'msgid_plural' # Inside msgid_plural part
+ MSGSTR = 'msgstr' # Inside msgstr part
+ STR = 'STR' # A continuation string
+ OLD = 'OLD' # An old pattern with #~
- msgs = []
- for ix, line in enumerate( lines ): # Use line numbers for messages
- lineno = ix + 1
+ global msgs
+ state = NONE
+ msg = None
- m = empty_pat.match( line )
- if m:
- continue # Empty lines are not interesting
+ msgs = []
+ for ix, line in enumerate( lines ): # Use line numbers for messages
+ lineno = ix + 1
- # What's the next state?
- if old_pat.match( line ):
- next_state = OLD
- elif comment_pat.match( line ):
- next_state = CMNT
- elif msgid_pat.match( line ):
- next_state = MSGID
- elif msgid_plural_pat.match( line ):
- next_state = MSGIDP
- elif msgstr_pat.match( line ):
- next_state = MSGSTR
- elif str_pat.match( line ):
- next_state = STR
- else:
- print 'WARNING: Unexpected input at %(fname)s:%(lineno)d' % vars()
- next_state = NONE
+ m = empty_pat.match( line )
+ if m:
+ continue # Empty lines are not interesting
- #print "%(state)d->%(next_state)d\t%(line)s" % vars()
- if state == NONE:
- # expect msgid or comment or old stuff
- if next_state == CMNT:
- state = CMNT
- msg = create_new_Msgid( msgs, lineno ) # Start with an empty new item
- msg.add_cmnt( line )
+ # What's the next state?
+ if old_pat.match( line ):
+ next_state = OLD
+ elif comment_pat.match( line ):
+ next_state = CMNT
+ elif msgid_pat.match( line ):
+ next_state = MSGID
+ elif msgid_plural_pat.match( line ):
+ next_state = MSGIDP
+ elif msgstr_pat.match( line ):
+ next_state = MSGSTR
+ elif str_pat.match( line ):
+ next_state = STR
+ else:
+ print('WARNING: Unexpected input at %(fname)s:%(lineno)d' % vars())
+ next_state = NONE
- elif next_state == MSGID:
- state = MSGID
- msg = create_new_Msgid( msgs, lineno ) # Start with an empty new item
- msg.add_msgid( line, lineno )
+ #print("%(state)d->%(next_state)d\t%(line)s" % vars())
+ if state == NONE:
+ # expect msgid or comment or old stuff
+ if next_state == CMNT:
+ state = CMNT
+ msg = create_new_Msgid( msgs, lineno ) # Start with an empty new item
+ msg.add_cmnt( line )
- elif next_state == MSGIDP:
- raise CheckException( 'Unexpected %(next_state)s at %(fname)s:%(lineno)d' % vars() )
+ elif next_state == MSGID:
+ state = MSGID
+ msg = create_new_Msgid( msgs, lineno ) # Start with an empty new item
+ msg.add_msgid( line, lineno )
- elif next_state == MSGSTR:
- print 'WARNING: Wild msgstr at %(fname)s:%(lineno)d' % vars()
- state = MSGSTR
- msg = create_new_Msgid( msgs, lineno ) # Start with an empty new item
- msg.add_new_msgstr( line, lineno )
+ elif next_state == MSGIDP:
+ raise CheckException( 'Unexpected %(next_state)s at %(fname)s:%(lineno)d' % vars() )
- elif next_state == STR:
- print 'WARNING: Wild string at %(fname)s:%(lineno)d' % vars()
+ elif next_state == MSGSTR:
+ print('WARNING: Wild msgstr at %(fname)s:%(lineno)d' % vars())
+ state = MSGSTR
+ msg = create_new_Msgid( msgs, lineno ) # Start with an empty new item
+ msg.add_new_msgstr( line, lineno )
- elif next_state == OLD:
- pass # Just skip
+ elif next_state == STR:
+ print('WARNING: Wild string at %(fname)s:%(lineno)d' % vars())
- else:
- raise CheckException( 'Unexpected state in po parsing (state = %(state)s)' % vars() )
+ elif next_state == OLD:
+ pass # Just skip
- elif state == CMNT:
- # Expect more comment, or msgid. If msgstr or string it is flagged as error.
- if next_state == CMNT:
- if msg:
- msg.add_cmnt( line )
- else:
- # Note. We may need to do something about these comments
- # Skip for now
- pass
+ else:
+ raise CheckException( 'Unexpected state in po parsing (state = %(state)s)' % vars() )
- elif next_state == MSGID:
- state = MSGID
- if not msg:
- msg = create_new_Msgid( msgs, lineno ) # Start with an empty new item
- msg.add_msgid( line, lineno )
+ elif state == CMNT:
+ # Expect more comment, or msgid. If msgstr or string it is flagged as error.
+ if next_state == CMNT:
+ if msg:
+ msg.add_cmnt( line )
+ else:
+ # Note. We may need to do something about these comments
+ # Skip for now
+ pass
- elif next_state == MSGIDP:
- raise CheckException( 'Unexpected %(next_state)s at %(fname)s:%(lineno)d' % vars() )
+ elif next_state == MSGID:
+ state = MSGID
+ if not msg:
+ msg = create_new_Msgid( msgs, lineno ) # Start with an empty new item
+ msg.add_msgid( line, lineno )
- elif next_state == MSGSTR:
- print 'WARNING: Wild msgstr at %(fname)s:%(lineno)d' % vars()
- state = MSGSTR
- msg = create_new_Msgid( msgs, lineno ) # Start with an empty new item
- msg.add_new_msgstr( line, lineno )
+ elif next_state == MSGIDP:
+ raise CheckException( 'Unexpected %(next_state)s at %(fname)s:%(lineno)d' % vars() )
- elif next_state == STR:
- print 'WARNING: Wild string at %(fname)s:%(lineno)d' % vars()
+ elif next_state == MSGSTR:
+ print('WARNING: Wild msgstr at %(fname)s:%(lineno)d' % vars())
+ state = MSGSTR
+ msg = create_new_Msgid( msgs, lineno ) # Start with an empty new item
+ msg.add_new_msgstr( line, lineno )
- elif next_state == OLD:
- msg = None
- pass # Just skip
+ elif next_state == STR:
+ print('WARNING: Wild string at %(fname)s:%(lineno)d' % vars())
- else:
- raise CheckException( 'Unexpected state in po parsing (state = %(state)s)' % vars() )
+ elif next_state == OLD:
+ msg = None
+ pass # Just skip
- elif state == MSGID:
- # Expect msgstr or msgid_plural or string
- if next_state == CMNT:
- # Hmmm. A comment here?
- print 'WARNING: Unexpted comment at %(fname)s:%(lineno)d' % vars()
+ else:
+ raise CheckException( 'Unexpected state in po parsing (state = %(state)s)' % vars() )
- elif next_state == MSGID:
- raise CheckException( 'Unexpected %(next_state)s at %(fname)s:%(lineno)d' % vars() )
+ elif state == MSGID:
+ # Expect msgstr or msgid_plural or string
+ if next_state == CMNT:
+ # Hmmm. A comment here?
+ print('WARNING: Unexpted comment at %(fname)s:%(lineno)d' % vars())
- elif next_state == MSGIDP:
- state = MSGIDP
- msg.add_msgidp( line, lineno )
+ elif next_state == MSGID:
+ raise CheckException( 'Unexpected %(next_state)s at %(fname)s:%(lineno)d' % vars() )
- elif next_state == MSGSTR:
- state = MSGSTR
- msg.add_new_msgstr( line, lineno )
+ elif next_state == MSGIDP:
+ state = MSGIDP
+ msg.add_msgidp( line, lineno )
- elif next_state == STR:
- # Continuation of msgid, stay in state MSGID
- msg.add_msgid( line, lineno )
+ elif next_state == MSGSTR:
+ state = MSGSTR
+ msg.add_new_msgstr( line, lineno )
- elif next_state == OLD:
- msg = None
- pass # Just skip
+ elif next_state == STR:
+ # Continuation of msgid, stay in state MSGID
+ msg.add_msgid( line, lineno )
- else:
- raise CheckException( 'Unexpected state in po parsing (state = %(state)s)' % vars() )
+ elif next_state == OLD:
+ msg = None
+ pass # Just skip
- elif state == MSGIDP:
- # Expect msgstr or string or comment
- if next_state == CMNT:
- # Hmmm. A comment here?
- print 'WARNING: Unexpted comment at %(fname)s:%(lineno)d' % vars()
+ else:
+ raise CheckException( 'Unexpected state in po parsing (state = %(state)s)' % vars() )
- elif next_state == MSGID:
- raise CheckException( 'Unexpected %(next_state)s at %(fname)s:%(lineno)d' % vars() )
+ elif state == MSGIDP:
+ # Expect msgstr or string or comment
+ if next_state == CMNT:
+ # Hmmm. A comment here?
+ print('WARNING: Unexpted comment at %(fname)s:%(lineno)d' % vars())
- elif next_state == MSGIDP:
- raise CheckException( 'Unexpected %(next_state)s at %(fname)s:%(lineno)d' % vars() )
+ elif next_state == MSGID:
+ raise CheckException( 'Unexpected %(next_state)s at %(fname)s:%(lineno)d' % vars() )
- elif next_state == MSGSTR:
- state = MSGSTR
- msg.add_new_msgstr( line, lineno )
+ elif next_state == MSGIDP:
+ raise CheckException( 'Unexpected %(next_state)s at %(fname)s:%(lineno)d' % vars() )
- elif next_state == STR:
- # Continuation of msgid_plural, stay in state MSGIDP
- msg.add_msgidp( line, lineno )
+ elif next_state == MSGSTR:
+ state = MSGSTR
+ msg.add_new_msgstr( line, lineno )
- elif next_state == OLD:
- msg = None
- pass # Just skip
+ elif next_state == STR:
+ # Continuation of msgid_plural, stay in state MSGIDP
+ msg.add_msgidp( line, lineno )
- else:
- raise CheckException( 'Unexpected state in po parsing (state = %(state)s)' % vars() )
+ elif next_state == OLD:
+ msg = None
+ pass # Just skip
- elif state == MSGSTR:
- # Expect comment, or msgid, or string.
- if next_state == CMNT:
- # A comment probably starts a new item
- state = CMNT
- msg = create_new_Msgid( msgs, lineno )
- msg.add_cmnt( line )
+ else:
+ raise CheckException( 'Unexpected state in po parsing (state = %(state)s)' % vars() )
- elif next_state == MSGID:
- state = MSGID
- msg = create_new_Msgid( msgs, lineno )
- msg.add_msgid( line, lineno )
+ elif state == MSGSTR:
+ # Expect comment, or msgid, or string.
+ if next_state == CMNT:
+ # A comment probably starts a new item
+ state = CMNT
+ msg = create_new_Msgid( msgs, lineno )
+ msg.add_cmnt( line )
- elif next_state == MSGIDP:
- raise CheckException( 'Unexpected %(next_state)s at %(fname)s:%(lineno)d' % vars() )
+ elif next_state == MSGID:
+ state = MSGID
+ msg = create_new_Msgid( msgs, lineno )
+ msg.add_msgid( line, lineno )
- elif next_state == MSGSTR:
- # New msgstr, probably for plural form
- # Stay in MSGSTR state
- msg.add_new_msgstr( line, lineno )
+ elif next_state == MSGIDP:
+ raise CheckException( 'Unexpected %(next_state)s at %(fname)s:%(lineno)d' % vars() )
- elif next_state == STR:
- msg.add_msgstr( line, lineno )
+ elif next_state == MSGSTR:
+ # New msgstr, probably for plural form
+ # Stay in MSGSTR state
+ msg.add_new_msgstr( line, lineno )
- elif next_state == OLD:
- msg = None
- pass # Just skip
+ elif next_state == STR:
+ msg.add_msgstr( line, lineno )
- else:
- raise CheckException( 'Unexpected state in po parsing (state = %(state)s)' % vars() )
+ elif next_state == OLD:
+ msg = None
+ pass # Just skip
- else:
- raise CheckException( 'Unexpected state in po parsing (state = %(state)s)' % vars() )
+ else:
+ raise CheckException( 'Unexpected state in po parsing (state = %(state)s)' % vars() )
- # Strip items with just comments. (Can this happen?)
- msgs1 = []
- for m in msgs:
- if not m.msgid and not m.msgstr:
- #print "INFO: No msgid or msgstr at %s:%s" % ( fname, m.lineno )
- pass
- else:
- msgs1.append( m )
- msgs = msgs1
- return msgs
+ else:
+ raise CheckException( 'Unexpected state in po parsing (state = %(state)s)' % vars() )
+
+ # Strip items with just comments. (Can this happen?)
+ msgs1 = []
+ for m in msgs:
+ if not m.msgid and not m.msgstr:
+ #print("INFO: No msgid or msgstr at %s:%s" % ( fname, m.lineno ))
+ pass
+ else:
+ msgs1.append( m )
+ msgs = msgs1
+ return msgs
def analyze_msgs( args, fname, msgs, nr_templates = None, nth = 0 ):
- nr_fuzzy = 0
- nr_untranslated = 0
+ nr_fuzzy = 0
+ nr_untranslated = 0
- checks = []
- checks.append( Check_fmt( '%s' ) )
- checks.append( Check_fmt( '%d' ) )
- checks.append( Check_named_fmt() )
- checks.append( Check_missing_sd() )
- checks.append( Check_runaway() )
- checks.append( Check_xml_chars() )
- checks.append( Check_last_char() )
- checks.append( Check_shortcut_trans() )
+ checks = []
+ checks.append( Check_fmt( '%s' ) )
+ checks.append( Check_fmt( '%d' ) )
+ checks.append( Check_named_fmt() )
+ checks.append( Check_missing_sd() )
+ checks.append( Check_runaway() )
+ checks.append( Check_xml_chars() )
+ checks.append( Check_last_char() )
+ checks.append( Check_shortcut_trans() )
- for msg in msgs:
- msgid = msg.msgid
- msgstr = msg.msgstr
- #print
- #print "msgid: %(msgid)s" % vars()
- #print "msgstr: %(msgstr)s" % vars()
+ for msg in msgs:
+ msgid = msg.msgid
+ msgstr = msg.msgstr
+ #print
+ #print("msgid: %(msgid)s" % vars())
+ #print("msgstr: %(msgstr)s" % vars())
- if ''.join(msgstr) == '':
- nr_untranslated += 1
- continue
+ if ''.join(msgstr) == '':
+ nr_untranslated += 1
+ continue
- if msg.is_fuzzy:
- nr_fuzzy += 1
+ if msg.is_fuzzy:
+ nr_fuzzy += 1
+ continue
- for c in checks:
- c.process( msg )
+ for c in checks:
+ c.process( msg )
- nr_msgs = len(msgs)
- if nth > 0:
- print
- print "====================================="
- print "%-20s%s" % ( "File:", fname )
- print "%-20s%d" % ( "Template total:", nr_templates )
- print "%-20s%d" % ( "PO total:", nr_msgs )
- print "%-20s%d" % ( "Fuzzy:", nr_fuzzy )
- print "%-20s%d" % ( "Untranslated:", nr_untranslated )
+ nr_msgs = len(msgs)
+ if nth > 0:
+ print
+ print("=====================================")
+ print("%-20s%s" % ( "File:", fname ))
+ print("%-20s%d" % ( "Template total:", nr_templates ))
+ print("%-20s%d" % ( "PO total:", nr_msgs ))
+ print("%-20s%d" % ( "Fuzzy:", nr_fuzzy ))
+ print("%-20s%d" % ( "Untranslated:", nr_untranslated ))
- for c in checks:
- c.summary()
+ for c in checks:
+ c.summary()
- po_coverage = (1.0 - (float(nr_untranslated) / float(nr_msgs))) * 100
- print "%-20s%5.2f%%" % ( "PO Coverage:", po_coverage )
+ po_coverage = (1.0 - (float(nr_untranslated) / float(nr_msgs))) * 100
+ print("%-20s%5.2f%%" % ( "PO Coverage:", po_coverage ))
- template_coverage = po_coverage * float(nr_msgs) / float(nr_templates)
- print "%-20s%5.2f%%" % ( "Template Coverage:", template_coverage )
+ template_coverage = po_coverage * float(nr_msgs) / float(nr_templates)
+ print("%-20s%5.2f%%" % ( "Template Coverage:", template_coverage ))
- not_displayed = nr_untranslated + nr_fuzzy
- translation = (1.0 - (float(not_displayed) / float(nr_templates))) * 100
- text = "%-20s%5.2f%%" % ( "Localized at:", translation)
+ not_displayed = nr_untranslated + nr_fuzzy
+ translation = (1.0 - (float(not_displayed) / float(nr_templates))) * 100
+ text = "%-20s%5.2f%%" % ( "Localized at:", translation)
- if template_coverage == po_coverage:
- print text
- else:
- print text + ' (previous gramps.pot)'
+ if int(template_coverage*1000) == int(po_coverage*1000):
+ print(text)
+ else:
+ print(text + ' (previous gramps.pot)')
+ for c in checks:
+ c.diag()
def main():
-
+
parser = ArgumentParser( description='This program validates a PO file for GRAMPS.')
-
- parser.add_argument("-s", "--summary", dest="summary",
- choices=[file for file in os.listdir('.') if file.endswith('.po')],
- default=False, help="only give the summary")
-
+
+ parser.add_argument("-s", dest="summary",
+ choices=[file for file in os.listdir('.') if file.endswith('.po')],
+ default=False, help="the summary of check, and if need, it gives details")
+
args = parser.parse_args()
-
+
if args.summary:
files = sys.argv[2:]
- try:
- pot_msgs = read_msgs( 'gramps.pot' )
- nr_templates = len( pot_msgs )
- nth = 0
- for fname in files:
- msgs = read_msgs( fname )
- analyze_msgs( files, fname, msgs, nr_templates, nth )
- nth += 1
+ try:
+ pot_msgs = read_msgs( 'gramps.pot' )
+ nr_templates = len( pot_msgs )
+ nth = 0
+ for fname in files:
+ msgs = read_msgs( fname )
+ analyze_msgs( files, fname, msgs, nr_templates, nth )
+ nth += 1
- except CheckException, e:
- print 'Oops.', e
- print 'Bailing out'
+ except CheckException as e:
+ print('Oops.', e)
+ print('Bailing out')
if __name__ == "__main__":
- main()
+ main()
diff --git a/po/da.po b/po/da.po
index 9a02bb926..9840db399 100644
--- a/po/da.po
+++ b/po/da.po
@@ -6,1858 +6,80 @@
# Ofte vil det lyde mere naturligt at ændre en ordstilling ved at
# bytte om på hoved- og ledsætning, som f.eks.
#
-# "Før reparationen udføres, forvis dig om at slægtsbogen virkelig
+# "Før reparationen udføres, forvis dig om at databasen virkelig
# "ikke længere kan åbnes"
# til
#
-# "forvis dig om at slægtsbogen virkelig ikke kan åbnes før du
+# "forvis dig om at databasen virkelig ikke kan åbnes før du
# "udfører reparationen."
#
# Jeg har dog i mange tilfælde valgt at bevare den oprindelige
# ordstilling, da der ligger en opmærksomhedsskabende værdi i denne. Her
# bliver man f.eks. som det første i sætningen gjort opmærksom på at man
# IKKE skal udføre reparationen FØR .. -MBJ
-# *** Konventioner: ***
+# *** Oversættelser af visse ord/vendinger: ***
# LDS: SDH (Latter Day Saints -> Sidste Dages Hellige)
# home person: proband
# ancestor: ane
-# give name: fornavn
+# given name: fornavn
# preferences: indstillinger
# link: forbindelse
-# family tree: slægtsbog
-# communion: altergang
+# family tree: slægtsbog (men se nedenfor)
+# First Communion: Førstekommunion
# probate: skifte
# record: optegnelse
+#
+# Anvendt af Lars Kr. Lundin:
+# citation: citering (fremfor f.eks. 'kildehenvisning')
+# database: database (fremfor det tidligere 'slægtsbog')
+# matches: matcher (fremfor det tidligere 'passer med')
+# locale: landestandard (i mangel af bedre)
msgid ""
msgstr ""
-"Project-Id-Version: GRAMPS 3.3 (SVN 17072)\n"
+"Project-Id-Version: GRAMPS 3.4.3 (SVN 21236)\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-01-27 16:40+0100\n"
-"PO-Revision-Date: 2011-04-07 17:56+0200\n"
-"Last-Translator: Morten Bo Johansen \n"
+"POT-Creation-Date: 2013-01-21 16:50+0100\n"
+"PO-Revision-Date: 2013-01-29 20:29+0100\n"
+"Last-Translator: Lars Kristian Lundin \n"
"Language-Team: Danish \n"
-"Language: da\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+"Language: da\n"
"Generated-By: pygettext.py 1.4\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"X-Generator: http://jedmodes.sourceforge.net/mode/po_mode\n"
-#: ../src/Assistant.py:338 ../src/Filters/Rules/Place/_HasPlace.py:48
-#: ../src/Filters/Rules/Repository/_HasRepo.py:47
-#: ../src/glade/editfamily.glade.h:16 ../src/glade/mergeperson.glade.h:8
-#: ../src/glade/mergerepository.glade.h:6
-#: ../src/plugins/tool/soundgen.glade.h:2
-msgid "Name:"
-msgstr "Navn:"
-
-#: ../src/Assistant.py:339 ../src/Filters/Rules/Repository/_HasRepo.py:49
-msgid "Address:"
-msgstr "Adresse:"
-
-#: ../src/Assistant.py:340 ../src/Filters/Rules/Place/_HasPlace.py:51
-msgid "City:"
-msgstr "By:"
-
-#: ../src/Assistant.py:341
-msgid "State/Province:"
-msgstr "Stat/Provins:"
-
-#: ../src/Assistant.py:342 ../src/Filters/Rules/Place/_HasPlace.py:54
-msgid "Country:"
-msgstr "Land:"
-
-#: ../src/Assistant.py:343
-msgid "ZIP/Postal code:"
-msgstr "Postnummer:"
-
-#: ../src/Assistant.py:344
-msgid "Phone:"
-msgstr "Telefon:"
-
-#: ../src/Assistant.py:345
-msgid "Email:"
-msgstr "E-post:"
-
-#: ../src/Bookmarks.py:66
-msgid "manual|Bookmarks"
-msgstr "Bogmærker"
-
-#. pylint: disable-msg=E1101
-#: ../src/Bookmarks.py:199 ../src/gui/views/tags.py:372
-#: ../src/gui/views/tags.py:583 ../src/gui/views/tags.py:598
-#: ../src/gui/widgets/tageditor.py:100
-#, python-format
-msgid "%(title)s - Gramps"
-msgstr "%(title)s - Gramps"
-
-#: ../src/Bookmarks.py:199 ../src/Bookmarks.py:207 ../src/gui/grampsgui.py:108
-#: ../src/gui/views/navigationview.py:274
-msgid "Organize Bookmarks"
-msgstr "Organisér bogmærker"
-
-#. 1 new gramplet
-#. Priority
-#. Handle
-#. Add column with object name
-#: ../src/Bookmarks.py:213 ../src/ScratchPad.py:524 ../src/ToolTips.py:175
-#: ../src/ToolTips.py:201 ../src/ToolTips.py:212 ../src/gui/configure.py:429
-#: ../src/gui/filtereditor.py:741 ../src/gui/filtereditor.py:893
-#: ../src/gui/viewmanager.py:468 ../src/gui/editors/editfamily.py:117
-#: ../src/gui/editors/editname.py:305
-#: ../src/gui/editors/displaytabs/backreflist.py:62
-#: ../src/gui/editors/displaytabs/nameembedlist.py:72
-#: ../src/gui/editors/displaytabs/personrefembedlist.py:63
-#: ../src/gui/plug/_guioptions.py:1110 ../src/gui/plug/_windows.py:115
-#: ../src/gui/selectors/selectperson.py:74 ../src/gui/views/tags.py:388
-#: ../src/gui/views/treemodels/peoplemodel.py:524
-#: ../src/plugins/BookReport.py:776 ../src/plugins/drawreport/TimeLine.py:68
-#: ../src/plugins/gramplet/Backlinks.py:45
-#: ../src/plugins/lib/libpersonview.py:92
-#: ../src/plugins/textreport/IndivComplete.py:599
-#: ../src/plugins/textreport/TagReport.py:123
-#: ../src/plugins/tool/NotRelated.py:130
-#: ../src/plugins/tool/RemoveUnused.py:200 ../src/plugins/tool/Verify.py:508
-#: ../src/plugins/view/repoview.py:82
-#: ../src/Filters/SideBar/_PersonSidebarFilter.py:127
-#: ../src/Filters/SideBar/_RepoSidebarFilter.py:93
-msgid "Name"
-msgstr "Navn"
-
-#. Add column with object gramps_id
-#. GRAMPS ID
-#: ../src/Bookmarks.py:213 ../src/gui/filtereditor.py:896
-#: ../src/gui/editors/editfamily.py:116
-#: ../src/gui/editors/displaytabs/backreflist.py:61
-#: ../src/gui/editors/displaytabs/citationembedlist.py:85
-#: ../src/gui/editors/displaytabs/eventembedlist.py:77
-#: ../src/gui/editors/displaytabs/personrefembedlist.py:64
-#: ../src/gui/editors/displaytabs/repoembedlist.py:67
-#: ../src/gui/plug/_guioptions.py:1111 ../src/gui/plug/_guioptions.py:1288
-#: ../src/gui/selectors/selectcitation.py:67
-#: ../src/gui/selectors/selectevent.py:62
-#: ../src/gui/selectors/selectfamily.py:61
-#: ../src/gui/selectors/selectnote.py:67
-#: ../src/gui/selectors/selectobject.py:75
-#: ../src/gui/selectors/selectperson.py:75
-#: ../src/gui/selectors/selectplace.py:63
-#: ../src/gui/selectors/selectrepository.py:62
-#: ../src/gui/selectors/selectsource.py:62
-#: ../src/gui/views/navigationview.py:348 ../src/Merge/mergeperson.py:174
-#: ../src/plugins/lib/libpersonview.py:93
-#: ../src/plugins/lib/libplaceview.py:93 ../src/plugins/tool/EventCmp.py:250
-#: ../src/plugins/tool/NotRelated.py:131 ../src/plugins/tool/PatchNames.py:399
-#: ../src/plugins/tool/RemoveUnused.py:194
-#: ../src/plugins/tool/SortEvents.py:58 ../src/plugins/tool/Verify.py:501
-#: ../src/plugins/view/citationtreeview.py:91
-#: ../src/plugins/view/citationlistview.py:96
-#: ../src/plugins/view/eventview.py:82 ../src/plugins/view/familyview.py:79
-#: ../src/plugins/view/mediaview.py:94 ../src/plugins/view/noteview.py:78
-#: ../src/plugins/view/placetreeview.py:71 ../src/plugins/view/relview.py:604
-#: ../src/plugins/view/repoview.py:83 ../src/plugins/view/sourceview.py:80
-#: ../src/Filters/SideBar/_CitationSidebarFilter.py:94
-#: ../src/Filters/SideBar/_EventSidebarFilter.py:93
-#: ../src/Filters/SideBar/_FamilySidebarFilter.py:114
-#: ../src/Filters/SideBar/_PersonSidebarFilter.py:128
-#: ../src/Filters/SideBar/_SourceSidebarFilter.py:79
-#: ../src/Filters/SideBar/_PlaceSidebarFilter.py:86
-#: ../src/Filters/SideBar/_MediaSidebarFilter.py:88
-#: ../src/Filters/SideBar/_RepoSidebarFilter.py:92
-#: ../src/Filters/SideBar/_NoteSidebarFilter.py:95
-msgid "ID"
-msgstr "Id"
-
-#: ../src/const.py:202
-msgid "Gramps (Genealogical Research and Analysis Management Programming System) is a personal genealogy program."
-msgstr "Gramps (Genealogical Research and Analysis Management Programming System) er et slægtsforskningsprogram til privatpersoner."
-
-#: ../src/const.py:223
-msgid "TRANSLATORS: Translate this to your name in your native language"
-msgstr ""
-"Lars Kr. Lundin\n"
-"Morten Bo Johansen\n"
-"Dansk-gruppen \n"
-"Mere info: http://www.dansk-gruppen.dk"
-
-#: ../src/const.py:234 ../src/const.py:235 ../src/gen/lib/date.py:1665
-#: ../src/gen/lib/date.py:1679
-msgid "none"
-msgstr "ingen"
-
-#: ../src/DateEdit.py:79 ../src/DateEdit.py:88
-msgid "Regular"
-msgstr "Regulær"
-
-#: ../src/DateEdit.py:80
-msgid "Before"
-msgstr "Før"
-
-#: ../src/DateEdit.py:81
-msgid "After"
-msgstr "Efter"
-
-#: ../src/DateEdit.py:82
-msgid "About"
-msgstr "Omkring"
-
-#: ../src/DateEdit.py:83
-msgid "Range"
-msgstr "Interval"
-
-#: ../src/DateEdit.py:84
-msgid "Span"
-msgstr "Tidsrum"
-
-#: ../src/DateEdit.py:85
-msgid "Text only"
-msgstr "Kun tekst"
-
-#: ../src/DateEdit.py:89
-msgid "Estimated"
-msgstr "Estimeret"
-
-#: ../src/DateEdit.py:90
-msgid "Calculated"
-msgstr "Beregnet"
-
-#: ../src/DateEdit.py:102
-msgid "manual|Editing_Dates"
-msgstr "Datoredigering"
-
-#: ../src/DateEdit.py:152
-msgid "Bad Date"
-msgstr "Ugyldig dato"
-
-#: ../src/DateEdit.py:155
-msgid "Date more than one year in the future"
-msgstr "Dato ligger senere end et år ud i fremtiden"
-
-#: ../src/DateEdit.py:202 ../src/DateEdit.py:306
-msgid "Date selection"
-msgstr "Valg af dato"
-
-#: ../src/DisplayState.py:364 ../src/plugins/gramplet/PersonDetails.py:132
-msgid "No active person"
-msgstr "Ingen aktiv person"
-
-#: ../src/DisplayState.py:365
-msgid "No active family"
-msgstr "Ingen familie er aktiv"
-
-#: ../src/DisplayState.py:366
-msgid "No active event"
-msgstr "Ingen hændelse er aktiv"
-
-#: ../src/DisplayState.py:367
-msgid "No active place"
-msgstr "Intet sted er aktivt"
-
-#: ../src/DisplayState.py:368
-msgid "No active source"
-msgstr "Ingen kilde er aktiv"
-
-#: ../src/DisplayState.py:369
-#, fuzzy
-msgid "No active citation"
-msgstr "Intet medie er aktivt"
-
-#: ../src/DisplayState.py:370
-msgid "No active repository"
-msgstr "Intet arkiv er aktivt"
-
-#: ../src/DisplayState.py:371
-msgid "No active media"
-msgstr "Intet medie er aktivt"
-
-#: ../src/DisplayState.py:372
-msgid "No active note"
-msgstr "Ingen person er aktiv"
-
-#. # end
-#. set up ManagedWindow
-#: ../src/ExportAssistant.py:125
-msgid "Export Assistant"
-msgstr "Eksport-vejleder"
-
-#: ../src/ExportAssistant.py:212
-msgid "Saving your data"
-msgstr "Gemmer dine data"
-
-#: ../src/ExportAssistant.py:261
-msgid "Choose the output format"
-msgstr "Vælg format på uddata"
-
-#: ../src/ExportAssistant.py:345
-msgid "Select Save File"
-msgstr "Vælg fil der skal gemmes i"
-
-#: ../src/ExportAssistant.py:383 ../src/plugins/tool/MediaManager.py:274
-msgid "Final confirmation"
-msgstr "Endelig bekræftelse"
-
-#: ../src/ExportAssistant.py:396
-msgid "Please wait while your data is selected and exported"
-msgstr "Vent venligst mens dine data udvælges og eksporteres"
-
-#: ../src/ExportAssistant.py:409
-msgid "Summary"
-msgstr "Opsummering"
-
-#: ../src/ExportAssistant.py:481
+#: ../gramps/cli/arghandler.py:222
#, python-format
msgid ""
-"The data will be exported as follows:\n"
-"\n"
-"Format:\t%s\n"
-"\n"
-"Press Apply to proceed, Back to revisit your options, or Cancel to abort"
+"Error: Family tree '%s' already exists.\n"
+"The '-C' option cannot be used."
msgstr ""
-"Data vil blive eksporteret som følger:\n"
-"\n"
-"Format:\t%s\n"
-"\n"
-"Tryk Anvend for at fortsætte, Tilbage for at revurdere indstillinger, eller Annullér for at afbryde"
+"Fejl: Slægtsbog '%s' findes allerede.\n"
+"Forvalg '-C' kan ikke benyttes."
-#: ../src/ExportAssistant.py:494
-#, python-format
-msgid ""
-"The data will be saved as follows:\n"
-"\n"
-"Format:\t%s\n"
-"Name:\t%s\n"
-"Folder:\t%s\n"
-"\n"
-"Press Apply to proceed, Back to revisit your options, or Cancel to abort"
-msgstr ""
-"Data bliver gemt som følger:\n"
-"\n"
-"Format:\t%s\n"
-"Navn:\t%s\n"
-"Folder:\t%s\n"
-"\n"
-"Tryk på \"Anvend\" for at fortsætte, Annullér for at afbryde, eller Tilbage for at gentage indstillingerne"
-
-#: ../src/ExportAssistant.py:501
-msgid ""
-"The selected file and folder to save to cannot be created or found.\n"
-"\n"
-"Press Back to return and select a valid filename."
-msgstr ""
-"Filen og mappen som der skal gemmes til, findes ikke og kan ikke oprettes.\n"
-"\n"
-"Tryk \"Tilbage\" for at vælge et gyldigt filnavn."
-
-#: ../src/ExportAssistant.py:527
-msgid "Your data has been saved"
-msgstr "Dine data er blevet gemt"
-
-#: ../src/ExportAssistant.py:529
-msgid ""
-"The copy of your data has been successfully saved. You may press Close button now to continue.\n"
-"\n"
-"Note: the database currently opened in your Gramps window is NOT the file you have just saved. Future editing of the currently opened database will not alter the copy you have just made. "
-msgstr ""
-"En kopi af dine data er blevet gemt. Du kan trykke \"Luk\" for at fortsætte.\n"
-"\n"
-"NB: Den database der for øjeblikket er åbnet i dit Gramps-vindue er IKKE den fil du lige har gemt. Redigering af den aktuelt åbnede database, vil ikke ændre i den kopi, du har lige har lavet. "
-
-#. add test, what is dir
-#: ../src/ExportAssistant.py:537
-#, python-format
-msgid "Filename: %s"
-msgstr "Filnavn: %s"
-
-#: ../src/ExportAssistant.py:539
-msgid "Saving failed"
-msgstr "Kunne ikke gemme"
-
-#: ../src/ExportAssistant.py:541
-msgid ""
-"There was an error while saving your data. You may try starting the export again.\n"
-"\n"
-"Note: your currently opened database is safe. It was only a copy of your data that failed to save."
-msgstr ""
-"Der opstod en fejl mens dine data blev gemt. Du kan prøve et genstarte eksport.\n"
-"\n"
-"NB: Din aktuelt åbnede database er uden for problemer, det var kun kopien af dine data der ikke kunne gemmes."
-
-#: ../src/ExportAssistant.py:568
-msgid ""
-"Under normal circumstances, Gramps does not require you to directly save your changes. All changes you make are immediately saved to the database.\n"
-"\n"
-"This process will help you save a copy of your data in any of the several formats supported by Gramps. This can be used to make a copy of your data, backup your data, or convert it to a format that will allow you to transfer it to a different program.\n"
-"\n"
-"If you change your mind during this process, you can safely press the Cancel button at any time and your present database will still be intact."
-msgstr ""
-"Under normale forhold kræver brugen af Gramps ikke at du selv gemmer dine ændringer. Alle ændringer du foretager bliver øjeblikkelig gemt i databasen.\n"
-"\n"
-"Denne proces hjælper dig med at gemme en kopi af dine data i ethvert af de formater som Gramps understøtter. Dette kan benyttes til at kopiere dine data, til at lave en sikkerhedskopi, eller til at konvertere dine data til et format, så de kan overføres til et andet program.\n"
-"\n"
-"Hvis du fortryder undervejs, kan du til enhver tid roligt trykke på Annullér-knappen, hvorefter din aktuelle database stadig vil være intakt."
-
-#: ../src/ExportOptions.py:52
-msgid "Selecting Preview Data"
-msgstr "Vælger data til forhåndsvisning"
-
-#: ../src/ExportOptions.py:52 ../src/ExportOptions.py:54
-msgid "Selecting..."
-msgstr "Vælger ..."
-
-#: ../src/ExportOptions.py:143
-msgid "Unfiltered Family Tree:"
-msgstr "Ufiltreret slægtsbog:"
-
-#: ../src/ExportOptions.py:145 ../src/ExportOptions.py:249
-#: ../src/ExportOptions.py:542
-#, python-format
-msgid "%d Person"
-msgid_plural "%d People"
-msgstr[0] "%d Person"
-msgstr[1] "%d Personer"
-
-#: ../src/ExportOptions.py:147
-msgid "Click to see preview of unfiltered data"
-msgstr "Klik for at se en forhåndsvisning af de ufiltrerede data"
-
-#: ../src/ExportOptions.py:159
-msgid "_Do not include records marked private"
-msgstr "Me_dtag ikke optegnelser der er markeret private"
-
-#: ../src/ExportOptions.py:174 ../src/ExportOptions.py:359
-msgid "Change order"
-msgstr "Ændr rækkefølge"
-
-#: ../src/ExportOptions.py:179
-msgid "Calculate Previews"
-msgstr "Beregn forhåndsvisninger"
-
-#: ../src/ExportOptions.py:256
-msgid "_Person Filter"
-msgstr "_Personfilter"
-
-#: ../src/ExportOptions.py:268
-msgid "Click to see preview after person filter"
-msgstr "Klik for at se en forhåndsvisning efter anvendelse af personfilter"
-
-#: ../src/ExportOptions.py:273
-msgid "_Note Filter"
-msgstr "_Note-filter"
-
-#: ../src/ExportOptions.py:285
-msgid "Click to see preview after note filter"
-msgstr "Klik for at se en forhåndsvisning efter anvendelse af notefilter"
-
-#. Frame 3:
-#: ../src/ExportOptions.py:288
-msgid "Privacy Filter"
-msgstr "Stedfiltre"
-
-#: ../src/ExportOptions.py:294
-msgid "Click to see preview after privacy filter"
-msgstr "Klik for at se en forhåndsvisning efter anvendelse af personsikkerhedsfilter"
-
-#. Frame 4:
-#: ../src/ExportOptions.py:297
-msgid "Living Filter"
-msgstr "Filter for nulevende personer"
-
-#: ../src/ExportOptions.py:304
-msgid "Click to see preview after living filter"
-msgstr "Klik for at se en forhåndsvisning efter anvendelse af filter for nulevende personer"
-
-#: ../src/ExportOptions.py:308
-msgid "Reference Filter"
-msgstr "Henvisningsfilter"
-
-#: ../src/ExportOptions.py:314
-msgid "Click to see preview after reference filter"
-msgstr "Klik for at se en forhåndsvisning efter anvendelse af henvisningsfilter"
-
-#: ../src/ExportOptions.py:366
-msgid "Hide order"
-msgstr "Skjul rækkefølge"
-
-#: ../src/ExportOptions.py:423 ../src/gen/plug/report/utils.py:271
-#: ../src/plugins/gramplet/DescendGramplet.py:70
-#: ../src/plugins/textreport/DescendReport.py:366
-#, python-format
-msgid "Descendants of %s"
-msgstr "Efterkommere af %s"
-
-#: ../src/ExportOptions.py:427 ../src/gen/plug/report/utils.py:275
-#, python-format
-msgid "Descendant Families of %s"
-msgstr "Familier der nedstammer fra %s"
-
-#: ../src/ExportOptions.py:431 ../src/gen/plug/report/utils.py:279
-#, python-format
-msgid "Ancestors of %s"
-msgstr "Aner til %s"
-
-#: ../src/ExportOptions.py:435 ../src/gen/plug/report/utils.py:283
-#, python-format
-msgid "People with common ancestor with %s"
-msgstr "Personer med samme ane som %s"
-
-#: ../src/ExportOptions.py:557
-msgid "Filtering private data"
-msgstr "Filtrerer private data"
-
-#: ../src/ExportOptions.py:566
-msgid "Filtering living persons"
-msgstr "Filtrerer nulevende personer"
-
-#: ../src/ExportOptions.py:582
-msgid "Applying selected person filter"
-msgstr "Anvender det valgte personfilter"
-
-#: ../src/ExportOptions.py:592
-msgid "Applying selected note filter"
-msgstr "Anvender det valgte notefilter"
-
-#: ../src/ExportOptions.py:601
-msgid "Filtering referenced records"
-msgstr "Filtrerer løsrevne optegnelsen"
-
-#: ../src/ExportOptions.py:642
-msgid "Cannot edit a system filter"
-msgstr "Kan ikke redigere et systemfilter"
-
-#: ../src/ExportOptions.py:643
-msgid "Please select a different filter to edit"
-msgstr "Vælg venligst et andet filter at redigere"
-
-#: ../src/ExportOptions.py:672 ../src/ExportOptions.py:697
-msgid "Include all selected people"
-msgstr "Medtag kun valgte personer"
-
-#: ../src/ExportOptions.py:686
-msgid "Include all selected notes"
-msgstr "Medtag alle valgte noter"
-
-#: ../src/ExportOptions.py:698
-msgid "Replace given names of living people"
-msgstr "Beg_ræns data om nulevende personer"
-
-#: ../src/ExportOptions.py:699
-msgid "Do not include living people"
-msgstr "Medtag ikke nulevende personer"
-
-#: ../src/ExportOptions.py:707
-msgid "Include all selected records"
-msgstr "Medtag alle valgte optegnelser"
-
-#: ../src/ExportOptions.py:708
-msgid "Do not include records not linked to a selected person"
-msgstr "Medtag ikke optegnelser som ikke er forbundet med en valgt person"
-
-#. FIXME: This should use LOG.warn, but logging has not been initialised yet
-#: ../src/gramps.py:68
-msgid "WARNING: Setting locale failed. Please fix the LC_* and/or the LANG environment variables to prevent this error"
-msgstr ""
-
-#: ../src/gramps.py:78
-msgid "ERROR: Setting the 'C' locale didn't work either"
-msgstr ""
-
-#: ../src/gramps.py:115
-#, python-format
-msgid ""
-"Your Python version does not meet the requirements. At least python %d.%d.%d is needed to start Gramps.\n"
-"\n"
-"Gramps will terminate now."
-msgstr ""
-"Din Python-version lever ikke op til kravene. Mindst Python %d.%d.%d kræves for at køre Gramps.\n"
-"\n"
-"Gramps afsluttes nu."
-
-#: ../src/gramps.py:354 ../src/gramps.py:361 ../src/gramps.py:432
-#, fuzzy
-msgid "Configuration error:"
-msgstr "Konfigurationsfejl"
-
-#: ../src/gramps.py:358
-msgid "Error reading configuration"
-msgstr "Fejl ved læsning af konfiguration"
-
-#: ../src/gramps.py:362
-#, python-format
-msgid ""
-"A definition for the MIME-type %s could not be found \n"
-"\n"
-" Possibly the installation of Gramps was incomplete. Make sure the MIME-types of Gramps are properly installed."
-msgstr ""
-"En definition af MIME-typen %s kunne ikke findes \n"
-"\n"
-"Gramps-installationen er muligvis ikke fuldstændig. Kontroller at MIME-typerne til Gramps er korrekt installeret."
-
-#. not all families have a spouse.
-#: ../src/LdsUtils.py:82 ../src/LdsUtils.py:88 ../src/ScratchPad.py:180
-#: ../src/cli/clidbman.py:468 ../src/gen/lib/attrtype.py:63
-#: ../src/gen/lib/childreftype.py:79 ../src/gen/lib/eventroletype.py:58
-#: ../src/gen/lib/eventtype.py:143 ../src/gen/lib/familyreltype.py:52
-#: ../src/gen/lib/grampstype.py:34 ../src/gen/lib/nametype.py:53
-#: ../src/gen/lib/nameorigintype.py:80 ../src/gen/lib/notetype.py:78
-#: ../src/gen/lib/repotype.py:59 ../src/gen/lib/srcmediatype.py:62
-#: ../src/gen/lib/urltype.py:54 ../src/gui/editors/editmedia.py:168
-#: ../src/gui/editors/editmediaref.py:130
-#: ../src/gui/editors/displaytabs/personrefembedlist.py:123
-#: ../src/plugins/gramplet/PersonDetails.py:159
-#: ../src/plugins/gramplet/PersonDetails.py:165
-#: ../src/plugins/gramplet/PersonDetails.py:167
-#: ../src/plugins/gramplet/PersonDetails.py:168
-#: ../src/plugins/gramplet/RelativeGramplet.py:123
-#: ../src/plugins/gramplet/RelativeGramplet.py:134
-#: ../src/plugins/graph/GVFamilyLines.py:159
-#: ../src/plugins/graph/GVRelGraph.py:555
-#: ../src/plugins/lib/libnarrate.py:1994
-#: ../src/plugins/lib/maps/geography.py:845
-#: ../src/plugins/lib/maps/geography.py:852
-#: ../src/plugins/lib/maps/geography.py:853
-#: ../src/plugins/quickview/all_relations.py:278
-#: ../src/plugins/quickview/all_relations.py:295
-#: ../src/plugins/textreport/IndivComplete.py:612
-#: ../src/plugins/tool/Check.py:1578 ../src/plugins/view/geofamily.py:402
-#: ../src/plugins/view/geoperson.py:448 ../src/plugins/view/relview.py:450
-#: ../src/plugins/view/relview.py:995 ../src/plugins/view/relview.py:1042
-#: ../src/plugins/webreport/NarrativeWeb.py:346
-#: ../src/plugins/webreport/NarrativeWeb.py:2272
-msgid "Unknown"
-msgstr "Ukendt"
-
-#: ../src/PlaceUtils.py:50
-#, python-format
-msgid "%(north_latitude)s N"
-msgstr "%(north_latitude)s N"
-
-#: ../src/PlaceUtils.py:51
-#, python-format
-msgid "%(south_latitude)s S"
-msgstr "%(south_latitude)s S"
-
-#: ../src/PlaceUtils.py:52
-#, python-format
-msgid "%(east_longitude)s E"
-msgstr "%(east_longitude)s E"
-
-#: ../src/PlaceUtils.py:53
-#, python-format
-msgid "%(west_longitude)s W"
-msgstr "%(west_longitude)s W"
-
-#: ../src/QuestionDialog.py:193
-msgid "Error detected in database"
-msgstr "Stødte på fejl i database"
-
-#: ../src/QuestionDialog.py:194
-msgid ""
-"Gramps has detected an error in the database. This can usually be resolved by running the \"Check and Repair Database\" tool.\n"
-"\n"
-"If this problem continues to exist after running this tool, please file a bug report at http://bugs.gramps-project.org\n"
-"\n"
-msgstr ""
-"Gramps er stødt på en fejl i databasen. Dette kan normalt løses ved at køre værktøjet \"Kontrollér og reparér database\".\n"
-"\n"
-"Hvis dette problem varer ved efter at have brugt ovennævnte værktøj, så indsend venligst en fejlrapport på adressen http://bugs.gramps-project.org\n"
-
-#: ../src/QuestionDialog.py:205 ../src/cli/grampscli.py:93
-msgid "Low level database corruption detected"
-msgstr "Dybtgående ødelæggelse af databasen er blevet opdaget"
-
-#: ../src/QuestionDialog.py:206 ../src/cli/grampscli.py:95
-msgid "Gramps has detected a problem in the underlying Berkeley database. This can be repaired from the Family Tree Manager. Select the database and click on the Repair button"
-msgstr "Gramps er stødt på et problem i den underliggende Berkeley-database. Dette kan repareres fra menuen \"Slægtsbøger\". Vælg databasen og klik på knappen \"reparér\""
-
-#: ../src/QuestionDialog.py:318 ../src/gui/utils.py:304
-msgid "Attempt to force closing the dialog"
-msgstr "Forsøg på at gennemtvinge lukning af dialogen"
-
-#: ../src/QuestionDialog.py:319
-msgid ""
-"Please do not force closing this important dialog.\n"
-"Instead select one of the available options"
-msgstr ""
-"Gennemtving venligst ikke en lukning af denne vigtige dialog.\n"
-"Vælg i stedet en af de foreliggende muligheder"
-
-#: ../src/QuickReports.py:92
-msgid "Web Connect"
-msgstr "Webforbindelse"
-
-#: ../src/QuickReports.py:137 ../src/docgen/TextBufDoc.py:81
-#: ../src/docgen/TextBufDoc.py:161 ../src/docgen/TextBufDoc.py:163
-#: ../src/plugins/gramplet/gramplet.gpr.py:181
-#: ../src/plugins/gramplet/gramplet.gpr.py:188
-#: ../src/plugins/lib/libpersonview.py:356
-#: ../src/plugins/lib/libplaceview.py:174
-#: ../src/plugins/view/citationtreeview.py:294
-#: ../src/plugins/view/citationlistview.py:182
-#: ../src/plugins/view/eventview.py:222 ../src/plugins/view/familyview.py:213
-#: ../src/plugins/view/mediaview.py:228 ../src/plugins/view/noteview.py:214
-#: ../src/plugins/view/repoview.py:152 ../src/plugins/view/sourceview.py:138
-msgid "Quick View"
-msgstr "Kvikoversigt"
-
-#: ../src/Relationship.py:800 ../src/plugins/view/pedigreeview.py:1676
-msgid "Relationship loop detected"
-msgstr "Slægtskabsløkke fundet"
-
-#: ../src/Relationship.py:857
-#, python-format
-msgid ""
-"Family tree reaches back more than the maximum %d generations searched.\n"
-"It is possible that relationships have been missed"
-msgstr ""
-"Slægtsbogen rækker længere tilbage end det maksimale %d antal generationer\n"
-"der søges i. Det er muligt at slægtskaber er blevet udeladt"
-
-#: ../src/Relationship.py:929
-msgid "Relationship loop detected:"
-msgstr "Slægtskabsløkke fundet:"
-
-#: ../src/Relationship.py:930
-#, python-format
-msgid "Person %(person)s connects to himself via %(relation)s"
-msgstr "Person %(person)s er forbundet med sig selv via %(relation)s"
-
-#: ../src/Relationship.py:1196
-msgid "undefined"
-msgstr "udefineret"
-
-#: ../src/Relationship.py:1673 ../src/plugins/import/ImportCsv.py:227
-msgid "husband"
-msgstr "mand"
-
-#: ../src/Relationship.py:1675 ../src/plugins/import/ImportCsv.py:223
-msgid "wife"
-msgstr "hustru"
-
-#: ../src/Relationship.py:1677
-msgid "gender unknown|spouse"
-msgstr "ægtefælle"
-
-#: ../src/Relationship.py:1680
-msgid "ex-husband"
-msgstr "fhv. mand"
-
-#: ../src/Relationship.py:1682
-msgid "ex-wife"
-msgstr "fhv. hustru"
-
-#: ../src/Relationship.py:1684
-msgid "gender unknown|ex-spouse"
-msgstr "fhv. ægtefælle"
-
-#: ../src/Relationship.py:1687
-msgid "unmarried|husband"
-msgstr "mand"
-
-#: ../src/Relationship.py:1689
-msgid "unmarried|wife"
-msgstr "hustru"
-
-#: ../src/Relationship.py:1691
-msgid "gender unknown,unmarried|spouse"
-msgstr "ægtefælle"
-
-#: ../src/Relationship.py:1694
-msgid "unmarried|ex-husband"
-msgstr "fhv. mand"
-
-#: ../src/Relationship.py:1696
-msgid "unmarried|ex-wife"
-msgstr "fhv. hustru"
-
-#: ../src/Relationship.py:1698
-msgid "gender unknown,unmarried|ex-spouse"
-msgstr "fhv. ægtefælle"
-
-#: ../src/Relationship.py:1701
-msgid "male,civil union|partner"
-msgstr "samlever"
-
-#: ../src/Relationship.py:1703
-msgid "female,civil union|partner"
-msgstr "samlever"
-
-#: ../src/Relationship.py:1705
-msgid "gender unknown,civil union|partner"
-msgstr "samlever"
-
-#: ../src/Relationship.py:1708
-msgid "male,civil union|former partner"
-msgstr "fhv. samlever"
-
-#: ../src/Relationship.py:1710
-msgid "female,civil union|former partner"
-msgstr "fhv. samlever"
-
-#: ../src/Relationship.py:1712
-msgid "gender unknown,civil union|former partner"
-msgstr "fhv. samlever"
-
-#: ../src/Relationship.py:1715
-msgid "male,unknown relation|partner"
-msgstr "samlever"
-
-#: ../src/Relationship.py:1717
-msgid "female,unknown relation|partner"
-msgstr "samlever"
-
-#: ../src/Relationship.py:1719
-msgid "gender unknown,unknown relation|partner"
-msgstr "samlever"
-
-#: ../src/Relationship.py:1724
-msgid "male,unknown relation|former partner"
-msgstr "fhv. samlever"
-
-#: ../src/Relationship.py:1726
-msgid "female,unknown relation|former partner"
-msgstr "fhv. samlever"
-
-#: ../src/Relationship.py:1728
-msgid "gender unknown,unknown relation|former partner"
-msgstr "fhv. samlever"
-
-#: ../src/Reorder.py:40 ../src/ToolTips.py:235
-#: ../src/gui/selectors/selectfamily.py:62 ../src/Merge/mergeperson.py:216
-#: ../src/plugins/gramplet/PersonDetails.py:170
-#: ../src/plugins/import/ImportCsv.py:225
-#: ../src/plugins/quickview/all_relations.py:301
-#: ../src/plugins/textreport/FamilyGroup.py:208
-#: ../src/plugins/textreport/FamilyGroup.py:219
-#: ../src/plugins/textreport/IndivComplete.py:325
-#: ../src/plugins/textreport/IndivComplete.py:327
-#: ../src/plugins/textreport/IndivComplete.py:601
-#: ../src/plugins/textreport/TagReport.py:210
-#: ../src/plugins/view/familyview.py:80 ../src/plugins/view/relview.py:883
-#: ../src/plugins/webreport/NarrativeWeb.py:6209
-#: ../src/Filters/SideBar/_FamilySidebarFilter.py:115
-#: ../src/glade/editfamily.glade.h:13
-msgid "Father"
-msgstr "Fader"
-
-#. ----------------------------------
-#: ../src/Reorder.py:40 ../src/ToolTips.py:240
-#: ../src/gui/selectors/selectfamily.py:63 ../src/Merge/mergeperson.py:218
-#: ../src/plugins/gramplet/PersonDetails.py:171
-#: ../src/plugins/import/ImportCsv.py:222
-#: ../src/plugins/quickview/all_relations.py:298
-#: ../src/plugins/textreport/FamilyGroup.py:225
-#: ../src/plugins/textreport/FamilyGroup.py:236
-#: ../src/plugins/textreport/IndivComplete.py:334
-#: ../src/plugins/textreport/IndivComplete.py:336
-#: ../src/plugins/textreport/IndivComplete.py:602
-#: ../src/plugins/textreport/TagReport.py:216
-#: ../src/plugins/view/familyview.py:81 ../src/plugins/view/relview.py:884
-#: ../src/plugins/webreport/NarrativeWeb.py:6219
-#: ../src/Filters/SideBar/_FamilySidebarFilter.py:116
-#: ../src/glade/editfamily.glade.h:15
-msgid "Mother"
-msgstr "Moder"
-
-#: ../src/Reorder.py:41 ../src/gui/selectors/selectperson.py:81
-#: ../src/Merge/mergeperson.py:232 ../src/plugins/gramplet/Children.py:89
-#: ../src/plugins/lib/libpersonview.py:99
-#: ../src/plugins/textreport/FamilyGroup.py:519
-#: ../src/plugins/view/relview.py:1343
-msgid "Spouse"
-msgstr "Ægtefælle"
-
-#: ../src/Reorder.py:41 ../src/plugins/textreport/TagReport.py:222
-#: ../src/plugins/view/familyview.py:82
-#: ../src/plugins/webreport/NarrativeWeb.py:5866
-#: ../src/Filters/SideBar/_FamilySidebarFilter.py:118
-msgid "Relationship"
-msgstr "Slægtskab"
-
-#: ../src/Reorder.py:59
-msgid "Reorder Relationships"
-msgstr "Omorganisér slægtskaberne"
-
-#: ../src/Reorder.py:141
-#, python-format
-msgid "Reorder Relationships: %s"
-msgstr "Omorganisér slægtskaberne: %s"
-
-#: ../src/ScratchPad.py:66
-msgid "manual|Using_the_Clipboard"
-msgstr "Brug_af_udklipsholderen"
-
-#: ../src/ScratchPad.py:183 ../src/ScratchPad.py:184
-#: ../src/gui/plug/_windows.py:473
-msgid "Unavailable"
-msgstr "Ikke tilgængelig"
-
-#: ../src/ScratchPad.py:292 ../src/gui/configure.py:430
-#: ../src/gui/grampsgui.py:103 ../src/gui/editors/editaddress.py:156
-#: ../src/plugins/gramplet/RepositoryDetails.py:123
-#: ../src/plugins/textreport/FamilyGroup.py:324
-#: ../src/plugins/webreport/NarrativeWeb.py:6682
-#: ../src/Filters/SideBar/_RepoSidebarFilter.py:95
-msgid "Address"
-msgstr "Adresse"
-
-#: ../src/ScratchPad.py:309 ../src/ToolTips.py:142
-#: ../src/gen/lib/nameorigintype.py:93 ../src/gui/plug/_windows.py:600
-#: ../src/plugins/gramplet/PlaceDetails.py:125
-msgid "Location"
-msgstr "Sted"
-
-#. 0 this order range above
-#: ../src/ScratchPad.py:323 ../src/gui/configure.py:460
-#: ../src/gui/filtereditor.py:292 ../src/gui/editors/editlink.py:81
-#: ../src/plugins/gramplet/QuickViewGramplet.py:107
-#: ../src/plugins/quickview/FilterByName.py:150
-#: ../src/plugins/quickview/FilterByName.py:221
-#: ../src/plugins/quickview/quickview.gpr.py:201
-#: ../src/plugins/quickview/References.py:87
-#: ../src/plugins/textreport/PlaceReport.py:386
-#: ../src/plugins/webreport/NarrativeWeb.py:325
-#: ../src/Filters/SideBar/_PersonSidebarFilter.py:134
-msgid "Event"
-msgstr "Hændelse"
-
-#. 5
-#: ../src/ScratchPad.py:347 ../src/gui/configure.py:452
-#: ../src/gui/filtereditor.py:293 ../src/gui/editors/editlink.py:86
-#: ../src/gui/editors/displaytabs/eventembedlist.py:80
-#: ../src/gui/editors/displaytabs/familyldsembedlist.py:55
-#: ../src/gui/editors/displaytabs/ldsembedlist.py:66
-#: ../src/gui/plug/_guioptions.py:1287 ../src/gui/selectors/selectevent.py:66
-#: ../src/gui/views/treemodels/placemodel.py:304
-#: ../src/plugins/export/ExportCsv.py:460 ../src/plugins/gramplet/Events.py:53
-#: ../src/plugins/gramplet/PersonResidence.py:50
-#: ../src/plugins/gramplet/QuickViewGramplet.py:111
-#: ../src/plugins/import/ImportCsv.py:230
-#: ../src/plugins/quickview/FilterByName.py:160
-#: ../src/plugins/quickview/FilterByName.py:227
-#: ../src/plugins/quickview/OnThisDay.py:80
-#: ../src/plugins/quickview/OnThisDay.py:81
-#: ../src/plugins/quickview/OnThisDay.py:82
-#: ../src/plugins/quickview/quickview.gpr.py:203
-#: ../src/plugins/quickview/References.py:92
-#: ../src/plugins/textreport/TagReport.py:306
-#: ../src/plugins/tool/SortEvents.py:60 ../src/plugins/view/eventview.py:85
-#: ../src/plugins/view/placetreeview.py:70
-#: ../src/plugins/webreport/NarrativeWeb.py:334
-#: ../src/plugins/webreport/NarrativeWeb.py:1056
-#: ../src/plugins/webreport/NarrativeWeb.py:1085
-#: ../src/Filters/SideBar/_EventSidebarFilter.py:98
-#: ../src/glade/editevent.glade.h:9
-msgid "Place"
-msgstr "Sted"
-
-#. ###############################
-#. 3
-#: ../src/ScratchPad.py:371 ../src/ToolTips.py:161
-#: ../src/gen/plug/docgen/graphdoc.py:229 ../src/gui/configure.py:464
-#: ../src/gui/filtereditor.py:297 ../src/gui/editors/editlink.py:84
-#: ../src/gui/editors/editmedia.py:88 ../src/gui/editors/editmedia.py:171
-#: ../src/gui/editors/editmediaref.py:133
-#: ../src/gui/views/treemodels/mediamodel.py:128
-#: ../src/plugins/drawreport/AncestorTree.py:1013
-#: ../src/plugins/drawreport/DescendTree.py:1609
-#: ../src/plugins/export/ExportCsv.py:343
-#: ../src/plugins/export/ExportCsv.py:460
-#: ../src/plugins/gramplet/QuickViewGramplet.py:110
-#: ../src/plugins/import/ImportCsv.py:183
-#: ../src/plugins/quickview/FilterByName.py:200
-#: ../src/plugins/quickview/FilterByName.py:251
-#: ../src/plugins/quickview/quickview.gpr.py:205
-#: ../src/plugins/quickview/References.py:94
-#: ../src/plugins/textreport/FamilyGroup.py:342
-#: ../src/Filters/SideBar/_CitationSidebarFilter.py:98
-#: ../src/Filters/SideBar/_EventSidebarFilter.py:99
-#: ../src/Filters/SideBar/_PersonSidebarFilter.py:135
-#: ../src/Filters/SideBar/_SourceSidebarFilter.py:83
-#: ../src/Filters/SideBar/_PlaceSidebarFilter.py:96
-#: ../src/Filters/SideBar/_MediaSidebarFilter.py:93
-#: ../src/Filters/SideBar/_RepoSidebarFilter.py:97
-msgid "Note"
-msgstr "Note"
-
-#: ../src/ScratchPad.py:401 ../src/Filters/SideBar/_FamilySidebarFilter.py:119
-msgid "Family Event"
-msgstr "Familiehændelse"
-
-#: ../src/ScratchPad.py:414 ../src/plugins/webreport/NarrativeWeb.py:2160
-msgid "Url"
-msgstr "Webadresse"
-
-#: ../src/ScratchPad.py:427 ../src/gui/grampsgui.py:104
-#: ../src/gui/editors/editattribute.py:135
-msgid "Attribute"
-msgstr "Attribut"
-
-#: ../src/ScratchPad.py:439
-msgid "Family Attribute"
-msgstr "Familieattribut"
-
-#: ../src/ScratchPad.py:452 ../src/gen/lib/notetype.py:84
-#: ../src/gui/configure.py:456 ../src/gui/filtereditor.py:298
-#: ../src/gui/editors/editcitation.py:140
-#: ../src/gui/editors/editcitation.py:146
-#: ../src/gui/views/treemodels/citationtreemodel.py:161
-#: ../src/plugins/gramplet/QuickViewGramplet.py:114
-#: ../src/plugins/quickview/quickview.gpr.py:206
-#: ../src/plugins/quickview/References.py:89
-#: ../src/plugins/webreport/NarrativeWeb.py:4816
-msgid "Citation"
-msgstr "Citering"
-
-#: ../src/ScratchPad.py:464
-msgid "not available|NA"
-msgstr "Ikke-tilgængelig"
-
-#: ../src/ScratchPad.py:473
-#, python-format
-msgid "Volume/Page: %(pag)s -- %(sourcetext)s"
-msgstr "Bind/side: %(pag)s -- %(sourcetext)s"
-
-#: ../src/ScratchPad.py:494
-msgid "Repository ref"
-msgstr "Arkivhenv."
-
-#: ../src/ScratchPad.py:509
-msgid "Event ref"
-msgstr "Hændelsehenv."
-
-#. show surname and first name
-#: ../src/ScratchPad.py:537 ../src/Utils.py:1275 ../src/gui/configure.py:515
-#: ../src/gui/configure.py:517 ../src/gui/configure.py:519
-#: ../src/gui/configure.py:521 ../src/gui/configure.py:524
-#: ../src/gui/configure.py:525 ../src/gui/configure.py:526
-#: ../src/gui/configure.py:527 ../src/gui/editors/displaytabs/surnametab.py:76
-#: ../src/gui/plug/_guioptions.py:88 ../src/gui/plug/_guioptions.py:1436
-#: ../src/plugins/drawreport/StatisticsChart.py:318
-#: ../src/plugins/export/ExportCsv.py:336
-#: ../src/plugins/import/ImportCsv.py:170
-#: ../src/plugins/quickview/FilterByName.py:318
-#: ../src/plugins/webreport/NarrativeWeb.py:2749
-#: ../src/plugins/webreport/NarrativeWeb.py:2919
-#: ../src/plugins/webreport/NarrativeWeb.py:4203
-msgid "Surname"
-msgstr "Efternavn"
-
-#: ../src/ScratchPad.py:550 ../src/ScratchPad.py:551
-#: ../src/gen/plug/report/_constants.py:56 ../src/gui/configure.py:973
-#: ../src/plugins/textreport/CustomBookText.py:117
-#: ../src/plugins/textreport/TagReport.py:392
-#: ../src/Filters/SideBar/_NoteSidebarFilter.py:96
-msgid "Text"
-msgstr "Tekst"
-
-#. 2
-#: ../src/ScratchPad.py:563 ../src/gui/grampsgui.py:127
-#: ../src/gui/editors/editlink.py:83
-#: ../src/plugins/gramplet/QuickViewGramplet.py:109
-#: ../src/plugins/quickview/FilterByName.py:109
-#: ../src/plugins/quickview/FilterByName.py:190
-#: ../src/plugins/quickview/FilterByName.py:245
-#: ../src/plugins/quickview/FilterByName.py:362
-#: ../src/plugins/quickview/quickview.gpr.py:204
-#: ../src/plugins/quickview/References.py:93
-#: ../src/plugins/textreport/TagReport.py:439
-#: ../src/plugins/view/mediaview.py:128 ../src/plugins/view/view.gpr.py:86
-#: ../src/plugins/webreport/NarrativeWeb.py:1608
-#: ../src/plugins/webreport/NarrativeWeb.py:1664
-#: ../src/plugins/webreport/NarrativeWeb.py:1722
-#: ../src/plugins/webreport/NarrativeWeb.py:2057
-#: ../src/plugins/webreport/NarrativeWeb.py:3889
-#: ../src/plugins/webreport/NarrativeWeb.py:4765
-#: ../src/plugins/webreport/NarrativeWeb.py:4837
-msgid "Media"
-msgstr "Medier"
-
-#: ../src/ScratchPad.py:587
-msgid "Media ref"
-msgstr "Mediehenv."
-
-#: ../src/ScratchPad.py:602
-msgid "Person ref"
-msgstr "Personhenv."
-
-#: ../src/ScratchPad.py:617
-#, fuzzy
-msgid "Child ref"
-msgstr "Børn"
-
-#: ../src/ScratchPad.py:623
-#, fuzzy, python-format
-msgid "%(frel)s %(mrel)s"
-msgstr "%(first)s %(second)s"
-
-#. 4
-#. ------------------------------------------------------------------------
-#.
-#. References
-#.
-#. ------------------------------------------------------------------------
-#. functions for the actual quickreports
-#: ../src/ScratchPad.py:635 ../src/ToolTips.py:200 ../src/gui/configure.py:448
-#: ../src/gui/filtereditor.py:290 ../src/gui/grampsgui.py:134
-#: ../src/gui/editors/editlink.py:85 ../src/plugins/export/ExportCsv.py:336
-#: ../src/plugins/gramplet/QuickViewGramplet.py:106
-#: ../src/plugins/import/ImportCsv.py:217
-#: ../src/plugins/quickview/AgeOnDate.py:55
-#: ../src/plugins/quickview/AttributeMatch.py:34
-#: ../src/plugins/quickview/FilterByName.py:129
-#: ../src/plugins/quickview/FilterByName.py:209
-#: ../src/plugins/quickview/FilterByName.py:257
-#: ../src/plugins/quickview/FilterByName.py:265
-#: ../src/plugins/quickview/FilterByName.py:273
-#: ../src/plugins/quickview/FilterByName.py:281
-#: ../src/plugins/quickview/FilterByName.py:290
-#: ../src/plugins/quickview/FilterByName.py:303
-#: ../src/plugins/quickview/FilterByName.py:329
-#: ../src/plugins/quickview/FilterByName.py:337
-#: ../src/plugins/quickview/FilterByName.py:373
-#: ../src/plugins/quickview/quickview.gpr.py:199
-#: ../src/plugins/quickview/References.py:85
-#: ../src/plugins/quickview/SameSurnames.py:108
-#: ../src/plugins/quickview/SameSurnames.py:150
-#: ../src/plugins/textreport/PlaceReport.py:183
-#: ../src/plugins/textreport/PlaceReport.py:255
-#: ../src/plugins/textreport/PlaceReport.py:387
-#: ../src/plugins/tool/EventCmp.py:250 ../src/plugins/view/geography.gpr.py:48
-#: ../src/plugins/webreport/NarrativeWeb.py:335
-#: ../src/plugins/webreport/NarrativeWeb.py:3611
-#: ../src/plugins/webreport/NarrativeWeb.py:5865
-#: ../src/glade/editpersonref.glade.h:5
-msgid "Person"
-msgstr "Person"
-
-#. 1
-#. get the family events
-#. show "> Family: ..." and nothing else
-#. show "V Family: ..." and the rest
-#: ../src/ScratchPad.py:661 ../src/ToolTips.py:230 ../src/gui/configure.py:450
-#: ../src/gui/filtereditor.py:291 ../src/gui/grampsgui.py:113
-#: ../src/gui/editors/editfamily.py:487 ../src/gui/editors/editlink.py:82
-#: ../src/plugins/export/ExportCsv.py:503
-#: ../src/plugins/gramplet/QuickViewGramplet.py:108
-#: ../src/plugins/import/ImportCsv.py:220
-#: ../src/plugins/quickview/all_events.py:79
-#: ../src/plugins/quickview/all_relations.py:271
-#: ../src/plugins/quickview/FilterByName.py:140
-#: ../src/plugins/quickview/FilterByName.py:215
-#: ../src/plugins/quickview/quickview.gpr.py:200
-#: ../src/plugins/quickview/References.py:86
-#: ../src/plugins/textreport/IndivComplete.py:77
-#: ../src/plugins/view/geography.gpr.py:96 ../src/plugins/view/relview.py:1318
-#: ../src/plugins/view/relview.py:1340 ../src/glade/editldsord.glade.h:3
-msgid "Family"
-msgstr "Familie"
-
-#. 7
-#: ../src/ScratchPad.py:686 ../src/gui/configure.py:454
-#: ../src/gui/filtereditor.py:294 ../src/gui/editors/editlink.py:88
-#: ../src/gui/editors/editsource.py:77
-#: ../src/gui/editors/displaytabs/nameembedlist.py:77
-#: ../src/gui/views/treemodels/citationtreemodel.py:161
-#: ../src/plugins/export/ExportCsv.py:460
-#: ../src/plugins/gramplet/QuickViewGramplet.py:113
-#: ../src/plugins/import/ImportCsv.py:182
-#: ../src/plugins/quickview/FilterByName.py:170
-#: ../src/plugins/quickview/FilterByName.py:233
-#: ../src/plugins/quickview/quickview.gpr.py:202
-#: ../src/plugins/quickview/References.py:88
-#: ../src/plugins/quickview/Reporef.py:62
-msgid "Source"
-msgstr "Kilde"
-
-#. 6
-#: ../src/ScratchPad.py:710 ../src/ToolTips.py:128 ../src/gui/configure.py:462
-#: ../src/gui/filtereditor.py:296 ../src/gui/editors/editlink.py:87
-#: ../src/gui/editors/editrepository.py:67
-#: ../src/gui/editors/editrepository.py:69
-#: ../src/plugins/gramplet/QuickViewGramplet.py:112
-#: ../src/plugins/quickview/FilterByName.py:180
-#: ../src/plugins/quickview/FilterByName.py:239
-msgid "Repository"
-msgstr "Arkiv"
-
-#. Create the tree columns
-#. 0 selected?
-#: ../src/ScratchPad.py:838 ../src/gui/viewmanager.py:467
-#: ../src/gui/editors/displaytabs/attrembedlist.py:63
-#: ../src/gui/editors/displaytabs/backreflist.py:60
-#: ../src/gui/editors/displaytabs/eventembedlist.py:75
-#: ../src/gui/editors/displaytabs/familyldsembedlist.py:51
-#: ../src/gui/editors/displaytabs/ldsembedlist.py:62
-#: ../src/gui/editors/displaytabs/nameembedlist.py:73
-#: ../src/gui/editors/displaytabs/notetab.py:77
-#: ../src/gui/editors/displaytabs/repoembedlist.py:70
-#: ../src/gui/editors/displaytabs/webembedlist.py:65
-#: ../src/gui/plug/_windows.py:108 ../src/gui/plug/_windows.py:226
-#: ../src/gui/selectors/selectevent.py:63
-#: ../src/gui/selectors/selectnote.py:68
-#: ../src/gui/selectors/selectobject.py:76 ../src/Merge/mergeperson.py:235
-#: ../src/plugins/BookReport.py:777 ../src/plugins/BookReport.py:781
-#: ../src/plugins/gramplet/Backlinks.py:44
-#: ../src/plugins/gramplet/Events.py:49
-#: ../src/plugins/quickview/FilterByName.py:290
-#: ../src/plugins/quickview/OnThisDay.py:80
-#: ../src/plugins/quickview/OnThisDay.py:81
-#: ../src/plugins/quickview/OnThisDay.py:82
-#: ../src/plugins/quickview/References.py:70
-#: ../src/plugins/quickview/LinkReferences.py:45
-#: ../src/plugins/quickview/siblings.py:47
-#: ../src/plugins/textreport/TagReport.py:386
-#: ../src/plugins/textreport/TagReport.py:462
-#: ../src/plugins/tool/PatchNames.py:402 ../src/plugins/tool/SortEvents.py:57
-#: ../src/plugins/view/eventview.py:83 ../src/plugins/view/mediaview.py:95
-#: ../src/plugins/view/noteview.py:79 ../src/plugins/view/repoview.py:84
-#: ../src/plugins/webreport/NarrativeWeb.py:342
-#: ../src/plugins/webreport/NarrativeWeb.py:1082
-#: ../src/plugins/webreport/NarrativeWeb.py:1394
-#: ../src/plugins/webreport/NarrativeWeb.py:2159
-#: ../src/plugins/webreport/NarrativeWeb.py:3608
-#: ../src/plugins/webreport/NarrativeWeb.py:6572
-#: ../src/Filters/SideBar/_EventSidebarFilter.py:95
-#: ../src/Filters/SideBar/_MediaSidebarFilter.py:90
-#: ../src/Filters/SideBar/_RepoSidebarFilter.py:94
-#: ../src/Filters/SideBar/_NoteSidebarFilter.py:97
-msgid "Type"
-msgstr "Type"
-
-#: ../src/ScratchPad.py:841
-#: ../src/gui/editors/displaytabs/citationembedlist.py:82
-#: ../src/gui/editors/displaytabs/repoembedlist.py:68
-#: ../src/gui/selectors/selectobject.py:74
-#: ../src/gui/selectors/selectplace.py:62
-#: ../src/gui/selectors/selectrepository.py:61
-#: ../src/gui/selectors/selectsource.py:61
-#: ../src/gui/widgets/grampletpane.py:1498
-#: ../src/plugins/gramplet/PersonDetails.py:124
-#: ../src/plugins/textreport/TagReport.py:456
-#: ../src/plugins/view/citationtreeview.py:165
-#: ../src/plugins/view/mediaview.py:93 ../src/plugins/view/sourceview.py:79
-#: ../src/plugins/webreport/NarrativeWeb.py:2632
-#: ../src/Filters/SideBar/_SourceSidebarFilter.py:80
-#: ../src/Filters/SideBar/_MediaSidebarFilter.py:89
-msgid "Title"
-msgstr "Titel"
-
-#: ../src/ScratchPad.py:844 ../src/gui/editors/displaytabs/attrembedlist.py:64
-#: ../src/gui/editors/displaytabs/dataembedlist.py:60
-#: ../src/plugins/gramplet/Attributes.py:47
-#: ../src/plugins/lib/libmetadata.py:161 ../src/plugins/tool/PatchNames.py:405
-#: ../src/plugins/webreport/NarrativeWeb.py:344
-#: ../src/plugins/webreport/NarrativeWeb.py:1141
-#: ../src/plugins/webreport/NarrativeWeb.py:1395
-msgid "Value"
-msgstr "Værdi"
-
-#. -------------------------------------------------------------------------
-#.
-#. constants
-#.
-#. -------------------------------------------------------------------------
-#: ../src/ScratchPad.py:847 ../src/cli/clidbman.py:65
-#: ../src/gui/configure.py:1126
-msgid "Family Tree"
-msgstr "Slægtsbog"
-
-#: ../src/ScratchPad.py:1236 ../src/ScratchPad.py:1242
-#: ../src/ScratchPad.py:1281 ../src/ScratchPad.py:1325
-#: ../src/glade/scratchpad.glade.h:2
-msgid "Clipboard"
-msgstr "Udklipsholder"
-
-#: ../src/ScratchPad.py:1367 ../src/Simple/_SimpleTable.py:137
-#, fuzzy, python-format
-msgid "the object|See %s details"
-msgstr "Vis %s detaljer"
-
-#. ---------------------------
-#: ../src/ScratchPad.py:1373 ../src/Simple/_SimpleTable.py:147
-#, python-format
-msgid "the object|Make %s active"
-msgstr ""
-
-#: ../src/ScratchPad.py:1389
-#, fuzzy, python-format
-msgid "the object|Create Filter from %s selected..."
-msgstr "Opret filter fra valgte %s ..."
-
-#: ../src/Spell.py:60
-msgid "Spelling checker is not installed"
-msgstr "Stavekontrol er ikke installeret"
-
-#: ../src/Spell.py:78
-msgid "Off"
-msgstr ""
-
-#: ../src/Spell.py:81
-msgid "On"
-msgstr ""
-
-#: ../src/TipOfDay.py:68 ../src/TipOfDay.py:69 ../src/TipOfDay.py:120
-#: ../src/gui/viewmanager.py:768
-msgid "Tip of the Day"
-msgstr "Dagens tip"
-
-#: ../src/TipOfDay.py:87
-msgid "Failed to display tip of the day"
-msgstr "Kunne ikke vise dagens tip"
-
-#: ../src/TipOfDay.py:88
-#, python-format
-msgid ""
-"Unable to read the tips from external file.\n"
-"\n"
-"%s"
-msgstr ""
-"Kan ikke læse tips fra ekstern fil.\n"
-"\n"
-"%s"
-
-#: ../src/ToolTips.py:150 ../src/plugins/webreport/NarrativeWeb.py:2561
-msgid "Telephone"
-msgstr "Telefon"
-
-#: ../src/ToolTips.py:170
-msgid "Sources in repository"
-msgstr "Kilder i arkiv"
-
-#: ../src/ToolTips.py:202 ../src/gen/lib/childreftype.py:74
-#: ../src/gen/lib/eventtype.py:146 ../src/Merge/mergeperson.py:180
-#: ../src/plugins/quickview/all_relations.py:271
-#: ../src/plugins/quickview/lineage.py:91
-#: ../src/plugins/textreport/FamilyGroup.py:477
-#: ../src/plugins/textreport/FamilyGroup.py:479
-#: ../src/plugins/textreport/TagReport.py:129
-#: ../src/plugins/view/relview.py:614
-#: ../src/plugins/webreport/NarrativeWeb.py:318
-#: ../src/plugins/webreport/NarrativeWeb.py:2753
-#: ../src/plugins/webreport/NarrativeWeb.py:2946
-msgid "Birth"
-msgstr "Fødsel"
-
-#: ../src/ToolTips.py:211
-msgid "Primary source"
-msgstr "Primær kilde"
-
-#. ----------------------------------
-#: ../src/ToolTips.py:245 ../src/gen/lib/ldsord.py:105
-#: ../src/Merge/mergeperson.py:243 ../src/plugins/export/ExportCsv.py:503
-#: ../src/plugins/gramplet/Children.py:84
-#: ../src/plugins/gramplet/Children.py:180
-#: ../src/plugins/import/ImportCsv.py:219
-#: ../src/Filters/SideBar/_FamilySidebarFilter.py:117
-#: ../src/glade/editchildref.glade.h:2
-msgid "Child"
-msgstr "Barn"
-
-#: ../src/TransUtils.py:309
-#, fuzzy
-msgid "the person"
-msgstr "person"
-
-#: ../src/TransUtils.py:311
-#, fuzzy
-msgid "the family"
-msgstr "Skrifttype-familie"
-
-#: ../src/TransUtils.py:313
-#, fuzzy
-msgid "the place"
-msgstr "Fødested"
-
-#: ../src/TransUtils.py:315
-#, fuzzy
-msgid "the event"
-msgstr "Alle hændelser"
-
-#: ../src/TransUtils.py:317
-#, fuzzy
-msgid "the repository"
-msgstr "Alle arkiver"
-
-#: ../src/TransUtils.py:319
-#, fuzzy
-msgid "the note"
-msgstr "Alle noter"
-
-#: ../src/TransUtils.py:321
-#, fuzzy
-msgid "the media"
-msgstr "medier"
-
-#: ../src/TransUtils.py:323
-#, fuzzy
-msgid "the source"
-msgstr "Kilde til oplysninger om fødsel"
-
-#: ../src/TransUtils.py:325
-#, fuzzy
-msgid "the filter"
-msgstr "Fader-filtre"
-
-#: ../src/TransUtils.py:327
-#, fuzzy
-msgid "See details"
-msgstr "Vis %s detaljer"
-
-#: ../src/Utils.py:83 ../src/gui/editors/editperson.py:325
-#: ../src/gui/views/treemodels/peoplemodel.py:96
-#: ../src/Merge/mergeperson.py:62
-#: ../src/plugins/webreport/NarrativeWeb.py:5289
-#: ../src/Filters/SideBar/_PersonSidebarFilter.py:90
-msgid "male"
-msgstr "mand"
-
-#: ../src/Utils.py:84 ../src/gui/editors/editperson.py:324
-#: ../src/gui/views/treemodels/peoplemodel.py:96
-#: ../src/Merge/mergeperson.py:62
-#: ../src/plugins/webreport/NarrativeWeb.py:5290
-#: ../src/Filters/SideBar/_PersonSidebarFilter.py:90
-msgid "female"
-msgstr "kvinde"
-
-#: ../src/Utils.py:85
-msgid "gender|unknown"
-msgstr "ukendt"
-
-#: ../src/Utils.py:89
-msgid "Invalid"
-msgstr "Ugyldig"
-
-#: ../src/Utils.py:92 ../src/gui/editors/editcitation.py:276
-msgid "Very High"
-msgstr "Meget Høj"
-
-#: ../src/Utils.py:93 ../src/gui/editors/editcitation.py:275
-#: ../src/plugins/tool/FindDupes.py:63
-msgid "High"
-msgstr "Høj"
-
-#: ../src/Utils.py:94 ../src/gui/editors/editcitation.py:274
-#: ../src/plugins/webreport/NarrativeWeb.py:2273
-msgid "Normal"
-msgstr "Normal"
-
-#: ../src/Utils.py:95 ../src/gui/editors/editcitation.py:273
-#: ../src/plugins/tool/FindDupes.py:61
-msgid "Low"
-msgstr "Lav"
-
-#: ../src/Utils.py:96 ../src/gui/editors/editcitation.py:272
-msgid "Very Low"
-msgstr "Meget lav"
-
-#: ../src/Utils.py:100
-msgid "A legal or common-law relationship between a husband and wife"
-msgstr "Et registreret eller ægteskabslignende forhold mellem en mand og kvinde"
-
-#: ../src/Utils.py:102
-msgid "No legal or common-law relationship between man and woman"
-msgstr "Intet registreret eller ægteskabslignende forhold mellem en mand og kvinde"
-
-#: ../src/Utils.py:104
-msgid "An established relationship between members of the same sex"
-msgstr "Et etableret forhold mellem medlemmer af det samme køn"
-
-#: ../src/Utils.py:106
-msgid "Unknown relationship between a man and woman"
-msgstr "Ukendt forhold mellem mand og kvinde"
-
-#: ../src/Utils.py:108
-msgid "An unspecified relationship between a man and woman"
-msgstr "Et ikke nærmere angivet forhold mellem en mand og en kvinde"
-
-#: ../src/Utils.py:124
-msgid "The data can only be recovered by Undo operation or by quitting with abandoning changes."
-msgstr "Oplysningerne kan kun gendannes ved en fortryd-operation eller ved at afslutte uden at gemme ændringerne."
-
-#. -------------------------------------------------------------------------
-#.
-#. Short hand function to return either the person's name, or an empty
-#. string if the person is None
-#.
-#. -------------------------------------------------------------------------
-#: ../src/Utils.py:216 ../src/gen/lib/date.py:457 ../src/gen/lib/date.py:495
-#: ../src/gen/mime/_gnomemime.py:39 ../src/gen/mime/_gnomemime.py:46
-#: ../src/gen/mime/_pythonmime.py:49 ../src/gen/mime/_pythonmime.py:57
-#: ../src/gui/editors/editperson.py:326
-#: ../src/gui/views/treemodels/peoplemodel.py:96
-#: ../src/Merge/mergeperson.py:62
-#: ../src/plugins/textreport/DetAncestralReport.py:543
-#: ../src/plugins/textreport/DetAncestralReport.py:550
-#: ../src/plugins/textreport/DetAncestralReport.py:593
-#: ../src/plugins/textreport/DetAncestralReport.py:600
-#: ../src/plugins/textreport/DetDescendantReport.py:588
-#: ../src/plugins/textreport/DetDescendantReport.py:595
-#: ../src/plugins/textreport/IndivComplete.py:428
-#: ../src/plugins/view/relview.py:652
-#: ../src/plugins/webreport/NarrativeWeb.py:5291
-#: ../src/Filters/SideBar/_PersonSidebarFilter.py:90
-msgid "unknown"
-msgstr "ukendt"
-
-#: ../src/Utils.py:226 ../src/Utils.py:246 ../src/plugins/Records.py:218
-#, python-format
-msgid "%(father)s and %(mother)s"
-msgstr "%(father)s og %(mother)s"
-
-#: ../src/Utils.py:561
-msgid "death-related evidence"
-msgstr "dødsrelateret vidnesbyrd"
-
-#: ../src/Utils.py:578
-msgid "birth-related evidence"
-msgstr "fødselsrelateret vidnesbyrd"
-
-#: ../src/Utils.py:583 ../src/plugins/import/ImportCsv.py:209
-msgid "death date"
-msgstr "dødsdato"
-
-#: ../src/Utils.py:588 ../src/plugins/import/ImportCsv.py:187
-msgid "birth date"
-msgstr "fødselsdato"
-
-#: ../src/Utils.py:621
-msgid "sibling birth date"
-msgstr "søskende fødselsdato"
-
-#: ../src/Utils.py:633
-msgid "sibling death date"
-msgstr "søskende dødsdato"
-
-#: ../src/Utils.py:647
-msgid "sibling birth-related date"
-msgstr "søskende fødselsrelateret dato"
-
-#: ../src/Utils.py:658
-msgid "sibling death-related date"
-msgstr "søskende dødsrelateret dato"
-
-#: ../src/Utils.py:671 ../src/Utils.py:676
-msgid "a spouse, "
-msgstr "en ægtefælle, "
-
-#: ../src/Utils.py:694
-msgid "event with spouse"
-msgstr "hændelse med ægtefælle"
-
-#: ../src/Utils.py:718
-msgid "descendant birth date"
-msgstr "efterkommer fødselsdato"
-
-#: ../src/Utils.py:727
-msgid "descendant death date"
-msgstr "efterkommer dødsdato"
-
-#: ../src/Utils.py:743
-msgid "descendant birth-related date"
-msgstr "efterkommer fødselsrelateret dato"
-
-#: ../src/Utils.py:751
-msgid "descendant death-related date"
-msgstr "efterkommer dødsrelateret dato"
-
-#: ../src/Utils.py:764
-#, python-format
-msgid "Database error: %s is defined as his or her own ancestor"
-msgstr "Database-fejl: %s er angivet som hans eller hendes egen efterkommer"
-
-#: ../src/Utils.py:788 ../src/Utils.py:834
-msgid "ancestor birth date"
-msgstr "anes fødselsdato"
-
-#: ../src/Utils.py:798 ../src/Utils.py:844
-msgid "ancestor death date"
-msgstr "anes dødsdato"
-
-#: ../src/Utils.py:809 ../src/Utils.py:855
-msgid "ancestor birth-related date"
-msgstr "ane, fødselsrelateret dato"
-
-#: ../src/Utils.py:817 ../src/Utils.py:863
-msgid "ancestor death-related date"
-msgstr "ane, dødsrelateret dato"
-
-#. no evidence, must consider alive
-#: ../src/Utils.py:921
-msgid "no evidence"
-msgstr "intet vidnesbyrd"
-
-#. -------------------------------------------------------------------------
-#.
-#. Keyword translation interface
-#.
-#. -------------------------------------------------------------------------
-#. keyword, code, translated standard, translated upper
-#. in gen.display.name.py we find:
-#. 't' : title = title
-#. 'f' : given = given (first names)
-#. 'l' : surname = full surname (lastname)
-#. 'c' : call = callname
-#. 'x' : common = nick name if existing, otherwise first first name (common name)
-#. 'i' : initials = initials of the first names
-#. 'm' : primary = primary surname (main)
-#. '0m': primary[pre]= prefix primary surname (main)
-#. '1m': primary[sur]= surname primary surname (main)
-#. '2m': primary[con]= connector primary surname (main)
-#. 'y' : patronymic = pa/matronymic surname (father/mother) - assumed unique
-#. '0y': patronymic[pre] = prefix "
-#. '1y': patronymic[sur] = surname "
-#. '2y': patronymic[con] = connector "
-#. 'o' : notpatronymic = surnames without pa/matronymic and primary
-#. 'r' : rest = non primary surnames
-#. 'p' : prefix = list of all prefixes
-#. 'q' : rawsurnames = surnames without prefixes and connectors
-#. 's' : suffix = suffix
-#. 'n' : nickname = nick name
-#. 'g' : familynick = family nick name
-#: ../src/Utils.py:1273 ../src/plugins/export/ExportCsv.py:338
-#: ../src/plugins/import/ImportCsv.py:178
-#: ../src/plugins/tool/PatchNames.py:439
-msgid "Person|Title"
-msgstr "Titel"
-
-#: ../src/Utils.py:1273
-msgid "Person|TITLE"
-msgstr "TITEL"
-
-#: ../src/Utils.py:1274 ../src/gen/display/name.py:327
-#: ../src/gui/configure.py:515 ../src/gui/configure.py:517
-#: ../src/gui/configure.py:522 ../src/gui/configure.py:524
-#: ../src/gui/configure.py:526 ../src/gui/configure.py:527
-#: ../src/gui/configure.py:528 ../src/gui/configure.py:529
-#: ../src/gui/configure.py:531 ../src/gui/configure.py:532
-#: ../src/gui/configure.py:533 ../src/gui/configure.py:534
-#: ../src/gui/configure.py:535 ../src/gui/configure.py:536
-#: ../src/plugins/export/ExportCsv.py:336
-#: ../src/plugins/import/ImportCsv.py:173
-msgid "Given"
-msgstr "Fornavn"
-
-#: ../src/Utils.py:1274
-msgid "GIVEN"
-msgstr "FORNAVN"
-
-#: ../src/Utils.py:1275 ../src/gui/configure.py:522
-#: ../src/gui/configure.py:529 ../src/gui/configure.py:531
-#: ../src/gui/configure.py:532 ../src/gui/configure.py:533
-#: ../src/gui/configure.py:534 ../src/gui/configure.py:535
-msgid "SURNAME"
-msgstr "EFTERNAVN"
-
-#: ../src/Utils.py:1276
-msgid "Name|Call"
-msgstr "Kaldenavn"
-
-#: ../src/Utils.py:1276
-msgid "Name|CALL"
-msgstr "KALDENAVN"
-
-#: ../src/Utils.py:1277 ../src/gui/configure.py:519
-#: ../src/gui/configure.py:521 ../src/gui/configure.py:524
-#: ../src/gui/configure.py:525 ../src/gui/configure.py:531
-msgid "Name|Common"
-msgstr "Almindelig"
-
-#: ../src/Utils.py:1277
-msgid "Name|COMMON"
-msgstr "ALMINDELIG"
-
-#: ../src/Utils.py:1278
-msgid "Initials"
-msgstr "Initialer"
-
-#: ../src/Utils.py:1278
-msgid "INITIALS"
-msgstr "INITIALER"
-
-#: ../src/Utils.py:1279 ../src/gui/configure.py:515
-#: ../src/gui/configure.py:517 ../src/gui/configure.py:519
-#: ../src/gui/configure.py:521 ../src/gui/configure.py:522
-#: ../src/gui/configure.py:527 ../src/gui/configure.py:529
-#: ../src/gui/configure.py:534 ../src/gui/configure.py:536
-#: ../src/plugins/export/ExportCsv.py:337
-#: ../src/plugins/import/ImportCsv.py:180 ../src/glade/editperson.glade.h:26
-msgid "Suffix"
-msgstr "Efterstavelse"
-
-#: ../src/Utils.py:1279
-msgid "SUFFIX"
-msgstr "EFTERSTAVELSE"
-
-#. name, sort, width, modelcol
-#: ../src/Utils.py:1280 ../src/gui/editors/displaytabs/surnametab.py:80
-msgid "Name|Primary"
-msgstr "Primær"
-
-#: ../src/Utils.py:1280
-msgid "PRIMARY"
-msgstr "PRIMÆR"
-
-#: ../src/Utils.py:1281
-msgid "Primary[pre]"
-msgstr "Primær[for]"
-
-#: ../src/Utils.py:1281
-msgid "PRIMARY[PRE]"
-msgstr "PRIMÆR[FOR]"
-
-#: ../src/Utils.py:1282
-msgid "Primary[sur]"
-msgstr "Primær[efter]"
-
-#: ../src/Utils.py:1282
-msgid "PRIMARY[SUR]"
-msgstr "PRIMÆR[EFTER]"
-
-# con = connector = bindeled?
-#: ../src/Utils.py:1283
-msgid "Primary[con]"
-msgstr "Primær(bin)"
-
-#: ../src/Utils.py:1283
-msgid "PRIMARY[CON]"
-msgstr "PRIMÆR(BIN)"
-
-#: ../src/Utils.py:1284 ../src/gen/lib/nameorigintype.py:86
-#: ../src/gui/configure.py:528
-msgid "Patronymic"
-msgstr "Patronym"
-
-#: ../src/Utils.py:1284
-msgid "PATRONYMIC"
-msgstr "PATRONYM"
-
-#: ../src/Utils.py:1285
-msgid "Patronymic[pre]"
-msgstr "Patronym[for]"
-
-#: ../src/Utils.py:1285
-msgid "PATRONYMIC[PRE]"
-msgstr "PATRONYM[FOR]"
-
-#: ../src/Utils.py:1286
-msgid "Patronymic[sur]"
-msgstr "Patronym[efter]"
-
-#: ../src/Utils.py:1286
-msgid "PATRONYMIC[SUR]"
-msgstr "PATRONYM[EFTER]"
-
-#: ../src/Utils.py:1287
-msgid "Patronymic[con]"
-msgstr "Patronym[bin]"
-
-#: ../src/Utils.py:1287
-msgid "PATRONYMIC[CON]"
-msgstr "PATRONYM[BIN]"
-
-#: ../src/Utils.py:1288 ../src/gui/configure.py:536
-msgid "Rawsurnames"
-msgstr "Råefternavne"
-
-#: ../src/Utils.py:1288
-msgid "RAWSURNAMES"
-msgstr "RÅEFTERNAVNE"
-
-#: ../src/Utils.py:1289
-msgid "Notpatronymic"
-msgstr "Ikkepatronym"
-
-#: ../src/Utils.py:1289
-msgid "NOTPATRONYMIC"
-msgstr "IKKEPATRONYM"
-
-#: ../src/Utils.py:1290 ../src/gui/editors/displaytabs/surnametab.py:75
-#: ../src/plugins/export/ExportCsv.py:337
-#: ../src/plugins/import/ImportCsv.py:179 ../src/glade/editperson.glade.h:22
-msgid "Prefix"
-msgstr "Forstavelse"
-
-#: ../src/Utils.py:1290
-msgid "PREFIX"
-msgstr "FORSTAVELSE"
-
-#: ../src/Utils.py:1291 ../src/gen/lib/attrtype.py:71
-#: ../src/gui/configure.py:518 ../src/gui/configure.py:520
-#: ../src/gui/configure.py:525 ../src/gui/configure.py:532
-#: ../src/plugins/tool/PatchNames.py:429
-msgid "Nickname"
-msgstr "Tilnavn"
-
-#: ../src/Utils.py:1291
-msgid "NICKNAME"
-msgstr "TILNAVN"
-
-#: ../src/Utils.py:1292
-msgid "Familynick"
-msgstr "Familie-tilnavn"
-
-#: ../src/Utils.py:1292
-msgid "FAMILYNICK"
-msgstr "FAMILIE-TILNAVN"
-
-#: ../src/Utils.py:1405 ../src/Utils.py:1424
-#, python-format
-msgid "%s, ..."
-msgstr "%s, ..."
-
-#: ../src/UndoHistory.py:64 ../src/gui/grampsgui.py:161
-msgid "Undo History"
-msgstr "Fortryd-historik"
-
-#: ../src/UndoHistory.py:97
-msgid "Original time"
-msgstr "Oprindeligt tidspunkt"
-
-#: ../src/UndoHistory.py:100
-msgid "Action"
-msgstr "Handling"
-
-#: ../src/UndoHistory.py:176
-msgid "Delete confirmation"
-msgstr "Slet bekræftelse"
-
-#: ../src/UndoHistory.py:177
-msgid "Are you sure you want to clear the Undo history?"
-msgstr "Er du sikker på at du vil rydde Fortryd-historikken?"
-
-#: ../src/UndoHistory.py:178
-msgid "Clear"
-msgstr "Ryd"
-
-#: ../src/UndoHistory.py:214
-msgid "Database opened"
-msgstr "Database åbnet"
-
-#: ../src/UndoHistory.py:216
-msgid "History cleared"
-msgstr "Historikken ryddet"
-
-#: ../src/cli/arghandler.py:216
+#: ../gramps/cli/arghandler.py:231
#, python-format
msgid ""
"Error: Input family tree \"%s\" does not exist.\n"
"If GEDCOM, Gramps-xml or grdb, use the -i option to import into a family tree instead."
msgstr ""
-"Fejl: Slægtsbogen \"%s\" findes ikke.\n"
+"Fejl: Databasen \"%s\" findes ikke.\n"
"Hvis det er i formatet gedcom, gramps-xml eller grdb, bruges i stedet tilvalget -i for at importere det ind i en slægtsbog."
-#: ../src/cli/arghandler.py:232
+#: ../gramps/cli/arghandler.py:247
#, python-format
msgid "Error: Import file %s not found."
msgstr "Fejl: Import-filen %s ikke fundet."
-#: ../src/cli/arghandler.py:250
+#: ../gramps/cli/arghandler.py:265
#, python-format
msgid "Error: Unrecognized type: \"%(format)s\" for import file: %(filename)s"
msgstr "Fejl: Type ikke genkendt: \"%(format)s\" af import-fil: %(filename)s"
-#: ../src/cli/arghandler.py:272
-#, fuzzy, python-format
+#: ../gramps/cli/arghandler.py:287
+#, python-format
msgid ""
"WARNING: Output file already exists!\n"
"WARNING: It will be overwritten:\n"
@@ -1865,144 +87,151 @@ msgid ""
msgstr ""
"ADVARSEL: Uddata-fil findes allerede!\n"
"ADVARSEL: Den vil blive overskrevet:\n"
-" %(name)s"
+" %s"
-#: ../src/cli/arghandler.py:278
+#: ../gramps/cli/arghandler.py:297
msgid "OK to overwrite? (yes/no) "
msgstr "Er det o.k. at overskrive? (ja/nej) "
-#: ../src/cli/arghandler.py:283
+#: ../gramps/cli/arghandler.py:302
msgid "YES"
msgstr "JA"
-#: ../src/cli/arghandler.py:284
+#: ../gramps/cli/arghandler.py:303
#, python-format
msgid "Will overwrite the existing file: %s"
msgstr "Vil overskrive den eksisterende fil: %s"
-#: ../src/cli/arghandler.py:304
+#: ../gramps/cli/arghandler.py:324
#, python-format
msgid "ERROR: Unrecognized format for export file %s"
msgstr "FEJL: Ukendt format på eksportfilen %s"
-#: ../src/cli/arghandler.py:391
+#: ../gramps/cli/arghandler.py:411
msgid "List of known family trees in your database path\n"
-msgstr ""
+msgstr "Liste over kendte slægtsbøger i din databasesti\n"
-#: ../src/cli/arghandler.py:394
+#: ../gramps/cli/arghandler.py:416
#, python-format
msgid "%(full_DB_path)s with name \"%(f_t_name)s\""
-msgstr ""
+msgstr "%(full_DB_path)s med navn \"%(f_t_name)s\""
-#: ../src/cli/arghandler.py:400
-#, fuzzy
+#: ../gramps/cli/arghandler.py:422
msgid "Gramps Family Trees:"
-msgstr "Gramps XML-slægtsbog"
+msgstr "Gramps Slægtsbøger"
-#: ../src/cli/arghandler.py:404
-#, fuzzy, python-format
+#: ../gramps/cli/arghandler.py:426
+#, python-format
msgid "Family Tree \"%s\":"
-msgstr "Slægtsbøger"
+msgstr "Slægtsbog \"%s\":"
-#: ../src/cli/arghandler.py:414
-#, fuzzy, python-format
+#: ../gramps/cli/arghandler.py:438
+#, python-format
msgid "Performing action: %s."
-msgstr "Udfør den valgte aktion"
+msgstr "Udfører handling: %s."
-#: ../src/cli/arghandler.py:416
+#: ../gramps/cli/arghandler.py:440
#, python-format
msgid "Using options string: %s"
-msgstr ""
+msgstr "Benytter forvalgsstreng: %s"
-#: ../src/cli/arghandler.py:424
+#: ../gramps/cli/arghandler.py:448
#, python-format
msgid "Exporting: file %(filename)s, format %(format)s."
-msgstr ""
+msgstr "Eksporterer: fil %(filename)s, format %(format)s."
-#: ../src/cli/arghandler.py:432
+#: ../gramps/cli/arghandler.py:456
msgid "Exiting."
-msgstr ""
+msgstr "Afslutter."
-#: ../src/cli/arghandler.py:436
+#: ../gramps/cli/arghandler.py:460
msgid "Cleaning up."
-msgstr ""
+msgstr "Rydder op."
-#: ../src/cli/arghandler.py:466
+#: ../gramps/cli/arghandler.py:490
msgid "Created empty family tree successfully"
-msgstr ""
+msgstr "Dannede tomt familietræ"
-#: ../src/cli/arghandler.py:469 ../src/cli/arghandler.py:496
-#, fuzzy
+#: ../gramps/cli/arghandler.py:493 ../gramps/cli/arghandler.py:520
msgid "Error opening the file."
-msgstr "Fejl ved åbning af fil"
+msgstr "Fejl ved åbning af filen."
-#: ../src/cli/arghandler.py:470 ../src/cli/arghandler.py:497
-#, fuzzy
+#: ../gramps/cli/arghandler.py:494 ../gramps/cli/arghandler.py:521
msgid "Exiting..."
-msgstr "Vælger ..."
+msgstr "Afslutter..."
-#: ../src/cli/arghandler.py:476
+#: ../gramps/cli/arghandler.py:500
#, python-format
msgid "Importing: file %(filename)s, format %(format)s."
-msgstr ""
+msgstr "Importerer: fil %(filename)s, format %(format)s."
-#: ../src/cli/arghandler.py:494
-#, fuzzy
+#: ../gramps/cli/arghandler.py:518
msgid "Opened successfully!"
-msgstr "Operation vellykket."
+msgstr "Åbning vellykket!"
-#: ../src/cli/arghandler.py:508
+#: ../gramps/cli/arghandler.py:532
msgid "Database is locked, cannot open it!"
msgstr "Databasen er låst, kan ikke åbne den!"
-#: ../src/cli/arghandler.py:509
+#: ../gramps/cli/arghandler.py:533
#, python-format
msgid " Info: %s"
msgstr " Info: %s"
-#: ../src/cli/arghandler.py:512
+#: ../gramps/cli/arghandler.py:536
msgid "Database needs recovery, cannot open it!"
-msgstr "Databasen skal genoprettes, kan ikke åbne den!"
+msgstr "Databasen skal repareres, kan ikke åbne den!"
-#: ../src/cli/arghandler.py:569 ../src/cli/arghandler.py:616
+#: ../gramps/cli/arghandler.py:593 ../gramps/cli/arghandler.py:639
+#: ../gramps/cli/arghandler.py:678
msgid "Ignoring invalid options string."
-msgstr ""
+msgstr "Ignorerer ugyldig forvalgsstreng."
-#. name exists, but is not in the list of valid report names
-#: ../src/cli/arghandler.py:592
-#, fuzzy
+#: ../gramps/cli/arghandler.py:616
msgid "Unknown report name."
-msgstr "Ukendt køn"
+msgstr "Ukendt rapport navn."
-#: ../src/cli/arghandler.py:594
+#: ../gramps/cli/arghandler.py:618
#, python-format
msgid "Report name not given. Please use one of %(donottranslate)s=reportname"
-msgstr ""
+msgstr "Rapport navn blev ikke givet. Benyt venligst et af %(donottranslate)s=reportname"
-#: ../src/cli/arghandler.py:598 ../src/cli/arghandler.py:639
-#, fuzzy, python-format
+#: ../gramps/cli/arghandler.py:622 ../gramps/cli/arghandler.py:662
+#: ../gramps/cli/arghandler.py:693
+#, python-format
msgid ""
"%s\n"
" Available names are:"
-msgstr "Menu over forhåndenværende elementer"
+msgstr ""
+"%s\n"
+" Forhåndenværende navne er:"
-#: ../src/cli/arghandler.py:633
-#, fuzzy
+#: ../gramps/cli/arghandler.py:656
msgid "Unknown tool name."
-msgstr "Ukendt køn"
+msgstr "Ukendt værktøjsnavn."
-#: ../src/cli/arghandler.py:635
+#: ../gramps/cli/arghandler.py:658
#, python-format
msgid "Tool name not given. Please use one of %(donottranslate)s=toolname."
-msgstr ""
+msgstr "Værktøjsnavn mangler. Benyt venligst et af %(donottranslate)s=toolname."
-#: ../src/cli/arghandler.py:651
+#: ../gramps/cli/arghandler.py:687
+#, fuzzy
+msgid "Unknown book name."
+msgstr "Ukendt værktøjsnavn."
+
+#: ../gramps/cli/arghandler.py:689
#, fuzzy, python-format
-msgid "Unknown action: %s."
-msgstr "uk."
+msgid "Book name not given. Please use one of %(donottranslate)s=bookname."
+msgstr "Værktøjsnavn mangler. Benyt venligst et af %(donottranslate)s=toolname."
-#. Note: Make sure to edit const.py.in POPT_TABLE too!
-#: ../src/cli/argparser.py:53
+#: ../gramps/cli/arghandler.py:698
+#, python-format
+msgid "Unknown action: %s."
+msgstr "Ukendt handling: %s."
+
+# [pyg3t error] Short option -f not found in translation
+#: ../gramps/cli/argparser.py:57
msgid ""
"\n"
"Usage: gramps.py [OPTION...]\n"
@@ -2014,6 +243,7 @@ msgid ""
"\n"
"Application options\n"
" -O, --open=FAMILY_TREE Open family tree\n"
+" -C, --create=FAMILY_TREE Create on open if new family tree\n"
" -i, --import=FILENAME Import file\n"
" -e, --export=FILENAME Export file\n"
" -f, --format=FORMAT Specify family tree format\n"
@@ -2045,13 +275,12 @@ msgstr ""
" -d, --debug=NAVN_LOGFIL Aktivér fejljournalisering\n"
" -l Oplist slægtsbøger\n"
" -L Oplist slægtsbøger i detaljer\n"
-" -u, --force-unlock Fjen lås på slægtsbog med tvang\n"
+" -u, --force-unlock Fjern lås på slægtsbog med tvang\n"
" -s, --show Vis indstillinger\n"
-" -c, --config=[config.setting[:value]] Angiv indstilling og start \n"
-"Gramps\n"
+" -c, --config=[config.setting[:value]] Angiv indstilling(er) og start Gramps\n"
" -v, --version Vis versioner\n"
-#: ../src/cli/argparser.py:77
+#: ../gramps/cli/argparser.py:82
msgid ""
"\n"
"Example of usage of Gramps command line interface\n"
@@ -2143,7 +372,7 @@ msgstr ""
" brug show=option_name , f.eks.. name=timeline,show=off string.\n"
" For at finde ud af tilgængelige rapportnavne, brug name=show string.\n"
"\n"
-"9. For at konvertere en slægtsbog til en .gramps xml-fil:\n"
+"9. For at konvertere en database til en .gramps xml-fil:\n"
"\n"
" gramps -O 'Family Tree 1' -e output.gramps -f gramps-xml\n"
"\n"
@@ -2158,11 +387,11 @@ msgstr ""
"NB: Disse eksempler er til skallen bash.\n"
" Syntaksen kan være forskellig for andre kommandoskaller og for Windows.\n"
-#: ../src/cli/argparser.py:228 ../src/cli/argparser.py:349
+#: ../gramps/cli/argparser.py:234 ../gramps/cli/argparser.py:357
msgid "Error parsing the arguments"
msgstr "Fejl under fortolkning af argumenter"
-#: ../src/cli/argparser.py:230
+#: ../gramps/cli/argparser.py:236
#, python-format
msgid ""
"Error parsing the arguments: %s \n"
@@ -2171,223 +400,331 @@ msgstr ""
"Fejl ved fortolkning af argumenter: %s \n"
"Tast gramps --help for en oversigt over kommandoer, eller læs manualsiderne.."
-#: ../src/cli/argparser.py:350
-#, fuzzy, python-format
+#: ../gramps/cli/argparser.py:358
+#, python-format
msgid ""
"Error parsing the arguments: %s \n"
"To use in the command-line mode, supply at least one input file to process."
msgstr ""
-"Fejl ved fortolkning af argumenter: %s \n"
-"Ved brug i kommandolinje-tilstand skal mindst en inddata-fil angives."
+"Fejl ved fortolkning af argumenterne: %s \n"
+"Ved brug på kommandolinjen skal mindst en inddata-fil angives."
-#: ../src/cli/clidbman.py:78
-#, python-format
+#: ../gramps/cli/clidbman.py:72 ../gramps/gui/clipboard.py:925
+#: ../gramps/gui/configure.py:1293
+msgid "Family Tree"
+msgstr "Slægtsbog"
+
+#: ../gramps/cli/clidbman.py:85
+#, fuzzy, python-format
msgid ""
-"ERROR: %s \n"
-" %s"
+"ERROR: %(title)s \n"
+" %(message)s"
msgstr ""
"FEJL: %s \n"
" %s"
-#: ../src/cli/clidbman.py:241
+#: ../gramps/cli/clidbman.py:257
#, python-format
msgid "Starting Import, %s"
msgstr "Påbegynder import, %s"
-#: ../src/cli/clidbman.py:247
+#: ../gramps/cli/clidbman.py:263
msgid "Import finished..."
msgstr "Import afsluttet ..."
-#. Create a new database
-#: ../src/cli/clidbman.py:319 ../src/plugins/import/ImportCsv.py:311
+#: ../gramps/cli/clidbman.py:341 ../gramps/plugins/importer/importcsv.py:331
msgid "Importing data..."
msgstr "Importerer data ..."
-#: ../src/cli/clidbman.py:363
+#: ../gramps/cli/clidbman.py:385
msgid "Could not rename family tree"
msgstr "Kunne ikke omdøbe slægtsbogen"
-#: ../src/cli/clidbman.py:398
-msgid "Could not make database directory: "
-msgstr "Kunne ikke oprette mappen til databaserne: "
+#: ../gramps/cli/clidbman.py:420
+#, python-format
+msgid ""
+"\n"
+"ERROR: Wrong database path in Edit Menu->Preferences.\n"
+"Open preferences and set correct database path.\n"
+"\n"
+"Details: Could not make database directory:\n"
+" %s\n"
+"\n"
+msgstr ""
+"\n"
+"FEJL: Forkert databasesti i Rediger Menu->Indstillinger.\n"
+"Åbn indstillinger og angiv den rigtige databasesti.\n"
+"\n"
+"Detaljer: Kunne ikke danne databasemappen:\n"
+" %s\n"
+"\n"
-#: ../src/cli/clidbman.py:446 ../src/gui/configure.py:1070
+#: ../gramps/cli/clidbman.py:473 ../gramps/gui/configure.py:1225
msgid "Never"
msgstr "Aldrig"
-#: ../src/cli/clidbman.py:465
+#: ../gramps/cli/clidbman.py:493
#, python-format
msgid "Locked by %s"
msgstr "Låst af %s"
-#: ../src/cli/grampscli.py:76
+#: ../gramps/cli/clidbman.py:496 ../gramps/gen/lib/attrtype.py:64
+#: ../gramps/gen/lib/childreftype.py:80 ../gramps/gen/lib/eventroletype.py:59
+#: ../gramps/gen/lib/eventtype.py:145 ../gramps/gen/lib/familyreltype.py:53
+#: ../gramps/gen/lib/grampstype.py:44 ../gramps/gen/lib/nameorigintype.py:81
+#: ../gramps/gen/lib/nametype.py:54 ../gramps/gen/lib/notetype.py:80
+#: ../gramps/gen/lib/repotype.py:60 ../gramps/gen/lib/srcmediatype.py:63
+#: ../gramps/gen/lib/urltype.py:55 ../gramps/gen/utils/lds.py:87
+#: ../gramps/gen/utils/lds.py:93 ../gramps/gen/utils/unknown.py:120
+#: ../gramps/gen/utils/unknown.py:122 ../gramps/gen/utils/unknown.py:126
+#: ../gramps/gen/utils/unknown.py:132 ../gramps/gen/utils/unknown.py:137
+#: ../gramps/gui/clipboard.py:188
+#: ../gramps/gui/editors/displaytabs/personrefembedlist.py:124
+#: ../gramps/gui/editors/editmedia.py:171
+#: ../gramps/gui/editors/editmediaref.py:133
+#: ../gramps/plugins/gramplet/persondetails.py:160
+#: ../gramps/plugins/gramplet/persondetails.py:166
+#: ../gramps/plugins/gramplet/persondetails.py:168
+#: ../gramps/plugins/gramplet/persondetails.py:169
+#: ../gramps/plugins/gramplet/relativegramplet.py:124
+#: ../gramps/plugins/gramplet/relativegramplet.py:135
+#: ../gramps/plugins/graph/gvfamilylines.py:162
+#: ../gramps/plugins/graph/gvrelgraph.py:565
+#: ../gramps/plugins/lib/libnarrate.py:1997
+#: ../gramps/plugins/lib/maps/geography.py:718
+#: ../gramps/plugins/lib/maps/geography.py:725
+#: ../gramps/plugins/lib/maps/geography.py:726
+#: ../gramps/plugins/quickview/all_relations.py:279
+#: ../gramps/plugins/quickview/all_relations.py:296
+#: ../gramps/plugins/textreport/indivcomplete.py:624
+#: ../gramps/plugins/tool/check.py:1967 ../gramps/plugins/view/geoclose.py:481
+#: ../gramps/plugins/view/geofamclose.py:630
+#: ../gramps/plugins/view/geofamily.py:423
+#: ../gramps/plugins/view/geomoves.py:569
+#: ../gramps/plugins/view/geoperson.py:448
+#: ../gramps/plugins/view/relview.py:471
+#: ../gramps/plugins/view/relview.py:1019
+#: ../gramps/plugins/view/relview.py:1066
+#: ../gramps/plugins/webreport/narrativeweb.py:393
+#: ../gramps/plugins/webreport/narrativeweb.py:2361
+#: ../gramps/plugins/webreport/narrativeweb.py:2516
+msgid "Unknown"
+msgstr "Ukendt"
+
+#: ../gramps/cli/grampscli.py:80
#, python-format
msgid "WARNING: %s"
msgstr "ADVARSEL: %s"
-#: ../src/cli/grampscli.py:83 ../src/cli/grampscli.py:207
+#: ../gramps/cli/grampscli.py:87 ../gramps/cli/grampscli.py:211
#, python-format
msgid "ERROR: %s"
msgstr "FEJL: %s"
-#: ../src/cli/grampscli.py:139 ../src/gui/dbloader.py:285
+#: ../gramps/cli/grampscli.py:97 ../gramps/cli/user.py:173
+#: ../gramps/gui/dialog.py:216
+msgid "Low level database corruption detected"
+msgstr "Dybtgående ødelæggelse af databasen er blevet opdaget"
+
+#: ../gramps/cli/grampscli.py:99 ../gramps/cli/user.py:174
+#: ../gramps/gui/dialog.py:217
+msgid "Gramps has detected a problem in the underlying Berkeley database. This can be repaired from the Family Tree Manager. Select the database and click on the Repair button"
+msgstr "Gramps er stødt på et problem i den underliggende Berkeley-database. Dette kan repareres fra menuen \"Slægtsbogshåndtering\". Vælg slægtsbogen og klik på knappen \"reparér\""
+
+#: ../gramps/cli/grampscli.py:143 ../gramps/gui/dbloader.py:293
msgid "Read only database"
msgstr "Skrivebeskyttet database"
-#: ../src/cli/grampscli.py:140 ../src/gui/dbloader.py:230
-#: ../src/gui/dbloader.py:286
+#: ../gramps/cli/grampscli.py:144 ../gramps/gui/dbloader.py:238
+#: ../gramps/gui/dbloader.py:294
msgid "You do not have write access to the selected file."
msgstr "Du har ikke skriverettighed til den valgte fil."
-#: ../src/cli/grampscli.py:159 ../src/cli/grampscli.py:162
-#: ../src/gui/dbloader.py:314 ../src/gui/dbloader.py:317
-#: ../src/gui/dbloader.py:320
+#: ../gramps/cli/grampscli.py:163 ../gramps/cli/grampscli.py:166
+#: ../gramps/gui/dbloader.py:327 ../gramps/gui/dbloader.py:330
+#: ../gramps/gui/dbloader.py:333
msgid "Cannot open database"
msgstr "Kan ikke åbne database"
-#: ../src/cli/grampscli.py:166 ../src/gui/dbloader.py:188
-#: ../src/gui/dbloader.py:324
+#: ../gramps/cli/grampscli.py:170 ../gramps/gui/dbloader.py:197
+#: ../gramps/gui/dbloader.py:337
#, python-format
msgid "Could not open file: %s"
msgstr "Kunne ikke åbne filen: %s"
-#: ../src/cli/grampscli.py:219
+#: ../gramps/cli/grampscli.py:223
msgid "Could not load a recent Family Tree."
msgstr "Kunne ikke indlæse en aktuel slægtsbog."
-#: ../src/cli/grampscli.py:220
+#: ../gramps/cli/grampscli.py:224
msgid "Family Tree does not exist, as it has been deleted."
msgstr "Slægtsbog findes ikke, da den er blevet slettet."
-#. already errors encountered. Show first one on terminal and exit
-#. Convert error message to file system encoding before print
-#: ../src/cli/grampscli.py:296
+#: ../gramps/cli/grampscli.py:299
#, python-format
msgid "Error encountered: %s"
msgstr "Fejl opstået: %s"
-#: ../src/cli/grampscli.py:299 ../src/cli/grampscli.py:310
+#: ../gramps/cli/grampscli.py:302 ../gramps/cli/grampscli.py:313
#, python-format
msgid " Details: %s"
msgstr " Detaljer: %s"
-#. Convert error message to file system encoding before print
-#: ../src/cli/grampscli.py:306
+#: ../gramps/cli/grampscli.py:309
#, python-format
msgid "Error encountered in argument parsing: %s"
msgstr "Fejl opstod i fortolkning af argument: %s"
-#: ../src/cli/plug/__init__.py:168
-#, fuzzy
+#: ../gramps/cli/plug/__init__.py:172
msgid "ERROR: Please specify a person"
-msgstr "Anfør venligst et navn til bogen"
+msgstr "FEJL: Angiv venligst en person"
-#: ../src/cli/plug/__init__.py:192
-#, fuzzy
+#: ../gramps/cli/plug/__init__.py:196
msgid "ERROR: Please specify a family"
-msgstr "Anfør venligst et navn til bogen"
+msgstr "FEJL: Angiv venligst en familie"
-#. FIXME it is wrong to use translatable text in comparison.
-#. How can we distinguish custom size though?
-#: ../src/cli/plug/__init__.py:302 ../src/gen/plug/report/_paper.py:91
-#: ../src/gen/plug/report/_paper.py:113
-#: ../src/gui/plug/report/_papermenu.py:182
-#: ../src/gui/plug/report/_papermenu.py:243
+#: ../gramps/cli/plug/__init__.py:308 ../gramps/gen/plug/report/_paper.py:92
+#: ../gramps/gen/plug/report/_paper.py:114
+#: ../gramps/gui/plug/report/_papermenu.py:184
+#: ../gramps/gui/plug/report/_papermenu.py:245
msgid "Custom Size"
msgstr "Tilpasset Størrelse"
-#: ../src/cli/plug/__init__.py:403
-#, fuzzy, python-format
+#: ../gramps/cli/plug/__init__.py:420
+#, python-format
msgid "Unknown option: %s"
-msgstr "Ukendt moder"
+msgstr "Ukendt valgmulighed: %s"
-#: ../src/cli/plug/__init__.py:404 ../src/cli/plug/__init__.py:434
+#: ../gramps/cli/plug/__init__.py:421 ../gramps/cli/plug/__init__.py:500
msgid " Valid options are:"
-msgstr ""
+msgstr " Mulige valg er:"
-#: ../src/cli/plug/__init__.py:406 ../src/cli/plug/__init__.py:436
-#: ../src/cli/plug/__init__.py:531
+#: ../gramps/cli/plug/__init__.py:423 ../gramps/cli/plug/__init__.py:502
+#: ../gramps/cli/plug/__init__.py:579
#, python-format
msgid " Use '%(donottranslate)s' to see description and acceptable values"
-msgstr ""
+msgstr " Benyt '%(donottranslate)s' for at se beskrivelse og mulige værdier"
-#: ../src/cli/plug/__init__.py:433
-#, python-format
-msgid "Ignoring unknown option: %s"
-msgstr ""
-
-#: ../src/cli/plug/__init__.py:481
+#: ../gramps/cli/plug/__init__.py:475
#, python-format
msgid "Ignoring '%(notranslate1)s=%(notranslate2)s' and using '%(notranslate1)s=%(notranslate3)s'."
-msgstr ""
+msgstr "Ignorerer '%(notranslate1)s=%(notranslate2)s' og benytter '%(notranslate1)s=%(notranslate3)s'."
-#: ../src/cli/plug/__init__.py:486
+#: ../gramps/cli/plug/__init__.py:480
#, python-format
msgid "Use '%(notranslate)s' to see valid values."
-msgstr ""
+msgstr "Benyt '%(notranslate)s' for at se de gyldige værdier."
-#: ../src/cli/plug/__init__.py:520
-#, fuzzy
+#: ../gramps/cli/plug/__init__.py:499
+#, python-format
+msgid "Ignoring unknown option: %s"
+msgstr "Ignorerer ukendt forvalg: %s"
+
+#: ../gramps/cli/plug/__init__.py:567
msgid " Available options:"
-msgstr "Bøger til rådighed"
+msgstr " Forhåndenværende forvalg:"
-#: ../src/cli/plug/__init__.py:538
+#: ../gramps/cli/plug/__init__.py:577
#, fuzzy
-msgid " Available values are:"
-msgstr "Menu over forhåndenværende elementer"
+msgid "(no help available)"
+msgstr "Ikke-tilgængelig"
-#. there was a show option given, but the option is invalid
-#: ../src/cli/plug/__init__.py:550
+#: ../gramps/cli/plug/__init__.py:586
+msgid " Available values are:"
+msgstr " Forhåndenværende værdier er:"
+
+#: ../gramps/cli/plug/__init__.py:598
#, python-format
msgid "option '%(optionname)s' not valid. Use '%(donottranslate)s' to see all valid options."
+msgstr "forvalg '%(optionname)s' ugyldig. Benyt '%(donottranslate)s' for at se alle gyldige forvalg."
+
+#: ../gramps/cli/plug/__init__.py:610
+msgid "Failed to write report. "
+msgstr "Kunne ikke skrive rapport. "
+
+#: ../gramps/gen/config.py:285
+msgid "Imported %Y/%m/%d %H:%M:%S"
msgstr ""
-#: ../src/cli/plug/__init__.py:562
-msgid "Failed to write report. "
-msgstr "Kunne ikke skrive raport. "
+#: ../gramps/gen/config.py:294
+msgid "Missing Given Name"
+msgstr "Manglende fornavn"
-#: ../src/gen/db/base.py:1600
+#: ../gramps/gen/config.py:295
+msgid "Missing Record"
+msgstr "Manglende optegnelse"
+
+#: ../gramps/gen/config.py:296
+msgid "Missing Surname"
+msgstr "Manglende efternavn"
+
+#: ../gramps/gen/config.py:303 ../gramps/gen/config.py:305
+msgid "Living"
+msgstr "Nulevende"
+
+#: ../gramps/gen/config.py:304
+msgid "Private Record"
+msgstr "Privat optegnelse"
+
+#: ../gramps/gen/const.py.in:237
+msgid "Gramps (Genealogical Research and Analysis Management Programming System) is a personal genealogy program."
+msgstr "Gramps (Genealogical Research and Analysis Management Programming System) er et slægtsforskningsprogram til privatpersoner."
+
+#: ../gramps/gen/const.py.in:258
+msgid "TRANSLATORS: Translate this to your name in your native language"
+msgstr ""
+"Lars Kr. Lundin\n"
+"Morten Bo Johansen\n"
+"Dansk-gruppen \n"
+"Mere info: http://www.dansk-gruppen.dk"
+
+#: ../gramps/gen/const.py.in:269 ../gramps/gen/const.py.in:270
+#: ../gramps/gen/lib/date.py:1650 ../gramps/gen/lib/date.py:1664
+msgid "none"
+msgstr "ingen"
+
+#: ../gramps/gen/db/base.py:1616
msgid "Add child to family"
msgstr "Tilføj barn til familien"
-#: ../src/gen/db/base.py:1613 ../src/gen/db/base.py:1618
+#: ../gramps/gen/db/base.py:1629 ../gramps/gen/db/base.py:1634
msgid "Remove child from family"
msgstr "Fjern barnet fra familien"
-#: ../src/gen/db/base.py:1693 ../src/gen/db/base.py:1697
+#: ../gramps/gen/db/base.py:1709 ../gramps/gen/db/base.py:1713
msgid "Remove Family"
msgstr "Fjern familie"
-#: ../src/gen/db/base.py:1738
+#: ../gramps/gen/db/base.py:1754
msgid "Remove father from family"
msgstr "Fjern faderen fra familien"
-#: ../src/gen/db/base.py:1740
+#: ../gramps/gen/db/base.py:1756
msgid "Remove mother from family"
msgstr "Fjern moderen fra familien"
-#: ../src/gen/db/exceptions.py:78 ../src/plugins/import/ImportGrdb.py:2786
+#: ../gramps/gen/db/exceptions.py:79
msgid ""
"The database version is not supported by this version of Gramps.\n"
"Please upgrade to the corresponding version or use XML for porting data between different database versions."
msgstr ""
"Version af databasen er ikke understøttet af denne version af Gramps.\n"
-"Opgradér venligst til en kompatibel version eller brug XML til at flytte data mellem forskellige database-versioner."
+"Opgradér venligst til en kompatibel version eller brug XML til at flytte data mellem forskellige versioner af databaser."
-#: ../src/gen/db/exceptions.py:93
+#: ../gramps/gen/db/exceptions.py:94
#, python-format
msgid "Gramps stores its data in a Berkeley Database. The family tree you try to load was created with version %(env_version)s of the Berkeley DB. However, the Gramps version in use right now employs version %(bdb_version)s of the Berkeley DB. So you are trying to load data created in a newer format into an older program; this is bound to fail. The right approach in this case is to use XML export and import. So try to open the family tree on that computer with that software that created the family tree, export it to XML and load that XML into the version of Gramps you intend to use."
-msgstr ""
+msgstr "Gramps gemmer sine data i en Berkeley-database. Den slægtsbog du forsøgte at indlæse er lavet med %(env_version)s af Berkeley DB. Den version af Gramps som du bruger nu, anvender verson %(bdb_version)s af Berkeley DB. Du prøver derfor at indlæse data som er lavet i et nyere format ind i et ældre program; dette er dømt til at mislykkes. Så prøv at åbne databasen på computeren med den software som blev brugt til at lave databasen, eksportér den til XML og indlæs denne XML-version af databasen ind i den version af Gramps som du vil bruge."
-#: ../src/gen/db/exceptions.py:116
+#: ../gramps/gen/db/exceptions.py:117
msgid ""
"Gramps has detected a problem in opening the 'environment' of the underlying Berkeley database used to store this Family Tree. The most likely cause is that the database was created with an old version of the Berkeley database program, and you are now using a new version. It is quite likely that your database has not been changed by Gramps.\n"
"If possible, you should revert to your old version of Gramps and its support software; export your database to XML; close the database; then upgrade again to this version of Gramps and import the XML file in an empty Family Tree. Alternatively, it may be possible to use the Berkeley database recovery tools."
msgstr ""
-"Gramps er stødt på et problem med at åbne den underliggende Berkeley database som indeholder denne slægtsbog. Sandsynligvis er databasen lavet med en ældre version af Berkeley databaseprogrammet, samtidig med at du bruger en nyere version. Det er meget sandsynligt at din database ikke er blevet ændret af Gramps.\n"
-"Om muligt, bør du gå tilbage til din gamle version af Gramps og dens tilhørende software: eksportér din database til XML, luk databasen, foretag en ny opgradering til denne version af Gramps og importér XML-filen ind i en tom slægtsbog. Alternativt er det måske muligt at bruge Berkeley databasens reparationsværktøjer."
+"Gramps er stødt på et problem med at åbne den underliggende Berkeley-database som indeholder denne slægtsbog. Sandsynligvis er databasen lavet med en ældre version af Berkeley databaseprogrammet, samtidig med at du bruger en nyere version. Det er meget sandsynligt at din database ikke er blevet ændret af Gramps.\n"
+"Om muligt, bør du gå tilbage til din gamle version af Gramps og dens tilhørende software: eksportér din database til XML, luk databasen, foretag en ny opgradering til denne version af Gramps og importér XML-filen ind i en tom slægtsbog. Alternativt er det måske muligt at bruge Berkeley-databasens reparationsværktøjer."
-#: ../src/gen/db/exceptions.py:139
+#: ../gramps/gen/db/exceptions.py:140
msgid ""
"You cannot open this database without upgrading it.\n"
"If you upgrade then you won't be able to use previous versions of Gramps.\n"
@@ -2397,807 +734,3404 @@ msgstr ""
"Hvis du opgraderer, kan du ikke bruge tidligere versioner af Gramps.\n"
"Du bør lave en sikkerhedskopi først."
-#: ../src/gen/db/undoredo.py:241 ../src/gen/db/undoredo.py:278
-#: ../src/plugins/lib/libgrdb.py:1705 ../src/plugins/lib/libgrdb.py:1777
-#: ../src/plugins/lib/libgrdb.py:1818
+#: ../gramps/gen/db/undoredo.py:249 ../gramps/gen/db/undoredo.py:286
+#: ../gramps/gen/db/write.py:1980 ../gramps/plugins/lib/libgrdb.py:1711
+#: ../gramps/plugins/lib/libgrdb.py:1783 ../gramps/plugins/lib/libgrdb.py:1824
#, python-format
msgid "_Undo %s"
msgstr "_Fortryd %s"
-#: ../src/gen/db/undoredo.py:247 ../src/gen/db/undoredo.py:284
-#: ../src/plugins/lib/libgrdb.py:1784 ../src/plugins/lib/libgrdb.py:1826
+#: ../gramps/gen/db/undoredo.py:255 ../gramps/gen/db/undoredo.py:292
+#: ../gramps/plugins/lib/libgrdb.py:1790 ../gramps/plugins/lib/libgrdb.py:1832
#, python-format
msgid "_Redo %s"
msgstr "_Omgør %s"
-#: ../src/gen/display/name.py:325
+#: ../gramps/gen/db/upgrade.py:86
+#, python-format
+msgid "%6d People upgraded with %6d citations in %6d secs\n"
+msgstr "%6d Personer opgraderet med %6d citeringer på %6d sekunder\n"
+
+#: ../gramps/gen/db/upgrade.py:87
+#, python-format
+msgid "%6d Families upgraded with %6d citations in %6d secs\n"
+msgstr "%6d Familier opgraderet med %6d citeringer på %6d sekunder\n"
+
+#: ../gramps/gen/db/upgrade.py:88
+#, python-format
+msgid "%6d Events upgraded with %6d citations in %6d secs\n"
+msgstr "%6d Hændelser opgraderet med %6d citeringer på %6d sekunder\n"
+
+#: ../gramps/gen/db/upgrade.py:89
+#, python-format
+msgid "%6d Media Objects upgraded with %6d citations in %6d secs\n"
+msgstr "%6d Medieobjekter opgraderet med %6d citeringer på %6d sekunder\n"
+
+#: ../gramps/gen/db/upgrade.py:90
+#, python-format
+msgid "%6d Places upgraded with %6d citations in %6d secs\n"
+msgstr "%6d Stednavne opgraderet med %6d citeringer på %6d sekunder\n"
+
+#: ../gramps/gen/db/upgrade.py:91
+#, python-format
+msgid "%6d Repositories upgraded with %6d citations in %6d secs\n"
+msgstr "%6d Arkiver opgraderet med %6d citeringer på %6d sekunder\n"
+
+#: ../gramps/gen/db/upgrade.py:431
+msgid "Number of new objects upgraded:\n"
+msgstr "Antal nye objekter der blev opgraderet:\n"
+
+#: ../gramps/gen/db/upgrade.py:437
+msgid ""
+"\n"
+"\n"
+"You may want to run\n"
+"Tools -> Family Tree Processing -> Merge\n"
+"in order to merge citations that contain similar\n"
+"information"
+msgstr ""
+"\n"
+"\n"
+"You kan udføre\n"
+"Værktøjer -> Slægtsbogshåndtering -> Sammenflet\n"
+"for at sammenflette citeringer der indeholder ens\n"
+"information"
+
+#: ../gramps/gen/db/upgrade.py:441
+msgid "Upgrade Statistics"
+msgstr "Statistik over opgradering"
+
+#: ../gramps/gen/db/write.py:962
+#, python-format
+msgid ""
+"An attempt is made to safe a reference key which is partly bytecode, this is not allowed.\n"
+"Key is %s"
+msgstr ""
+
+#: ../gramps/gen/db/write.py:1031
+msgid "Rebuild reference map"
+msgstr "Gendan indeks over henvisninger"
+
+#: ../gramps/gen/db/write.py:1833
+#, python-format
+msgid "A second transaction is started while there is still a transaction, \"%s\", active in the database."
+msgstr ""
+
+#: ../gramps/gen/display/name.py:331
msgid "Default format (defined by Gramps preferences)"
msgstr "Standardformat (defineret i Gramps' indstillinger)"
# Fejlmeld msgid, mgl. komma
-#: ../src/gen/display/name.py:326
+#: ../gramps/gen/display/name.py:332
msgid "Surname, Given Suffix"
msgstr "Efternavn, fornavns-efterstavelse"
-#: ../src/gen/display/name.py:328
+#: ../gramps/gen/display/name.py:333 ../gramps/gen/utils/keyword.py:57
+#: ../gramps/gui/configure.py:612 ../gramps/gui/configure.py:614
+#: ../gramps/gui/configure.py:619 ../gramps/gui/configure.py:621
+#: ../gramps/gui/configure.py:623 ../gramps/gui/configure.py:624
+#: ../gramps/gui/configure.py:625 ../gramps/gui/configure.py:626
+#: ../gramps/gui/configure.py:628 ../gramps/gui/configure.py:629
+#: ../gramps/gui/configure.py:630 ../gramps/gui/configure.py:631
+#: ../gramps/gui/configure.py:632 ../gramps/gui/configure.py:633
+#: ../gramps/plugins/export/exportcsv.py:338
+#: ../gramps/plugins/importer/importcsv.py:183
+msgid "Given"
+msgstr "Fornavn"
+
+#: ../gramps/gen/display/name.py:334
msgid "Given Surname Suffix"
msgstr "Slægtsnavn-efterstavelse"
-#. primary name primconnector other, given pa/matronynic suffix, primprefix
-#. translators, long string, have a look at Preferences dialog
-#: ../src/gen/display/name.py:331
+#: ../gramps/gen/display/name.py:337
msgid "Main Surnames, Given Patronymic Suffix Prefix"
msgstr "Hovedefternavne, fornavn patronym efterstavelse forstavelse"
-#. DEPRECATED FORMATS
-#: ../src/gen/display/name.py:334
+#: ../gramps/gen/display/name.py:340
msgid "Patronymic, Given"
msgstr "Patronym, fornavn"
-#: ../src/gen/display/name.py:540 ../src/gen/display/name.py:640
-#: ../src/plugins/import/ImportCsv.py:178
+#: ../gramps/gen/display/name.py:569 ../gramps/gen/display/name.py:669
+#: ../gramps/plugins/importer/importcsv.py:188
msgid "Person|title"
msgstr "titel"
-#: ../src/gen/display/name.py:542 ../src/gen/display/name.py:642
-#: ../src/plugins/import/ImportCsv.py:174
+#: ../gramps/gen/display/name.py:571 ../gramps/gen/display/name.py:671
+#: ../gramps/plugins/importer/importcsv.py:184
msgid "given"
msgstr "fornavn"
-#: ../src/gen/display/name.py:544 ../src/gen/display/name.py:644
-#: ../src/plugins/import/ImportCsv.py:171
+#: ../gramps/gen/display/name.py:573 ../gramps/gen/display/name.py:673
+#: ../gramps/plugins/importer/importcsv.py:181
msgid "surname"
msgstr "efternavn"
-#: ../src/gen/display/name.py:546 ../src/gen/display/name.py:646
-#: ../src/gui/editors/editperson.py:363 ../src/plugins/import/ImportCsv.py:180
+#: ../gramps/gen/display/name.py:575 ../gramps/gen/display/name.py:675
+#: ../gramps/gui/editors/editperson.py:368
+#: ../gramps/plugins/importer/importcsv.py:190
msgid "suffix"
msgstr "efterstavelse"
-#: ../src/gen/display/name.py:548 ../src/gen/display/name.py:648
+#: ../gramps/gen/display/name.py:577 ../gramps/gen/display/name.py:677
msgid "Name|call"
-msgstr "Kaldenavn"
+msgstr "kaldenavn"
-#: ../src/gen/display/name.py:551 ../src/gen/display/name.py:650
+#: ../gramps/gen/display/name.py:580 ../gramps/gen/display/name.py:679
msgid "Name|common"
msgstr "almindelig"
-#: ../src/gen/display/name.py:555 ../src/gen/display/name.py:653
+#: ../gramps/gen/display/name.py:584 ../gramps/gen/display/name.py:682
msgid "initials"
msgstr "initialer"
-#: ../src/gen/display/name.py:558 ../src/gen/display/name.py:655
+#: ../gramps/gen/display/name.py:587 ../gramps/gen/display/name.py:684
msgid "Name|primary"
-msgstr "Primær"
+msgstr "primær"
-#: ../src/gen/display/name.py:561 ../src/gen/display/name.py:657
+#: ../gramps/gen/display/name.py:590 ../gramps/gen/display/name.py:686
msgid "primary[pre]"
msgstr "primær[for]"
-#: ../src/gen/display/name.py:564 ../src/gen/display/name.py:659
+#: ../gramps/gen/display/name.py:593 ../gramps/gen/display/name.py:688
msgid "primary[sur]"
msgstr "primær[efter]"
-#: ../src/gen/display/name.py:567 ../src/gen/display/name.py:661
+#: ../gramps/gen/display/name.py:596 ../gramps/gen/display/name.py:690
msgid "primary[con]"
msgstr "primær[bin]"
-#: ../src/gen/display/name.py:569 ../src/gen/display/name.py:663
+#: ../gramps/gen/display/name.py:598 ../gramps/gen/display/name.py:692
msgid "patronymic"
msgstr "patronym"
-#: ../src/gen/display/name.py:571 ../src/gen/display/name.py:665
+#: ../gramps/gen/display/name.py:600 ../gramps/gen/display/name.py:694
msgid "patronymic[pre]"
msgstr "patronym[for]"
-#: ../src/gen/display/name.py:573 ../src/gen/display/name.py:667
+#: ../gramps/gen/display/name.py:602 ../gramps/gen/display/name.py:696
msgid "patronymic[sur]"
msgstr "patronym[efter]"
-#: ../src/gen/display/name.py:575 ../src/gen/display/name.py:669
+#: ../gramps/gen/display/name.py:604 ../gramps/gen/display/name.py:698
msgid "patronymic[con]"
msgstr "patronym[bin]"
-#: ../src/gen/display/name.py:577 ../src/gen/display/name.py:671
+#: ../gramps/gen/display/name.py:606 ../gramps/gen/display/name.py:700
msgid "notpatronymic"
msgstr "ikkepatronym"
-#: ../src/gen/display/name.py:580 ../src/gen/display/name.py:673
+#: ../gramps/gen/display/name.py:609 ../gramps/gen/display/name.py:702
msgid "Remaining names|rest"
msgstr "rest"
-#: ../src/gen/display/name.py:583 ../src/gen/display/name.py:675
-#: ../src/gui/editors/editperson.py:384 ../src/plugins/import/ImportCsv.py:179
+#: ../gramps/gen/display/name.py:612 ../gramps/gen/display/name.py:704
+#: ../gramps/gui/editors/editperson.py:389
+#: ../gramps/plugins/importer/importcsv.py:189
msgid "prefix"
msgstr "forstavelse"
-#: ../src/gen/display/name.py:586 ../src/gen/display/name.py:677
+#: ../gramps/gen/display/name.py:615 ../gramps/gen/display/name.py:706
msgid "rawsurnames"
msgstr "råefternavne"
-#: ../src/gen/display/name.py:588 ../src/gen/display/name.py:679
+#: ../gramps/gen/display/name.py:617 ../gramps/gen/display/name.py:708
msgid "nickname"
msgstr "tilnavn"
-#: ../src/gen/display/name.py:590 ../src/gen/display/name.py:681
+#: ../gramps/gen/display/name.py:619 ../gramps/gen/display/name.py:710
msgid "familynick"
msgstr "familie-tilnavn"
-#: ../src/gen/lib/attrtype.py:64 ../src/gen/lib/childreftype.py:80
-#: ../src/gen/lib/eventroletype.py:59 ../src/gen/lib/eventtype.py:144
-#: ../src/gen/lib/familyreltype.py:53 ../src/gen/lib/markertype.py:58
-#: ../src/gen/lib/nametype.py:54 ../src/gen/lib/nameorigintype.py:81
-#: ../src/gen/lib/notetype.py:79 ../src/gen/lib/repotype.py:60
-#: ../src/gen/lib/srcmediatype.py:63 ../src/gen/lib/urltype.py:55
-#: ../src/plugins/textreport/IndivComplete.py:78
+#: ../gramps/gen/display/name.py:1059
+#, python-format
+msgid "Wrong name format string %s"
+msgstr ""
+
+#: ../gramps/gen/display/name.py:1063
+#, fuzzy
+msgid "ERROR, Edit Name format in Preferences"
+msgstr "Leder efter ugyldige henvisninger til navneformater"
+
+#: ../gramps/gen/filters/_filterparser.py:115
+#, python-format
+msgid ""
+"WARNING: Too many arguments in filter '%s'!\n"
+"Trying to load with subset of arguments."
+msgstr ""
+"ADVARSEL: For mange argumenter i filteret \"%s\"!\n"
+"Prøver at indlæse med en del af argumenterne."
+
+#: ../gramps/gen/filters/_filterparser.py:123
+#, python-format
+msgid ""
+"WARNING: Too few arguments in filter '%s'!\n"
+" Trying to load anyway in the hope this will be upgraded."
+msgstr ""
+"ADVARSEL: For få argumenter i filteret \"%s\"!\n"
+" Prøver at indlæse alligevel i håbet om at dette vil blive opgraderet."
+
+#: ../gramps/gen/filters/_filterparser.py:131
+#, python-format
+msgid "ERROR: filter %s could not be correctly loaded. Edit the filter!"
+msgstr "FEJL: Filteret %s kunne ikke indlæses korrekt. Redigér filteret!"
+
+#: ../gramps/gen/filters/rules/_changedsincebase.py:56
+#: ../gramps/gen/filters/rules/_everything.py:47
+#: ../gramps/gen/filters/rules/_hasattributebase.py:53
+#: ../gramps/gen/filters/rules/_hasgallerybase.py:50
+#: ../gramps/gen/filters/rules/_hasgrampsid.py:50
+#: ../gramps/gen/filters/rules/_hasldsbase.py:53
+#: ../gramps/gen/filters/rules/_hasnotebase.py:51
+#: ../gramps/gen/filters/rules/_hasnoteregexbase.py:49
+#: ../gramps/gen/filters/rules/_hasnotesubstrbase.py:48
+#: ../gramps/gen/filters/rules/_hasreferencecountbase.py:47
+#: ../gramps/gen/filters/rules/_hastagbase.py:53
+#: ../gramps/gen/filters/rules/_hastextmatchingsubstringof.py:50
+#: ../gramps/gen/filters/rules/_isprivate.py:44
+#: ../gramps/gen/filters/rules/_ispublic.py:41
+#: ../gramps/gen/filters/rules/_matcheseventfilterbase.py:56
+#: ../gramps/gen/filters/rules/_matchesfilterbase.py:59
+#: ../gramps/gen/filters/rules/_regexpidbase.py:53
+#: ../gramps/gen/filters/rules/citation/_hascitation.py:54
+#: ../gramps/gen/filters/rules/citation/_matchespagesubstringof.py:48
+#: ../gramps/gen/filters/rules/citation/_matchesrepositoryfilter.py:52
+#: ../gramps/gen/filters/rules/citation/_matchessourcefilter.py:54
+#: ../gramps/gen/filters/rules/event/_hasdata.py:52
+#: ../gramps/gen/filters/rules/event/_hastype.py:50
+#: ../gramps/gen/filters/rules/event/_matchespersonfilter.py:56
+#: ../gramps/gen/filters/rules/family/_hasreltype.py:51
+#: ../gramps/gen/filters/rules/family/_isbookmarked.py:47
+#: ../gramps/gen/filters/rules/media/_hasmedia.py:55
+#: ../gramps/gen/filters/rules/note/_hasnote.py:53
+#: ../gramps/gen/filters/rules/note/_matchesregexpof.py:49
+#: ../gramps/gen/filters/rules/note/_matchessubstringof.py:49
+#: ../gramps/gen/filters/rules/person/_disconnected.py:47
+#: ../gramps/gen/filters/rules/person/_everyone.py:47
+#: ../gramps/gen/filters/rules/person/_hasaddress.py:53
+#: ../gramps/gen/filters/rules/person/_hasalternatename.py:49
+#: ../gramps/gen/filters/rules/person/_hasassociation.py:53
+#: ../gramps/gen/filters/rules/person/_hasfamilyattribute.py:50
+#: ../gramps/gen/filters/rules/person/_hasnameof.py:63
+#: ../gramps/gen/filters/rules/person/_hasnameorigintype.py:51
+#: ../gramps/gen/filters/rules/person/_hasnametype.py:51
+#: ../gramps/gen/filters/rules/person/_hasnickname.py:49
+#: ../gramps/gen/filters/rules/person/_hastextmatchingsubstringof.py:54
+#: ../gramps/gen/filters/rules/person/_hasunknowngender.py:48
+#: ../gramps/gen/filters/rules/person/_incompletenames.py:48
+#: ../gramps/gen/filters/rules/person/_isbookmarked.py:48
+#: ../gramps/gen/filters/rules/person/_isdefaultperson.py:47
+#: ../gramps/gen/filters/rules/person/_isfemale.py:48
+#: ../gramps/gen/filters/rules/person/_ismale.py:48
+#: ../gramps/gen/filters/rules/person/_matcheseventfilter.py:57
+#: ../gramps/gen/filters/rules/person/_matchidof.py:49
+#: ../gramps/gen/filters/rules/person/_nobirthdate.py:46
+#: ../gramps/gen/filters/rules/person/_nodeathdate.py:46
+#: ../gramps/gen/filters/rules/person/_peopleprivate.py:46
+#: ../gramps/gen/filters/rules/person/_peoplepublic.py:47
+#: ../gramps/gen/filters/rules/person/_probablyalive.py:50
+#: ../gramps/gen/filters/rules/person/_regexpname.py:51
+#: ../gramps/gen/filters/rules/person/_searchname.py:50
+#: ../gramps/gen/filters/rules/place/_hasplace.py:61
+#: ../gramps/gen/filters/rules/place/_matcheseventfilter.py:55
+#: ../gramps/gen/filters/rules/repository/_hasrepo.py:55
+#: ../gramps/gen/filters/rules/repository/_matchesnamesubstringof.py:47
+#: ../gramps/gen/filters/rules/source/_hasrepository.py:51
+#: ../gramps/gen/filters/rules/source/_hasrepositorycallnumberref.py:49
+#: ../gramps/gen/filters/rules/source/_matchesrepositoryfilter.py:49
+#: ../gramps/gen/filters/rules/source/_matchestitlesubstringof.py:48
+#: ../gramps/plugins/quickview/samesurnames.py:42
+#: ../gramps/plugins/quickview/samesurnames.py:54
+#: ../gramps/plugins/quickview/samesurnames.py:67
+#: ../gramps/plugins/quickview/samesurnames.py:84
+msgid "General filters"
+msgstr "Generelle filtre"
+
+#: ../gramps/gen/filters/rules/_changedsincebase.py:82
+msgid "Wrong format of date-time"
+msgstr "Forkert format for dato-tidspunkt"
+
+#: ../gramps/gen/filters/rules/_changedsincebase.py:83
+#, python-format
+msgid "Only date-times in the iso format of yyyy-mm-dd hh:mm:ss, where the time part is optional, are accepted. %s does not satisfy."
+msgstr "Kun dato-tidspunkter i ISO-formatet yyyy-mm-dd hh hh:mm:ss, hvor tidspunktet kan udelades, accepteres. %s passer ikke."
+
+#: ../gramps/gen/filters/rules/_hascitationbase.py:51
+#: ../gramps/gen/filters/rules/citation/_hascitation.py:50
+#: ../gramps/gen/filters/rules/event/_hascitation.py:50
+#: ../gramps/gen/filters/rules/family/_hascitation.py:50
+#: ../gramps/gen/filters/rules/media/_hascitation.py:49
+#: ../gramps/gen/filters/rules/person/_hascitation.py:49
+#: ../gramps/gen/filters/rules/place/_hascitation.py:50
+#: ../gramps/gui/glade/mergecitation.glade:226
+#: ../gramps/gui/glade/mergecitation.glade:245
+msgid "Volume/Page:"
+msgstr "Bind/Side:"
+
+#: ../gramps/gen/filters/rules/_hascitationbase.py:52
+#: ../gramps/gen/filters/rules/citation/_hascitation.py:51
+#: ../gramps/gen/filters/rules/event/_hascitation.py:51
+#: ../gramps/gen/filters/rules/event/_hasdata.py:48
+#: ../gramps/gen/filters/rules/family/_hascitation.py:51
+#: ../gramps/gen/filters/rules/family/_hasevent.py:50
+#: ../gramps/gen/filters/rules/media/_hascitation.py:50
+#: ../gramps/gen/filters/rules/media/_hasmedia.py:51
+#: ../gramps/gen/filters/rules/person/_hasbirth.py:49
+#: ../gramps/gen/filters/rules/person/_hascitation.py:50
+#: ../gramps/gen/filters/rules/person/_hasdeath.py:49
+#: ../gramps/gen/filters/rules/person/_hasevent.py:51
+#: ../gramps/gen/filters/rules/person/_hasfamilyevent.py:50
+#: ../gramps/gen/filters/rules/place/_hascitation.py:51
+#: ../gramps/gui/glade/mergecitation.glade:267
+#: ../gramps/gui/glade/mergecitation.glade:286
+#: ../gramps/gui/glade/mergeevent.glade:255
+#: ../gramps/gui/glade/mergeevent.glade:274
+#: ../gramps/gui/glade/mergemedia.glade:296
+#: ../gramps/gui/glade/mergemedia.glade:315
+msgid "Date:"
+msgstr "Dato:"
+
+#: ../gramps/gen/filters/rules/_hascitationbase.py:53
+#: ../gramps/gui/glade/mergecitation.glade:308
+#: ../gramps/gui/glade/mergecitation.glade:327
+msgid "Confidence:"
+msgstr "Troværdighed:"
+
+#: ../gramps/gen/filters/rules/_hascitationbase.py:54
+#: ../gramps/gen/filters/rules/citation/_hascitation.py:53
+msgid "Citations matching parameters"
+msgstr "Citeringer der passer med parametre"
+
+#: ../gramps/gen/filters/rules/_hascitationbase.py:55
+#: ../gramps/gen/filters/rules/citation/_hascitation.py:55
+msgid "Matches citations with particular parameters"
+msgstr "Matcher citeringer med bestemte parametre"
+
+#: ../gramps/gen/filters/rules/_hascitationbase.py:56
+#: ../gramps/gen/filters/rules/_hassourcebase.py:54
+#: ../gramps/gen/filters/rules/_hassourcecountbase.py:51
+#: ../gramps/gen/filters/rules/_hassourceofbase.py:49
+#: ../gramps/gen/filters/rules/_matchessourceconfidencebase.py:52
+#: ../gramps/gen/filters/rules/_matchessourcefilterbase.py:53
+#: ../gramps/gen/filters/rules/event/_matchessourcefilter.py:54
+#: ../gramps/gen/filters/rules/family/_hassourceof.py:49
+#: ../gramps/gen/filters/rules/media/_hassourceof.py:49
+#: ../gramps/gen/filters/rules/person/_hassourceof.py:49
+#: ../gramps/gen/filters/rules/place/_hassourceof.py:49
+msgid "Citation/source filters"
+msgstr "Citerings/kilde-filtre"
+
+#: ../gramps/gen/filters/rules/_haseventbase.py:57
+#: ../gramps/gen/filters/rules/person/_familywithincompleteevent.py:47
+#: ../gramps/gen/filters/rules/person/_hasbirth.py:52
+#: ../gramps/gen/filters/rules/person/_hasdeath.py:52
+#: ../gramps/gen/filters/rules/person/_hasfamilyevent.py:55
+#: ../gramps/gen/filters/rules/person/_iswitness.py:49
+#: ../gramps/gen/filters/rules/person/_personwithincompleteevent.py:46
+msgid "Event filters"
+msgstr "Hændelsesfiltre"
+
+#: ../gramps/gen/filters/rules/_hasgallerybase.py:47
+#: ../gramps/gen/filters/rules/_hasldsbase.py:50
+#: ../gramps/gen/filters/rules/_hasnotebase.py:48
+#: ../gramps/gen/filters/rules/_hassourcecountbase.py:47
+#: ../gramps/gen/filters/rules/person/_hasaddress.py:50
+#: ../gramps/gen/filters/rules/person/_hasassociation.py:50
+#: ../gramps/gen/filters/rules/source/_hasrepository.py:48
+#: ../gramps/gui/editors/filtereditor.py:512
+msgid "Number of instances:"
+msgstr "Antal tilfælde:"
+
+#: ../gramps/gen/filters/rules/_hasgallerybase.py:47
+#: ../gramps/gen/filters/rules/_hasldsbase.py:50
+#: ../gramps/gen/filters/rules/_hasnotebase.py:48
+#: ../gramps/gen/filters/rules/_hassourcecountbase.py:47
+#: ../gramps/gen/filters/rules/person/_hasaddress.py:50
+#: ../gramps/gen/filters/rules/person/_hasassociation.py:50
+#: ../gramps/gen/filters/rules/source/_hasrepository.py:48
+#: ../gramps/gui/editors/filtereditor.py:517
+msgid "Number must be:"
+msgstr "Tallet skal være:"
+
+#: ../gramps/gen/filters/rules/_hasgrampsid.py:47
+#: ../gramps/gen/filters/rules/person/_deeprelationshippathbetween.py:124
+#: ../gramps/gen/filters/rules/person/_hascommonancestorwith.py:47
+#: ../gramps/gen/filters/rules/person/_isancestorof.py:46
+#: ../gramps/gen/filters/rules/person/_isdescendantfamilyof.py:51
+#: ../gramps/gen/filters/rules/person/_isdescendantof.py:47
+#: ../gramps/gen/filters/rules/person/_isduplicatedancestorof.py:48
+#: ../gramps/gen/filters/rules/person/_islessthannthgenerationancestorof.py:47
+#: ../gramps/gen/filters/rules/person/_islessthannthgenerationdescendantof.py:47
+#: ../gramps/gen/filters/rules/person/_ismorethannthgenerationancestorof.py:47
+#: ../gramps/gen/filters/rules/person/_ismorethannthgenerationdescendantof.py:47
+#: ../gramps/gen/filters/rules/person/_isrelatedwith.py:46
+#: ../gramps/gen/filters/rules/person/_matchidof.py:46
+#: ../gramps/gen/filters/rules/person/_relationshippathbetween.py:47
+#: ../gramps/gui/editors/filtereditor.py:521
+msgid "ID:"
+msgstr "Id:"
+
+#: ../gramps/gen/filters/rules/_hasnoteregexbase.py:45
+#: ../gramps/gen/filters/rules/_regexpidbase.py:49
+#: ../gramps/gen/filters/rules/note/_matchesregexpof.py:45
+msgid "Regular expression:"
+msgstr "Regulært udtryk:"
+
+#: ../gramps/gen/filters/rules/_hasnotesubstrbase.py:44
+#: ../gramps/gen/filters/rules/citation/_matchespagesubstringof.py:44
+#: ../gramps/gen/filters/rules/note/_matchessubstringof.py:45
+#: ../gramps/gen/filters/rules/person/_hastextmatchingsubstringof.py:48
+#: ../gramps/gen/filters/rules/person/_searchname.py:47
+#: ../gramps/gen/filters/rules/repository/_matchesnamesubstringof.py:44
+#: ../gramps/gen/filters/rules/source/_hasrepositorycallnumberref.py:45
+#: ../gramps/gen/filters/rules/source/_matchestitlesubstringof.py:44
+#: ../gramps/plugins/quickview/samesurnames.py:51
+#: ../gramps/plugins/quickview/samesurnames.py:64
+msgid "Substring:"
+msgstr "Delstreng:"
+
+#: ../gramps/gen/filters/rules/_hasreferencecountbase.py:44
+#: ../gramps/gui/editors/filtereditor.py:515
+msgid "Reference count must be:"
+msgstr "Antal af henvisninger skal være:"
+
+#: ../gramps/gen/filters/rules/_hasreferencecountbase.py:44
+#: ../gramps/gui/editors/filtereditor.py:511
+msgid "Reference count:"
+msgstr "Antal henvisninger:"
+
+#: ../gramps/gen/filters/rules/_hassourceofbase.py:47
+#: ../gramps/gen/filters/rules/family/_hassourceof.py:47
+#: ../gramps/gen/filters/rules/media/_hassourceof.py:47
+#: ../gramps/gen/filters/rules/person/_hassourceof.py:47
+#: ../gramps/gen/filters/rules/place/_hassourceof.py:47
+#: ../gramps/gui/editors/filtereditor.py:524
+msgid "Source ID:"
+msgstr "Kilde-id:"
+
+#: ../gramps/gen/filters/rules/_matchesfilterbase.py:56
+#: ../gramps/gen/filters/rules/person/_deeprelationshippathbetween.py:124
+#: ../gramps/gen/filters/rules/person/_hascommonancestorwithfiltermatch.py:49
+#: ../gramps/gen/filters/rules/person/_isancestoroffiltermatch.py:48
+#: ../gramps/gen/filters/rules/person/_ischildoffiltermatch.py:48
+#: ../gramps/gen/filters/rules/person/_isdescendantfamilyoffiltermatch.py:48
+#: ../gramps/gen/filters/rules/person/_isdescendantoffiltermatch.py:48
+#: ../gramps/gen/filters/rules/person/_isparentoffiltermatch.py:48
+#: ../gramps/gen/filters/rules/person/_issiblingoffiltermatch.py:47
+#: ../gramps/gen/filters/rules/person/_isspouseoffiltermatch.py:48
+#: ../gramps/gui/editors/filtereditor.py:526
+msgid "Filter name:"
+msgstr "Filternavn:"
+
+#: ../gramps/gen/filters/rules/_matchesfilterbase.py:69
+#: ../gramps/gen/filters/rules/_matchesfilterbase.py:72
+#, python-format
+msgid "Can't find filter %s in the defined custom filters"
+msgstr ""
+
+#: ../gramps/gen/filters/rules/_matchessourcefilterbase.py:49
+#: ../gramps/gen/filters/rules/citation/_matchessourcefilter.py:50
+#: ../gramps/gen/filters/rules/event/_matchessourcefilter.py:50
+#: ../gramps/gui/editors/filtereditor.py:534
+msgid "Source filter name:"
+msgstr "Kildefilters navn:"
+
+#: ../gramps/gen/filters/rules/_rule.py:57
+msgid "Miscellaneous filters"
+msgstr "Forskellige filtre"
+
+#: ../gramps/gen/filters/rules/_rule.py:58
+#: ../gramps/plugins/view/geoclose.py:492
+#: ../gramps/plugins/view/geofamclose.py:641
+#: ../gramps/plugins/view/geofamily.py:434
+#: ../gramps/plugins/view/geomoves.py:581
+#: ../gramps/plugins/view/geoperson.py:457 ../gramps/gui/glade/rule.glade:928
+msgid "No description"
+msgstr "Ingen beskrivelse"
+
+#: ../gramps/gen/filters/rules/citation/_allcitations.py:47
+msgid "Every citation"
+msgstr "Enhver citering"
+
+#: ../gramps/gen/filters/rules/citation/_allcitations.py:48
+msgid "Matches every citation in the database"
+msgstr "Matcher enhver citering i databasen"
+
+#: ../gramps/gen/filters/rules/citation/_changedsince.py:47
+#: ../gramps/gen/filters/rules/event/_changedsince.py:47
+#: ../gramps/gen/filters/rules/family/_changedsince.py:47
+#: ../gramps/gen/filters/rules/media/_changedsince.py:46
+#: ../gramps/gen/filters/rules/note/_changedsince.py:47
+#: ../gramps/gen/filters/rules/person/_changedsince.py:47
+#: ../gramps/gen/filters/rules/place/_changedsince.py:47
+#: ../gramps/gen/filters/rules/repository/_changedsince.py:47
+#: ../gramps/gen/filters/rules/source/_changedsince.py:47
+msgid "Changed after:"
+msgstr "Ændret efter:"
+
+#: ../gramps/gen/filters/rules/citation/_changedsince.py:47
+#: ../gramps/gen/filters/rules/event/_changedsince.py:47
+#: ../gramps/gen/filters/rules/family/_changedsince.py:47
+#: ../gramps/gen/filters/rules/media/_changedsince.py:46
+#: ../gramps/gen/filters/rules/note/_changedsince.py:47
+#: ../gramps/gen/filters/rules/person/_changedsince.py:47
+#: ../gramps/gen/filters/rules/place/_changedsince.py:47
+#: ../gramps/gen/filters/rules/repository/_changedsince.py:47
+#: ../gramps/gen/filters/rules/source/_changedsince.py:47
+msgid "but before:"
+msgstr "men før:"
+
+#: ../gramps/gen/filters/rules/citation/_changedsince.py:48
+msgid "Citations changed after "
+msgstr "Citeringer der er ændret efter "
+
+#: ../gramps/gen/filters/rules/citation/_changedsince.py:49
+msgid "Matches citation records changed after a specified date-time (yyyy-mm-dd hh:mm:ss) or in the range, if a second date-time is given."
+msgstr "Matcher citeringer som er ændret efter et angivet dato/tidspunkt (yyyy-mm-dd hh:mm:ss), eller indenfor et tidsinterval hvis endnu en dato/tidspunkt er angivet."
+
+#: ../gramps/gen/filters/rules/citation/_citationprivate.py:45
+msgid "Citations marked private"
+msgstr "Citeringer der er markeret private"
+
+#: ../gramps/gen/filters/rules/citation/_citationprivate.py:46
+msgid "Matches citations that are indicated as private"
+msgstr "Matcher citeringer der er markeret private"
+
+#: ../gramps/gen/filters/rules/citation/_hascitation.py:52
+#: ../gramps/gen/filters/rules/event/_hascitation.py:52
+#: ../gramps/gen/filters/rules/event/_matchessourceconfidence.py:46
+#: ../gramps/gen/filters/rules/family/_hascitation.py:52
+#: ../gramps/gen/filters/rules/family/_matchessourceconfidence.py:45
+#: ../gramps/gen/filters/rules/media/_hascitation.py:51
+#: ../gramps/gen/filters/rules/media/_matchessourceconfidence.py:45
+#: ../gramps/gen/filters/rules/person/_hascitation.py:51
+#: ../gramps/gen/filters/rules/person/_matchessourceconfidence.py:45
+#: ../gramps/gen/filters/rules/place/_hascitation.py:52
+#: ../gramps/gen/filters/rules/place/_matchessourceconfidence.py:45
+#: ../gramps/gui/editors/filtereditor.py:553
+msgid "Confidence level:"
+msgstr "Troværdighedsniveau:"
+
+#: ../gramps/gen/filters/rules/citation/_hasgallery.py:47
+msgid "Citations with media"
+msgstr "Citeringer med medier"
+
+#: ../gramps/gen/filters/rules/citation/_hasgallery.py:48
+msgid "Matches citations with a certain number of items in the gallery"
+msgstr "Matcher citeringer med et bestemt antal elementer i galleriet"
+
+#: ../gramps/gen/filters/rules/citation/_hasidof.py:47
+msgid "Citation with "
+msgstr "Citering med "
+
+#: ../gramps/gen/filters/rules/citation/_hasidof.py:48
+msgid "Matches a citation with a specified Gramps ID"
+msgstr "Matcher en citering med et angivet Gramps-ID"
+
+#: ../gramps/gen/filters/rules/citation/_hasnote.py:48
+msgid "Citations having notes"
+msgstr "Citeringer med noter"
+
+#: ../gramps/gen/filters/rules/citation/_hasnote.py:49
+msgid "Matches citations having a certain number of notes"
+msgstr "Matcher citeringer med et bestemt antal noter"
+
+#: ../gramps/gen/filters/rules/citation/_hasnotematchingsubstringof.py:45
+msgid "Citations having notes containing "
+msgstr "Citeringer med noter der indeholder "
+
+#: ../gramps/gen/filters/rules/citation/_hasnotematchingsubstringof.py:46
+msgid "Matches citations whose notes contain text matching a substring"
+msgstr "Matcher citeringer hvis noter indeholder tekst der matcher en delstreng"
+
+#: ../gramps/gen/filters/rules/citation/_hasnoteregexp.py:44
+msgid "Citations having notes containing "
+msgstr "Citeringer med noter der indeholder "
+
+#: ../gramps/gen/filters/rules/citation/_hasnoteregexp.py:45
+msgid "Matches citations whose notes contain text matching a regular expression"
+msgstr "Matcher citeringer med noter der indeholder tekst der matcher et regulært udtryk"
+
+#: ../gramps/gen/filters/rules/citation/_hasreferencecountof.py:45
+msgid "Citations with a reference count of "
+msgstr "Citeringer med et antal henvisninger på "
+
+#: ../gramps/gen/filters/rules/citation/_hasreferencecountof.py:46
+msgid "Matches citations with a certain reference count"
+msgstr "Matcher citeringer med et bestemt antal henvisninger"
+
+#: ../gramps/gen/filters/rules/citation/_hassource.py:50
+#: ../gramps/gen/filters/rules/media/_hasmedia.py:48
+#: ../gramps/gui/glade/mergedata.glade:866
+#: ../gramps/gui/glade/mergedata.glade:887
+#: ../gramps/gui/glade/mergemedia.glade:214
+#: ../gramps/gui/glade/mergemedia.glade:233
+#: ../gramps/gui/glade/mergeplace.glade:214
+#: ../gramps/gui/glade/mergeplace.glade:233
+#: ../gramps/gui/glade/mergesource.glade:214
+#: ../gramps/gui/glade/mergesource.glade:233
+msgid "Title:"
+msgstr "Titel:"
+
+#: ../gramps/gen/filters/rules/citation/_hassource.py:51
+#: ../gramps/gui/glade/mergedata.glade:909
+#: ../gramps/gui/glade/mergedata.glade:930
+#: ../gramps/gui/glade/mergesource.glade:255
+#: ../gramps/gui/glade/mergesource.glade:274
+#: ../gramps/gui/glade/plugins.glade:185
+msgid "Author:"
+msgstr "Ophavsmand:"
+
+#: ../gramps/gen/filters/rules/citation/_hassource.py:52
+#: ../gramps/gui/glade/mergedata.glade:952
+#: ../gramps/gui/glade/mergedata.glade:973
+#: ../gramps/gui/glade/mergesource.glade:296
+#: ../gramps/gui/glade/mergesource.glade:315
+msgid "Abbreviation:"
+msgstr "Forkortelse:"
+
+#: ../gramps/gen/filters/rules/citation/_hassource.py:53
+#: ../gramps/gui/glade/mergedata.glade:995
+#: ../gramps/gui/glade/mergedata.glade:1016
+#: ../gramps/gui/glade/mergesource.glade:337
+#: ../gramps/gui/glade/mergesource.glade:356
+msgid "Publication:"
+msgstr "Udgivelse:"
+
+#: ../gramps/gen/filters/rules/citation/_hassource.py:54
+msgid "Sources matching parameters"
+msgstr "Kilder der passer med parametre"
+
+#: ../gramps/gen/filters/rules/citation/_hassource.py:55
+msgid "Matches citations with a source of a particular value"
+msgstr "Matcher citeringer med en bestemt kilder der har en bestemt værdi"
+
+#: ../gramps/gen/filters/rules/citation/_hassource.py:57
+msgid "Source filters"
+msgstr "Kildefiltre"
+
+#: ../gramps/gen/filters/rules/citation/_matchesfilter.py:47
+msgid "Citations matching the "
+msgstr "Citeringer der matcher "
+
+#: ../gramps/gen/filters/rules/citation/_matchesfilter.py:48
+msgid "Matches citations matched by the specified filter name"
+msgstr "Matcher citeringer som matcher det angivne filternavn"
+
+#: ../gramps/gen/filters/rules/citation/_matchespagesubstringof.py:45
+msgid "Citation Volume/Page containing "
+msgstr "Citering Bind/Side indeholder "
+
+#: ../gramps/gen/filters/rules/citation/_matchespagesubstringof.py:46
+msgid "Matches citations whose Volume/Page contains a certain substring"
+msgstr "Matcher citeringer med et Bind/Side der indeholder en bestemt delstreng"
+
+#: ../gramps/gen/filters/rules/citation/_matchesrepositoryfilter.py:47
+#: ../gramps/gen/filters/rules/source/_matchesrepositoryfilter.py:45
+#: ../gramps/gui/editors/filtereditor.py:536
+msgid "Repository filter name:"
+msgstr "Navn på arkivfilter:"
+
+#: ../gramps/gen/filters/rules/citation/_matchesrepositoryfilter.py:48
+msgid "Citations with a source with a repository reference matching the "
+msgstr "Citeringer med en kilde med en arkivhenvisning der matcher "
+
+#: ../gramps/gen/filters/rules/citation/_matchesrepositoryfilter.py:50
+msgid "Matches citations with sources with a repository reference that match a certain repository filter"
+msgstr "Matcher citeringer af kilder en arkivhenvisning der matcher et bestemt arkivfilter"
+
+#: ../gramps/gen/filters/rules/citation/_matchessourcefilter.py:51
+msgid "Citations with source matching the "
+msgstr "Citeringer med en kilde der matcher "
+
+#: ../gramps/gen/filters/rules/citation/_matchessourcefilter.py:52
+msgid "Matches citations with sources that match the specified source filter name"
+msgstr "Matcher citeringer af kilder som passer med det angivne navn på kildefilter"
+
+#: ../gramps/gen/filters/rules/citation/_regexpidof.py:50
+msgid "Citations with matching regular expression"
+msgstr "Citeringer med der matcher regulært udtryk"
+
+#: ../gramps/gen/filters/rules/citation/_regexpidof.py:51
+msgid "Matches citations whose Gramps ID matches the regular expression"
+msgstr "Matcher citeringer hvis Gramps-ID matcher det regulære udtryk"
+
+#: ../gramps/gen/filters/rules/event/_allevents.py:46
+msgid "Every event"
+msgstr "Alle hændelser"
+
+#: ../gramps/gen/filters/rules/event/_allevents.py:47
+msgid "Matches every event in the database"
+msgstr "Matcher alle hændelser i databasen"
+
+#: ../gramps/gen/filters/rules/event/_changedsince.py:48
+msgid "Events changed after "
+msgstr "Hændelser der er ændret efter "
+
+#: ../gramps/gen/filters/rules/event/_changedsince.py:49
+msgid "Matches event records changed after a specified date/time (yyyy-mm-dd hh:mm:ss) or in the range, if a second date/time is given."
+msgstr "Matcher hændelsesoptegnelser som er ændret efter et angivet dato/tidspunkt (åååå-mm-dd tt:mm:ss), eller indenfor et tidsinterval hvis endnu en dato/tidspunkt er angivet."
+
+#: ../gramps/gen/filters/rules/event/_eventprivate.py:44
+msgid "Events marked private"
+msgstr "Hændelser der er markeret private"
+
+#: ../gramps/gen/filters/rules/event/_eventprivate.py:45
+msgid "Matches events that are indicated as private"
+msgstr "Matcher hændelser der er markeret private"
+
+#: ../gramps/gen/filters/rules/event/_hasattribute.py:46
+#: ../gramps/gui/editors/filtereditor.py:103
+msgid "Event attribute:"
+msgstr "Hændelsesattribut:"
+
+#: ../gramps/gen/filters/rules/event/_hasattribute.py:46
+#: ../gramps/gen/filters/rules/family/_hasattribute.py:46
+#: ../gramps/gen/filters/rules/media/_hasattribute.py:46
+#: ../gramps/gen/filters/rules/person/_hasattribute.py:46
+#: ../gramps/gen/filters/rules/person/_hasfamilyattribute.py:46
+msgid "Value:"
+msgstr "Værdi:"
+
+#: ../gramps/gen/filters/rules/event/_hasattribute.py:47
+msgid "Events with the attribute "
+msgstr "Hændelser med attributten "
+
+#: ../gramps/gen/filters/rules/event/_hasattribute.py:48
+msgid "Matches events with the event attribute of a particular value"
+msgstr "Matcher hændelser med en hændelsesattribut af en bestemt værdi"
+
+#: ../gramps/gen/filters/rules/event/_hascitation.py:53
+msgid "Event with the "
+msgstr "Hændelse med "
+
+#: ../gramps/gen/filters/rules/event/_hascitation.py:54
+msgid "Matches events with a citation of a particular value"
+msgstr "Matcher hændelser med en citering der har bestemt værdi"
+
+#: ../gramps/gen/filters/rules/event/_hasdata.py:48
+#: ../gramps/gen/filters/rules/event/_hastype.py:47
+#: ../gramps/gen/filters/rules/person/_iswitness.py:46
+#: ../gramps/gui/editors/filtereditor.py:100
+msgid "Event type:"
+msgstr "Hændelsestype:"
+
+#: ../gramps/gen/filters/rules/event/_hasdata.py:48
+#: ../gramps/gen/filters/rules/family/_hasevent.py:51
+#: ../gramps/gen/filters/rules/person/_hasbirth.py:49
+#: ../gramps/gen/filters/rules/person/_hasdeath.py:49
+#: ../gramps/gen/filters/rules/person/_hasevent.py:52
+#: ../gramps/gen/filters/rules/person/_hasfamilyevent.py:51
+#: ../gramps/gui/editors/filtereditor.py:509
+#: ../gramps/gui/glade/mergeevent.glade:296
+#: ../gramps/gui/glade/mergeevent.glade:315
+msgid "Place:"
+msgstr "Sted:"
+
+#: ../gramps/gen/filters/rules/event/_hasdata.py:49
+#: ../gramps/gen/filters/rules/family/_hasevent.py:52
+#: ../gramps/gen/filters/rules/person/_hasbirth.py:49
+#: ../gramps/gen/filters/rules/person/_hasdeath.py:49
+#: ../gramps/gen/filters/rules/person/_hasevent.py:53
+#: ../gramps/gen/filters/rules/person/_hasfamilyevent.py:52
+#: ../gramps/gui/glade/mergeevent.glade:337
+#: ../gramps/gui/glade/mergeevent.glade:356
+msgid "Description:"
+msgstr "Beskrivelse:"
+
+#: ../gramps/gen/filters/rules/event/_hasdata.py:50
+msgid "Events with "
+msgstr "Hændelser med "
+
+#: ../gramps/gen/filters/rules/event/_hasdata.py:51
+msgid "Matches events with data of a particular value"
+msgstr "Matcher hændelser der indeholder data med en bestemt værdi"
+
+#: ../gramps/gen/filters/rules/event/_hasgallery.py:47
+msgid "Events with media"
+msgstr "Hændelser med medieobjekter"
+
+#: ../gramps/gen/filters/rules/event/_hasgallery.py:48
+msgid "Matches events with a certain number of items in the gallery"
+msgstr "Matcher hændelser med et bestemt antal elementer i galleriet"
+
+#: ../gramps/gen/filters/rules/event/_hasidof.py:46
+msgid "Event with "
+msgstr "Hændelse med "
+
+#: ../gramps/gen/filters/rules/event/_hasidof.py:47
+msgid "Matches an event with a specified Gramps ID"
+msgstr "Matcher en hændelse med en angivet Gramps-id"
+
+#: ../gramps/gen/filters/rules/event/_hasnote.py:47
+msgid "Events having notes"
+msgstr "Hændelser med noter"
+
+#: ../gramps/gen/filters/rules/event/_hasnote.py:48
+msgid "Matches events having a certain number of notes"
+msgstr "Matcher hændelser med et bestemt antal noter"
+
+#: ../gramps/gen/filters/rules/event/_hasnotematchingsubstringof.py:44
+msgid "Events having notes containing "
+msgstr "Hændelser med noter der matcher "
+
+#: ../gramps/gen/filters/rules/event/_hasnotematchingsubstringof.py:45
+msgid "Matches events whose notes contain text matching a substring"
+msgstr "Matcher hændelser med noter der indeholder en delstreng"
+
+#: ../gramps/gen/filters/rules/event/_hasnoteregexp.py:43
+msgid "Events having notes containing "
+msgstr "Hændelser med noter der indeholder "
+
+#: ../gramps/gen/filters/rules/event/_hasnoteregexp.py:44
+msgid "Matches events whose notes contain text matching a regular expression"
+msgstr "Matcher hændelser med noter der indeholder regulært udtryk"
+
+#: ../gramps/gen/filters/rules/event/_hasreferencecountof.py:44
+msgid "Events with a reference count of "
+msgstr "Hændelser med at antal henvisninger på "
+
+#: ../gramps/gen/filters/rules/event/_hasreferencecountof.py:45
+msgid "Matches events with a certain reference count"
+msgstr "Matcher hændelser med et bestemt antal henvisninger"
+
+#: ../gramps/gen/filters/rules/event/_hassourcecount.py:46
+msgid "Events with sources"
+msgstr "Hændelser med kilder"
+
+#: ../gramps/gen/filters/rules/event/_hassourcecount.py:47
+msgid "Matches events with a certain number of sources connected to it"
+msgstr "Matcher hændelser med et bestemt antal tilknyttede kilder"
+
+#: ../gramps/gen/filters/rules/event/_hastype.py:48
+msgid "Events with the particular type"
+msgstr "Hændelser af den bestemte type"
+
+#: ../gramps/gen/filters/rules/event/_hastype.py:49
+msgid "Matches events with the particular type "
+msgstr "Matcher hændelser af en bestemt type "
+
+#: ../gramps/gen/filters/rules/event/_matchesfilter.py:46
+msgid "Events matching the "
+msgstr "Hændelser der matcher "
+
+#: ../gramps/gen/filters/rules/event/_matchesfilter.py:47
+msgid "Matches events matched by the specified filter name"
+msgstr "Matcher hændelser som passer med det angivne filternavn"
+
+#: ../gramps/gen/filters/rules/event/_matchespersonfilter.py:52
+#: ../gramps/gui/editors/filtereditor.py:530
+msgid "Person filter name:"
+msgstr "Navn til personfilter:"
+
+#: ../gramps/gen/filters/rules/event/_matchespersonfilter.py:52
+#: ../gramps/gui/editors/filtereditor.py:546
+msgid "Include Family events:"
+msgstr "Medtag familiehændelser:"
+
+#: ../gramps/gen/filters/rules/event/_matchespersonfilter.py:53
+msgid "Events of persons matching the "
+msgstr "Hændelser for personer der matcher "
+
+#: ../gramps/gen/filters/rules/event/_matchespersonfilter.py:54
+msgid "Matches events of persons matched by the specified person filter name"
+msgstr "Matcher en persons hændelser som matcher et angivet personfilternavn"
+
+#: ../gramps/gen/filters/rules/event/_matchessourceconfidence.py:47
+msgid "Events with at least one direct source >= "
+msgstr "Hændelser med mindst en direkte kilde >= "
+
+#: ../gramps/gen/filters/rules/event/_matchessourceconfidence.py:48
+msgid "Matches events with at least one direct source with confidence level(s)"
+msgstr "Matcher hændelser der har mindst en direkte kilde med troværdighedsniveau(er)"
+
+#: ../gramps/gen/filters/rules/event/_matchessourcefilter.py:51
+msgid "Events with source matching the "
+msgstr "Hændelser med en kilde der matcher "
+
+#: ../gramps/gen/filters/rules/event/_matchessourcefilter.py:52
+msgid "Matches events with sources that match the specified source filter name"
+msgstr "Matcher hændelser der har kilder som passer med det angivne navn på kildefilter"
+
+#: ../gramps/gen/filters/rules/event/_regexpidof.py:49
+msgid "Events with matching regular expression"
+msgstr "Hændelser med der matcher regulært udtryk"
+
+#: ../gramps/gen/filters/rules/event/_regexpidof.py:50
+msgid "Matches events whose Gramps ID matches the regular expression"
+msgstr "Matcher hændelser hvis Gramps-id matcher det regulære udtryk"
+
+#: ../gramps/gen/filters/rules/family/_allfamilies.py:46
+msgid "Every family"
+msgstr "Alle familier"
+
+#: ../gramps/gen/filters/rules/family/_allfamilies.py:47
+msgid "Matches every family in the database"
+msgstr "Matcher alle familier i databasen"
+
+#: ../gramps/gen/filters/rules/family/_changedsince.py:48
+msgid "Families changed after "
+msgstr "Familier der er ændret efter "
+
+#: ../gramps/gen/filters/rules/family/_changedsince.py:49
+msgid "Matches family records changed after a specified date-time (yyyy-mm-dd hh:mm:ss) or in the range, if a second date-time is given."
+msgstr "Matcher familieoptegnelser som er ændret efter et angivet dato/tidspunkt (åååå-mm-dd tt:mm:ss), eller indenfor et tidsinterval hvis endnu en dato/tidspunkt er angivet."
+
+#: ../gramps/gen/filters/rules/family/_childhasidof.py:47
+#: ../gramps/gen/filters/rules/family/_fatherhasidof.py:47
+#: ../gramps/gen/filters/rules/family/_motherhasidof.py:47
+msgid "Person ID:"
+msgstr "Person-id:"
+
+#: ../gramps/gen/filters/rules/family/_childhasidof.py:48
+msgid "Families with child with the "
+msgstr "Familier med et barn der har "
+
+#: ../gramps/gen/filters/rules/family/_childhasidof.py:49
+msgid "Matches families where child has a specified Gramps ID"
+msgstr "Matcher familier hvor barn har en angivet Gramps-id"
+
+#: ../gramps/gen/filters/rules/family/_childhasidof.py:51
+#: ../gramps/gen/filters/rules/family/_childhasnameof.py:50
+#: ../gramps/gen/filters/rules/family/_hastwins.py:49
+#: ../gramps/gen/filters/rules/family/_regexpchildname.py:50
+#: ../gramps/gen/filters/rules/family/_searchchildname.py:50
+msgid "Child filters"
+msgstr "Barnefiltre"
+
+#: ../gramps/gen/filters/rules/family/_childhasnameof.py:47
+msgid "Families with child with the "
+msgstr "Familier med et barn der har "
+
+#: ../gramps/gen/filters/rules/family/_childhasnameof.py:48
+msgid "Matches families where child has a specified (partial) name"
+msgstr "Matcher familier hvor et barn har et (delvist) angivet navn"
+
+#: ../gramps/gen/filters/rules/family/_familyprivate.py:44
+msgid "Families marked private"
+msgstr "Familier der er markeret private"
+
+#: ../gramps/gen/filters/rules/family/_familyprivate.py:45
+msgid "Matches families that are indicated as private"
+msgstr "Matcher familier der er markeret private"
+
+#: ../gramps/gen/filters/rules/family/_fatherhasidof.py:48
+msgid "Families with father with the "
+msgstr "Familier med en fader der har "
+
+#: ../gramps/gen/filters/rules/family/_fatherhasidof.py:49
+msgid "Matches families whose father has a specified Gramps ID"
+msgstr "Matcher familier hvis fader har en angivet Gramps-id"
+
+#: ../gramps/gen/filters/rules/family/_fatherhasidof.py:51
+#: ../gramps/gen/filters/rules/family/_fatherhasnameof.py:50
+#: ../gramps/gen/filters/rules/family/_regexpfathername.py:50
+#: ../gramps/gen/filters/rules/family/_searchfathername.py:50
+msgid "Father filters"
+msgstr "Fader-filtre"
+
+#: ../gramps/gen/filters/rules/family/_fatherhasnameof.py:47
+msgid "Families with father with the "
+msgstr "Familier med en fader der har "
+
+#: ../gramps/gen/filters/rules/family/_fatherhasnameof.py:48
+#: ../gramps/gen/filters/rules/family/_searchfathername.py:48
+msgid "Matches families whose father has a specified (partial) name"
+msgstr "Matcher familier hvis fader har et (delvist) angivet navn"
+
+#: ../gramps/gen/filters/rules/family/_hasattribute.py:46
+#: ../gramps/gen/filters/rules/person/_hasfamilyattribute.py:46
+#: ../gramps/gui/editors/filtereditor.py:102
+msgid "Family attribute:"
+msgstr "Familieattribut:"
+
+#: ../gramps/gen/filters/rules/family/_hasattribute.py:47
+msgid "Families with the family "
+msgstr "Familier med familie-"
+
+#: ../gramps/gen/filters/rules/family/_hasattribute.py:48
+msgid "Matches families with the family attribute of a particular value"
+msgstr "Matcher familier med familieattributten sat til en bestemt værdi"
+
+#: ../gramps/gen/filters/rules/family/_hascitation.py:53
+msgid "Family with the "
+msgstr "Familier med "
+
+#: ../gramps/gen/filters/rules/family/_hascitation.py:54
+msgid "Matches families with a citation of a particular value"
+msgstr "Matcher familier med en citering af en bestemt værdi"
+
+#: ../gramps/gen/filters/rules/family/_hasevent.py:49
+#: ../gramps/gen/filters/rules/person/_hasfamilyevent.py:49
+#: ../gramps/gui/editors/filtereditor.py:99
+msgid "Family event:"
+msgstr "Familiehændelse:"
+
+#: ../gramps/gen/filters/rules/family/_hasevent.py:53
+#: ../gramps/gen/filters/rules/person/_hasevent.py:54
+#: ../gramps/gui/selectors/selectevent.py:65
+#: ../gramps/plugins/view/eventview.py:90
+msgid "Main Participants"
+msgstr "Primære deltagere"
+
+#: ../gramps/gen/filters/rules/family/_hasevent.py:54
+msgid "Families with the "
+msgstr "Familier med "
+
+#: ../gramps/gen/filters/rules/family/_hasevent.py:55
+msgid "Matches families with an event of a particular value"
+msgstr "Matcher familier med en bestemt hændelse"
+
+#: ../gramps/gen/filters/rules/family/_hasgallery.py:47
+msgid "Families with media"
+msgstr "Familier med medieobjekter"
+
+#: ../gramps/gen/filters/rules/family/_hasgallery.py:48
+msgid "Matches families with a certain number of items in the gallery"
+msgstr "Matcher familier med et bestemt antal elementer i galleriet"
+
+#: ../gramps/gen/filters/rules/family/_hasidof.py:46
+msgid "Family with "
+msgstr "Familier med "
+
+#: ../gramps/gen/filters/rules/family/_hasidof.py:47
+msgid "Matches a family with a specified Gramps ID"
+msgstr "Matcher en familie med en angivet Gramps-id"
+
+#: ../gramps/gen/filters/rules/family/_haslds.py:50
+msgid "Families with LDS events"
+msgstr "Familier med SDH-hændelser"
+
+#: ../gramps/gen/filters/rules/family/_haslds.py:51
+msgid "Matches families with a certain number of LDS events"
+msgstr "Matcher familier med et bestemt antal SDH-hændelser"
+
+#: ../gramps/gen/filters/rules/family/_hasnote.py:47
+msgid "Families having notes"
+msgstr "Familier med noter"
+
+#: ../gramps/gen/filters/rules/family/_hasnote.py:48
+msgid "Matches families having a certain number notes"
+msgstr "Matcher familier med et bestemt antal noter"
+
+#: ../gramps/gen/filters/rules/family/_hasnotematchingsubstringof.py:44
+msgid "Families having notes containing "
+msgstr "Familier med noter der indeholder "
+
+#: ../gramps/gen/filters/rules/family/_hasnotematchingsubstringof.py:45
+msgid "Matches families whose notes contain text matching a substring"
+msgstr "Matcher familier hvis noter indeholder tekst der matcher en delstreng"
+
+#: ../gramps/gen/filters/rules/family/_hasnoteregexp.py:43
+msgid "Families having notes containing "
+msgstr "Familier med noter der indeholder "
+
+#: ../gramps/gen/filters/rules/family/_hasnoteregexp.py:44
+msgid "Matches families whose notes contain text matching a regular expression"
+msgstr "Matcher familier med noter der indeholder regulært udtryk"
+
+#: ../gramps/gen/filters/rules/family/_hasreferencecountof.py:44
+msgid "Families with a reference count of "
+msgstr "Familier med et antal henvisninger på "
+
+#: ../gramps/gen/filters/rules/family/_hasreferencecountof.py:45
+msgid "Matches family objects with a certain reference count"
+msgstr "Matcher familieobjekter med et bestemt antal henvisninger"
+
+#: ../gramps/gen/filters/rules/family/_hasreltype.py:47
+#: ../gramps/gen/filters/rules/person/_hasrelationship.py:48
+#: ../gramps/gui/editors/filtereditor.py:105
+msgid "Relationship type:"
+msgstr "Slægtskabstype:"
+
+#: ../gramps/gen/filters/rules/family/_hasreltype.py:48
+msgid "Families with the relationship type"
+msgstr "Familier der har slægtskabstype"
+
+#: ../gramps/gen/filters/rules/family/_hasreltype.py:49
+msgid "Matches families with the relationship type of a particular value"
+msgstr "Matcher familier med en slægtskabstype af en bestemt værdi"
+
+#: ../gramps/gen/filters/rules/family/_hassourcecount.py:47
+msgid "Families with sources"
+msgstr "Familier med kilder"
+
+#: ../gramps/gen/filters/rules/family/_hassourcecount.py:48
+msgid "Matches families with a certain number of sources connected to it"
+msgstr "Matcher familier med et bestemt antal tilknyttede kilder"
+
+#: ../gramps/gen/filters/rules/family/_hassourceof.py:48
+msgid "Families with the "
+msgstr "Familier med "
+
+#: ../gramps/gen/filters/rules/family/_hassourceof.py:50
+msgid "Matches families who have a particular source"
+msgstr "Matcher familier med en bestemt kilde"
+
+#: ../gramps/gen/filters/rules/family/_hastag.py:49
+#: ../gramps/gen/filters/rules/media/_hastag.py:49
+#: ../gramps/gen/filters/rules/note/_hastag.py:49
+#: ../gramps/gen/filters/rules/person/_hastag.py:49
+#: ../gramps/gui/editors/filtereditor.py:549
+msgid "Tag:"
+msgstr "Mærkat:"
+
+#: ../gramps/gen/filters/rules/family/_hastag.py:50
+msgid "Families with the "
+msgstr "Familier med "
+
+#: ../gramps/gen/filters/rules/family/_hastag.py:51
+msgid "Matches families with the particular tag"
+msgstr "Matcher familier med en bestemt type mærkat"
+
+#: ../gramps/gen/filters/rules/family/_hastwins.py:47
+#, fuzzy
+msgid "Families with twins"
+msgstr "Familier med "
+
+#: ../gramps/gen/filters/rules/family/_hastwins.py:48
+#, fuzzy
+msgid "Matches families with twins"
+msgstr "Matcher familier med en bestemt type mærkat"
+
+#: ../gramps/gen/filters/rules/family/_isbookmarked.py:46
+msgid "Bookmarked families"
+msgstr "Familier med et bogmærke"
+
+#: ../gramps/gen/filters/rules/family/_isbookmarked.py:48
+msgid "Matches the families on the bookmark list"
+msgstr "Matcher familier på bogmærkelisten"
+
+#: ../gramps/gen/filters/rules/family/_matchesfilter.py:46
+msgid "Families matching the "
+msgstr "Familier der matcher "
+
+#: ../gramps/gen/filters/rules/family/_matchesfilter.py:47
+msgid "Matches families matched by the specified filter name"
+msgstr "Matcher familier som passer med det angivne filternavn"
+
+#: ../gramps/gen/filters/rules/family/_matchessourceconfidence.py:46
+msgid "Families with at least one direct source >= "
+msgstr "Familier med mindst en direkte kilde >= "
+
+#: ../gramps/gen/filters/rules/family/_matchessourceconfidence.py:47
+msgid "Matches families with at least one direct source with confidence level(s)"
+msgstr "Matcher familier der har mindst en direkte kilde med troværdighedsniveau(er)"
+
+#: ../gramps/gen/filters/rules/family/_motherhasidof.py:48
+msgid "Families with mother with the "
+msgstr "Familier med en moder der har "
+
+#: ../gramps/gen/filters/rules/family/_motherhasidof.py:49
+msgid "Matches families whose mother has a specified Gramps ID"
+msgstr "Matcher familier hvis moder har en angivet Gramps-id"
+
+#: ../gramps/gen/filters/rules/family/_motherhasidof.py:51
+#: ../gramps/gen/filters/rules/family/_motherhasnameof.py:50
+#: ../gramps/gen/filters/rules/family/_regexpmothername.py:50
+#: ../gramps/gen/filters/rules/family/_searchmothername.py:50
+msgid "Mother filters"
+msgstr "Moder-filtre"
+
+#: ../gramps/gen/filters/rules/family/_motherhasnameof.py:47
+msgid "Families with mother with the "
+msgstr "Familier med en moder der hedder "
+
+#: ../gramps/gen/filters/rules/family/_motherhasnameof.py:48
+#: ../gramps/gen/filters/rules/family/_searchmothername.py:48
+msgid "Matches families whose mother has a specified (partial) name"
+msgstr "Matcher familier hvis moder har et (delvist) angivet navn"
+
+#: ../gramps/gen/filters/rules/family/_regexpchildname.py:47
+msgid "Families with child matching the "
+msgstr "Familier med et barn der matcher "
+
+#: ../gramps/gen/filters/rules/family/_regexpchildname.py:48
+msgid "Matches families where some child has a name that matches a specified regular expression"
+msgstr "Matcher familier hvor barnet har et navn der matcher et angivet regulært udtryk"
+
+#: ../gramps/gen/filters/rules/family/_regexpfathername.py:47
+msgid "Families with father matching the "
+msgstr "Familier med en fader der matcher "
+
+#: ../gramps/gen/filters/rules/family/_regexpfathername.py:48
+msgid "Matches families whose father has a name matching a specified regular expression"
+msgstr "Matcher familier hvor faderen har et navn der matcher et angivet regulært udtryk"
+
+#: ../gramps/gen/filters/rules/family/_regexpidof.py:49
+msgid "Families with matching regular expression"
+msgstr "Familier med der indeholder "
+
+#: ../gramps/gen/filters/rules/family/_regexpidof.py:50
+msgid "Matches families whose Gramps ID matches the regular expression"
+msgstr "Matcher familier med en Gramps-id der indeholder det regulære udtryk"
+
+#: ../gramps/gen/filters/rules/family/_regexpmothername.py:47
+msgid "Families with mother matching the "
+msgstr "Familier med en moder der matcher "
+
+#: ../gramps/gen/filters/rules/family/_regexpmothername.py:48
+msgid "Matches families whose mother has a name matching a specified regular expression"
+msgstr "Matcher familier hvor moderen har et navn der matcher et angivet regulært udtryk"
+
+#: ../gramps/gen/filters/rules/family/_searchchildname.py:47
+msgid "Families with any child matching the "
+msgstr "Familier hvor alle børn matcher "
+
+#: ../gramps/gen/filters/rules/family/_searchchildname.py:48
+msgid "Matches families where any child has a specified (partial) name"
+msgstr "Matcher familier hvor alle børn har et (delvist) angivet navn"
+
+#: ../gramps/gen/filters/rules/family/_searchfathername.py:47
+msgid "Families with father matching the "
+msgstr "Familier med en fader der matcher "
+
+#: ../gramps/gen/filters/rules/family/_searchmothername.py:47
+msgid "Families with mother matching the "
+msgstr "Familier med en moder der matcher "
+
+#: ../gramps/gen/filters/rules/media/_allmedia.py:46
+msgid "Every media object"
+msgstr "Alle medieobjekter"
+
+#: ../gramps/gen/filters/rules/media/_allmedia.py:47
+msgid "Matches every media object in the database"
+msgstr "Matcher alle medieobjekter i databasen"
+
+#: ../gramps/gen/filters/rules/media/_changedsince.py:47
+msgid "Media objects changed after "
+msgstr "Medieobjekter der er ændret efter "
+
+#: ../gramps/gen/filters/rules/media/_changedsince.py:48
+msgid "Matches media objects changed after a specified date:time (yyyy-mm-dd hh:mm:ss) or in the range, if a second date:time is given."
+msgstr "Matcher medieobjektoptegnelser som er ændret efter en angivet dato/tidspunkt(åååå-mm-dd tt:mm:ss), eller indenfor et tidsinterval hvis endnu en dato/tidspunkt er angivet."
+
+#: ../gramps/gen/filters/rules/media/_hasattribute.py:46
+#: ../gramps/gui/editors/filtereditor.py:104
+msgid "Media attribute:"
+msgstr "Medie-attribut:"
+
+#: ../gramps/gen/filters/rules/media/_hasattribute.py:47
+msgid "Media objects with the attribute "
+msgstr "Medieobjekter med "
+
+#: ../gramps/gen/filters/rules/media/_hasattribute.py:48
+msgid "Matches media objects with the attribute of a particular value"
+msgstr "Matcher medieobjekter som har en attribut af en bestemt værdi"
+
+#: ../gramps/gen/filters/rules/media/_hascitation.py:52
+msgid "Media with the "
+msgstr "Medie med "
+
+#: ../gramps/gen/filters/rules/media/_hascitation.py:53
+msgid "Matches media with a citation of a particular value"
+msgstr "Matcher medier med en citering der har en bestemt værdi"
+
+#: ../gramps/gen/filters/rules/media/_hasidof.py:46
+msgid "Media object with "
+msgstr "Medieobjekt med "
+
+#: ../gramps/gen/filters/rules/media/_hasidof.py:47
+msgid "Matches a media object with a specified Gramps ID"
+msgstr "Matcher medieobjekter med en angivet Gramps-id"
+
+#: ../gramps/gen/filters/rules/media/_hasmedia.py:49
+#: ../gramps/gen/filters/rules/repository/_hasrepo.py:49
+#: ../gramps/gui/glade/editmediaref.glade:632
+#: ../gramps/gui/glade/mergeevent.glade:214
+#: ../gramps/gui/glade/mergeevent.glade:233
+#: ../gramps/gui/glade/mergenote.glade:255
+#: ../gramps/gui/glade/mergenote.glade:274
+#: ../gramps/gui/glade/mergerepository.glade:255
+#: ../gramps/gui/glade/mergerepository.glade:274
+msgid "Type:"
+msgstr "Type:"
+
+#: ../gramps/gen/filters/rules/media/_hasmedia.py:50
+#: ../gramps/gui/viewmanager.py:1498 ../gramps/gui/glade/mergemedia.glade:255
+#: ../gramps/gui/glade/mergemedia.glade:274
+msgid "Path:"
+msgstr "Søgesti:"
+
+#: ../gramps/gen/filters/rules/media/_hasmedia.py:53
+msgid "Media objects matching parameters"
+msgstr "Medieobjekter der matcher parametre"
+
+#: ../gramps/gen/filters/rules/media/_hasmedia.py:54
+msgid "Matches media objects with particular parameters"
+msgstr "Matcher medieobjekter med bestemte parametre"
+
+#: ../gramps/gen/filters/rules/media/_hasnotematchingsubstringof.py:44
+msgid "Media objects having notes containing "
+msgstr "Medieobjekter med noter der matcher "
+
+#: ../gramps/gen/filters/rules/media/_hasnotematchingsubstringof.py:45
+msgid "Matches media objects whose notes contain text matching a substring"
+msgstr "Matcher medieobjekter med noter der matcher en delstreng"
+
+#: ../gramps/gen/filters/rules/media/_hasnoteregexp.py:43
+msgid "Media objects having notes containing "
+msgstr "Medieobjekter med noter der indeholder "
+
+#: ../gramps/gen/filters/rules/media/_hasnoteregexp.py:45
+msgid "Matches media objects whose notes contain text matching a regular expression"
+msgstr "Matcher medieobjekter med noter der indeholder regulært udtryk"
+
+#: ../gramps/gen/filters/rules/media/_hasreferencecountof.py:44
+msgid "Media objects with a reference count of "
+msgstr "Medieobjekter med et antal henvisninger på "
+
+#: ../gramps/gen/filters/rules/media/_hasreferencecountof.py:45
+msgid "Matches media objects with a certain reference count"
+msgstr "Matcher medieobjekter med et bestemt antal henvisninger"
+
+#: ../gramps/gen/filters/rules/media/_hassourcecount.py:47
+msgid "Media with sources"
+msgstr "Medier med kilder"
+
+#: ../gramps/gen/filters/rules/media/_hassourcecount.py:48
+msgid "Matches media with a certain number of sources connected to it"
+msgstr "Matcher medier med et bestemt antal tilknyttede kilder"
+
+#: ../gramps/gen/filters/rules/media/_hassourceof.py:48
+msgid "Media with the "
+msgstr "Medier med "
+
+#: ../gramps/gen/filters/rules/media/_hassourceof.py:50
+msgid "Matches media who have a particular source"
+msgstr "Matcher medier med en bestemt kilde"
+
+#: ../gramps/gen/filters/rules/media/_hastag.py:50
+msgid "Media objects with the "
+msgstr "Medieobjekt med "
+
+#: ../gramps/gen/filters/rules/media/_hastag.py:51
+msgid "Matches media objects with the particular tag"
+msgstr "Matcher medieobjekter med bestemte mærkater"
+
+#: ../gramps/gen/filters/rules/media/_matchesfilter.py:46
+msgid "Media objects matching the "
+msgstr "Medieobjekter der matcher "
+
+#: ../gramps/gen/filters/rules/media/_matchesfilter.py:47
+msgid "Matches media objects matched by the specified filter name"
+msgstr "Matcher medieobjekter der passer med det angivne filternavn"
+
+#: ../gramps/gen/filters/rules/media/_matchessourceconfidence.py:46
+#, fuzzy
+msgid "Media with a direct source >= "
+msgstr "Medier med mindst en direkte kilde >= "
+
+#: ../gramps/gen/filters/rules/media/_matchessourceconfidence.py:47
+msgid "Matches media with at least one direct source with confidence level(s)"
+msgstr "Matcher medier med mindst en direkte kilde med troværdighedsniveau(er)"
+
+#: ../gramps/gen/filters/rules/media/_mediaprivate.py:44
+msgid "Media objects marked private"
+msgstr "Medieobjekter der er markeret private"
+
+#: ../gramps/gen/filters/rules/media/_mediaprivate.py:45
+msgid "Matches Media objects that are indicated as private"
+msgstr "Matcher medieobjekter der er markeret private"
+
+#: ../gramps/gen/filters/rules/media/_regexpidof.py:49
+msgid "Media Objects with matching regular expression"
+msgstr "Medieobjekter med der matcher regulært udtryk"
+
+#: ../gramps/gen/filters/rules/media/_regexpidof.py:50
+msgid "Matches media objects whose Gramps ID matches the regular expression"
+msgstr "Matcher medieobjekter hvis Gramps-id indeholder et regulært udtryk"
+
+#: ../gramps/gen/filters/rules/note/_allnotes.py:46
+msgid "Every note"
+msgstr "Alle noter"
+
+#: ../gramps/gen/filters/rules/note/_allnotes.py:47
+msgid "Matches every note in the database"
+msgstr "Matcher alle noter i databasen"
+
+#: ../gramps/gen/filters/rules/note/_changedsince.py:48
+msgid "Notes changed after "
+msgstr "Noter som er ændret efter "
+
+#: ../gramps/gen/filters/rules/note/_changedsince.py:49
+msgid "Matches note records changed after a specified date-time (yyyy-mm-dd hh:mm:ss) or in the range, if a second date-time is given."
+msgstr "Matcher noteoptegnelser som er ændret efter en angivet dato/tidspunkt (åååå-mm-dd tt:mm:ss), eller indenfor et tidsinterval hvis endnu en dato/tidspunkt er angivet."
+
+#: ../gramps/gen/filters/rules/note/_hasidof.py:46
+msgid "Note with "
+msgstr "Note med "
+
+#: ../gramps/gen/filters/rules/note/_hasidof.py:47
+msgid "Matches a note with a specified Gramps ID"
+msgstr "Matcher en note med en angivet Gramps-id"
+
+#: ../gramps/gen/filters/rules/note/_hasnote.py:48
+#: ../gramps/gui/glade/mergenote.glade:214
+#: ../gramps/gui/glade/mergenote.glade:233
+msgid "Text:"
+msgstr "Tekst:"
+
+#: ../gramps/gen/filters/rules/note/_hasnote.py:49
+#: ../gramps/gui/editors/filtereditor.py:106
+msgid "Note type:"
+msgstr "Notetype:"
+
+#: ../gramps/gen/filters/rules/note/_hasnote.py:51
+msgid "Notes matching parameters"
+msgstr "Noter der passer med parametre"
+
+#: ../gramps/gen/filters/rules/note/_hasnote.py:52
+msgid "Matches Notes with particular parameters"
+msgstr "Matcher noter med bestemte parametre"
+
+#: ../gramps/gen/filters/rules/note/_hasreferencecountof.py:44
+msgid "Notes with a reference count of "
+msgstr "Noter med et antal henvisninger på "
+
+#: ../gramps/gen/filters/rules/note/_hasreferencecountof.py:45
+msgid "Matches notes with a certain reference count"
+msgstr "Matcher noter med et bestemt antal henvisninger"
+
+#: ../gramps/gen/filters/rules/note/_hastag.py:50
+msgid "Notes with the "
+msgstr "Noter med "
+
+#: ../gramps/gen/filters/rules/note/_hastag.py:51
+msgid "Matches notes with the particular tag"
+msgstr "Matcher noter med et bestemt mærkat"
+
+#: ../gramps/gen/filters/rules/note/_matchesfilter.py:46
+msgid "Notes matching the "
+msgstr "Noter der matcher "
+
+#: ../gramps/gen/filters/rules/note/_matchesfilter.py:47
+msgid "Matches notes matched by the specified filter name"
+msgstr "Matcher noter som passer med det angivne filternavn"
+
+#: ../gramps/gen/filters/rules/note/_matchesregexpof.py:46
+msgid "Notes containing "
+msgstr "Noter der indeholder "
+
+#: ../gramps/gen/filters/rules/note/_matchesregexpof.py:47
+msgid "Matches notes that contain text which matches a regular expression"
+msgstr "Matcher noter der indeholder tekst der passer med et regulært udtryk"
+
+#: ../gramps/gen/filters/rules/note/_matchessubstringof.py:46
+msgid "Notes containing "
+msgstr "Noter der indeholder "
+
+#: ../gramps/gen/filters/rules/note/_matchessubstringof.py:47
+msgid "Matches notes that contain text which matches a substring"
+msgstr "Matcher noter der indeholder tekst der passer med en delstreng"
+
+#: ../gramps/gen/filters/rules/note/_noteprivate.py:44
+msgid "Notes marked private"
+msgstr "Noter der er markeret private"
+
+#: ../gramps/gen/filters/rules/note/_noteprivate.py:45
+msgid "Matches notes that are indicated as private"
+msgstr "Matcher noter der er markeret private"
+
+#: ../gramps/gen/filters/rules/note/_regexpidof.py:49
+msgid "Notes with matching regular expression"
+msgstr "Noter med der matcher regulært udtryk"
+
+#: ../gramps/gen/filters/rules/note/_regexpidof.py:50
+msgid "Matches notes whose Gramps ID matches the regular expression"
+msgstr "Matcher noter hvis Gramps-id matcher det regulære udtryk"
+
+#: ../gramps/gen/filters/rules/person/_changedsince.py:48
+msgid "Persons changed after "
+msgstr "Personer der er ændret efter "
+
+#: ../gramps/gen/filters/rules/person/_changedsince.py:49
+msgid "Matches person records changed after a specified date-time (yyyy-mm-dd hh:mm:ss) or in the range, if a second date-time is given."
+msgstr "Matcher personoptegnelser som er ændret efter et angivet dato/tidspunkt (yyyy-mm-dd hh:mm:ss), eller indenfor et tidsinterval hvis endnu en dato/tidspunkt er angivet."
+
+#: ../gramps/gen/filters/rules/person/_deeprelationshippathbetween.py:51
+msgid "Preparing sub-filter"
+msgstr "Forbereder underfilter"
+
+#: ../gramps/gen/filters/rules/person/_deeprelationshippathbetween.py:54
+msgid "Retrieving all sub-filter matches"
+msgstr "Indhenter alle forekomster fra underfilter"
+
+#: ../gramps/gen/filters/rules/person/_deeprelationshippathbetween.py:125
+msgid "Relationship path between and people matching "
+msgstr "Slægtskabslinjen mellem og personer der passer på "
+
+#: ../gramps/gen/filters/rules/person/_deeprelationshippathbetween.py:126
+#: ../gramps/gen/filters/rules/person/_isrelatedwith.py:48
+#: ../gramps/gen/filters/rules/person/_relationshippathbetween.py:49
+#: ../gramps/gen/filters/rules/person/_relationshippathbetweenbookmarks.py:54
+msgid "Relationship filters"
+msgstr "Slægtskabsfiltre"
+
+#: ../gramps/gen/filters/rules/person/_deeprelationshippathbetween.py:127
+msgid "Searches over the database starting from a specified person and returns everyone between that person and a set of target people specified with a filter. This produces a set of relationship paths (including by marriage) between the specified person and the target people. Each path is not necessarily the shortest path."
+msgstr "Gennemsøger databasen ved at starte fra en angivet person for at vise alle personer mellem den angivne person og en gruppe af målpersoner som er specificeret i et filter. Herved skabes et sæt af slægtslinjer (medtager også ægteskab) mellem den angivne person og målpersonerne. Hver linje er ikke nødvendigvis den korteste."
+
+#: ../gramps/gen/filters/rules/person/_deeprelationshippathbetween.py:137
+msgid "Finding relationship paths"
+msgstr "Finder slægtskabslinjerne"
+
+#: ../gramps/gen/filters/rules/person/_deeprelationshippathbetween.py:138
+msgid "Evaluating people"
+msgstr "Evaluerer personer"
+
+#: ../gramps/gen/filters/rules/person/_disconnected.py:46
+msgid "Disconnected people"
+msgstr "Slægtsløse personer"
+
+#: ../gramps/gen/filters/rules/person/_disconnected.py:48
+msgid "Matches people that have no family relationships to any other person in the database"
+msgstr "Matcher personer der ikke er beslægtet med nogen anden person i databasen"
+
+#: ../gramps/gen/filters/rules/person/_everyone.py:46
+msgid "Everyone"
+msgstr "Alle"
+
+#: ../gramps/gen/filters/rules/person/_everyone.py:48
+msgid "Matches everyone in the database"
+msgstr "Matcher alle i databasen"
+
+#: ../gramps/gen/filters/rules/person/_familywithincompleteevent.py:44
+msgid "Families with incomplete events"
+msgstr "Familier med ufuldstændige hændelser"
+
+#: ../gramps/gen/filters/rules/person/_familywithincompleteevent.py:45
+msgid "Matches people with missing date or place in an event of the family"
+msgstr "Matcher personer med manglende dato eller sted for en familiehændelse"
+
+#: ../gramps/gen/filters/rules/person/_hasaddress.py:51
+msgid "People with addresses"
+msgstr "Personer med adresser"
+
+#: ../gramps/gen/filters/rules/person/_hasaddress.py:52
+msgid "Matches people with a certain number of personal addresses"
+msgstr "Matcher personer med et bestemt antal personlige adresser"
+
+#: ../gramps/gen/filters/rules/person/_hasalternatename.py:47
+msgid "People with an alternate name"
+msgstr "Personer med et alternativt navn"
+
+#: ../gramps/gen/filters/rules/person/_hasalternatename.py:48
+msgid "Matches people with an alternate name"
+msgstr "Matcher personer der har et alternativt navn"
+
+#: ../gramps/gen/filters/rules/person/_hasassociation.py:51
+msgid "People with associations"
+msgstr "Personer med forbindelser"
+
+#: ../gramps/gen/filters/rules/person/_hasassociation.py:52
+msgid "Matches people with a certain number of associations"
+msgstr "Matcher personer med et vist antal forbindelser"
+
+#: ../gramps/gen/filters/rules/person/_hasattribute.py:46
+#: ../gramps/gui/editors/filtereditor.py:101
+msgid "Personal attribute:"
+msgstr "Personattribut:"
+
+#: ../gramps/gen/filters/rules/person/_hasattribute.py:47
+msgid "People with the personal "
+msgstr "Personer med personlig "
+
+#: ../gramps/gen/filters/rules/person/_hasattribute.py:48
+msgid "Matches people with the personal attribute of a particular value"
+msgstr "Matcher personer med en bestemt personlig attribut"
+
+#: ../gramps/gen/filters/rules/person/_hasbirth.py:50
+msgid "People with the "
+msgstr "Personer med "
+
+#: ../gramps/gen/filters/rules/person/_hasbirth.py:51
+msgid "Matches people with birth data of a particular value"
+msgstr "Matcher personer med en bestemt fødselsdato"
+
+#: ../gramps/gen/filters/rules/person/_hascitation.py:52
+msgid "People with the "
+msgstr "Personer med "
+
+#: ../gramps/gen/filters/rules/person/_hascitation.py:53
+msgid "Matches people with a citation of a particular value"
+msgstr "Matcher personer med en citering af en bestemt værdi"
+
+#: ../gramps/gen/filters/rules/person/_hascommonancestorwith.py:48
+msgid "People with a common ancestor with "
+msgstr "Personer der har en ane fælles med "
+
+#: ../gramps/gen/filters/rules/person/_hascommonancestorwith.py:49
+#: ../gramps/gen/filters/rules/person/_hascommonancestorwithfiltermatch.py:53
+#: ../gramps/gen/filters/rules/person/_isancestorof.py:48
+#: ../gramps/gen/filters/rules/person/_isancestoroffiltermatch.py:50
+#: ../gramps/gen/filters/rules/person/_isduplicatedancestorof.py:50
+#: ../gramps/gen/filters/rules/person/_islessthannthgenerationancestorof.py:49
+#: ../gramps/gen/filters/rules/person/_islessthannthgenerationancestorofbookmarked.py:56
+#: ../gramps/gen/filters/rules/person/_islessthannthgenerationancestorofdefaultperson.py:51
+#: ../gramps/gen/filters/rules/person/_ismorethannthgenerationancestorof.py:49
+msgid "Ancestral filters"
+msgstr "Anefiltre"
+
+#: ../gramps/gen/filters/rules/person/_hascommonancestorwith.py:50
+msgid "Matches people that have a common ancestor with a specified person"
+msgstr "Matcher personer med samme ane som den angivne person"
+
+#: ../gramps/gen/filters/rules/person/_hascommonancestorwithfiltermatch.py:50
+msgid "People with a common ancestor with match"
+msgstr "Personer der har en ane fælles med person der passer med "
+
+#: ../gramps/gen/filters/rules/person/_hascommonancestorwithfiltermatch.py:51
+msgid "Matches people that have a common ancestor with anybody matched by a filter"
+msgstr "Matcher personer der har en ane fælles med en person der matcher et filter"
+
+#: ../gramps/gen/filters/rules/person/_hasdeath.py:50
+msgid "People with the "
+msgstr "Personer med "
+
+#: ../gramps/gen/filters/rules/person/_hasdeath.py:51
+msgid "Matches people with death data of a particular value"
+msgstr "Matcher personer med en bestemt slags dødsdata"
+
+#: ../gramps/gen/filters/rules/person/_hasevent.py:50
+#: ../gramps/gui/editors/filtereditor.py:98
+msgid "Personal event:"
+msgstr "Personhændelse:"
+
+#: ../gramps/gen/filters/rules/person/_hasevent.py:55
+msgid "People with the personal "
+msgstr "Personer med "
+
+#: ../gramps/gen/filters/rules/person/_hasevent.py:56
+msgid "Matches people with a personal event of a particular value"
+msgstr "Matcher en person med en personlig hændelse af særlig værdi"
+
+#: ../gramps/gen/filters/rules/person/_hasfamilyattribute.py:47
+msgid "People with the family "
+msgstr "Personer med familie-"
+
+#: ../gramps/gen/filters/rules/person/_hasfamilyattribute.py:48
+msgid "Matches people with the family attribute of a particular value"
+msgstr "Matcher personer med en bestemt attribut"
+
+#: ../gramps/gen/filters/rules/person/_hasfamilyevent.py:53
+msgid "People with the family "
+msgstr "Personer med "
+
+#: ../gramps/gen/filters/rules/person/_hasfamilyevent.py:54
+msgid "Matches people with a family event of a particular value"
+msgstr "Matcher personer med en bestemt familiehændelse"
+
+#: ../gramps/gen/filters/rules/person/_hasgallery.py:44
+msgid "People with media"
+msgstr "Personer med medieobjekter"
+
+#: ../gramps/gen/filters/rules/person/_hasgallery.py:45
+msgid "Matches people with a certain number of items in the gallery"
+msgstr "Matcher personer med et bestemt antal elementer i galleriet"
+
+#: ../gramps/gen/filters/rules/person/_hasidof.py:46
+#: ../gramps/gen/filters/rules/person/_matchidof.py:47
+msgid "Person with "
+msgstr "Person med "
+
+#: ../gramps/gen/filters/rules/person/_hasidof.py:47
+#: ../gramps/gen/filters/rules/person/_matchidof.py:48
+msgid "Matches person with a specified Gramps ID"
+msgstr "Matcher en person med en angivet Gramps-id"
+
+#: ../gramps/gen/filters/rules/person/_haslds.py:50
+msgid "People with LDS events"
+msgstr "Personer med SDH-hændelser"
+
+#: ../gramps/gen/filters/rules/person/_haslds.py:51
+msgid "Matches people with a certain number of LDS events"
+msgstr "Matcher personer med et bestemt antal SDH-hændelser"
+
+#: ../gramps/gen/filters/rules/person/_hasnameof.py:49
+msgid "Given name:"
+msgstr "Fornavn:"
+
+#: ../gramps/gen/filters/rules/person/_hasnameof.py:50
+msgid "Full Family name:"
+msgstr "Fulde slægtsnavn:"
+
+#: ../gramps/gen/filters/rules/person/_hasnameof.py:51
+msgid "person|Title:"
+msgstr "Titel:"
+
+#: ../gramps/gen/filters/rules/person/_hasnameof.py:52
+msgid "Suffix:"
+msgstr "Efterstavelse:"
+
+#: ../gramps/gen/filters/rules/person/_hasnameof.py:53
+msgid "Call Name:"
+msgstr "Kaldenavn:"
+
+#: ../gramps/gen/filters/rules/person/_hasnameof.py:54
+msgid "Nick Name:"
+msgstr "Tilnavn:"
+
+#: ../gramps/gen/filters/rules/person/_hasnameof.py:55
+msgid "Prefix:"
+msgstr "Forstavelse:"
+
+#: ../gramps/gen/filters/rules/person/_hasnameof.py:56
+msgid "Single Surname:"
+msgstr "Enkelt efternavn:"
+
+# ??? -MBJ
+#: ../gramps/gen/filters/rules/person/_hasnameof.py:57
+#: ../gramps/gui/editors/displaytabs/surnametab.py:79
+msgid "Connector"
+msgstr "Bindeled"
+
+#: ../gramps/gen/filters/rules/person/_hasnameof.py:58
+msgid "Patronymic:"
+msgstr "Patronym:"
+
+#: ../gramps/gen/filters/rules/person/_hasnameof.py:59
+msgid "Family Nick Name:"
+msgstr "Slægtstilnavn:"
+
+#: ../gramps/gen/filters/rules/person/_hasnameof.py:60
+#: ../gramps/gen/filters/rules/person/_hastextmatchingsubstringof.py:50
+#: ../gramps/gui/editors/filtereditor.py:544
+msgid "Regular-Expression matching:"
+msgstr "Match med regulært udtryk:"
+
+#: ../gramps/gen/filters/rules/person/_hasnameof.py:61
+msgid "People with the "
+msgstr "Personer med "
+
+#: ../gramps/gen/filters/rules/person/_hasnameof.py:62
+#: ../gramps/gen/filters/rules/person/_searchname.py:49
+msgid "Matches people with a specified (partial) name"
+msgstr "Matcher personer med et (delvist) angivet navn"
+
+#: ../gramps/gen/filters/rules/person/_hasnameorigintype.py:48
+#: ../gramps/gui/editors/filtereditor.py:108
+msgid "Surname origin type:"
+msgstr "Oprindelse af efternavn:"
+
+#: ../gramps/gen/filters/rules/person/_hasnameorigintype.py:49
+msgid "People with the "
+msgstr "Personer med "
+
+#: ../gramps/gen/filters/rules/person/_hasnameorigintype.py:50
+msgid "Matches people with a surname origin"
+msgstr "Matcher personer som har et efternavn af oprindelsestypen"
+
+#: ../gramps/gen/filters/rules/person/_hasnametype.py:48
+#: ../gramps/gui/editors/filtereditor.py:107
+msgid "Name type:"
+msgstr "Navnetype:"
+
+#: ../gramps/gen/filters/rules/person/_hasnametype.py:49
+msgid "People with the "
+msgstr "Personer med