Compare commits

..

39 Commits

Author SHA1 Message Date
romjerome 96e715df2b fix trailing whitespace
https://github.com/gramps-project/gramps/pull/966#issuecomment-569182132
thanks!
2019-12-29 14:59:57 +01:00
romjerome 0120572a7a Wrong continued indentation 2019-12-14 18:48:56 +01:00
romjerome ea58544530 Trailing whitespace 2019-12-14 18:47:46 +01:00
romjerome c36b6c20c1 options for including occupation data 2019-12-10 16:18:01 +01:00
Paulo Henrique Moraes fc9e5c2a4a Updated translation. (#952) 2019-11-27 11:51:50 -06:00
prculley e3eedb2219 Merge branch 'gramps51' 2019-11-08 11:46:40 -06:00
Nick Hall f5861169fe Merge pull request #908 from SNoiraud:FR11336
New narrative web and web calendar features:

* Allow urls in the user's css files
* Allow alternate stylesheets in pages for narrative web and webcal
* Webcal: incorrect results when divorce event.
* Some pylint improvements

Resolves #11336.
2019-10-05 18:10:45 +01:00
SNoiraud 4e2f98da02 Better score for pylint 2019-10-05 18:05:21 +01:00
SNoiraud 95a0216287 Duplicate marriage 2019-10-05 18:05:21 +01:00
SNoiraud 03fb2ff1c2 Incorrect results when divorce event 2019-10-05 18:05:15 +01:00
SNoiraud 17141a0536 Add alternate stylesheets 2019-10-05 18:03:03 +01:00
SNoiraud 528852b9b3 Allow alternate stylesheets in pages
Useful when you create a site web, you don't need to create a new
web when you are testing the stylesheets. The final user can change
the stylesheet for the current page.

i.e. on Firefox: View -> Page style -> The stylesheet
2019-10-05 18:02:51 +01:00
SNoiraud 0de286e7a8 Allow urls for images in user css files 2019-10-05 17:59:17 +01:00
SNoiraud 7979bf79fd Better code quality for within area rule 2019-10-05 17:28:21 +01:00
Nick Hall 7100c51a31 Merge pull request #903 from prculley:deprecations 2019-10-05 17:22:19 +01:00
prculley 57f7502105 Fix deprecation of Gtk positional arguments 2019-10-05 17:17:54 +01:00
prculley 0f925a86f5 Fix Gtk deprecation Menu.set_title 2019-10-05 17:17:54 +01:00
prculley 17f4d93363 Fix Gtk deprecatioon ScrolledWindow.add_with_viewport 2019-10-05 17:17:54 +01:00
prculley cea48b618f Fix GObject.PARAM_READWRITE deprecation 2019-10-05 17:17:54 +01:00
prculley 290d6f7287 Fix deprecation GObject.GError -> GLib.GError 2019-10-05 17:17:54 +01:00
prculley 4d0e86a2e8 Fix Gtk deprecation Widget.reparent 2019-10-05 17:17:54 +01:00
prculley 831c7f9c66 Fix Gtk deprecation Widget.set_padding 2019-10-05 17:17:54 +01:00
prculley 702e51dd47 Fix deprecation on Gtk.Widget.override_font and modify_font 2019-10-05 17:17:54 +01:00
Jonas Hahnfeld f3555d0168 Add new graph output format to the tree document generator
The "graph" is the data part for genealogytree without the boilerplate
code around it that makes up a full LaTeX file. This format is useful
for people who have their own (more sophisticated) LaTeX file with
custom styles and so on.
The implementation is pretty straight-forward: Just don't output the
LaTeX code.
2019-10-05 17:05:38 +01:00
Matthias Kemmer bedc4b8e74 Add a new person filter rule 'HasAddressText' 2019-10-04 21:07:52 +01:00
Matthias Kemmer 8a8a21f85d Add date format option for 'numeric date with leading zeros' 2019-10-04 19:59:54 +01:00
Nick Hall c7350c53e2 Remove irrelevant comment 2019-10-04 19:54:00 +01:00
Fredrik Lindseth 52e76b506a Add descriptions to decendant tree report styles 2019-10-04 19:18:16 +01:00
Matthias Kemmer ab52d0988e Remove tag from selected rows 2019-10-03 21:28:33 +01:00
Matthias Kemmer 5935a315b2 Add 'HasAttribute' filter rule to repositories, sources and citations
Fixes #9845
2019-10-03 21:05:14 +01:00
prculley 1eaa609058 Get BetaWarning correct for master 2019-09-16 11:13:08 -05:00
prculley 5f0c2c1c54 Set Beta warning to True 2019-09-16 11:02:03 -05:00
prculley 6d39920e6f Merge branch 'gramps51' 2019-09-16 10:54:55 -05:00
prculley 4859c14aaa Fix typo in merge 2019-08-12 16:58:55 -05:00
prculley f4a8f21032 Merge from gramps51 2019-08-09 09:06:42 -05:00
prculley e894c4478f Some pylint cleanups 2019-08-09 08:55:05 -05:00
romjerome 56afb5bca9 Add missing 'get_number_of_citations' method (#859)
* Add missing 'get_number_of_citations' method

* update db test for bsddb

* fix trailing whitespace

* typo
2019-08-07 13:47:09 -05:00
SNoiraud 9da8f705f6 Narrative web: Add popup to manage markers
If you click on a marker in the family map page, you get a popup.
In this popup associated with a place, if you have several events,
for each event you see the person and the event type.
If you click on the person, you go to the related page for this person.
If you click on the event type, you go to the related page for this event.

Fixes #11150
2019-07-07 19:25:42 +02:00
SNoiraud ce4cd33139 Narrative web: Add Stamen map
Fixes #05984
2019-07-07 19:24:44 +02:00
233 changed files with 87547 additions and 90423 deletions
+162 -343
View File
@@ -1,458 +1,277 @@
2021-07-26 Nick Hall <nick-h@gramps-project.org>
2019-09-14 SNoiraud <Serge.Noiraud@free.fr>
* gramps/gen/const.py: Update copyright date
* gramps/gen/filters/rules/place/_withinarea.py: Fix deprecation
warning in withinarea rule
2021-07-23 SNoiraud <Serge.Noiraud@free.fr>
2019-09-14 Nick Hall <nick-h@gramps-project.org>
* gramps/gen/utils/alive.py: Probably alive incorrect if death
without date
* gramps/gui/grampsgui.py: Disable development warning message
2021-07-10 SNoiraud <Serge.Noiraud@free.fr>
2019-09-13 Jonas Hahnfeld <hahnjo@hahnjo.de>
* gramps/gui/editors/editplace.py,
gramps/gui/editors/editplaceref.py: Place editor, copy and paste of
lat and long text no longer auto-populating latitude and longitude fields.
Fixes #12349
* gramps/gen/plug/docgen/treedoc.py: Add options to sandclock in
tree document generator This works and is actually needed to style the root node.
2021-06-25 prculley <paulr2787@gmail.com>
2019-09-11 SNoiraud <Serge.Noiraud@free.fr>
* gramps/gui/viewmanager.py: Fix for crash when changing views if
part of toolbar is not shown because of a small screen when changing
views. Fixes #12048
* gramps/gui/filters/sidebar/_personsidebarfilter.py: Using regex in
the sidebar gives different result from previous gramps release. Fixes #11321
2021-06-25 prculley <paulr2787@gmail.com>
2019-09-12 Jérôme Rapinat <romjerome@yahoo.fr>
* gramps/gui/views/pageview.py: Fix bottombar always showing after
restart, even when not wanted. Fixes #12338
* po/fr.po: Add missing French translation strings
2021-07-09 Tian Shixiong <tiansworld@fedoraproject.org>
2019-09-10 Gil da Costa <gdacosta@sommier-colas.fr>
* po/zh_CN.po: Update and fix Simplified Chinese translation
* po/fr.po: Update French translation
2021-07-16 Mirko Leonhaeuser <mirko@leonhaeuser.de>
2019-09-09 prculley <paulr2787@gmail.com>
* po/de.po: fixed small German translation error for item also fixed
in Weblate GUI for master
* gramps/plugins/docgen/odfdoc.py: Fix odt output when db owner has
XML unfriendly chars ('&') Fixes #11327
2021-06-28 Tian Shixiong <tiansworld@fedoraproject.org>
2019-09-11 John Bickmore <johnbickmore@users.noreply.github.com>
* po/zh_CN.po: Update Simplified Chinese translation
* README.md: Bump required Python version to 3.3 on Readme As mentioned on the release announcement
2021-07-05 pehlm <par.ekholm@pekholm.org>
https://gramps-project.org/introduction-WP/2019/08/gramps-5-1-0-released/
* po/sv.po: One update Swedish translation
2019-09-08 SNoiraud <Serge.Noiraud@free.fr>
2021-07-03 John Ralls <jralls@ceridwen.us>
* gramps/plugins/webreport/narrativeweb.py: Remove
reload_custom_filters to conform to PR894
* gramps/plugins/db/dbapi/dbapi.py: Better to use
locale.get_collation than locale.collation.
2019-09-07 prculley <paulr2787@gmail.com>
2021-07-03 John Ralls <jralls@ceridwen.us>
* gramps/cli/grampscli.py: Fix CLI crash when generating reports Fixes #11318, #11213
* gramps/plugins/db/dbapi/dbapi.py: Wrap call to
dbapi.check_collection to prevent a forced API change.
2019-09-06 prculley <paulr2787@gmail.com>
2021-07-01 John Ralls <jralls@ceridwen.us>
* gramps/gui/views/listview.py: Fix Statusbar HandleError on merge
families Fixes #11320, #11294, #11279
* mac/gramps.modules: Fix URL for berkeleydb patch.
2019-09-12 Avi Markovitz <avi.markovitz@gmail.com>
2021-07-01 John Ralls <jralls@ceridwen.us>
* po/he.po: Update Hebrew translation
* gramps/plugins/db/dbapi/dbapi.py,
gramps/plugins/db/dbapi/sqlite.py: Always use filtered collation
names. Store the Sqlite3 collations in the __collations array to
short-circuit re-creation. Fixes #12343
2019-09-12 Matti Niemelä <matti.u.niemela@gmail.com>
2021-06-25 Mirko Leonhaeuser <mirko@leonhaeuser.de>
* po/fi.po: Fix translation in Finnish
* po/de.po: Fixed different German translations for "What's next"
also fixed in master (Weblate)
2019-09-12 Matti Niemelä <matti.u.niemela@gmail.com>
2021-06-23 Mirko Leonhaeuser <mirko@leonhaeuser.de>
* po/fi.po: Update finnish translation
* gramps/plugins/rel/rel_de.py: German relation calculator fixed
issue if more then 24 generations between the two person
2019-09-11 vantu5z <vantu5z@mail.ru>
2021-06-22 Matti Niemelä <matti.u.niemela@gmail.com>
* po/ru.po: update Russian translation
* po/fi.po: Fix translation in Finnish
2019-09-10 pehlm <par.ekholm@pekholm.org>
2021-06-17 Tian Shixiong <tiansworld@fedoraproject.org>
* po/sv.po: Update Swedish translation
* po/zh_CN.po: Correct and improve Simplified Chinese translation.
Correct some terribly wrong and low quality translation, even machine
translation. Improve some existing translation for better user experience
as a software, use more written language.
2019-09-10 Mirko Leonhaeuser <mirko@leonhaeuser.de>
2021-05-31 Tian Shixiong <tiansworld@fedoraproject.org>
* po/de.po: Update German translation
* po/zh_CN.po: Improve and correct Simplified Chinese translation
2019-09-10 Nick Hall <nick-h@gramps-project.org>
2021-05-27 Tian Shixiong <tiansworld@fedoraproject.org>
* po/ar.po, po/bg.po, po/br.po, po/ca.po, po/cs.po, po/da.po,
po/de.po, po/el.po, po/en_GB.po, po/eo.po, po/es.po, po/fi.po,
po/fr.po, po/ga.po, po/he.po, po/hr.po, po/hu.po, po/is.po,
po/it.po, po/ja.po, po/lt.po, po/mk.po, po/nb.po, po/nl.po,
po/nn.po, po/pl.po, po/pt_BR.po, po/pt_PT.po, po/ro.po, po/ru.po,
po/sk.po, po/sl.po, po/sq.po, po/sr.po, po/sr_Latn.po, po/sv.po,
po/ta.po, po/tr.po, po/uk.po, po/vi.po, po/zh_CN.po, po/zh_HK.po,
po/zh_TW.po: Merge po files and new template
* po/zh_CN.po: Improve and correct the Simplified Chinese
translation
2019-09-10 Nick Hall <nick-h@gramps-project.org>
2021-05-21 Tian Shixiong <tiansworld@fedoraproject.org>
* po/gramps.pot: Update translation template for new release
* po/zh_CN.po: Update and improve Simplified Chinese translation
2019-08-27 Avi Markovitz <avi.markovitz@gmail.com>
2021-05-17 Tian Shixiong <tiansworld@fedoraproject.org>
* po/he.po: Update Hebrew translation
* po/zh_CN.po: Update Simplified Chinese translation
2019-07-11 Pedro Albuquerque <palbuquerque73@gmail.com>
2020-09-26 Jan Sparreboom <jan@sparreboom.net>
* po/pt_PT.po: Update Portuguese (Europe) translation
* gramps/gen/datehandler/_date_nl.py, gramps/plugins/rel/rel_nl.py,
po/nl.po: Update Dutch translation
2019-06-24 Milo Ivir <mail@milotype.de>
2021-05-07 Tian Shixiong <tiansworld@fedoraproject.org>
* po/hr.po: Update croatian translation - update with newest/current .pot file - translation is complete - corrections in wording and some missing accelerators
* po/zh_CN.po: Correct and Update Simplified Chinese translation
2019-09-02 prculley <paulr2787@gmail.com>
2020-10-13 Tian Shixiong <tiansworld@fedoraproject.org>
* gramps/gui/widgets/styledtexteditor.py: Fix missing tooltip
translations in the Note editor toolbar Fixes #11289
* po/zh_CN.po: Update Simplified Chinese translation
2019-09-01 SNoiraud <Serge.Noiraud@free.fr>
2021-05-14 Mirko Leonhaeuser <mirko@leonhaeuser.de>
* gramps/gen/filters/rules/place/_withinarea.py: Avoid bad
coordinates in the ref place
* po/de.po: Corrected some German translation errors found during
handbook revision
2019-08-28 SNoiraud <Serge.Noiraud@free.fr>
2021-05-04 John Ralls <jralls@ceridwen.us>
* gramps/gen/filters/rules/place/_withinarea.py: Avoid alphabetic
characters in filter rules
* gramps/grampsapp.py: Add file logging for macOS. When Gramps is launched
from macOS's LaunchServices it doesn't have a sys.stderr attached so the
default stream logger goes to /dev/null. Use a FileHandler in tht case,
writing the log to $TMPDIR/gramps-pid.log. This will help particularly in
analyzing crashes where python shuts down as there's no crash report in
that case.
2019-08-23 SNoiraud <Serge.Noiraud@free.fr>
2021-05-06 John Ralls <jralls@ceridwen.us>
* gramps/gen/filters/rules/place/_withinarea.py: Could not convert
string to float by using withinarea filter rule + difference between sidebar filter
and filter rule + some pylint improvements
* mac/gramps.modules: Update PyICU to 2.7.2 in macOS build.
2019-08-31 prculley <paulr2787@gmail.com>
2021-05-06 Paul Culley <paulr2787@gmail.com>
* gramps/gen/plug/docgen/graphdoc.py: Fix Graph outputs for multiple
page PDF Postscript Fixes #11305
* gramps/plugins/lib/libplaceview.py: Fix libplaceview to avoid
exception when mapservice is no longer present (#1193) Fixes #12263
2019-08-31 prculley <paulr2787@gmail.com>
2021-05-06 Paul Culley <paulr2787@gmail.com>
* gramps/gen/plug/_pluginreg.py, gramps/gui/managedwindow.py,
gramps/gui/plug/quick/_quickreports.py, gramps/gui/uimanager.py,
gramps/gui/viewmanager.py, gramps/gui/views/tags.py,
gramps/gui/widgets/grampletpane.py: Fix to make Gtk 'action names'
always valid Fixes #11291
* gramps/plugins/gramplet/backlinks.py: Fix References Gramplet for
inadequate updates when other objects change (#1192) Fixes #12248
2019-08-31 prculley <paulr2787@gmail.com>
2021-05-06 Serge Noiraud <Serge.Noiraud@free.fr>
* gramps/gui/uimanager.py, gramps/gui/views/tags.py: Fix missing
menus/buttons when operating in non-English languages Fixes #11292
* gramps/plugins/view/geofamily.py: geofamily crashes if a family
has no father (#1188)
2019-08-31 SNoiraud <Serge.Noiraud@free.fr>
2021-05-06 Serge Noiraud <Serge.Noiraud@free.fr>
* gramps/gui/widgets/validatedmaskedentry.py: Cursor position error
in lat and long fields Fixes #11310
* gramps/gen/merge/mergepersonquery.py: Home Person setting does not
convey in a merge. Fixes #12235
2019-08-30 SNoiraud <Serge.Noiraud@free.fr>
2021-05-06 Paul Culley <paulr2787@gmail.com>
* gramps/plugins/tool/removespaces.py: Avoid all characters looking
like a dash hyphen non breaking hyphen figure dash em dash horizontal bar Fixes #11308
* gramps/gen/utils/docgen/csvtab.py: Fix CSV export of view to only
put single CR character. (#1186) Fixes #12158
2019-08-30 SNoiraud <Serge.Noiraud@free.fr>
2021-05-06 Paul Culley <paulr2787@gmail.com>
* data/css/Web_Mainz.css: Narrative web: Mainz Style sheet weird
looking Fixes #11282
* gramps/gen/filters/rules/media/__init__.py: Add Media filter rule
'HasMedia' to list of media rules for editor (#1182) Fixes #12212
2019-09-02 SNoiraud <Serge.Noiraud@free.fr>
2021-04-28 Mirko Leonhaeuser <mirko@leonhaeuser.de>
* gramps/plugins/view/relview.py: Set symbols for the active person
* po/de.po: corrected German translation of "confidence"
2019-08-28 SNoiraud <Serge.Noiraud@free.fr>
2021-04-26 Mirko Leonhaeuser <mirko@leonhaeuser.de>
* gramps/plugins/view/relview.py: Set good symbols for marriage,
baptism, cremation and burial
* po/de.po: German corrected translation of 'attribute'
2019-08-28 SNoiraud <Serge.Noiraud@free.fr>
2021-04-25 Mirko Leonhaeuser <mirko@leonhaeuser.de>
* gramps/plugins/view/relview.py: Reduce the size of the sexuality
symbol in relview Fixes #11295
* po/de.po: Fixed translation error of "display name editor" into
German
2019-08-28 prculley <paulr2787@gmail.com>
2021-04-24 Mirko Leonhaeuser <mirko@leonhaeuser.de>
* gramps/gui/widgets/styledtexteditor.py: Fix exception when editing
Note with italics/bold etc. in non English Fixes #11284
* po/de.po: some translation fixes for German
2019-08-27 Nick Hall <nick-h@gramps-project.org>
2021-04-24 pehlm <par.ekholm@pekholm.org>
* gramps/gui/views/pageview.py: Restore keybindings for gramplet
bars Resolves #11297.
* po/sv.po: Changed immigration too, Swedish
2019-08-27 Nick Hall <nick-h@gramps-project.org>
2021-04-24 pehlm <par.ekholm@pekholm.org>
* gramps/gui/plug/quick/_quickreports.py: Fix bug in web connection
menu launching incorrect web site Resolves #11280.
* po/sv.po: Correction of Swedish translation
2019-08-26 SNoiraud <Serge.Noiraud@free.fr>
2021-04-22 Helder Geovane Gomes de Lima <he7d3r@gmail.com>
* gramps/gui/autocomp.py: Translation problem when creating event
filter If you create a filter with the rule name: "Events with a particular type" or "Events with <data>" The menu "Travel", "Academic"... are not
translated Fixes #11293
* po/pt_BR.po: Update Portuguese translation (pt_BR) (#1199)
This pull request is an updated version of the patch I've provided
at <https://gramps-project.org/bugs/view.php?id=10547> in 2018, now
based on branch 5.1
2019-08-26 SNoiraud <Serge.Noiraud@free.fr>
2021-04-19 Mirko Leonhaeuser <mirko@leonhaeuser.de>
* gramps/gui/configure.py, gramps/gui/widgets/grampletbar.py: Error
when checking option to add Quit to Taskbar Fixes #11290
* po/de.po: Corrected translation of markup in German translation
2019-08-25 SNoiraud <Serge.Noiraud@free.fr>
2021-04-17 Mirko Leonhaeuser <mirko@leonhaeuser.de>
* gramps/plugins/webreport/narrativeweb.py,
gramps/plugins/webreport/person.py: Make the narratives notes
placement an option From 5.1 the narrative notes are placed just after the name, gender
and age at death. This follow the feature request #6772. Some
people want to have this placement an option to have the same
functionality as before Fixes #11283
* po/de.po: Fixed translation of tags in German translation
2019-08-24 Ross Gammon <rossgammon@mail.dk>
2021-04-14 Mirko Leonhaeuser <mirko@leonhaeuser.de>
* debian/changelog: Finalise Debian changelog for 5.1.0 release
* po/de.po: German translation for type unified
2019-08-24 Ross Gammon <rossgammon@mail.dk>
2021-04-13 romjerome <romjerome@yahoo.fr>
* debian/control: Bump gtk+ version to 3.12 & add
gir1.2-geocodeglib-1.0 dependency
* po/fr.po: 11656: typo, spelling correction contribution by Philippe
2019-08-24 Ross Gammon <rossgammon@mail.dk>
2021-04-13 romjerome <romjerome@yahoo.fr>
* debian/copyright: Update copyrights
* gramps/gen/utils/grampslocale.py: Need to set locale.textdomain
under linux (#1198) _build_popup_ui() ignores translated strings without
locale.textdomain set.
2019-08-24 Ross Gammon <rossgammon@mail.dk>
2021-04-13 Mirko Leonhaeuser <mirko@leonhaeuser.de>
* debian/changelog, debian/control: Merge last 5.0.2 debian release
information into 51 maintenance branch
* po/de.po: Fixed German translation of number for places
2019-08-23 Sebastian Schubert <schubert.seb@gmail.com>
2021-04-11 John Ralls <jralls@ceridwen.us>
* README.md: Add optional fontconfig package to README.md
* mac/gramps.bundle, mac/gramps.modules,
mac/patches/berkeleydb-4.8-atomic.patch: Update dependencies.
Includes moving berkeleydb and pybsddb over from gtk-osx.
2019-08-23 Sebastian Schubert <schubert.seb@gmail.com>
2021-03-21 Mirko Leonhaeuser <mirko@leonhaeuser.de>
* NEWS: Fix typo in NEWS
* po/de.po: Some small fixes in German translation
2019-08-30 Zdeněk Hataš <zdenek.hatas@gmail.com>
2021-03-11 Mirko Leonhaeuser <mirko@leonhaeuser.de>
* po/cs.po: Update Czech translation
* po/de.po: Update German translation for csv import/export
2019-08-29 Zdeněk Hataš <zdenek.hatas@gmail.com>
2021-03-01 Mirko Leonhaeuser <mirko@leonhaeuser.de>
* po/cs.po: Update Czech translation
* po/de.po: small fix in German translation
2019-08-25 Mirko Leonhaeuser <mirko@leonhaeuser.de>
2021-02-19 Matthias Kemmer <49940207+Mattkmmr@users.noreply.github.com>
* po/de.po: German translation updated
* gramps/gen/filters/rules/person/_matcheseventfilter.py: Change
category of 'MatchesEventFilter' (#1130)
2019-08-24 John Ralls <jralls@ceridwen.us>
2021-02-19 Paul Culley <paulr2787@gmail.com>
* mac/Info.plist, mac/gramps.modules: Release Gramps-5.1.0 on Mac.
* gramps/gui/viewmanager.py, gramps/gui/views/pageview.py: Fix issue
where separator between top and bottom bar of View creeps up.
(#1122) Fixes #11973
2019-08-16 John Ralls <jralls@ceridwen.us>
2021-02-19 Paul Culley <paulr2787@gmail.com>
* mac/release.entitlements.plist: An entitlements plist for
codesigning Gramps. Python is an interpreter and therefore needs to create executable
memory. Since it doesn't know how to sign that memory it requires
the allow-unsigned-executable-memory entitlement to run in a
hardened runtime. One must apply this entitlement to both Gramps.app
and Gramps.app/Contents/MacOS/dot when codesigning them.
* gramps/plugins/gramplet/locations.py: Fix Locations Gramplet
(Enclosed by) to properly display certain nested places. (#1127)
when the smallest place has undated enclosure and larger places are dated.
Issue #11691
2019-06-11 John Ralls <jralls@ceridwen.us>
2021-02-19 Paul Culley <paulr2787@gmail.com>
* mac/gramps.modules: Fix graphviz and exiv2 download URLs.
* gramps/gui/dbman.py: Fix Family Tree Manager drop error on Windows
(#1132) Fixes #10734
2019-06-11 John Ralls <jralls@ceridwen.us>
2021-02-19 Paul Culley <paulr2787@gmail.com>
* mac/gramps.modules: Update dependency versions and download paths.
* gramps/plugins/export/exportvcalendar.py: Fix exportvcalendar
error is "is not" with a literal (Python 3.8 issue) (#1135) Fixes #12000
2019-08-22 vantu5z <vantu5z@mail.ru>
2021-02-19 Serge Noiraud <Serge.Noiraud@free.fr>
* po/ru.po: update Russian translation
* gramps/gui/clipboard.py: Handle not found when copying source from
the citation tree (#1175) Fixes #12170
2019-08-22 pehlm <par.ekholm@pekholm.org>
2021-02-19 Paul Culley <paulr2787@gmail.com>
* po/sv.po: Update Swedish translation with the new gramps.pot
* gramps/gui/dbloader.py: DbLoader: Fix call to 'file' function,
which doesn't exist in Python3 (#1173)
2019-08-21 prculley <paulr2787@gmail.com>
2021-02-19 Paul Culley <paulr2787@gmail.com>
* Bump to 5.1.1
* gramps/gen/db/utils.py: Fix write_lock_file exception when
USERNAME is missing (#1171) Fixes #12150
2021-02-19 Paul Culley <paulr2787@gmail.com>
* gramps/gui/glade/editplace.glade: Fix EditPlace so Tab key doesn't
get stuck on Private icon (#1168) Fixes #12139
2021-02-19 Paul Culley <paulr2787@gmail.com>
* gramps/plugins/textreport/tagreport.py: Fix Tag report for places
that have a hierarchy. (#1162) Fixes #12124
2021-02-19 Paul Culley <paulr2787@gmail.com>
* gramps/gui/viewmanager.py: Fix exception when cancelling out of a
db upgrade in GUI (#1154) Fixes #12063
2021-02-12 Mirko Leonhaeuser <mirko@leonhaeuser.de>
* po/de.po: additional small German translation fixes
2021-02-11 Mirko Leonhaeuser <mirko@leonhaeuser.de>
* po/de.po: Small fixes German translation
2021-02-06 Mirko Leonhaeuser <mirko@leonhaeuser.de>
* po/de.po: fix wrong translation of source text in German
translation
2021-02-06 Mirko Leonhaeuser <mirko@leonhaeuser.de>
* po/de.po: fixed small error in German translation
2021-01-26 Mirko Leonhaeuser <mirko@leonhaeuser.de>
* po/de.po: small fixes German translation
2020-11-06 Chris Mayo <aklhfex@gmail.com>
* setup.py: Install 128x128 and 256x256 application icons created with
ImageMagick using e.g.:
convert -background none ../../../gramps.svg -geometry 256x256 gramps.png
2020-11-06 Chris Mayo <aklhfex@gmail.com>
* data/{gnome-mime-application-x-gedcom.svg =>
application-x-gedcom.svg},
data/{gnome-mime-application-x-geneweb.svg =>
application-x-geneweb.svg},
data/{gnome-mime-application-x-gramps-package.svg =>
application-x-gramps-package.svg},
data/{gnome-mime-application-x-gramps-xml.svg =>
application-x-gramps-xml.svg},
data/{gnome-mime-application-x-gramps.svg =>
application-x-gramps.svg},
setup.py: Install MIME type icons into the hicolor theme.
The gnome theme is defunct. Remove gnome-mime- prefix from icon filenames.
2020-08-20 Nick Hall <nick-h@gramps-project.org>
* images/hicolor/scalable/{actions => apps}/gramps.svg, setup.py:
Install application icons into correct directories
2020-10-15 vantu5z <vantu5z@mail.ru>
* po/ru.po: Update Russian translation
2020-09-25 Zdeněk Hataš <zdenek.hatas@gmail.com>
* po/cs.po: Update Czech translation - typo fixes
2020-09-06 Tian Shixiong <tiansworld@fedoraproject.org>
* po/zh_CN.po: Update Simplified Chinese translation
2020-08-16 Jan Sparreboom <jan@sparreboom.net>
* po/nl.po: Update Dutch translation
2020-04-21 Lajos Nemeséri <nemeseril@gmail.com>
* po/hu.po: Revised and updated hu translation
2020-09-13 Juan Saavedra <jcsaaver@gmail.com>
* po/es.po: Update Spanish translation
2020-09-15 bokfink <62996239+bokfink@users.noreply.github.com>
* gramps/plugins/textreport/birthdayreport.py: Fix error in Birthday
and Anniversary report (#1113) Fixes an error triggered when the first
person_handle in the list has a death event, but no birth event
(get_birth_ref() == None) and does not have family relationships
(spouse_handle == None). These conditions lead to the local variable
short_name not being declared before it comes time to process death events.
Fixes #11766
2020-09-14 Paul Culley <paulr2787@gmail.com>
* gramps/gen/plug/docgen/graphdoc.py: Fix graphdoc to properly
escape characters in ids for Graphviz (#1111) Fixes #11741
2020-09-14 John Ralls <jralls@ceridwen.us>
* gramps/gen/db/dummydb.py, gramps/gen/db/txn.py,
gramps/gen/db/utils.py, gramps/gen/dbstate.py,
gramps/gen/filters/rules/test/person_rules_test.py,
gramps/gen/utils/callback.py, gramps/plugins/db/bsddb/bsddbtxn.py:
Replace inspect.stack() with inspect.currentframe() (#1104)
* Replace inspect.stack() with inspect.currentframe() Fixes #11874
Works around https://bugs.python.org/issue12920 which causes every
call to inspect.trace() to fail because __main__ is always the
starting point. * Fix a few Codecov complaints from files touched by
previous commit. Ignoring the "duplicate code" issue caused by the empty
comment line at the beginning of every file.
2020-09-14 RossGammon <rossgammon@mail.dk>
* debian/changelog, debian/copyright: Update Debian directory after
producing the deb file for the 5.1.3 (#1100) Release.
2020-09-14 Paul Culley <paulr2787@gmail.com>
* gramps/gui/selectors/baseselector.py: Fix crash sorting on columns
in Selectors with TreeModels (#1099) Fixes #11750
2020-09-14 Paul Culley <paulr2787@gmail.com>
* gramps/gui/dbloader.py, gramps/gui/displaystate.py,
gramps/gui/uimanager.py, gramps/gui/utils.py,
gramps/gui/viewmanager.py: Fix progress bar freeze due to changes in
Gtk (#1103) Fixes #11642
2020-09-14 Paul Culley <paulr2787@gmail.com>
* gramps/plugins/docgen/svgdrawdoc.py: Fix svgdrawdoc for text
containing XML invalid characters (#1110) Fixes #11929
2020-08-30 John Ralls <jralls@ceridwen.us>
* mac/gramps.bundle: Further changes for bundling with Python 3.8.
2020-08-30 John Ralls <jralls@ceridwen.us>
* mac/gramps.bundle: Add libgeocode-glib to bundle so that it
actually works.
2020-08-26 Mirko Leonhaeuser <mirko@leonhaeuser.de>
* po/de.po: German translation two small corrections
2020-08-25 John Ralls <jralls@ceridwen.us>
* mac/gramps_launcher.py: [mac] Set __file__ if gramps_launcher.py
is run as __main__. Fixes #11874.
2020-08-21 Zdeněk Hataš <zdenek.hatas@gmail.com>
* po/cs.po: Update Czech translation
2020-08-20 John Ralls <jralls@ceridwen.us>
* mac/Info.plist, mac/gramps.modules: Bundle release of Gramps
5.1.3.
2020-08-20 John Ralls <jralls@ceridwen.us>
* mac/gramps.modules: Add geocode-glib to build.
2020-08-12 pehlm <par.ekholm@pekholm.org>
* po/sv.po: Update Swedish translation
2020-08-12 prculley <paulr2787@gmail.com>
* Bump to 5.1.4
-188
View File
@@ -1,191 +1,3 @@
2021-07-26
Version 5.1.4
* Update translations: cs, de, es, fi, fr, hu, nl, pt_BR, ru, sv, zh_CN.
* Update copyright date.
* Fix probably alive if death without date.
* Place editor, copy and paste of lat and long text no longer
auto-populating latitude and longitude fields.
* Fix for crash when changing views if part of toolbar is not shown because
of a small screen when changing views.
* Fix bottombar always showing after restart, even when not wanted.
* Always use filtered collation names. Store the Sqlite3 collations in the
__collations array to short-circuit re-creation.
* Fix issue with German relation calculator fixed issue when more than 24
generations between the two people.
* Add file logging for macOS. When Gramps is launched from macOS's
LaunchServices it doesn't have a sys.stderr attached so the default stream
logger goes to /dev/null. Use a FileHandler in tht case, writing the log
to $TMPDIR/gramps-pid.log. This will help particularly in analyzing
crashes where python shuts down as there's no crash report in that case.
* Fix libplaceview to avoid exception when mapservice is no longer present.
* Fix References Gramplet for inadequate updates when other objects change.
* Fix geofamily crash if a family has no father.
* Home Person setting does not convey in a merge.
* Fix CSV export of view to only put single CR character.
* Add Media filter rule 'HasMedia' to list of media rules for editor.
* Need to set locale.textdomain under linux. _build_popup_ui() ignores
translated strings without locale.textdomain set.
* Change category of 'MatchesEventFilter'.
* Fix issue where separator between top and bottom bar of View creeps up.
* Fix Locations Gramplet (Enclosed by) to properly display certain nested
places when the smallest place has undated enclosure and larger places are
dated.
* Fix Family Tree Manager drop error on Windows.
* Fix exportvcalendar error is "is not" with a literal (Python 3.8 issue)
* Handle not found when copying source from the citation tree.
* Fix call to 'file' function, which doesn't exist in Python3.
* Fix write_lock_file exception when USERNAME is missing.
* Fix EditPlace so Tab key doesn't get stuck on Private icon.
* Fix Tag report for places that have a hierarchy.
* Fix exception when cancelling out of a db upgrade in GUI.
* Icon file changes:
* Install 128x128 and 256x256 application icons.
* Install MIME type icons into the hicolor theme.
* Remove gnome-mime- prefix from icon filenames.
* Install application icons into correct directories.
* Fix error in Birthday and Anniversary report. Fixes an error triggered
when the first person_handle in the list has a death event, but no birth
event and does not have family relationships. These conditions lead to
the local variable short_name not being declared before it comes time to
process death events.
* Fix graphdoc to properly escape characters in ids for Graphviz.
* Replace inspect.stack() with inspect.currentframe().
Works around https://bugs.python.org/issue12920 which causes every
call to inspect.trace() to fail because __main__ is always the
starting point.
* Fix crash sorting on columns in Selectors with TreeModels.
* Fix progress bar freeze due to changes in Gtk.
* Fix svgdrawdoc for text containing XML invalid characters.
* Mac:
* Update PyICU to 2.7.2 in macOS build.
* Update dependencies. Includes moving berkeleydb and pybsddb over from
gtk-osx.
* Further changes for bundling with Python 3.8.
* Set __file__ if gramps_launcher.py is run as __main__.
* Add geocode-glib to build.
2020-08-11
Version 5.1.3
* Update ca, de, fi, fr, ja, pl, ru, sl, sv, uk, zh_CN translation
* Events View: "Main Participants" column does not show the full list
of participants when expanded.
* mac/gramps.modules: Use current Gtk release instead of Gtk-3.14.
* mac/gramps.modules: Upgrade pymodules for Python 3.8 compatibility.
* Fix XML export when 'Group-as" name contains XML invalid chars
* Fix NarWeb: Province place-type is not displayed
* Fix ManagedWindow so that new windows don't appear offscreen when
system 'screen' sizes change in part time multi-monitor setups.
* Fix menus when db fails to open due to upgrade/downgrade etc.
* Fix issue with attach source tool, results panel
* Fix GEDCOM export; don't include ADDR when address is missing
* EditPlace: Allow Coordinates containing a comma instead of a period
* NarrativeWeb:
* Should show patronymic in individuals.
In the individuals and in surnames pages, we should show the
complete name like defined in the display tab from the narrative web
configuration.
* Fix Narrated Website Google Maps Output JS Warning SensorNotRequired
* Fix incorrect link type for osm css files
* Fix image size limit doesn't match tooltip
* Update all translations for changes from 'Default' to 'Home' Person
* Change GUI references to 'Home Person' instead of 'Default Person'
* Use event attribute types in the event reference editor.
In the event reference editor, custom event attribute types should
be used rather than the default person attribute types.
* Fix Verify tool bug caused by bad change in GObject introspection
* Fix RemoveUnused tool for crash caused by Gtk introspection bug
* Fix import test for change cause by previous change which was:
Fix GEDCOM import for bad source title when sources precede references.
* Fix GEDCOM import for bad source title when sources precede references.
* Fix some reports for CLI where warning message about Value not found
* Fix Genealogy Tree reports for crash in CLI
* Add uistate to tree views filter initialization
* Fix some Python syntax errors that appear in v3.8.x
* Suppress age = 0 days in events list. If the reference event date is equal
to the event date, don't show the age except if the date is estimated,
calculated, etc.
* Fix Dashboard Gramplets to update during db close when not shown
* Fix Windows GUI mode startup for crash with some languages
* Fix dbapi to support "Abandon Changes & Quit" feature
* Fix GrampsType for comparison bug with empty string as one value
* Fix Date Display so that it uses LC_TIME if defined
* Fix StyledText so serialize will match for style list order changes
* Try to fix exceptions on ManagedWindow close
* Fix Mac SQLite3 locale bug when locale contains non-ascii characters
* Fix issue when Person has Same date of birth and death; gives an error.
* Geography: add a popup for a bad tiles path
* Fix GEDCOM export of estimated/calculated dates with modifers
* Bump to v5.1.3
2020-01-14
Version 5.1.2
* Narweb: Private notes for home, intro and contact. If the notes are private,
we can't use them in these pages.
* Referenced regions problems. When image width > 800, the referenced
regions are incorrectly placed
* Ancestor's tree display looks weird Solves the following:
- Person boxes overlap
- Some person boxes partially visible or hidden
* some cleanup in ancestortree.css
* ancestor tree and long names.
* Adapt ancestor tree css file for all themes
* dates not localised in place pages
* Mainz problem with short text in one note, Issue occurs on the homepage
and introduction page.
* bad event links on media pages
* Navweb: Don't use media regions in some case:
- If we don't show families
- If we don't show events
- Don't show the media regions for a thumbnail
* WEBCAL: home link translated to lowercase
* Wrong web calendar title on home page. This solves the possibility to
have ">", "<" in the title
* Update LDS Temple list
* Make GuiDestinationOption Folder Icon start in users directory
* Allow import file filter to accept case insensitive extensions
* Fix db to warn/prevent opening newer schema versions
* Fix Progen import dialog and progress meter for correct parent window
* Fix Progen import to correctly handle AKA surnames
* Fix ExportPkg so errors are not lost, and has progress bar for media
* Fix Export Assistant so error messages get correct parent window
* Fix GEDCOM import when family is missing; import created a missing note
* Fix Dashboard for adding Gramplet crash in Slovenian
* Update cs, ca, fr, uk, he, fi, hr, de, sv translation
* Update date parsing for czech locale
* Fix Spanish translation for dates
* fix private proxy tagref support. Add missing code for event, repository,
source, citation and place
* [Tree doc Tex] fix "-" char on place name "-" can lead to confusion,
generating text out of the box with PDF file format
* [Tree doc Tex] fix typo on custom size
* Fix duplicated "døde døde" Norwegion Translation for libnarrate
* Fix up Event Editors Place display for bidi text with Gramps ID
* Fix issues with RTL languages and LAT/LONG
* Fix display of GPS coordinates in Places view for RTL languages
* Fix place editor lat/long entry for RTL languages
* Fix GEDCOM export to avoid translated GrampsType strings
* Allow Tools with Notbook tabs to expand to fill the window
* Limit Age Stats gramplet settings to appropriate values.
* Max ages should be divisible by 5 to avoid out of range errors.
* The chart width should be greater than 45 to look right and
avoid division by zero errors.
* Fix the Preferences 'Age display precision' value getting lost
* Fix Window family tree title for non-ASCII chars on Windows
* Fix Preferences/Genealogical Symbols when only one font is present
* Fix various Entry fields so Undo/Redo works
* Fix tag colors on PedigreeView
* Fix Gramps -v error when Gtk is not present
* Fix for PedigreeView not reflecting changes to birthday or death
* ODF DOC - Fix improper escaping in odt output for TOC/Bookmark etc.
* Fix CLI parser to accept negative integers as valid
* Fix Descendant Tree report for HandleError when no parents on family
* Fix Reorder ID tool so subsequent db additions used next possible ID
* Upgrade export VCalendar to v2.0, so can export all utf8 characters
* Fix Preferences so <ctrl>PageUp/PageDn doesn't stick on Dates tab
* Graphs: Escape for name, dates and places in graph reports with XML
illegal characters
* Fix 'Go' menu direct object selection, goes to wrong place
2019-09-14
Version 5.1.1
* Update translations: cs, de, fi, fr, he, hr, pt_PT, ru, sv
+45
View File
@@ -66,3 +66,48 @@ div#FamilyMapDetail div#references table.infolist {
div#FamilyMapDetail div#references table.infolist tbody tr td.ColumnPlace {
width: 40%;
}
/* Subsection: popup
------------------------------------------------------ */
.ol-popup {
position: absolute;
background-color: white;
-webkit-filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2));
filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2));
padding: 15px;
border-radius: 10px;
border: 2px solid #111111;
bottom: 12px;
left: -50px;
min-width: 450px;
}
.ol-popup:after, .ol-popup:before {
top: 100%;
border: solid transparent;
height: 0;
width: 0;
position: absolute;
pointer-events: none;
}
.ol-popup:after {
border-top-color: white;
border-width: 10px;
left: 48px;
margin-left: -10px;
}
.ol-popup:before {
border-top-color: #cccccc;
border-width: 11px;
left: 48px;
margin-left: -11px;
}
.ol-popup-closer {
text-decoration: none;
position: absolute;
top: 2px;
right: 8px;
}
.ol-popup-closer:after {
content: "✖";
}

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

+14 -82
View File
@@ -20,9 +20,6 @@
<code>SAMOA</code>
<code>AP</code>
</temple>
<temple name="Arequipa Peru Temple">
<code>AREQU</code>
</temple>
<temple name="Asuncion, Paraguay">
<code>ASUNC</code>
</temple>
@@ -30,9 +27,6 @@
<code>ATLAN</code>
<code>AT</code>
</temple>
<temple name="Barranquilla Colombia Temple">
<code>BARRA</code>
</temple>
<temple name="Baton Rouge, Louisiana">
<code>BROUG</code>
</temple>
@@ -63,9 +57,6 @@
<temple name="Bountiful, Utah">
<code>BOUNT</code>
</temple>
<temple name="Brigham City Utah Temple">
<code>BRIGH</code>
</temple>
<temple name="Brisbane, Australia">
<code>BRISB</code>
</temple>
@@ -88,12 +79,8 @@
<code>ALBR</code>
</temple>
<temple name="Cebu, Philippines">
<code>CEBUP</code>
<code>CEBU</code>
</temple>
<temple name="Cedar City Utah">
<code>CEDAR</code>
</temple>
<temple name="Chicago, Illinois">
<code>CHICA</code>
<code>CH</code>
@@ -107,18 +94,15 @@
<temple name="Colonia Juarez, Chihuahua, Mexico">
<code>COLJU</code>
</temple>
<temple name="Columbia River, Washington">
<code>CRIVE</code>
</temple>
<temple name="Columbia, South Carolina">
<code>COLSC</code>
</temple>
<temple name="Columbia River, Washington">
<code>CRIVE</code>
</temple>
<temple name="Columbus, Ohio">
<code>COLUM</code>
</temple>
<temple name="Concepción Chile">
<code>CONCE</code>
</temple>
<temple name="Copenhagen, Denmark">
<code>COPEN</code>
</temple>
@@ -145,19 +129,6 @@
<temple name="Edmonton, Alberta">
<code>EDMON</code>
</temple>
<temple name="Endowment House">
<code>EHOUS</code>
<code>EH</code>
</temple>
<temple name="Fort Collins Colorado">
<code>FORTC</code>
</temple>
<temple name="Fort Lauderdale Florida">
<code>FORTL</code>
</temple>
<temple name="Fortaleza Brazil">
<code>FORTA</code>
</temple>
<temple name="Frankfurt, Germany">
<code>FRANK</code>
<code>FR</code>
@@ -220,9 +191,6 @@
<code>IFALL</code>
<code>IF</code>
</temple>
<temple name="Indianapolis Indiana">
<code>INDIA</code>
</temple>
<temple name="Johannesburg, South Africa">
<code>JOHAN</code>
<code>JO</code>
@@ -234,14 +202,10 @@
<temple name="Kansas City, Missouri">
<code>KANSA</code>
</temple>
<temple name="Kinshasa Democratic Republic of the Congo">
<code>KINSH</code>
</temple>
<temple name="Kona, Hawaii">
<code>KONA</code>
</temple>
<temple name="Kiev, Ukraine">
<code>KYIV</code>
<code>KIEV</code>
</temple>
<temple name="Kirtland, Ohio">
@@ -259,9 +223,6 @@
<code>LIMA</code>
<code>LI</code>
</temple>
<temple name="Lisbon Portugal">
<code>LISBO</code>
</temple>
<temple name="Logan, Utah">
<code>LOGAN</code>
<code>LG</code>
@@ -309,9 +270,6 @@
<temple name="Merida, Mexico">
<code>MERID</code>
</temple>
<temple name="Meridian Idaho">
<code>MIDAH</code>
</temple>
<temple name="Mesa, Arizona">
<code>ARIZO</code>
<code>AZ</code>
@@ -367,7 +325,6 @@
<code>OKLAH</code>
</temple>
<temple name="Oquirrh Mountain, Utah">
<code>OQUIR</code>
<code>OMOUN</code>
</temple>
<temple name="Orlando, Florida">
@@ -383,12 +340,6 @@
<code>PAPEE</code>
<code>TA</code>
</temple>
<temple name="Paris France">
<code>PARIS</code>
</temple>
<temple name="Payson Utah">
<code>PAYSO</code>
</temple>
<temple name="Perth, Australia">
<code>PERTH</code>
</temple>
@@ -398,9 +349,6 @@
<temple name="Phoenix, Arizona">
<code>PHOEN</code>
</temple>
<temple name="Port-au-Prince Haiti">
<code>PORTA</code>
</temple>
<temple name="Portland, Oregon">
<code>PORTL</code>
<code>PT</code>
@@ -411,9 +359,6 @@
<temple name="Preston, England">
<code>PREST</code>
</temple>
<temple name="Provo City Center, Utah">
<code>PROCC</code>
</temple>
<temple name="Provo, Utah">
<code>PROVO</code>
<code>PV</code>
@@ -440,7 +385,6 @@
<code>REXBU</code>
</temple>
<temple name="Rome, Italy">
<code>ROMEI</code>
<code>ROME</code>
</temple>
<temple name="Sacramento, California">
@@ -450,6 +394,12 @@
<code>SGEOR</code>
<code>SG</code>
</temple>
<temple name="St. Louis, Missouri">
<code>SLOUI</code>
</temple>
<temple name="St. Paul, Minnesota">
<code>SPMIN</code>
</temple>
<temple name="Salt Lake City, Utah">
<code>SLAKE</code>
<code>SL</code>
@@ -465,7 +415,6 @@
<code>SJOSE</code>
</temple>
<temple name="San Salvador, El Salvador">
<code>SANSA</code>
<code>SSALV</code>
</temple>
<temple name="Santiago, Chile">
@@ -479,9 +428,6 @@
<code>SPAUL</code>
<code>SP</code>
</temple>
<temple name="Sapporo Japan">
<code>SAPPO</code>
</temple>
<temple name="Seattle, Washington">
<code>SEATT</code>
<code>SE</code>
@@ -496,15 +442,6 @@
<temple name="Spokane, Washington">
<code>SPOKA</code>
</temple>
<temple name="St. Louis, Missouri">
<code>SLOUI</code>
</temple>
<temple name="St. Paul, Minnesota">
<code>SPMIN</code>
</temple>
<temple name="Star Valley Wyoming">
<code>STARV</code>
</temple>
<temple name="Stockholm, Sweden">
<code>STOCK</code>
<code>ST</code>
@@ -526,15 +463,9 @@
<temple name="Tegucigalpa, Honduras">
<code>TEGUC</code>
</temple>
<temple name="The Gila Valley Arizona">
<code>GILAV</code>
</temple>
<temple name="The Hague, Netherlands">
<code>HAGUE</code>
</temple>
<temple name="Tijuana Mexico">
<code>TIJUA</code>
</temple>
<temple name="Tokyo, Japan">
<code>TOKYO</code>
<code>TK</code>
@@ -543,19 +474,16 @@
<code>TORON</code>
<code>TORNO</code>
<code>TR</code>
</temple>
<temple name="Trujillo, Peru">
<code>TRUJI</code>
</temple>
<temple name="Tucson Arizona">
<code>TUCSO</code>
</temple>
<temple name="Tuxtla Gutierrez, Mexico">
<code>TGUTI</code>
</temple>
<temple name="Twin Falls, Idaho">
<code>TWINF</code>
<code>TFALL</code>
<code>TWINF</code>
</temple>
<temple name="Vancouver, British Columbia">
<code>VANCO</code>
@@ -577,6 +505,10 @@
<code>WINTE</code>
<code>WQUAR</code>
</temple>
<temple name="Endowment House">
<code>EHOUS</code>
<code>EH</code>
</temple>
<temple name="President's Office">
<code>POFFI</code>
<code>PO</code>
+6 -6
View File
@@ -1,12 +1,12 @@
0 HEAD
1 SOUR Gramps
2 VERS 5.1.2
2 VERS 5.0.2
2 NAME Gramps
1 DATE 7 JAN 2020
2 TIME 13:39:43
1 DATE 4 AUG 2019
2 TIME 15:26:44
1 SUBM @SUBM@
1 FILE C:\Users\prc\AppData\Roaming\gramps\temp\exp_sample_ged.ged
1 COPR Copyright (c) 2020 Alex Roitman,,,.
1 COPR Copyright (c) 2019 Alex Roitman,,,.
1 GEDC
2 VERS 5.5.1
2 FORM LINEAGE-LINKED
@@ -911,7 +911,7 @@
2 DATE I think 1970 to 1971
2 PLAC San Francisco, San Francisco Co., CA
1 SLGC
2 DATE ABT 1999
2 DATE EST ABT 1999
2 FAMC @F0016@
2 TEMP DENVE
2 PLAC Denver, Denver Co., CO, Denver Co., Colorado, USA
@@ -1424,7 +1424,7 @@
0 @N0018@ NOTE Another Citation Note
0 @N0019@ NOTE A bad photo for sure
0 @O0000@ OBJE
1 FILE d:\users\prc\documents\gramps\data\tests\O0.jpg
1 FILE c:\users\prc\workspace\grampsm\main\data\tests\O0.jpg
2 FORM jpg
2 TITL Michael O'Toole 2015-11
1 NOTE @N0019@
+3 -3
View File
@@ -3,7 +3,7 @@
"http://gramps-project.org/xml/1.7.1/grampsxml.dtd">
<database xmlns="http://gramps-project.org/xml/1.7.1/">
<header>
<created date="1999-12-25" version="5.1.3"/>
<created date="2019-08-04" version="5.0.2"/>
<researcher>
<resname>Alex Roitman,,,</resname>
<resaddr>Not Provided</resaddr>
@@ -1302,7 +1302,7 @@
</reporef>
</source>
<source handle="_0000008500000085" change="1" id="S0000">
<stitle>Marriage Certificae</stitle>
<stitle>@S0@</stitle>
<noteref hlink="_000000e7000000e7"/>
<reporef hlink="_000000e6000000e6" callno="what-321-ever" medium="Photo"/>
</source>
@@ -1705,7 +1705,7 @@ Unknown tag Line 1111:
<range start="0" end="163"/>
</style>
</note>
<note handle="_000000f9000000f9" change="1591544255" id="N0036" type="General">
<note handle="_000000f9000000f9" change="1564950708" id="N0036" type="General">
<text>Objects referenced by this note were missing in a file imported on 12/25/1999 12:00:00 AM.</text>
</note>
</notes>
-13
View File
@@ -1,16 +1,3 @@
gramps (5.1.3-1) focal; urgency=medium
* New release
* Update debian/copyright for Alex Roitman
-- Ross Gammon <rosco2@ubuntu.com> Sun, 16 Aug 2020 20:23:34 +0200
gramps (5.1.2-1) unstable; urgency=medium
* New release
-- Ross Gammon <rossgammon@debian.org> Sat, 11 Jan 2020 19:07:08 +0100
gramps (5.1.1-1) unstable; urgency=medium
* New release
+1 -1
View File
@@ -3,7 +3,7 @@ Upstream-Name: Gramps
Source: https://gramps-project.org
Files: *
Copyright: 2000-2007, 2020 Alex Roitman
Copyright: 2000-2007, Alex Roitman
2000-2002, Bruce J. DeGrasse
2000-2008, Donald N. Allingham
2000-2007, Martin Hawlisch
+2 -2
View File
@@ -519,8 +519,8 @@ class CommandLineReport:
self.format = tree_format["class"]
if self.format is None:
# Pick the first one as the default.
self.format = treedoc.FORMATS[0]["class"]
_chosen_format = treedoc.FORMATS[0]["type"]
self.format = tree_format.FORMATS[0]["class"]
_chosen_format = tree_format.FORMATS[0]["type"]
else:
self.format = None
if _chosen_format and _format_str:
+2 -2
View File
@@ -145,7 +145,7 @@ sys.path.insert(0, ROOT_DIR)
git_revision = get_git_revision(ROOT_DIR).replace('\n', '')
if sys.platform == 'win32' and git_revision == "":
git_revision = get_git_revision(os.path.split(ROOT_DIR)[1])
#VERSION += git_revision
VERSION += git_revision
#VERSION += "-1"
#
@@ -225,7 +225,7 @@ GTK_GETTEXT_DOMAIN = 'gtk30'
#
#-------------------------------------------------------------------------
COPYRIGHT_MSG = "© 2001-2006 Donald N. Allingham\n" \
"© 2007-2021 The Gramps Developers"
"© 2007-2019 The Gramps Developers"
COMMENTS = _("Gramps\n (Genealogical Research and Analysis "
"Management Programming System)\n"
"is a personal genealogy program.")
+6 -11
View File
@@ -35,7 +35,6 @@ import logging
# Gramps modules
#
#-------------------------------------------------------------------------
from ..utils.grampslocale import GrampsLocale
from ..const import GRAMPS_LOCALE as glocale
_ = glocale.translation.sgettext
# import prerequisites for localized handlers
@@ -73,20 +72,16 @@ from . import _date_uk
from . import _date_zh_CN
from . import _date_zh_TW
# the following makes sure we use the LC_TIME value for date display & parsing
dlocale = GrampsLocale(lang=glocale.calendar)
# Initialize global parser
try:
if LANG in LANG_TO_PARSER:
parser = LANG_TO_PARSER[LANG](plocale=dlocale)
parser = LANG_TO_PARSER[LANG](plocale=glocale)
else:
parser = LANG_TO_PARSER[LANG_SHORT](plocale=dlocale)
parser = LANG_TO_PARSER[LANG_SHORT](plocale=glocale)
except:
logging.warning(
_("Date parser for '%s' not available, using default") % LANG)
parser = LANG_TO_PARSER["C"](plocale=dlocale)
parser = LANG_TO_PARSER["C"](plocale=glocale)
# Initialize global displayer
try:
@@ -97,13 +92,13 @@ except:
try:
if LANG in LANG_TO_DISPLAY:
displayer = LANG_TO_DISPLAY[LANG](val, blocale=dlocale)
displayer = LANG_TO_DISPLAY[LANG](val, blocale=glocale)
else:
displayer = LANG_TO_DISPLAY[LANG_SHORT](val, blocale=dlocale)
displayer = LANG_TO_DISPLAY[LANG_SHORT](val, blocale=glocale)
except:
logging.warning(
_("Date displayer for '%s' not available, using default") % LANG)
displayer = LANG_TO_DISPLAY["C"](val, blocale=dlocale)
displayer = LANG_TO_DISPLAY["C"](val, blocale=glocale)
# Import utility functions
-20
View File
@@ -50,15 +50,6 @@ class DateParserCZ(DateParser):
Converts a text string into a Date object
"""
quality_to_int = {
'přibližně' : Date.QUAL_ESTIMATED,
'odhadem' : Date.QUAL_ESTIMATED,
'odh.' : Date.QUAL_ESTIMATED,
'vypočteno' : Date.QUAL_CALCULATED,
'vypočtené' : Date.QUAL_CALCULATED,
'vyp.' : Date.QUAL_CALCULATED,
}
bce = ["před naším letopočtem", "před Kristem",
"př. n. l.", "př. Kr."] + DateParser.bce
@@ -67,17 +58,6 @@ class DateParserCZ(DateParser):
# bug 9739 grampslocale.py gets '%-d.%-m.%Y' -- makes it be '%/d.%/m.%Y'
self.dhformat = self.dhformat.replace('/', '') # so counteract that
def init_strings(self):
DateParser.init_strings(self)
self._text2 = re.compile(r'(\d+)?\.?\s+?%s\.?\s*((\d+)(/\d+)?)?\s*$'
% self._mon_str, re.IGNORECASE)
self._span = re.compile(
r"(od)\s+(?P<start>.+)\s+(do)\s+(?P<stop>.+)",
re.IGNORECASE)
self._range = re.compile(
r"(mezi)\s+(?P<start>.+)\s+(a)\s+(?P<stop>.+)",
re.IGNORECASE)
#-------------------------------------------------------------------------
#
# Czech display
+14 -1
View File
@@ -290,7 +290,8 @@ class DateDisplayDE(DateDisplay):
formats = (
"JJJJ-MM-DD (ISO)", "Numerisch", "Monat Tag Jahr",
"MONAT Tag Jahr", "Tag. Monat Jahr", "Tag. MONAT Jahr"
"MONAT Tag Jahr", "Tag. Monat Jahr", "Tag. MONAT Jahr",
"Numerisch mit führenden Nullen"
)
# this definition must agree with its "_display_gregorian" method
@@ -343,6 +344,18 @@ class DateDisplayDE(DateDisplay):
else:
value = "%d. %s %s" % (date_val[0],
self.long_months[date_val[1]], year)
elif self.format == 6:
# day.month_number.year with leading zeros
if date_val[3]:
return self.display_iso(date_val)
else:
if date_val[0] == date_val[1] == 0:
value = str(date_val[2])
else:
value = self.dhformat.replace('%m', str(date_val[1])
.zfill(2))
value = value.replace('%d', str(date_val[0]).zfill(2))
value = value.replace('%Y', str(date_val[2]))
else:
# day. month_abbreviation year
if date_val[0] == 0:
+25 -27
View File
@@ -83,37 +83,35 @@ class DateParserNL(DateParser):
month_to_int["xbris"] = 12
modifier_to_int = {
'voor' : Date.MOD_BEFORE,
'na' : Date.MOD_AFTER,
'ca.' : Date.MOD_ABOUT,
'circa' : Date.MOD_ABOUT,
'om' : Date.MOD_ABOUT,
'omstreeks' : Date.MOD_ABOUT,
'ongeveer' : Date.MOD_ABOUT,
'rond' : Date.MOD_ABOUT,
'tegen' : Date.MOD_ABOUT,
'voor' : Date.MOD_BEFORE,
'na' : Date.MOD_AFTER,
'tegen' : Date.MOD_ABOUT,
'om' : Date.MOD_ABOUT,
'rond' : Date.MOD_ABOUT,
'circa' : Date.MOD_ABOUT,
'ca.' : Date.MOD_ABOUT,
}
calendar_to_int = {
'gregoriaans' : Date.CAL_GREGORIAN,
'greg.' : Date.CAL_GREGORIAN,
'juliaans' : Date.CAL_JULIAN,
'jul.' : Date.CAL_JULIAN,
'hebreeuws' : Date.CAL_HEBREW,
'hebr.' : Date.CAL_HEBREW,
'islamitisch' : Date.CAL_ISLAMIC,
'isl.' : Date.CAL_ISLAMIC,
'frans republiekeins' : Date.CAL_FRENCH,
'fran.' : Date.CAL_FRENCH,
'persisch' : Date.CAL_PERSIAN,
'zweeds' : Date.CAL_SWEDISH,
'z' : Date.CAL_SWEDISH,
'gregoriaans' : Date.CAL_GREGORIAN,
'greg.' : Date.CAL_GREGORIAN,
'juliaans' : Date.CAL_JULIAN,
'jul.' : Date.CAL_JULIAN,
'hebreeuws' : Date.CAL_HEBREW,
'hebr.' : Date.CAL_HEBREW,
'islamitisch' : Date.CAL_ISLAMIC,
'isl.' : Date.CAL_ISLAMIC,
'franse republiek': Date.CAL_FRENCH,
'fran.' : Date.CAL_FRENCH,
'persisch' : Date.CAL_PERSIAN,
'zweeds' : Date.CAL_SWEDISH,
'z' : Date.CAL_SWEDISH,
}
quality_to_int = {
'geschat' : Date.QUAL_ESTIMATED,
'geschat' : Date.QUAL_ESTIMATED,
'gesch.' : Date.QUAL_ESTIMATED,
'berekend' : Date.QUAL_CALCULATED,
'berekend' : Date.QUAL_CALCULATED,
'ber.' : Date.QUAL_CALCULATED,
}
@@ -149,17 +147,17 @@ class DateDisplayNL(DateDisplay):
calendar = (
"", "juliaans", "hebreeuws",
"frans republikeins", "persisch", "islamitisch",
"franse republiek", "persisch", "islamitisch",
"zweeds" )
_mod_str = ("", "voor ", "na ", "omstreeks ", "", "", "")
_mod_str = ("", "voor ", "na ", "rond ", "", "", "")
_qual_str = ("", "geschat ", "berekend ")
_bce_str = "%s v. Chr."
formats = (
"JJJJ-MM-DD (ISO)", "Numeriek DD/MM/JJJJ", "Maand Dag, Jaar",
"JJJJ-MM-DD (ISO)", "Numerisch DD/MM/JJ", "Maand Dag, Jaar",
"Mnd. Dag Jaar", "Dag Maand Jaar", "Dag Mnd. Jaar"
)
# this definition must agree with its "_display_gregorian" method
+13 -6
View File
@@ -32,7 +32,7 @@ database to fetch data from). Thus, dbstate.db cannot be left as 'None' because
None has no 'is_open' attribute. Therefore this database class is provided so
that it can be instantiated for dbstate.db.
FIXME: Ideally, only is_open() needs to be implemented here, bacause that is the
FIXME: Ideally, only is_open() needs to be implemented here, because that is the
only method that should really be called, but the Gramps code is not perfect,
and many other methods are called. Calls of other methods could be considered
bugs, so when these are fixed, this class could be reduced.
@@ -52,6 +52,7 @@ methods should be changed to generate exceptions. Possibly by globally changing
#
#-------------------------------------------------------------------------
import logging
import os
import inspect
from abc import ABCMeta
from types import FunctionType
@@ -159,12 +160,10 @@ def wrapper(method):
"""
class_name = args[0].__class__.__name__
func_name = method.__name__
frame = inspect.currentframe()
c_frame = frame.f_back
c_code = c_frame.f_code
caller_frame = inspect.stack()[1]
LOG.debug('calling %s.%s()... from file %s, line %s in %s',
class_name, func_name, c_code.co_filename, c_frame.f_lineno,
c_code.co_name)
class_name, func_name, os.path.split(caller_frame[1])[1],
caller_frame[2], caller_frame[3])
return method(*args, **keywargs)
return wrapped
@@ -758,6 +757,14 @@ class DummyDb(M_A_M_B("NewBaseClass", (DbReadBase, Callback, object,), {})):
LOG.warning("database is closed")
return 0
def get_number_of_citations(self):
"""
Return the number of citations currently in the database.
"""
if not self.db_is_open:
LOG.warning("database is closed")
return 0
def get_number_of_tags(self):
"""
Return the number of tags currently in the database.
+1 -8
View File
@@ -47,7 +47,6 @@ from . import (DbReadBase, DbWriteBase, DbUndo, DBLOGNAME, DBUNDOFN,
REPOSITORY_KEY, NOTE_KEY, TAG_KEY, TXNADD, TXNUPD, TXNDEL,
KEY_TO_NAME_MAP, DBMODE_R, DBMODE_W)
from .utils import write_lock_file, clear_lock_file
from .exceptions import DbVersionError
from ..errors import HandleError
from ..utils.callback import Callback
from ..updatecallback import UpdateCallback
@@ -535,7 +534,7 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback):
self.undo_history_callback = None
self.modified = 0
self.transaction = None
self.abort_possible = True
self.abort_possible = False
self._bm_changes = 0
self.has_changed = False
self.surname_list = []
@@ -660,12 +659,6 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback):
self.db_is_open = True
# Check on db version to see if too new
dbversion = int(self._get_metadata('version', default='0'))
if dbversion > self.VERSION[0]:
self.close()
raise DbVersionError(dbversion, 18, self.VERSION[0])
def _close(self):
"""
Close database backend.
+8 -6
View File
@@ -78,13 +78,15 @@ class DbTxn(defaultdict):
elapsed_time = time.time() - self.start_time
if __debug__:
frame = inspect.currentframe()
c_frame = frame.f_back
c_code = c_frame.f_code
caller_frame = inspect.stack()[1]
_LOG.debug(" **** DbTxn %s exited. Called from file %s, "
"line %s, in %s **** %.2f seconds",
hex(id(self)), c_code.co_filename, c_frame.f_lineno,
c_code.co_name, elapsed_time)
"line %s, in %s **** %.2f seconds" %
((hex(id(self)),)+
(os.path.split(caller_frame[1])[1],)+
tuple(caller_frame[i] for i in range(2, 4))+
(elapsed_time,)
)
)
return False
+7 -11
View File
@@ -42,8 +42,6 @@ from ..const import PLUGINS_DIR, USER_PLUGINS
from ..constfunc import win, get_env_var
from ..config import config
from .dbconst import DBLOGNAME, DBLOCKFN, DBBACKEND
from ..const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
#-------------------------------------------------------------------------
#
@@ -72,14 +70,12 @@ def make_database(plugin_id):
database = getattr(mod, pdata.databaseclass)
db = database()
import inspect
frame = inspect.currentframe()
c_frame = frame.f_back
c_code = c_frame.f_code
caller_frame = inspect.stack()[1]
_LOG.debug("Database class instance created Class:%s instance:%s. "
"Called from File %s, line %s, in %s",
db.__class__.__name__, hex(id(db)), c_code.co_filename,
c_frame.f_lineno, c_code.co_name)
"Called from File %s, line %s, in %s"
% ((db.__class__.__name__, hex(id(db)))
+ (os.path.split(caller_frame[1])[1],)
+ tuple(caller_frame[i] for i in range(2, 4))))
return db
else:
raise Exception("can't load database backend: '%s'" % plugin_id)
@@ -213,8 +209,8 @@ def write_lock_file(name):
if win():
user = get_env_var('USERNAME')
host = get_env_var('USERDOMAIN')
if not user:
user = _("Unknown")
if host is None:
host = ""
else:
host = os.uname()[1]
# An ugly workaround for os.getlogin() issue with Konsole
+4 -5
View File
@@ -29,6 +29,7 @@ Provide the database state class
#
#------------------------------------------------------------------------
import sys
import os
import logging
import inspect
@@ -87,12 +88,10 @@ class DbState(Callback):
"""
class_name = self.__class__.__name__
func_name = "is_open"
frame = inspect.currentframe()
c_frame = frame.f_back
c_code = c_frame.f_code
caller_frame = inspect.stack()[1]
_LOG.debug('calling %s.%s()... from file %s, line %s in %s',
class_name, func_name, c_code.co_filename, c_frame.f_lineno,
c_code.co_name)
class_name, func_name, os.path.split(caller_frame[1])[1],
caller_frame[2], caller_frame[3])
return (self.db is not None) and self.db.is_open()
def change_database(self, database):
@@ -28,6 +28,7 @@ from ._hascitation import HasCitation
from ._allcitations import AllCitations
from ._changedsince import ChangedSince
from ._citationprivate import CitationPrivate
from ._hasattribute import HasAttribute
from ._hasgallery import HasGallery
from ._hasidof import HasIdOf
from ._hasnote import HasNote
@@ -50,6 +51,7 @@ editor_rule_list = [
AllCitations,
ChangedSince,
CitationPrivate,
HasAttribute,
HasGallery,
HasIdOf,
HasNote,
@@ -0,0 +1,49 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2008 Gary Burton
# Copyright (C) 2019 Matthias Kemmer
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# -------------------------------------------------------------------------
#
# Standard Python modules
#
# -------------------------------------------------------------------------
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
# -------------------------------------------------------------------------
#
# Gramps modules
#
# -------------------------------------------------------------------------
from .._hasattributebase import HasAttributeBase
# -------------------------------------------------------------------------
#
# HasAttribute
#
# -------------------------------------------------------------------------
class HasAttribute(HasAttributeBase):
"""Rule that checks for a citation with a particular attribute"""
labels = [_('Citation attribute:'), _('Value:')]
name = _('Citations with the attribute <attribute>')
description = _("Matches citations with the attribute "
"of a particular value")
@@ -51,7 +51,6 @@ editor_rule_list = [
MediaPrivate,
MatchesFilter,
MatchesSourceConfidence,
HasMedia,
HasAttribute,
ChangedSince,
HasTag,
@@ -29,6 +29,7 @@ from ._disconnected import Disconnected
from ._everyone import Everyone
from ._familywithincompleteevent import FamilyWithIncompleteEvent
from ._hasaddress import HasAddress
from ._hasaddresstext import HasAddressText
from ._hasalternatename import HasAlternateName
from ._hasassociation import HasAssociation
from ._hasattribute import HasAttribute
@@ -125,6 +126,7 @@ editor_rule_list = [
IsBookmarked,
HasAlternateName,
HasAddress,
HasAddressText,
HasAssociation,
HasIdOf,
HasLDS,
@@ -0,0 +1,54 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2008 Brian G. Matherly
# Copyright (C) 2008 Jerome Rapinat
# Copyright (C) 2008 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
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# -------------------------------------------------------------------------
#
# Gramps modules
#
# -------------------------------------------------------------------------
from .. import Rule
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
# -------------------------------------------------------------------------
#
# HasAddressText
#
# -------------------------------------------------------------------------
class HasAddressText(Rule):
"""Rule that checks for text in personal addresses"""
labels = [_('Text:')]
name = _('People with an address containing <text>')
description = _("Matches people with a personal address containing "
"the given text")
category = _('General filters')
allow_regex = True
def apply(self, db, person):
for address in person.get_address_list():
for string in address.get_text_data_list():
if self.match_substring(0, string):
return True
return False
@@ -41,9 +41,9 @@ from .. import Rule
class IsDefaultPerson(Rule):
"""Rule that checks for a default person in the database"""
name = _('Home Person')
name = _('Default person')
category = _('General filters')
description = _("Matches the Home Person")
description = _("Matches the default person")
def prepare(self, db, user):
p = db.get_default_person()
@@ -44,10 +44,10 @@ class IsLessThanNthGenerationAncestorOfDefaultPerson(Rule):
not more than N generations away"""
labels = [ _('Number of generations:') ]
name = _('Ancestors of the Home Person '
name = _('Ancestors of the default person '
'not more than <N> generations away')
category = _('Ancestral filters')
description = _("Matches ancestors of the Home Person "
description = _("Matches ancestors of the default person "
"not more than N generations away")
def prepare(self, db, user):
@@ -52,7 +52,7 @@ class MatchesEventFilter(MatchesEventFilterBase):
name = _('Persons with events matching the <event filter>')
description = _("Matches persons who have events that match a certain"
" event filter")
category = _('Event filters')
category = _('General filters')
# we want to have this filter show event filters
namespace = 'Event'
@@ -37,10 +37,10 @@ import re
# Gramps modules
#
#-------------------------------------------------------------------------
from gramps.gen.errors import FilterError
from ....const import GRAMPS_LOCALE as glocale
from .. import Rule
from ....utils.place import conv_lat_lon
from gramps.gen.errors import FilterError
_ = glocale.translation.sgettext
@@ -81,13 +81,13 @@ class WithinArea(Rule):
"D.D8")
if self.latitude is None or self.longitude is None:
raise FilterError(_("Cannot use the filter 'within area'"),
_("The place you selected contains bad coordinates. "
"Please, run the tool 'clean input data'"))
return
_("The place you selected contains bad"
" coordinates. Please, run the tool "
"'clean input data'"))
val = self.list[1]
if isinstance(val, str):
val = re.sub(r"\D", "", val) # suppress all alpha characters
val = re.sub(r"\D", "", val) # suppress all alpha characters
value = int(val)
unit = int(self.list[2])
# earth perimeter in kilometers for latitude
@@ -25,6 +25,7 @@ Package providing filter rules for Gramps.
from ._allrepos import AllRepos
from ._hasidof import HasIdOf
from ._regexpidof import RegExpIdOf
from ._hasattribute import HasAttribute
from ._hasnoteregexp import HasNoteRegexp
from ._hasnotematchingsubstringof import HasNoteMatchingSubstringOf
from ._hasreferencecountof import HasReferenceCountOf
@@ -37,6 +38,7 @@ from ._hastag import HasTag
editor_rule_list = [
AllRepos,
HasAttribute,
HasIdOf,
RegExpIdOf,
HasNoteRegexp,
@@ -0,0 +1,49 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2008 Gary Burton
# Copyright (C) 2019 Matthias Kemmer
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# -------------------------------------------------------------------------
#
# Standard Python modules
#
# -------------------------------------------------------------------------
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
# -------------------------------------------------------------------------
#
# Gramps modules
#
# -------------------------------------------------------------------------
from .._hasattributebase import HasAttributeBase
# -------------------------------------------------------------------------
#
# HasAttribute
#
# -------------------------------------------------------------------------
class HasAttribute(HasAttributeBase):
"""Rule that checks for a repository with a particular attribute"""
labels = [_('Repository attribute:'), _('Value:')]
name = _('Repositories with the attribute <attribute>')
description = _("Matches repositories with the attribute "
"of a particular value")
@@ -27,6 +27,7 @@ Package providing filter rules for Gramps.
from .._hassourcebase import HasSourceBase as HasSource
from ._allsources import AllSources
from ._hasattribute import HasAttribute
from ._hasgallery import HasGallery
from ._hasidof import HasIdOf
from ._regexpidof import RegExpIdOf
@@ -45,6 +46,7 @@ from ._hastag import HasTag
editor_rule_list = [
AllSources,
HasAttribute,
HasGallery,
HasIdOf,
RegExpIdOf,
@@ -0,0 +1,49 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2008 Gary Burton
# Copyright (C) 2019 Matthias Kemmer
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# -------------------------------------------------------------------------
#
# Standard Python modules
#
# -------------------------------------------------------------------------
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
# -------------------------------------------------------------------------
#
# Gramps modules
#
# -------------------------------------------------------------------------
from .._hasattributebase import HasAttributeBase
# -------------------------------------------------------------------------
#
# HasAttribute
#
# -------------------------------------------------------------------------
class HasAttribute(HasAttributeBase):
"""Rule that checks for a source with a particular attribute"""
labels = [_('Source attribute:'), _('Value:')]
name = _('Sources with the attribute <attribute>')
description = _("Matches sources with the attribute "
"of a particular value")
@@ -99,8 +99,7 @@ class BaseTest(unittest.TestCase):
stime = perf_counter()
results = filter_.apply(self.db)
if __debug__:
frame = inspect.currentframe()
rulename = frame.f_back.f_code.co_name
rulename = inspect.stack()[1][3]
print("%s: %.2f\n" % (rulename, perf_counter() - stime))
return set(results)
+2 -4
View File
@@ -288,12 +288,10 @@ class GrampsType(object, metaclass=GrampsTypeMeta):
else:
return self.__value == value[0]
else:
if value.value == self._CUSTOM and self.__value == self._CUSTOM:
if value.value == self._CUSTOM:
return self.__string == value.string
elif value.value != self._CUSTOM and self.__value != self._CUSTOM:
return self.__value == value.value
else:
return False
return self.__value == value.value
def __ne__(self, value):
return not self.__eq__(value)
-1
View File
@@ -299,7 +299,6 @@ class StyledText:
"""
if self._tags:
the_tags = [tag.serialize() for tag in self._tags]
the_tags.sort()
else:
the_tags = []
+3 -3
View File
@@ -64,11 +64,11 @@ class Test1(unittest.TestCase):
C = self.C.join([self.A, self.S, deepcopy(self.B)])
C = C.replace('X', StyledText('_', [self.T3]))
_C = ('123_456\ncleartext\nabc_def',
[((0, ''), 'v3', [(3, 4)]),
((0, ''), 'v3', [(21, 22)]),
((1, ''), 'v1', [(0, 2), (2, 3)]),
[((1, ''), 'v1', [(0, 2), (2, 3)]),
((0, ''), 'v3', [(3, 4)]),
((1, ''), 'v1', [(4, 6)]),
((2, ''), 'v2', [(19, 21), (18, 21)]),
((0, ''), 'v3', [(21, 22)]),
((2, ''), 'v2', [(22, 23), (22, 25)])])
self.assertEqual(C.serialize(), _C)
+9 -14
View File
@@ -31,8 +31,8 @@ Provide merge capabilities for persons.
#-------------------------------------------------------------------------
from ..db import DbTxn
from ..const import GRAMPS_LOCALE as glocale
from ..errors import MergeError
_ = glocale.translation.sgettext
from ..errors import MergeError
#-------------------------------------------------------------------------
#
@@ -49,12 +49,11 @@ class MergePersonQuery:
self.titanic = titanic
if self.check_for_spouse(self.phoenix, self.titanic):
raise MergeError(_("Spouses cannot be merged. To merge these "
"people, you must first break the relationship"
" between them."))
"people, you must first break the relationship between them."))
if self.check_for_child(self.phoenix, self.titanic):
raise MergeError(_("A parent and child cannot be merged. To merge "
"these people, you must first break the relatio"
"nship between them."))
"these people, you must first break the relationship between "
"them."))
def check_for_spouse(self, person1, person2):
"""Return if person1 and person2 are spouses of eachother."""
@@ -81,12 +80,12 @@ class MergePersonQuery:
main_family.merge(family)
for childref in family.get_child_ref_list():
child = self.database.get_person_from_handle(
childref.get_reference_handle())
childref.get_reference_handle())
if main_family_handle in child.parent_family_list:
child.remove_handle_references('Family', [family_handle])
else:
child.replace_handle_reference('Family', family_handle,
main_family_handle)
main_family_handle)
self.database.commit_person(child, trans)
if self.phoenix:
self.phoenix.remove_family_handle(family_handle)
@@ -144,8 +143,7 @@ class MergePersonQuery:
for family_handle in self.phoenix.get_parent_family_handle_list():
family = self.database.get_family_from_handle(family_handle)
if family.has_handle_reference('Person', old_handle):
family.replace_handle_reference('Person', old_handle,
new_handle)
family.replace_handle_reference('Person', old_handle,new_handle)
self.database.commit_family(family, trans)
family_merge_guard = False
@@ -184,10 +182,7 @@ class MergePersonQuery:
self.database.commit_family(family, trans)
parent_list.append(parents)
hp_hdl = self.database.get_default_handle()
if (hp_hdl in (self.phoenix.get_handle(), self.titanic.get_handle())
and hp_hdl != self.phoenix.get_handle()):
self.database.set_default_person_handle(self.phoenix.get_handle())
if self.database.get_default_handle() == old_handle:
self.database.set_default_person_handle(None)
self.database.remove_person(old_handle, trans)
return family_merge_ok
+1 -1
View File
@@ -83,7 +83,7 @@ class BasePluginManager:
def __init__(self):
""" This function should only be run once by get_instance() """
if BasePluginManager.__instance != 1:
if BasePluginManager.__instance is not 1:
raise Exception("This class is a singleton. "
"Use the get_instance() method")
+1 -1
View File
@@ -1135,7 +1135,7 @@ class PluginRegister:
def __init__(self):
""" This function should only be run once by get_instance() """
if PluginRegister.__instance != 1:
if PluginRegister.__instance is not 1:
raise Exception("This class is a singleton. "
"Use the get_instance() method")
self.stable_only = True
+4 -8
View File
@@ -113,10 +113,6 @@ else:
_GS_CMD = where_is("gs")
def esc(id_txt):
return id_txt.replace('"', '\\"')
#------------------------------------------------------------------------------
#
# GVOptions
@@ -579,7 +575,7 @@ class GVDocBase(BaseDoc, GVDoc):
text += ' URL="%s"' % url
text += " ]"
self.write(' "%s" %s;\n' % (esc(node_id), text))
self.write(' "%s" %s;\n' % (node_id, text))
def add_link(self, id1, id2, style="", head="", tail="", comment=""):
"""
@@ -587,7 +583,7 @@ class GVDocBase(BaseDoc, GVDoc):
Implements GVDocBase.add_link().
"""
self.write(' "%s" -> "%s"' % (esc(id1), esc(id2)))
self.write(' "%s" -> "%s"' % (id1, id2))
if style or head or tail:
self.write(' [')
@@ -639,7 +635,7 @@ class GVDocBase(BaseDoc, GVDoc):
Implements GVDocBase.add_samerank().
"""
self.write(' {rank=same "%s" "%s"}\n' % (esc(id1), esc(id2)))
self.write(' {rank=same "%s" "%s"}\n' % (id1, id2))
def rewrite_label(self, id, label):
"""
@@ -647,7 +643,7 @@ class GVDocBase(BaseDoc, GVDoc):
Implements GVDocBase.rewrite_label().
"""
self.write(' "%s" [label = "%s"]\n' % (esc(id), label))
self.write(' "%s" [label = "%s"]\n' % (id, label))
def start_subgraph(self, graph_id):
""" Implement GVDocBase.start_subgraph() """
+76 -4
View File
@@ -69,6 +69,12 @@ _MARRIAGE = [{'name': _("Default"), 'value': ""},
{'name': _("Below"), 'value': "marriage below"},
{'name': _("Not shown"), 'value': "no marriage"}]
_OCCUPATION = [{'name': _("Do not include"), 'value': "no"},
{'name': _("Only description"), 'value': "basic"},
{'name': _("Use date"), 'value': "date"},
{'name': _("Use place"), 'value': "place"},
{'name': _("Use date and place"), 'value': "date place"}]
_COLOR = [{'name': _("None"), 'value': "none"},
{'name': _("Default"), 'value': "default"},
{'name': _("Preferences"), 'value': "preferences"}]
@@ -153,6 +159,12 @@ class TreeOptions:
marriage.set_help(_("Position of marriage information."))
menu.add_option(category, "marriage", marriage)
occupation = EnumeratedListOption(_("Occupation"), "")
for item in _OCCUPATION:
occupation.add_item(item["value"], item["name"])
occupation.set_help(_("Details of occupation information."))
menu.add_option(category, "occupation", occupation)
nodesize = NumberOption(_("Node size"), 25, 5, 100, 5)
nodesize.set_help(_("One dimension of a node, in mm. If the timeflow "
"is up or down then this is the width, otherwise "
@@ -282,6 +294,7 @@ class TreeDocBase(BaseDoc, TreeDoc):
self.detail = get_option('detail').get_value()
self.marriage = get_option('marriage').get_value()
self.occupation = get_option('occupation').get_value()
self.nodesize = get_option('nodesize').get_value()
self.levelsize = get_option('levelsize').get_value()
self.nodecolor = get_option('nodecolor').get_value()
@@ -302,7 +315,7 @@ class TreeDocBase(BaseDoc, TreeDoc):
name = paper_size.get_name().lower()
if name == 'custom size':
width = str(paper_size.get_width())
height = str(paper_size.get_height())
height = str(paper_size.get_width())
paper = 'papersize={%scm,%scm}' % (width, height)
elif name in ('a', 'b', 'c', 'd', 'e'):
paper = 'ansi' + name + 'paper'
@@ -449,8 +462,9 @@ class TreeDocBase(BaseDoc, TreeDoc):
# Comparison with 'Occupation' for backwards compatibility with Gramps 5.0
attr_type = str(attr.get_type())
if attr_type in ('Occupation', _('Occupation')):
self.write(level+1, 'profession = {%s},\n' %
escape(attr.get_value()))
if self.occupation != "no":
self.write(level+1, 'profession = {%s},\n' %
escape(attr.get_value()))
if attr_type == 'Comment':
self.write(level+1, 'comment = {%s},\n' %
escape(attr.get_value()))
@@ -494,6 +508,8 @@ class TreeDocBase(BaseDoc, TreeDoc):
elif event.type == EventType.CREMATION:
event_type = 'burial'
modifier = 'cremated'
elif event.type == EventType.OCCUPATION:
event_type = 'occupation'
else:
return
@@ -519,7 +535,17 @@ class TreeDocBase(BaseDoc, TreeDoc):
date_str = date_str + '/' + stop_date
place = escape(_pd.display_event(db, event))
place = place.replace("-", "\--")
if event_type == 'occupation' and self.occupation != "no":
description = escape(event.description)
self.write(level, 'profession = {%s}' % description)
if self.occupation == "date":
self.write(level+1, '{%s}' % date_str)
if self.occupation == "place":
self.write(level+1, '{%s}' % place)
if self.occupation == "date place":
self.write(level+1, '{%s}\, {%s}' % (date_str, place))
self.write(level, ',\n')
if modifier:
event_type += '+'
@@ -587,6 +613,47 @@ class TreeDocBase(BaseDoc, TreeDoc):
self.write_end()
#------------------------------------------------------------------------------
#
# TreeGraphDoc
#
#------------------------------------------------------------------------------
class TreeGraphDoc(TreeDocBase):
"""
TreeGraphDoc implementation that generates a .graph file.
"""
def write_start(self):
"""
Write the start of the document - nothing for a graph file.
"""
pass
def start_tree(self, option_list):
"""
Write the start of a tree - nothing for a graph file.
"""
pass
def end_tree(self):
"""
Write the end of a tree - nothing for a graph file.
"""
pass
def write_end(self):
"""
Write the end of the document - nothing for a graph file.
"""
pass
def close(self):
""" Implements TreeDocBase.close() """
TreeDocBase.close(self)
with open(self._filename, 'w', encoding='utf-8') as texfile:
texfile.write(self._tex.getvalue())
#------------------------------------------------------------------------------
#
# TreeTexDoc
@@ -654,6 +721,11 @@ if _LATEX_FOUND:
'mime' : "application/pdf",
'class': TreePdfDoc}]
FORMATS += [{'type' : "graph",
'ext' : "graph",
'descr': _("Graph File for genealogytree"),
'class': TreeGraphDoc}]
FORMATS += [{'type' : "tex",
'ext' : "tex",
'descr': _("LaTeX File"),
-3
View File
@@ -62,7 +62,6 @@ class EnumeratedListOption(Option):
:type value: int
:return: nothing
"""
self.ini_value = value
Option.__init__(self, label, value)
self.__items = []
self.__xml_items = []
@@ -139,8 +138,6 @@ class EnumeratedListOption(Option):
"""
if value in (v for v, d in self.__items):
Option.set_value(self, value)
elif value == self.ini_value:
return
else:
logging.warning(_("Value '%(val)s' not found for option '%(opt)s'") %
{'val' : str(value), 'opt' : self.get_label()})
-5
View File
@@ -769,7 +769,6 @@ def sanitize_citation(db, citation):
new_citation.set_gramps_id(citation.get_gramps_id())
new_citation.set_handle(citation.get_handle())
new_citation.set_change_time(citation.get_change_time())
new_citation.set_tag_list(citation.get_tag_list())
copy_srcattributes(db, citation, new_citation)
copy_notes(db, citation, new_citation)
copy_media_ref_list(db, citation, new_citation)
@@ -915,7 +914,6 @@ def sanitize_source(db, source):
new_source.set_gramps_id(source.get_gramps_id())
new_source.set_handle(source.get_handle())
new_source.set_change_time(source.get_change_time())
new_source.set_tag_list(source.get_tag_list())
for repo_ref in source.get_reporef_list():
if repo_ref and not repo_ref.get_privacy():
@@ -989,7 +987,6 @@ def sanitize_place(db, place):
new_place.set_type(place.get_type())
new_place.set_code(place.get_code())
new_place.set_placeref_list(place.get_placeref_list())
new_place.set_tag_list(place.get_tag_list())
copy_citation_ref_list(db, place, new_place)
copy_notes(db, place, new_place)
@@ -1020,7 +1017,6 @@ def sanitize_event(db, event):
new_event.set_handle(event.get_handle())
new_event.set_date_object(event.get_date_object())
new_event.set_change_time(event.get_change_time())
new_event.set_tag_list(event.get_tag_list())
copy_citation_ref_list(db, event, new_event)
copy_notes(db, event, new_event)
@@ -1124,7 +1120,6 @@ def sanitize_repository(db, repository):
new_repository.set_gramps_id(repository.get_gramps_id())
new_repository.set_handle(repository.get_handle())
new_repository.set_change_time(repository.get_change_time())
new_repository.set_tag_list(repository.get_tag_list())
copy_notes(db, repository, new_repository)
copy_addresses(db, repository, new_repository)
-2
View File
@@ -142,8 +142,6 @@ class ProbablyAlive:
# person died more than MAX after current year
if death_date.is_valid():
birth_date = death_date.copy_offset_ymd(year=-self.MAX_AGE_PROB_ALIVE)
else:
birth_date = death_date
explain = _("death date")
if not death_date and birth_date:
+6 -10
View File
@@ -324,16 +324,12 @@ class Callback:
return
# Check signal exists
frame = inspect.currentframe()
c_frame = frame.f_back
c_code = c_frame.f_code
frame_info = (c_code.co_filename, c_frame.f_lineno, c_code.co_name)
if signal_name not in self.__signal_map:
self._warn("Attempt to emit to unknown signal: %s\n"
" from: file: %s\n"
" line: %d\n"
" func: %s\n"
% ((str(signal_name), ) + frame_info))
% ((str(signal_name), ) + inspect.stack()[1][1:4]))
return
# check that the signal is not already being emitted. This prevents
@@ -344,7 +340,7 @@ class Callback:
" from: file: %s\n"
" line: %d\n"
" func: %s\n"
% ((str(signal_name), ) + frame_info))
% ((str(signal_name), ) + inspect.stack()[1][1:4]))
return
try:
@@ -362,7 +358,7 @@ class Callback:
" from: file: %s\n"
" line: %d\n"
" func: %s\n"
% ((str(signal_name), ) + frame_info))
% ((str(signal_name), ) + inspect.stack()[1][1:4]))
return
# type check arguments
@@ -373,7 +369,7 @@ class Callback:
" from: file: %s\n"
" line: %d\n"
" func: %s\n"
% ((str(signal_name), ) + frame_info))
% ((str(signal_name), ) + inspect.stack()[1][1:4]))
return
if len(args) > 0:
@@ -383,7 +379,7 @@ class Callback:
" from: file: %s\n"
" line: %d\n"
" func: %s\n"
% ((str(signal_name), ) + frame_info))
% ((str(signal_name), ) + inspect.stack()[1][1:4]))
return
if arg_types is not None:
@@ -395,7 +391,7 @@ class Callback:
" line: %d\n"
" func: %s\n"
" arg passed was: %s, type of arg passed %s, type should be: %s\n"
% ((str(signal_name), ) + frame_info +\
% ((str(signal_name), ) + inspect.stack()[1][1:4] +\
(args[i], repr(type(args[i])), repr(arg_types[i]))))
return
if signal_name in self.__callback_map:
+1 -1
View File
@@ -49,7 +49,7 @@ class CSVTab(TabbedDoc):
else:
self.filename = filename
self.f = open(self.filename, "w", newline='',
self.f = open(self.filename, "w",
encoding='utf_8_sig' if win() else 'utf_8')
self.writer = csv.writer(self.f)
+1 -3
View File
@@ -117,7 +117,7 @@ _LOCALE_NAMES = {
_RTL_LOCALES = ('ar', 'he')
# locales with less than 70% currently translated
INCOMPLETE_TRANSLATIONS = ('ar', 'bg', 'he', 'sq', 'ta', 'tr')
INCOMPLETE_TRANSLATIONS = ('ar', 'bg', 'he', 'ja', 'sq', 'ta', 'tr')
def _check_mswin_locale(locale):
msloc = None
@@ -525,8 +525,6 @@ class GrampsLocale:
# with locale instead of gettext. Win32 doesn't support bindtextdomain.
if self.localedir:
if not sys.platform == 'win32':
# bug12278, _build_popup_ui() under linux and macOS
locale.textdomain(self.localedomain)
locale.bindtextdomain(self.localedomain, self.localedir)
else:
self._win_bindtextdomain(self.localedomain.encode('utf-8'),
+2 -2
View File
@@ -161,12 +161,12 @@ def image_size(source):
:returns: a tuple consisting of the width and height
"""
from gi.repository import GdkPixbuf
from gi.repository import GObject
from gi.repository import GLib
try:
img = GdkPixbuf.Pixbuf.new_from_file(source)
width = img.get_width()
height = img.get_height()
except GObject.GError:
except GLib.GError:
width = 0
height = 0
return (width, height)
+4 -4
View File
@@ -36,7 +36,7 @@ from hashlib import md5
# GTK/Gnome modules
#
#-------------------------------------------------------------------------
from gi.repository import GObject
from gi.repository import GLib
from gi.repository import GdkPixbuf
try:
@@ -98,7 +98,7 @@ def __get_gconf_string(key):
"""
try:
val = CLIENT.get_string(key)
except GObject.GError:
except GLib.GError:
val = None
return str(val)
@@ -119,7 +119,7 @@ def __get_gconf_bool(key):
"""
try:
val = CLIENT.get_bool(key)
except GObject.GError:
except GLib.GError:
val = None
return val
@@ -318,7 +318,7 @@ def get_thumbnail_image(src_file, mtype=None, rectangle=None, size=SIZE_NORMAL):
try:
filename = get_thumbnail_path(src_file, mtype, rectangle, size)
return GdkPixbuf.Pixbuf.new_from_file(filename)
except (GObject.GError, OSError):
except (GLib.GError, OSError):
if mtype:
return find_mime_type_pixbuf(mtype)
else:
+9 -26
View File
@@ -126,33 +126,16 @@ if win():
pass # ok
elif not os.path.isdir(HOME_DIR):
os.makedirs(HOME_DIR)
sys.stdout = sys.stderr = open(logfile, "w", encoding='utf-8')
# macOS sets stderr to /dev/null when running without a terminal,
# e.g. if Gramps.app is lauched by double-clicking on it in
# finder. Write to a file instead.
if mac() and not sys.stdin.isatty():
from tempfile import gettempdir
sys.stdout = sys.stderr = open(logfile, "w")
stderrh = logging.StreamHandler(sys.stderr)
stderrh.setFormatter(form)
stderrh.setLevel(logging.DEBUG)
log_file_name = 'gramps-' + str(os.getpid()) + '.log'
log_file_path = os.path.join(gettempdir(), log_file_name)
log_file_handler = logging.FileHandler(log_file_path, mode='a',
encoding='utf-8')
log_file_handler.setFormatter(form)
log_file_handler.setLevel(logging.DEBUG)
logger = logging.getLogger()
logger.setLevel(logging.WARNING)
logger.addHandler(log_file_handler)
else:
stderrh = logging.StreamHandler(sys.stderr)
stderrh.setFormatter(form)
stderrh.setLevel(logging.DEBUG)
# Setup the base level logger, this one gets
# everything.
l = logging.getLogger()
l.setLevel(logging.WARNING)
l.addHandler(stderrh)
# Setup the base level logger, this one gets
# everything.
l = logging.getLogger()
l.setLevel(logging.WARNING)
l.addHandler(stderrh)
def exc_hook(err_type, value, t_b):
+21 -38
View File
@@ -471,36 +471,27 @@ class ClipCitation(ClipHandleWrapper):
def refresh(self):
if self._handle:
try:
citation = clipdb.get_citation_from_handle(self._handle)
if citation:
self._title = citation.get_gramps_id()
notelist = list(map(clipdb.get_note_from_handle,
citation.get_note_list()))
srctxtlist = [note for note in notelist
if note.get_type() == NoteType.SOURCE_TEXT]
page = citation.get_page()
if not page:
page = _('not available|NA')
text = ""
if srctxtlist:
text = " ".join(srctxtlist[0].get().split())
#String must be unicode for truncation to work for non
#ascii characters
text = str(text)
if len(text) > 60:
text = text[:60] + "..."
self._value = _("Volume/Page: %(pag)s -- %(sourcetext)s"
) % { 'pag' : page,
'sourcetext' : text}
except:
# We are in the Source tree view. The shortcuts only
# work for citations.
print("We cannot copy the source from this view."
" Use drag and drop.")
self._title = self._value = ''
self._pickle = self._type = self._objclass = None
self._handle = self._dbid = self._dbname = None
citation = clipdb.get_citation_from_handle(self._handle)
if citation:
self._title = citation.get_gramps_id()
notelist = list(map(clipdb.get_note_from_handle,
citation.get_note_list()))
srctxtlist = [note for note in notelist
if note.get_type() == NoteType.SOURCE_TEXT]
page = citation.get_page()
if not page:
page = _('not available|NA')
text = ""
if srctxtlist:
text = " ".join(srctxtlist[0].get().split())
#String must be unicode for truncation to work for non
#ascii characters
text = str(text)
if len(text) > 60:
text = text[:60] + "..."
self._value = _("Volume/Page: %(pag)s -- %(sourcetext)s") % {
'pag' : page,
'sourcetext' : text}
class ClipRepoRef(ClipObjWrapper):
@@ -1290,14 +1281,6 @@ class ClipboardListView:
model.insert_before(node, data)
else:
model.insert_after(node, data)
elif isinstance(data[1], ClipCitation):
if data[3]:
# we have a real citation
model.append(data)
#else:
# We are in a Source treeview and trying
# to copy a source with a shortcut.
# Use drag and drop to do that.
else:
model.append(data)
+14 -23
View File
@@ -690,7 +690,7 @@ class GrampsPreferences(ConfigureDialog):
hbox.pack_start(lwidget, False, False, 0)
hbox.pack_start(self.color_scheme_box, False, False, 0)
restore_btn = Gtk.Button(_('Restore to defaults'))
restore_btn = Gtk.Button(label=_('Restore to defaults'))
restore_btn.set_tooltip_text(
_('Restore colors for current theme to default.'))
restore_btn.connect('clicked', self.restore_colors)
@@ -1241,7 +1241,7 @@ class GrampsPreferences(ConfigureDialog):
row, 'preferences.place-auto', start=0, stop=1,
extra_callback=self.auto_title_changed,
tooltip=_("Enables automatic place title generation "
"using specified format."))
"using specifed format."))
self.auto_title_changed(cb_widget)
hbox.pack_start(self.pformat, True, True, 0)
hbox.pack_start(self.fmt_btn, False, False, 0)
@@ -1573,7 +1573,7 @@ class GrampsPreferences(ConfigureDialog):
self.add_checkbox(grid, _('Add tag on import'), current_line,
cb_const, stop=2,
extra_callback=self.toggle_tag_on_import,
tooltip=_("Specified tag will be added on import.\n"
tooltip=_("Specifed tag will be added on import.\n"
"Clear to set default value."))
grid.attach(self.tag_format_entry, 2, current_line, 1, 1)
@@ -1828,12 +1828,10 @@ class GrampsPreferences(ConfigureDialog):
Show dialog to choose media directory.
"""
f = Gtk.FileChooserDialog(title=_("Select media directory"),
parent=self.window,
action=Gtk.FileChooserAction.SELECT_FOLDER,
buttons=(_('_Cancel'),
Gtk.ResponseType.CANCEL,
_('_Apply'),
Gtk.ResponseType.OK))
transient_for=self.window,
action=Gtk.FileChooserAction.SELECT_FOLDER)
f.add_buttons(_('_Cancel'), Gtk.ResponseType.CANCEL,
_('_Apply'), Gtk.ResponseType.OK)
mpath = media_path(self.dbstate.db)
f.set_current_folder(os.path.dirname(mpath))
@@ -1878,12 +1876,10 @@ class GrampsPreferences(ConfigureDialog):
Show dialog to choose backup directory.
"""
f = Gtk.FileChooserDialog(title=_("Select backup directory"),
parent=self.window,
action=Gtk.FileChooserAction.SELECT_FOLDER,
buttons=(_('_Cancel'),
Gtk.ResponseType.CANCEL,
_('_Apply'),
Gtk.ResponseType.OK))
transient_for=self.window,
action=Gtk.FileChooserAction.SELECT_FOLDER)
f.add_buttons(_('_Cancel'), Gtk.ResponseType.CANCEL,
_('_Apply'), Gtk.ResponseType.OK)
backup_path = config.get('database.backup-path')
if not backup_path:
backup_path = config.get('database.path')
@@ -2163,11 +2159,9 @@ class GrampsPreferences(ConfigureDialog):
scrollw.set_size_request(600, 100)
text = Gtk.Label()
text.set_line_wrap(True)
font_description = Pango.font_description_from_string(font)
text.modify_font(font_description)
self.activate_change_font()
text.set_halign(Gtk.Align.START)
text.set_text(my_characters)
text.set_markup("<span font='%s'>%s</span>" % (font, my_characters))
scrollw.add(text)
scrollw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
self.grid.attach(scrollw, 1, 7, 8, 1)
@@ -2180,12 +2174,9 @@ class GrampsPreferences(ConfigureDialog):
my_characters += symbols.get_death_symbol_for_char(death_symbl)
text = Gtk.Label()
text.set_line_wrap(True)
font_description = Pango.font_description_from_string(font)
text.modify_font(font_description)
text.set_halign(Gtk.Align.START)
text.set_markup("<big><big><big><big>" +
my_characters +
"</big></big></big></big>")
text.set_markup("<big><big><big><big><span font='%s'>%s</span>"
"</big></big></big></big>" % (font, my_characters))
self.grid.attach(text, 1, 8, 8, 1)
scrollw.show_all()
text.show_all()
+6 -10
View File
@@ -317,13 +317,6 @@ def add_all_files_filter(chooser):
mime_filter.add_pattern('*')
chooser.add_filter(mime_filter)
def icase(ext):
"""
Return a glob reresenting a case insensitive file extension.
"""
return ''.join(['[{}{}]'.format(s.lower(), s.upper()) for s in ext])
#-------------------------------------------------------------------------
#
# Format selectors: explictly set the format of the file
@@ -387,7 +380,7 @@ class GrampsLoginDialog(ManagedWindow):
self.title = _("Login")
ManagedWindow.__init__(self, uistate, [], self.__class__, modal=True)
dialog = Gtk.Dialog(parent=uistate.window)
dialog = Gtk.Dialog(transient_for=uistate.window)
grid = Gtk.Grid()
grid.set_border_width(6)
grid.set_row_spacing(6)
@@ -453,7 +446,8 @@ class GrampsImportFileDialog(ManagedWindow):
file_filter = Gtk.FileFilter()
name = "%s (.%s)" % (plugin.get_name(), plugin.get_extension())
file_filter.set_name(name)
file_filter.add_pattern("*.%s" % icase(plugin.get_extension()))
file_filter.add_pattern("*.%s" % plugin.get_extension())
file_filter.add_pattern(plugin.get_extension().capitalize())
import_dialog.add_filter(file_filter)
(box, type_selector) = format_maker()
@@ -532,7 +526,7 @@ class GrampsImportFileDialog(ManagedWindow):
return True
else:
try:
f = open(filename, 'w')
f = file(filename,'w')
f.close()
os.remove(filename)
except IOError:
@@ -548,6 +542,7 @@ class GrampsImportFileDialog(ManagedWindow):
self.import_info = None
self._begin_progress()
self.uistate.set_sensitive(False)
self.uistate.viewmanager.enable_menu(False)
try:
#an importer can return an object with info, object.info_text()
@@ -568,6 +563,7 @@ class GrampsImportFileDialog(ManagedWindow):
except Exception:
_LOG.error("Failed to import database.", exc_info=True)
self.uistate.set_sensitive(True)
self.uistate.viewmanager.enable_menu(True)
self._end_progress()
def build_menu_names(self, obj): # this is meaningless since it's modal
+1 -1
View File
@@ -1013,7 +1013,7 @@ class DbManager(CLIDbManager, ManagedWindow):
"""
Handle the reception of drag data
"""
drag_value = selection.get_data().decode().strip(' \r\n\x00')
drag_value = selection.get_data().decode()
fname = None
type = None
title = None
+1 -4
View File
@@ -520,10 +520,7 @@ class DisplayState(Callback):
history.push(handle)
def set_sensitive(self, state):
tbar = self.uimanager.get_widget('ToolBar')
tbar.set_sensitive(state)
self.viewmanager.hpane.set_sensitive(state)
self.uimanager.enable_all_actions(state)
self.window.set_sensitive(state)
def db_changed(self, db):
db.connect('long-op-start', self.progress_monitor.add_op)
@@ -46,7 +46,7 @@ from html import escape
#
#-------------------------------------------------------------------------
from ...widgets.undoablebuffer import UndoableBuffer
from gramps.gen.lib import (EventRoleType, EventType, Date)
from gramps.gen.lib import EventRoleType
from gramps.gen.datehandler import get_date, get_date_valid
from gramps.gen.config import config
from gramps.gen.utils.db import get_participant_from_event
@@ -175,12 +175,7 @@ class EventRefModel(Gtk.TreeStore):
"""
date = event.get_date_object()
if date and self.start_date:
if (date == self.start_date and date.modifier == Date.MOD_NONE
and not (event.get_type().is_death_fallback() or
event.get_type() == EventType.DEATH)):
return ""
else:
return (date - self.start_date).format(precision=age_precision)
return (date - self.start_date).format(precision=age_precision)
else:
return ""
+9 -10
View File
@@ -38,7 +38,7 @@ from gramps.gen.lib import EventType, NoteType
from gramps.gen.db import DbTxn
from ..glade import Glade
from .displaytabs import (CitationEmbedList, NoteTab, GalleryTab,
EventBackRefList, EventAttrEmbedList)
EventBackRefList, AttrEmbedList)
from ..widgets import (PrivacyButton, MonitoredEntry,
MonitoredDate, MonitoredDataType, MonitoredTagList)
from .editreference import RefTab, EditReference
@@ -209,10 +209,10 @@ class EditEventRef(EditReference):
self._add_tab(notebook, self.srcref_list)
self.track_ref_for_deletion("srcref_list")
self.attr_list = EventAttrEmbedList(self.dbstate,
self.uistate,
self.track,
self.source.get_attribute_list())
self.attr_list = AttrEmbedList(self.dbstate,
self.uistate,
self.track,
self.source.get_attribute_list())
self._add_tab(notebook, self.attr_list)
self.track_ref_for_deletion("attr_list")
@@ -247,11 +247,10 @@ class EditEventRef(EditReference):
self._add_tab(notebook, self.backref_tab)
self.track_ref_for_deletion("backref_tab")
self.attr_ref_list = EventAttrEmbedList(
self.dbstate,
self.uistate,
self.track,
self.source_ref.get_attribute_list())
self.attr_ref_list = AttrEmbedList(self.dbstate,
self.uistate,
self.track,
self.source_ref.get_attribute_list())
self._add_tab(notebook_ref, self.attr_ref_list)
self.track_ref_for_deletion("attr_ref_list")
+7 -6
View File
@@ -42,6 +42,7 @@ import pickle
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import Pango
from gi.repository.GLib import markup_escape_text
#-------------------------------------------------------------------------
#
@@ -435,7 +436,6 @@ class EditPerson(EditPrimary):
obj.connect('changed', self._changed_name)
self.preview_name = self.top.get_object("full_name")
self.preview_name.override_font(Pango.FontDescription('sans bold 12'))
self.surntab = SurnameTab(self.dbstate, self.uistate, self.track,
self.obj.get_primary_name(),
on_change=self._changed_name)
@@ -550,7 +550,9 @@ class EditPerson(EditPrimary):
Update the window title, and default name in name tab
"""
self.update_title(self.get_menu_title())
self.preview_name.set_text(self.get_preview_name())
self.preview_name.set_markup(
"<span size='x-large' weight='bold'>%s</span>" %
markup_escape_text(self.get_preview_name(), -1))
self.name_list.update_defname()
def name_callback(self):
@@ -638,7 +640,6 @@ class EditPerson(EditPrimary):
"""
self.imgmenu = Gtk.Menu()
menu = self.imgmenu
menu.set_title(_("Media Object"))
obj = self.db.get_media_from_handle(photo.get_reference_handle())
if obj:
add_menuitem(menu, _("View"), photo,
@@ -1086,9 +1087,9 @@ class EditPerson(EditPrimary):
class GenderDialog(Gtk.MessageDialog):
def __init__(self, parent=None):
Gtk.MessageDialog.__init__(self,
parent,
flags=Gtk.DialogFlags.MODAL,
type=Gtk.MessageType.QUESTION,
transient_for=parent,
modal=True,
message_type=Gtk.MessageType.QUESTION,
)
self.set_icon(ICON)
self.set_title('')
+3 -10
View File
@@ -187,16 +187,9 @@ class EditPlace(EditPrimary):
def set_latlongitude(self, value):
try:
# Bug 12349
parts = value.split(', ')
if len(parts) == 2:
longitude = parts[0].strip().replace(',', '.')
latitude = parts[1].strip().replace(',', '.')
else:
longitude, latitude = value.split(',')
self.longitude.set_text(longitude)
self.latitude.set_text(latitude)
coma = value.index(',')
self.longitude.set_text(value[coma+1:].strip())
self.latitude.set_text(value[:coma].strip())
self.top.get_object("lat_entry").validate(force=True)
self.top.get_object("lon_entry").validate(force=True)
self.obj.set_latitude(self.latitude.get_value())
+3 -10
View File
@@ -180,16 +180,9 @@ class EditPlaceRef(EditReference):
def set_latlongitude(self, value):
try:
# Bug 12349
parts = value.split(', ')
if len(parts) == 2:
longitude = parts[0].strip().replace(',', '.')
latitude = parts[1].strip().replace(',', '.')
else:
longitude, latitude = value.split(',')
self.longitude.set_text(longitude)
self.latitude.set_text(latitude)
coma = value.index(',')
self.longitude.set_text(value[coma+1:].strip())
self.latitude.set_text(value[:coma].strip())
self.top.get_object("lat_entry").validate(force=True)
self.top.get_object("lon_entry").validate(force=True)
self.source.set_latitude(self.latitude.get_value())
+1 -1
View File
@@ -101,7 +101,7 @@ class EditTagList(ManagedWindow):
Create a dialog box to select tags.
"""
# pylint: disable-msg=E1101
top = Gtk.Dialog(parent=self.uistate.window)
top = Gtk.Dialog(transient_for=self.uistate.window)
top.vbox.set_spacing(5)
columns = [('', -1, 300),
+3 -5
View File
@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.2 -->
<!-- Generated with glade 3.18.3 -->
<interface>
<requires lib="gtk+" version="3.10"/>
<requires lib="grampswidgets" version="0.0"/>
<object class="GtkDialog" id="editplace">
<property name="can_focus">False</property>
<property name="type_hint">dialog</property>
<child type="titlebar">
<placeholder/>
</child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox19">
<property name="visible">True</property>
@@ -103,7 +101,7 @@
<child>
<object class="GtkLabel" id="comment1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Either use the two fields below to enter coordinates (latitude and longitude),</property>
<property name="hexpand">True</property>
+1 -1
View File
@@ -618,7 +618,7 @@ class Gramps:
and not gettext.find(GTK_GETTEXT_DOMAIN)):
_display_gtk_gettext_message(parent=self._vm.window)
#_display_welcome_message(parent=self._vm.window)
_display_welcome_message(parent=self._vm.window)
_display_translator_message(parent=self._vm.window)
+21 -14
View File
@@ -284,7 +284,8 @@ class ErrorReportAssistant(ManagedWindow, Gtk.Assistant):
"information included in the error please remove "
"it."))
label.set_halign(Gtk.Align.START)
label.set_padding(0, 4)
label.set_margin_top(4)
label.set_margin_bottom(4)
label.set_line_wrap(True)
swin = Gtk.ScrolledWindow()
@@ -300,9 +301,9 @@ class ErrorReportAssistant(ManagedWindow, Gtk.Assistant):
sw_frame = Gtk.Frame()
sw_frame.add(swin)
reset = Gtk.Button("Reset")
reset = Gtk.Button(label="Reset")
reset.connect('clicked', self._reset_error_details)
clear = Gtk.Button("Clear")
clear = Gtk.Button(label="Clear")
clear.connect('clicked', self._clear_error_details)
button_box = Gtk.ButtonBox()
@@ -364,7 +365,8 @@ class ErrorReportAssistant(ManagedWindow, Gtk.Assistant):
"remove anything that you would rather not have "
"included in the bug report."))
label.set_halign(Gtk.Align.START)
label.set_padding(0, 4)
label.set_margin_top(4)
label.set_margin_bottom(4)
label.set_line_wrap(True)
swin = Gtk.ScrolledWindow()
@@ -380,9 +382,9 @@ class ErrorReportAssistant(ManagedWindow, Gtk.Assistant):
sw_frame = Gtk.Frame()
sw_frame.add(swin)
reset = Gtk.Button("Reset")
reset = Gtk.Button(label="Reset")
reset.connect('clicked', self._reset_sys_information)
clear = Gtk.Button("Clear")
clear = Gtk.Button(label="Clear")
clear.connect('clicked', self._clear_sys_information)
@@ -441,7 +443,8 @@ class ErrorReportAssistant(ManagedWindow, Gtk.Assistant):
"can about what you were doing when the error "
"occurred."))
label.set_halign(Gtk.Align.START)
label.set_padding(0, 4)
label.set_margin_top(4)
label.set_margin_bottom(4)
label.set_line_wrap(True)
swin = Gtk.ScrolledWindow()
@@ -456,7 +459,7 @@ class ErrorReportAssistant(ManagedWindow, Gtk.Assistant):
sw_frame = Gtk.Frame()
sw_frame.add(swin)
clear = Gtk.Button("Clear")
clear = Gtk.Button(label="Clear")
clear.connect('clicked', self._clear_user_information)
button_box = Gtk.ButtonBox()
@@ -514,7 +517,8 @@ class ErrorReportAssistant(ManagedWindow, Gtk.Assistant):
"that it does not contain anything that you do not "
"want to be sent to the developers."))
label.set_halign(Gtk.Align.START)
label.set_padding(0, 4)
label.set_margin_top(4)
label.set_margin_bottom(4)
label.set_line_wrap(True)
swin = Gtk.ScrolledWindow()
@@ -580,7 +584,8 @@ class ErrorReportAssistant(ManagedWindow, Gtk.Assistant):
"clipboard and then open a webbrowser to file a bug report at "),
URL_BUGTRACKER))
label.set_halign(Gtk.Align.START)
label.set_padding(0, 4)
label.set_margin_top(4)
label.set_margin_bottom(4)
label.set_line_wrap(True)
label.set_use_markup(True)
@@ -589,11 +594,12 @@ class ErrorReportAssistant(ManagedWindow, Gtk.Assistant):
"and file a bug report on the Gramps bug "
"tracking system."))
url_label.set_halign(Gtk.Align.START)
url_label.set_padding(0, 4)
url_label.set_margin_top(4)
url_label.set_margin_bottom(4)
url_label.set_line_wrap(True)
url_label.set_size_request(200, -1)
url_button = Gtk.Button("File bug report")
url_button = Gtk.Button(label="File bug report")
url_button.connect('clicked', self._start_gramps_bts_in_browser)
url_button_vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
url_button_vbox.pack_start(url_button, True, False, 0)
@@ -613,11 +619,12 @@ class ErrorReportAssistant(ManagedWindow, Gtk.Assistant):
"the button below, paste the report and click "
"submit report"))
clip_label.set_halign(Gtk.Align.START)
clip_label.set_padding(0, 4)
clip_label.set_margin_top(4)
clip_label.set_margin_bottom(4)
clip_label.set_line_wrap(True)
clip_label.set_size_request(200, -1)
clip_button = Gtk.Button("Copy to clipboard")
clip_button = Gtk.Button(label="Copy to clipboard")
clip_button.connect('clicked', self._copy_to_clipboard)
clip_button_vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
clip_button_vbox.pack_start(clip_button, True, False, 0)
+1 -1
View File
@@ -105,7 +105,7 @@ class ErrorView(ManagedWindow):
def draw_window(self):
title = "%s - Gramps" % _("Error Report")
self.top = Gtk.Dialog(title)
self.top = Gtk.Dialog(title=title)
# look over the top level windows, it seems the oldest come first, so
# the most recent still visible window appears to be a good choice for
# a transient parent
-22
View File
@@ -32,14 +32,6 @@ the create/deletion of dialog windows.
import os
from io import StringIO
import html
import logging
#-------------------------------------------------------------------------
#
# Set up logging
#
#-------------------------------------------------------------------------
_LOG = logging.getLogger(".")
#-------------------------------------------------------------------------
#
# GNOME/GTK
@@ -583,9 +575,6 @@ class ManagedWindow:
Takes care of closing children and removing itself from menu.
"""
if hasattr(self, 'opened') and not self.opened:
_LOG.warning("Tried to close a ManagedWindow more than once.")
return # in case close somehow gets called again
self.opened = False
self._save_position(save_config=False) # the next line will save it
self._save_size()
@@ -633,17 +622,6 @@ class ManagedWindow:
if self.horiz_position_key is not None:
horiz_position = config.get(self.horiz_position_key)
vert_position = config.get(self.vert_position_key)
# make sure some of left side shows on screen
# for part time multi monitor setups
screen = Gtk.Window().get_screen()
s_width = screen.get_width()
s_height = screen.get_height()
if horiz_position > s_width - 50 or vert_position > s_height - 50:
(p_width, p_height) = self.parent_window.get_size()
(p_horiz, p_vert) = self.parent_window.get_position()
(w_width, w_height) = self.window.get_size()
horiz_position = p_horiz + ((p_width - w_width) // 2)
vert_position = p_vert + ((p_height - w_height) // 2)
self.window.move(horiz_position, vert_position)
def _save_position(self, save_config=True):
+11 -13
View File
@@ -75,16 +75,17 @@ class LastNameDialog(ManagedWindow):
def __init__(self, database, uistate, track, surnames, skip_list=set()):
ManagedWindow.__init__(self, uistate, track, self, modal=True)
flags = Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT
buttons = (_('_Cancel'), Gtk.ResponseType.REJECT,
_('_OK'), Gtk.ResponseType.ACCEPT)
self.__dlg = Gtk.Dialog(None, uistate.window, flags, buttons)
self.__dlg = Gtk.Dialog(
transient_for=uistate.window, destroy_with_parent=True,
modal=True)
self.__dlg.add_buttons(_('_Cancel'), Gtk.ResponseType.REJECT,
_('_OK'), Gtk.ResponseType.ACCEPT)
self.set_window(self.__dlg, None, _('Select surname'))
self.setup_configs('interface.lastnamedialog', 400, 400)
# build up a container to display all of the people of interest
self.__model = Gtk.ListStore(GObject.TYPE_STRING, GObject.TYPE_INT)
self.__tree_view = Gtk.TreeView(self.__model)
self.__tree_view = Gtk.TreeView(model=self.__model)
col1 = Gtk.TreeViewColumn(_('Surname'), Gtk.CellRendererText(), text=0)
col2 = Gtk.TreeViewColumn(_('Count'), Gtk.CellRendererText(), text=1)
col1.set_resizable(True)
@@ -1739,12 +1740,10 @@ class GuiDestinationOption(Gtk.Box):
else:
my_action = Gtk.FileChooserAction.SAVE
fcd = Gtk.FileChooserDialog(_("Save As"), action=my_action,
parent=self.__uistate.window,
buttons=(_('_Cancel'),
Gtk.ResponseType.CANCEL,
_('_Open'),
Gtk.ResponseType.OK))
fcd = Gtk.FileChooserDialog(title=_("Save As"), action=my_action,
transient_for=self.__uistate.window)
fcd.add_buttons(_('_Cancel'), Gtk.ResponseType.CANCEL,
_('_Open'), Gtk.ResponseType.OK)
name = os.path.abspath(self.__option.get_value())
if self.__option.get_directory_entry():
@@ -1756,8 +1755,7 @@ class GuiDestinationOption(Gtk.Box):
name = get_curr_dir
fcd.set_current_folder(name)
else:
fcd.set_current_name(os.path.basename(name))
fcd.set_current_folder(os.path.dirname(name))
fcd.set_current_name(name)
status = fcd.run()
if status == Gtk.ResponseType.OK:
+13 -20
View File
@@ -435,12 +435,10 @@ class PluginStatus(ManagedWindow):
"""
Select a file from the file system.
"""
fcd = Gtk.FileChooserDialog(_("Load Addon"),
parent=self.__uistate.window,
buttons=(_('_Cancel'),
Gtk.ResponseType.CANCEL,
_('_Open'),
Gtk.ResponseType.OK))
fcd = Gtk.FileChooserDialog(title=_("Load Addon"),
transient_for=self.__uistate.window)
fcd.add_buttons(_('_Cancel'), Gtk.ResponseType.CANCEL,
_('_Open'), Gtk.ResponseType.OK)
name = self.install_addon_path.get_text()
dir = os.path.dirname(name)
if not os.path.isdir(dir):
@@ -688,10 +686,10 @@ class PluginTrace(ManagedWindow):
) % {'str1': _("Plugin Error"), 'str2': name}
ManagedWindow.__init__(self, uistate, track, self)
self.set_window(Gtk.Dialog("", uistate.window,
Gtk.DialogFlags.DESTROY_WITH_PARENT,
(_('_Close'), Gtk.ResponseType.CLOSE)),
None, title)
dlg = Gtk.Dialog(title="", transient_for=uistate.window,
destroy_with_parent=True)
dlg.add_button(_('_Close'), Gtk.ResponseType.CLOSE),
self.set_window(dlg, None, title)
self.setup_configs('interface.plugintrace', 600, 400)
self.window.connect('response', self.close)
@@ -742,7 +740,7 @@ class ToolManagedWindowBase(ManagedWindow):
self.format_menu = None
self.style_button = None
window = Gtk.Dialog('Tool')
window = Gtk.Dialog(title='Tool')
self.set_window(window, None, self.get_title())
#self.window.connect('response', self.close)
@@ -814,12 +812,9 @@ class ToolManagedWindowBase(ManagedWindow):
buffer_location = view.window_to_buffer_coords(Gtk.TextWindowType.TEXT,
int(event.x),
int(event.y))
_iter = view.get_iter_at_location(*buffer_location)
if isinstance(_iter, tuple): # Gtk changed api in recent versions
_iter = _iter[1]
iter = view.get_iter_at_location(*buffer_location)
for (tag, person_handle) in self.tags:
if _iter.has_tag(tag):
if iter.has_tag(tag):
_window = view.get_window(Gtk.TextWindowType.TEXT)
_window.set_cursor(self.link_cursor)
return False # handle event further, if necessary
@@ -830,11 +825,9 @@ class ToolManagedWindowBase(ManagedWindow):
buffer_location = view.window_to_buffer_coords(Gtk.TextWindowType.TEXT,
int(event.x),
int(event.y))
_iter = view.get_iter_at_location(*buffer_location)
if isinstance(_iter, tuple): # Gtk changed api in recent versions
_iter = _iter[1]
iter = view.get_iter_at_location(*buffer_location)
for (tag, person_handle) in self.tags:
if _iter.has_tag(tag):
if iter.has_tag(tag):
person = self.db.get_person_from_handle(person_handle)
if event.button == 1:
if event.type == Gdk.EventType.DOUBLE_BUTTON_PRESS:
+6 -6
View File
@@ -286,7 +286,7 @@ class ExportAssistant(ManagedWindow, Gtk.Assistant):
self.set_page_complete(vbox, True)
def create_page_fileselect(self):
self.chooser = Gtk.FileChooserWidget(Gtk.FileChooserAction.SAVE)
self.chooser = Gtk.FileChooserWidget(action=Gtk.FileChooserAction.SAVE)
self.chooser.set_homogeneous(False) # Fix for bug #8350.
#add border
self.chooser.set_border_width(12)
@@ -586,11 +586,11 @@ class ExportAssistant(ManagedWindow, Gtk.Assistant):
ix = self.get_selected_format_index()
config.set('behavior.recent-export-type', ix)
export_function = self.map_exporters[ix].get_export_function()
success = export_function(
self.dbstate.db, filename,
User(error=ErrorDialog, parent=self.window,
callback=self.callback),
self.option_box_instance)
success = export_function(self.dbstate.db,
filename,
User(error=ErrorDialog, parent=self.uistate.window,
callback=self.callback),
self.option_box_instance)
except:
#an error not catched in the export_function itself
success = False
+16 -11
View File
@@ -164,9 +164,9 @@ class WriterOptionBox:
full_database_row.pack_start(label, True, True, 0)
people_count = len(self.dbstate.db.get_person_handles())
# translators: leave all/any {...} untranslated
button = Gtk.Button(ngettext("{number_of} Person",
"{number_of} People", people_count
).format(number_of=people_count) )
button = Gtk.Button(label=ngettext("{number_of} Person",
"{number_of} People", people_count
).format(number_of=people_count))
button.set_tooltip_text(_("Click to see preview of unfiltered data"))
button.set_size_request(107, -1)
button.connect("clicked", self.show_preview_data)
@@ -271,9 +271,9 @@ class WriterOptionBox:
from gi.repository import Gtk
from ...widgets import SimpleButton
# translators: leave all/any {...} untranslated
button = Gtk.Button(ngettext("{number_of} Person",
"{number_of} People", 0
).format(number_of=0) )
button = Gtk.Button(label=ngettext("{number_of} Person",
"{number_of} People", 0
).format(number_of=0))
button.set_size_request(107, -1)
button.connect("clicked", self.show_preview_data)
button.proxy_name = proxy_name
@@ -283,7 +283,8 @@ class WriterOptionBox:
label = Gtk.Label(label=_('_Person Filter') + COLON)
label.set_halign(Gtk.Align.START)
label.set_size_request(120, -1)
label.set_padding(5, 0)
label.set_margin_start(5)
label.set_margin_end(5)
label.set_use_underline(True)
label.set_mnemonic_widget(self.filter_obj)
box = Gtk.Box()
@@ -301,7 +302,8 @@ class WriterOptionBox:
label_note = Gtk.Label(label=_('_Note Filter') + COLON)
label_note.set_halign(Gtk.Align.START)
label_note.set_size_request(120, -1)
label_note.set_padding(5, 0)
label_note.set_margin_start(5)
label_note.set_margin_end(5)
label_note.set_use_underline(True)
label_note.set_mnemonic_widget(self.filter_note)
box = Gtk.Box()
@@ -317,7 +319,8 @@ class WriterOptionBox:
label = Gtk.Label(label=_("Privacy Filter") + COLON)
label.set_halign(Gtk.Align.START)
label.set_size_request(120, -1)
label.set_padding(5, 0)
label.set_margin_start(5)
label.set_margin_end(5)
box = Gtk.Box()
box.pack_start(label, False, True, 0)
box.add(self.private_check)
@@ -327,7 +330,8 @@ class WriterOptionBox:
label = Gtk.Label(label=_("Living Filter") + COLON)
label.set_halign(Gtk.Align.START)
label.set_size_request(120, -1)
label.set_padding(5, 0)
label.set_margin_start(5)
label.set_margin_end(5)
box = Gtk.Box()
box.pack_start(label, False, True, 0)
self.restrict_option = Gtk.ComboBox()
@@ -339,7 +343,8 @@ class WriterOptionBox:
label = Gtk.Label(label=_('Reference Filter') + COLON)
label.set_halign(Gtk.Align.START)
label.set_size_request(120, -1)
label.set_padding(5, 0)
label.set_margin_start(5)
label.set_margin_end(5)
box = Gtk.Box()
box.pack_start(label, False, True, 0)
box.pack_start(self.reference_filter, True, True, 0)
+5 -7
View File
@@ -58,13 +58,11 @@ class FileEntry(Gtk.Box):
else:
my_action = Gtk.FileChooserAction.SAVE
dialog = Gtk.FileChooserDialog(self.title,
self.parent,
action=my_action,
buttons=(_('_Cancel'),
Gtk.ResponseType.CANCEL,
_('_Open'),
Gtk.ResponseType.OK))
dialog = Gtk.FileChooserDialog(title=self.title,
transient_for=self.parent,
action=my_action)
dialog.add_buttons(_('_Cancel'), Gtk.ResponseType.CANCEL,
_('_Open'), Gtk.ResponseType.OK)
name = os.path.basename(self.entry.get_text())
if self.dir:
+2 -1
View File
@@ -175,7 +175,8 @@ class PaperFrame(Gtk.Box):
self.paper_grid.show_all()
# Shift the grid from glade toplevel window to this box
self.paper_grid.reparent(self)
self.paper_grid.get_parent().remove(self.paper_grid)
self.add(self.paper_grid)
# need to get rid of glade toplevel now that we are done with it.
self.top.destroy()
+1 -1
View File
@@ -414,7 +414,7 @@ class StyleEditor(ManagedWindow):
spin.set_value(t.get_column_width(i))
self.column.append(spin)
hbox.pack_start(spin, False, False, 6)
hbox.pack_start(Gtk.Label('%'), False, False, 6)
hbox.pack_start(Gtk.Label(label='%'), False, False, 6)
hbox.show_all()
self.vbox.pack_start(hbox, False, False, 3)
+1 -1
View File
@@ -71,7 +71,7 @@ class GuiPluginManager(Callback):
def __init__(self):
""" This function should only be run once by get_instance() """
if GuiPluginManager.__instance != 1:
if GuiPluginManager.__instance is not 1:
raise Exception("This class is a singleton. "
"Use the get_instance() method")
+1
View File
@@ -325,6 +325,7 @@ class BaseSelector(ManagedWindow):
self.sortorder = Gtk.SortType.ASCENDING
else:
self.sortorder = Gtk.SortType.DESCENDING
self.model.reverse_order()
self.build_tree()
return True
-10
View File
@@ -496,16 +496,6 @@ class UIManager():
"""
return group.act_group.lookup_action(actionname)
def enable_all_actions(self, state):
for group in self.action_groups:
if group.act_group:
for item in group.actionlist:
action = group.act_group.lookup_action(item[ACTION_NAME])
if action:
# We check in case the group has not been inserted into
# UIManager yet
action.set_enabled(group.sensitive if state else False)
def dump_all_accels(self):
''' A function used diagnostically to see what accels are present.
This will only dump the current accel set, if other non-open windows
+1 -1
View File
@@ -450,7 +450,7 @@ def open_file_with_default_application(path, uistate):
GLib.timeout_add_seconds(1, poll_external, (proc, errstrings, uistate))
return
def process_pending_events(max_count=20):
def process_pending_events(max_count=10):
"""
Process pending events, but don't get into an infinite loop.
"""
+74 -40
View File
@@ -56,7 +56,6 @@ LOG = logging.getLogger(".")
#-------------------------------------------------------------------------
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GLib
#-------------------------------------------------------------------------
#
@@ -274,13 +273,13 @@ class ViewManager(CLIManager):
Gdk.ModifierType.CONTROL_MASK | Gdk.ModifierType.MOD1_MASK)
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.window.add(vbox)
self.hpane = Gtk.Paned()
hpane = Gtk.Paned()
self.ebox = Gtk.EventBox()
self.navigator = Navigator(self)
self.ebox.add(self.navigator.get_top())
self.hpane.pack1(self.ebox, False, False)
self.hpane.show()
hpane.pack1(self.ebox, False, False)
hpane.show()
self.notebook = Gtk.Notebook()
self.notebook.set_scrollable(True)
@@ -289,14 +288,14 @@ class ViewManager(CLIManager):
self.__init_lists()
self.__build_ui_manager()
self.hpane.add2(self.notebook)
hpane.add2(self.notebook)
toolbar = self.uimanager.get_widget('ToolBar')
self.statusbar = Statusbar()
self.statusbar.show()
vbox.pack_end(self.statusbar, False, True, 0)
vbox.pack_start(toolbar, False, True, 0)
vbox.pack_end(self.hpane, True, True, 0)
vbox.show_all()
vbox.pack_end(hpane, True, True, 0)
vbox.show()
self.uistate = DisplayState(self.window, self.statusbar,
self.uimanager, self)
@@ -836,7 +835,6 @@ class ViewManager(CLIManager):
hbox.add(Gtk.Label(label=pdata.name))
hbox.show_all()
page_num = self.notebook.append_page(page.get_display(), hbox)
self.active_page.post_create()
if not self.file_loaded:
self.uimanager.set_actions_visible(self.actiongroup, False)
self.uimanager.set_actions_visible(self.readonlygroup, False)
@@ -877,6 +875,9 @@ class ViewManager(CLIManager):
"""
Perform necessary actions when a page is changed.
"""
if not self.dbstate.is_open():
return
self.__disconnect_previous_page()
self.active_page = self.pages[page_num]
@@ -885,17 +886,12 @@ class ViewManager(CLIManager):
while Gtk.events_pending():
Gtk.main_iteration()
# bug 12048 this avoids crash if part of toolbar in view is not shown
# because of a small screen when changing views. Part of the Gtk code
# was deleting a toolbar object too soon; and another part of Gtk still
# had a reference.
def page_changer(self):
self.uimanager.update_menu()
self.active_page.change_page()
return False
self.uimanager.update_menu()
GLib.idle_add(page_changer, self,
priority=GLib.PRIORITY_DEFAULT_IDLE - 10)
while Gtk.events_pending():
Gtk.main_iteration()
self.active_page.change_page()
def __delete_pages(self):
"""
@@ -965,7 +961,8 @@ class ViewManager(CLIManager):
self.dbstate.db.close(user=self.user)
(filename, title) = value
self.db_loader.read_file(filename)
self._post_load_newdb(filename, 'x-directory/normal', title)
if self.dbstate.db.is_open():
self._post_load_newdb(filename, 'x-directory/normal', title)
else:
if dialog.after_change != "":
# We change the title of the main window.
@@ -1000,8 +997,7 @@ class ViewManager(CLIManager):
The method called after load of a new database.
Inherit CLI method to add GUI part
"""
if self.dbstate.db.is_open():
self._post_load_newdb_nongui(filename, title)
self._post_load_newdb_nongui(filename, title)
self._post_load_newdb_gui(filename, filetype, title)
def _post_load_newdb_gui(self, filename, filetype, title=None):
@@ -1016,16 +1012,11 @@ class ViewManager(CLIManager):
if title:
name = title
isopen = self.dbstate.is_open()
if not isopen:
rw = False
msg = "Gramps"
rw = not self.dbstate.db.readonly
if rw:
msg = "%s - Gramps" % name
else:
rw = not self.dbstate.db.readonly
if rw:
msg = "%s - Gramps" % name
else:
msg = "%s (%s) - Gramps" % (name, _('Read Only'))
msg = "%s (%s) - Gramps" % (name, _('Read Only'))
self.uistate.window.set_title(msg)
if(bool(config.get('behavior.runcheck')) and QuestionDialog2(
@@ -1044,7 +1035,7 @@ class ViewManager(CLIManager):
config.set('behavior.runcheck', False)
self.__change_page(self.notebook.get_current_page())
self.uimanager.set_actions_visible(self.actiongroup, rw)
self.uimanager.set_actions_visible(self.readonlygroup, isopen)
self.uimanager.set_actions_visible(self.readonlygroup, True)
self.uimanager.set_actions_visible(self.undoactions, rw)
self.uimanager.set_actions_visible(self.redoactions, rw)
@@ -1069,6 +1060,51 @@ class ViewManager(CLIManager):
config.set('paths.recent-file', '')
config.save()
def enable_menu(self, enable):
""" Enable/disable the menues. Used by the dbloader for import to
prevent other operations during import. Needed because simpler methods
don't work under Gnome with application menus at top of screen (instead
of Gramps window).
Note: enable must be set to False on first call.
"""
if not enable:
self.action_st = (
self.uimanager.get_actions_sensitive(self.actiongroup),
self.uimanager.get_actions_sensitive(self.readonlygroup),
self.uimanager.get_actions_sensitive(self.undoactions),
self.uimanager.get_actions_sensitive(self.redoactions),
self.uimanager.get_actions_sensitive(self.fileactions),
self.uimanager.get_actions_sensitive(self.toolactions),
self.uimanager.get_actions_sensitive(self.reportactions),
self.uimanager.get_actions_sensitive(
self.recent_manager.action_group))
self.uimanager.set_actions_sensitive(self.actiongroup, enable)
self.uimanager.set_actions_sensitive(self.readonlygroup, enable)
self.uimanager.set_actions_sensitive(self.undoactions, enable)
self.uimanager.set_actions_sensitive(self.redoactions, enable)
self.uimanager.set_actions_sensitive(self.fileactions, enable)
self.uimanager.set_actions_sensitive(self.toolactions, enable)
self.uimanager.set_actions_sensitive(self.reportactions, enable)
self.uimanager.set_actions_sensitive(
self.recent_manager.action_group, enable)
else:
self.uimanager.set_actions_sensitive(
self.actiongroup, self.action_st[0])
self.uimanager.set_actions_sensitive(
self.readonlygroup, self.action_st[1])
self.uimanager.set_actions_sensitive(
self.undoactions, self.action_st[2])
self.uimanager.set_actions_sensitive(
self.redoactions, self.action_st[3])
self.uimanager.set_actions_sensitive(
self.fileactions, self.action_st[4])
self.uimanager.set_actions_sensitive(
self.toolactions, self.action_st[5])
self.uimanager.set_actions_sensitive(
self.reportactions, self.action_st[6])
self.uimanager.set_actions_sensitive(
self.recent_manager.action_group, self.action_st[7])
def __change_undo_label(self, label, update_menu=True):
"""
Change the UNDO label
@@ -1613,9 +1649,9 @@ class QuickBackup(ManagedWindow): # TODO move this class into its own module
self.user = user
ManagedWindow.__init__(self, uistate, [], self.__class__)
window = Gtk.Dialog('',
self.uistate.window,
Gtk.DialogFlags.DESTROY_WITH_PARENT, None)
window = Gtk.Dialog(title='',
transient_for=self.uistate.window,
destroy_with_parent=True)
self.set_window(window, None, _("Gramps XML Backup"))
self.setup_configs('interface.quick-backup', 500, 150)
close_button = window.add_button(_('_Close'),
@@ -1751,12 +1787,10 @@ class QuickBackup(ManagedWindow): # TODO move this class into its own module
"""
fdialog = Gtk.FileChooserDialog(
title=_("Select backup directory"),
parent=self.window,
action=Gtk.FileChooserAction.SELECT_FOLDER,
buttons=(_('_Cancel'),
Gtk.ResponseType.CANCEL,
_('_Apply'),
Gtk.ResponseType.OK))
transient_for=self.window,
action=Gtk.FileChooserAction.SELECT_FOLDER)
fdialog.add_buttons(_('_Cancel'), Gtk.ResponseType.CANCEL,
_('_Apply'), Gtk.ResponseType.OK)
mpath = path_entry.get_text()
if not mpath:
mpath = HOME_DIR
+1 -1
View File
@@ -269,7 +269,7 @@ class BookmarksDialog(ManagedWindow):
def draw_window(self):
"""Draw the bookmark dialog box."""
self.top = Gtk.Dialog(parent=self.parent_window)
self.top = Gtk.Dialog(transient_for=self.parent_window)
self.top.vbox.set_spacing(5)
label = Gtk.Label(label='<span size="larger" weight="bold">%s</span>'
% _("Organize Bookmarks"))
+5 -5
View File
@@ -1059,11 +1059,11 @@ class ListView(NavigationView):
####################################################################
def export(self, *obj):
chooser = Gtk.FileChooserDialog(
_("Export View as Spreadsheet"),
self.uistate.window,
Gtk.FileChooserAction.SAVE,
(_('_Cancel'), Gtk.ResponseType.CANCEL,
_('_Save'), Gtk.ResponseType.OK))
title=_("Export View as Spreadsheet"),
transient_for=self.uistate.window,
action=Gtk.FileChooserAction.SAVE)
chooser.add_buttons(_('_Cancel'), Gtk.ResponseType.CANCEL,
_('_Save'), Gtk.ResponseType.OK)
chooser.set_do_overwrite_confirmation(True)
combobox = Gtk.ComboBoxText()
+3 -2
View File
@@ -321,7 +321,7 @@ class NavigationView(PageView):
else:
from ..dialog import WarningDialog
WarningDialog(_("No Home Person"),
_("You need to set a 'Home 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."),
@@ -331,7 +331,8 @@ class NavigationView(PageView):
"""
A dialog to move to a Gramps ID entered by the user.
"""
dialog = Gtk.Dialog(_('Jump to by Gramps ID'), self.uistate.window)
dialog = Gtk.Dialog(title=_('Jump to by Gramps ID'),
transient_for=self.uistate.window)
dialog.set_border_width(12)
label = Gtk.Label(label='<span weight="bold" size="larger">%s</span>' %
_('Jump to by Gramps ID'))
+6 -14
View File
@@ -138,7 +138,6 @@ class PageView(DbGUIElement, metaclass=ABCMeta):
self.sidebar = None
self.bottombar = None
self.widget = None
self.vpane = None
DbGUIElement.__init__(self, dbstate.db)
@@ -155,20 +154,18 @@ class PageView(DbGUIElement, metaclass=ABCMeta):
self.ident + "_bottombar",
defaults[1])
hpane = Gtk.Paned()
self.vpane = Gtk.Paned(orientation=Gtk.Orientation.VERTICAL)
hpane.pack1(self.vpane, resize=True, shrink=False)
vpane = Gtk.Paned(orientation=Gtk.Orientation.VERTICAL)
hpane.pack1(vpane, resize=True, shrink=False)
hpane.pack2(self.sidebar, resize=False, shrink=False)
hpane.show()
self.vpane.show()
vpane.show()
self.widget = self.build_widget()
self.widget.show_all()
self.widget.set_name('view')
self.vpane.pack1(self.widget, resize=True, shrink=False)
self.vpane.pack2(self.bottombar, resize=False, shrink=True)
self.vpane.show()
self._config.register('vpane.slider-position', -1)
self.vpane.set_position(self._config.get('vpane.slider-position'))
vpane.pack1(self.widget, resize=True, shrink=False)
vpane.pack2(self.bottombar, resize=False, shrink=True)
self._setup_slider_config(vpane, 'vpane.slider-position')
self.sidebar_toggled(self.sidebar.get_property('visible'))
self.hpane_sig = hpane.connect("draw", self.set_page_slider)
@@ -346,11 +343,6 @@ class PageView(DbGUIElement, metaclass=ABCMeta):
self.bottombar.set_inactive()
self.active = False
def post_create(self):
if self.vpane:
self._setup_slider_config(self.vpane, 'vpane.slider-position')
self.vpane = None
@abstractmethod
def build_tree(self):
"""
+33 -4
View File
@@ -241,14 +241,21 @@ class Tags(DbGUIElement):
tag_menu = ''
menuitem = '''
<item>
<attribute name="action">win.TAG-%s</attribute>
<attribute name="action">win.%s</attribute>
<attribute name="label">%s</attribute>
</item>'''
for tag_name, handle in self.__tag_list:
tag_menu += menuitem % (handle, escape(tag_name))
tag_menu += menuitem % ("TAG-%s" % handle,
"Add tag '%s'" % tag_name)
actions.append(('TAG-%s' % handle,
make_callback(self.tag_selected_rows, handle)))
for tag_name, handle in self.__tag_list:
tag_menu += menuitem % ("R-TAG-%s" % handle,
"Remove tag '%s'" % tag_name)
actions.append(('R-TAG-%s' % handle,
make_callback(self.remove_tag_selected_rows,
handle)))
tag_menu = TAG_MENU % tag_menu
self.tag_ui = [TAG_1 % tag_menu, TAG_2, TAG_3 % tag_menu]
@@ -315,6 +322,28 @@ class Tags(DbGUIElement):
view.add_tag(trans, object_handle, tag_handle)
status.end()
def remove_tag_selected_rows(self, tag_handle):
"""
Remove tag from selected rows.
"""
view = self.uistate.viewmanager.active_page
selected = view.selected_handles()
# 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)
status = progressdlg.LongOpStatus(msg=_("Adding Tags"),
total_steps=len(selected),
interval=len(selected)//20)
pmon.add_op(status)
tag = self.db.get_tag_from_handle(tag_handle)
msg = _('Tag Selection (%s)') % tag.get_name()
with DbTxn(msg, self.db) as trans:
for object_handle in selected:
status.heartbeat()
view.remove_tag(trans, object_handle, tag_handle)
status.end()
def cb_menu_position(*args):
"""
Determine the position of the popup menu.
@@ -430,7 +459,7 @@ class OrganizeTagsDialog(ManagedWindow):
Create a dialog box to organize tags.
"""
# pylint: disable-msg=E1101
top = Gtk.Dialog(parent=self.parent_window)
top = Gtk.Dialog(transient_for=self.parent_window)
top.vbox.set_spacing(5)
label = Gtk.Label(label='<span size="larger" weight="bold">%s</span>'
% _("Organize Tags"))
@@ -659,7 +688,7 @@ class EditTag(ManagedWindow):
Create a dialog box to enter a new tag.
"""
# pylint: disable-msg=E1101
top = Gtk.Dialog(parent=self.parent_window)
top = Gtk.Dialog(transient_for=self.parent_window)
top.vbox.set_spacing(5)
hbox = Gtk.Box()
+1 -2
View File
@@ -130,8 +130,7 @@ class EventModel(FlatBaseModel):
handle = data[0]
cached, value = self.get_cached_value(handle, "PARTICIPANT")
if not cached:
value = get_participant_from_event(self.db, data[COLUMN_HANDLE],
all_=True) # all participants
value = get_participant_from_event(self.db, data[COLUMN_HANDLE])
self.set_cached_value(handle, "PARTICIPANT", value)
return value
+1 -2
View File
@@ -587,8 +587,7 @@ class TreeBaseModel(GObject.GObject, Gtk.TreeModel, BaseModel):
if dfilter:
cdb = CacheProxyDb(self.db)
for handle in dfilter.apply(cdb, tree=True,
user=User(parent=self.uistate.window,
uistate=self.uistate)):
user=User(parent=self.uistate.window)):
status_ppl.heartbeat()
data = data_map(handle)
add_func(handle, data)
+7 -8
View File
@@ -630,13 +630,11 @@ class DetachedWindow(ManagedWindow):
self.grampletbar = grampletbar
self.gramplet = gramplet
ManagedWindow.__init__(self, gramplet.uistate, [],
self.title)
self.set_window(Gtk.Dialog("", gramplet.uistate.window,
Gtk.DialogFlags.DESTROY_WITH_PARENT,
(_('_Close'), Gtk.ResponseType.CLOSE)),
None,
self.title)
ManagedWindow.__init__(self, gramplet.uistate, [], self.title)
dlg = Gtk.Dialog(transient_for=gramplet.uistate.window,
destroy_with_parent = True)
dlg.add_button(_('_Close'), Gtk.ResponseType.CLOSE)
self.set_window(dlg, None, self.title)
self.window.move(x_pos, y_pos)
self.window.set_default_size(gramplet.detached_width,
gramplet.detached_height)
@@ -701,7 +699,8 @@ class DetachedWindow(ManagedWindow):
self.gramplet.detached_width = size[0]
self.gramplet.detached_height = size[1]
self.gramplet.detached_window = None
self.gramplet.reparent(self.grampletbar)
self.notebook.remove(self.gramplet)
self.grampletbar.add(self.gramplet)
ManagedWindow.close(self, *args)
#-------------------------------------------------------------------------
+11 -10
View File
@@ -233,12 +233,11 @@ class GrampletWindow(ManagedWindow):
self.docked_state = gramplet.gstate
# Now detach it
self.gramplet.set_state("detached")
ManagedWindow.__init__(self, gramplet.uistate, [],
self.title)
self.set_window(Gtk.Dialog("", gramplet.uistate.window,
Gtk.DialogFlags.DESTROY_WITH_PARENT,
(_('_Close'), Gtk.ResponseType.CLOSE)),
None, self.title)
ManagedWindow.__init__(self, gramplet.uistate, [], self.title)
dlg = Gtk.Dialog(transient_for=gramplet.uistate.window,
destroy_with_parent=True)
dlg.add_button(_('_Close'), Gtk.ResponseType.CLOSE)
self.set_window(dlg, None, self.title)
cfg_name = gramplet.gname.replace(' ', '').lower() + '-gramplet'
self.setup_configs('interface.' + cfg_name,
gramplet.detached_width, gramplet.detached_height)
@@ -246,7 +245,8 @@ class GrampletWindow(ManagedWindow):
# add gramplet:
if self.gramplet.pui:
self.gramplet.pui.active = True
self.gramplet.mainframe.reparent(self.window.vbox)
self.gramplet.mainframe.get_parent().remove(self.gramplet.mainframe)
self.window.vbox.add(self.gramplet.mainframe)
self.window.connect('response', self.handle_response)
self.show()
# After we show, then we hide:
@@ -310,7 +310,8 @@ class GrampletWindow(ManagedWindow):
expand = self.gramplet.gstate == "maximized" and self.gramplet.expand
column = pane.columns[col]
parent = self.gramplet.pane.get_column_frame(self.gramplet.column)
self.gramplet.mainframe.reparent(parent)
self.gramplet.mainframe.get_parent().remove(self.gramplet.mainframe)
parent.add(self.gramplet.mainframe)
if self.gramplet.pui:
self.gramplet.pui.active = self.gramplet.pane.pageview.active
for gframe in stack:
@@ -1473,7 +1474,7 @@ class GrampletPane(Gtk.ScrolledWindow):
plugs.sort(key=lambda x: x.name)
for plug in plugs:
action_name = valid_action_name(plug.id)
a_menuitems += menuitem % (action_name, escape(plug.name))
a_menuitems += menuitem % (action_name, plug.name)
actions.append((action_name,
make_callback(self.add_gramplet, plug.name)))
names = [gramplet.title for gramplet in self.closed_gramplets]
@@ -1484,7 +1485,7 @@ class GrampletPane(Gtk.ScrolledWindow):
# 'name' could be non-ASCII when in non-English language
# action names must be in ASCII, so use 'id' instead.
action_name = valid_action_name(str(id(name)))
r_menuitems += menuitem % (action_name, escape(name))
r_menuitems += menuitem % (action_name, name)
actions.append((action_name,
make_callback(self.restore_gramplet,
name)))
+7 -19
View File
@@ -18,7 +18,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
__all__ = ["LinkLabel", "EditLabel", "BasicLabel", "GenderLabel",
__all__ = ["LinkLabel", "EditLabel", "BasicLabel",
"MarkupLabel", "DualMarkupLabel"]
#-------------------------------------------------------------------------
@@ -127,7 +127,7 @@ class LinkLabel(Gtk.EventBox):
hbox = Gtk.Box()
hbox.pack_start(self.label, False, False, 0)
if label[1]:
hbox.pack_start(GenderLabel(label[1]), False, False, 0)
hbox.pack_start(Gtk.Label(label=label[1]), False, False, 0)
hbox.set_spacing(4)
self.add(hbox)
@@ -138,7 +138,10 @@ class LinkLabel(Gtk.EventBox):
self.connect('realize', realize_cb)
def set_padding(self, x, y):
self.label.set_padding(x, y)
self.label.set_margin_start(x)
self.label.set_margin_end(x)
self.label.set_margin_top(x)
self.label.set_margin_bottom(x)
def enter_text(self, obj, event, handle):
if self.emph:
@@ -205,20 +208,6 @@ class BasicLabel(Gtk.Label):
self.set_ellipsize(ellipsize)
self.show()
#-------------------------------------------------------------------------
#
# GenderLabel class
#
#-------------------------------------------------------------------------
class GenderLabel(Gtk.Label):
def __init__(self, text):
Gtk.Label.__init__(self, label=text)
self.set_halign(Gtk.Align.START)
if win():
pangoFont = Pango.FontDescription('Arial')
self.override_font(pangoFont)
self.show()
#-------------------------------------------------------------------------
#
@@ -247,7 +236,6 @@ class DualMarkupLabel(Gtk.Box):
label.set_use_markup(True)
self.pack_start(label, False, False, 0)
b = GenderLabel(alt)
b.set_use_markup(True)
b = Gtk.Label(label=alt)
self.pack_start(b, False, False, 4)
self.show()
+1 -29
View File
@@ -177,36 +177,8 @@ class MonitoredEntryIndicator(MonitoredEntry):
autolist=None, changed=None):
MonitoredEntry.__init__(self, obj, set_val, get_val, read_only,
autolist, changed)
self.origcolor = obj.get_style_context().get_color(Gtk.StateType.NORMAL)
if get_val():
self.indicatorshown = False
else:
self.indicatorshown = True
self.indicator = indicator
self.obj.set_text(indicator)
rgba = Gdk.RGBA()
Gdk.RGBA.parse(rgba, 'grey')
self.obj.override_color(Gtk.StateType.NORMAL, rgba)
self.obj.override_font(Pango.FontDescription('sans italic'))
self.fockey = self.obj.connect('focus-in-event',
self._obj_focus)
self.obj.set_placeholder_text(indicator)
def _on_change(self, obj):
if not self.indicatorshown:
self.set_val(str(obj.get_text()))
if self.changed:
self.changed(obj)
def _obj_focus(self, widg, eve):
"""
callback for when prefix obtains focus
"""
self.set_text('')
self.obj.override_color(Gtk.StateType.NORMAL, self.origcolor)
self.obj.override_font(Pango.FontDescription('normal'))
self.obj.disconnect(self.fockey)
self.indicatorshown = False
return False
#-------------------------------------------------------------------------
#
-1
View File
@@ -84,7 +84,6 @@ class Photo(Gtk.EventBox):
elif is_right_click(event):
if self.handle and self.uistate:
self.menu = Gtk.Menu()
self.menu.set_title(_("Media Object"))
add_menuitem(self.menu, _("Make Active Media"), widget,
lambda obj: self.uistate.set_active(self.handle, "Media"))
self.menu.popup(None, None, None, None, event.button, event.time)

Some files were not shown because too many files have changed in this diff Show More