Compare commits

..

160 Commits

Author SHA1 Message Date
kulath 4370fa29ad Fix Testcasegenerator to generate correct LDS ordinances for people and
families (avoids an error when the GEDCOM is reimported).
2016-06-13 18:51:54 +01:00
romjerome 20bb38de62 9003: Locality data in address was not imported 2015-10-27 09:53:12 +01:00
romjerome 7c3073c54a 6684: Unused Object Dialog box too small 2015-09-05 10:50:26 +02:00
kulath f96c6ce2a0 0008537: Gedcom import crashes
(1) Fix count of individuals in libgedcom/GedcomStageOne/parse so that
magic transactions are used when more than 1000 individuals.
(2) Remove use of find_backlink_handles in libgedcom so it doesn't
crash.
2015-07-27 22:12:30 +01:00
Zdeněk Hataš 5c88ccfe7a czech translation update 2015-06-06 17:07:32 +02:00
Doug Blank 93197c4677 Fixed GW import issue with citation handles 2015-05-23 10:38:09 -04:00
John Ralls 9b0145d050 More mac fixups for 3.4.9 release. 2015-05-02 17:20:56 -07:00
John Ralls 2b9efedd41 Mac updates for releasing 3.4.9. 2015-05-02 11:45:58 -07:00
SNoiraud 9a8af2289a narrativeweb : bug 8528 : local variable 'body' referenced before assignment 2015-05-01 10:30:11 +02:00
Jérôme Rapinat 58d30e6ded make official release 2015-04-30 15:28:56 +02:00
Jérôme Rapinat b656d55364 update translation template
was change around GEDCOM SUBM tag

update french translation

remove extra 'gramps/gui/viewmanager.py' file from 34 branch
2015-04-28 20:07:25 +02:00
John Ralls 2fc6750867 Use MSWin environment variables USERPROFILE and APPDATA.
Instead of GRAMPSHOME. GRAMPSHOME is based on the assumption that
the config directory is GRAMPSHOME/gramps, and that causes the
default location for reports and backups to be ~/Library/Application Support.
The MSWin variables allow the two to be separated.

Thanks to Tim Lyons for the suggestion.

(cherry picked from commit c11c63169f)
2015-04-25 17:01:21 -07:00
Leonhaeuser 44d9578622 update German translation 2015-04-24 21:59:33 +02:00
kulath 78c79202de 0001360: Gedcom input: SUBN and SUBM record handling
Fixed:
(a) Additional spaces beyond the first between a GEDCOM tag and the rest
of the line are not ignored.

(b) The SUBMitter name is ignored (it is overwritten by the XREF).

(c) SUBmissioN data items are not committed to the database.
2015-04-24 10:51:08 +01:00
John Ralls df1ffe06e1 Fix gtk-critical error when setting mac menubar.
Port of 3147cf5 from master.
2015-04-17 15:20:27 -07:00
kulath c46f7dde41 0002370: GEDCOM import/export round trip causes lost information
Fixed output of Adoption records so "1 ADOP" is only written once for
the person event and the adoption relationship.
2015-04-12 19:04:08 +01:00
Nemeséri Lajos e9c3ca1620 update Hungarian translation 2015-04-01 16:18:58 +02:00
Jérôme Rapinat 46cf600fac 6403: false positive on pattern 2015-04-01 15:53:46 +02:00
kulath 3246bf77d3 0004412: Entering a witness to an event such as marriage
In some circumstances (after a Father's age of Mother's age) a witness
could be ignored.
2015-04-01 14:48:41 +01:00
Jérôme Rapinat 3501a9666c 6403: add a rule for checking mapping key 2015-04-01 15:25:07 +02:00
Matt Keenan ee0bc905da 8468: GuiColorOption missing avail-changed event handler 2015-03-31 10:21:29 -07:00
kulath 8be01ff00e 0008355: Gramps can't [GEDCOM] import estim. date period exported by
itself

Changed output format to DATE EST FROM TO and DATE CALC FROM TO. Also
changed in Narrative Web (which uses the same functions).
2015-03-31 10:48:16 +01:00
Jérôme Rapinat 5c278cfc36 update template; fr.po:8103: sidebar gramplet does not fit well into Event and Citation views 2015-03-19 16:19:01 +01:00
Jérôme Rapinat 915522c989 8451: Fix crash on RelGraph report with unknown gender 2015-03-19 16:12:01 +01:00
Paul Franklin e4ebeb247a 7155: Support creating directories in various scenarios 2015-03-18 14:04:26 -07:00
Zdeněk Hataš e6c7a53580 czech translation update 2015-03-13 17:33:00 +01:00
kulath 10aca55568 0008401: NameError in GEDCOM importer 2015-03-12 14:10:04 +00:00
kulath 5fc71a7923 0008322: Event address is lost on import, i.e. disconnected from event.
On GEDCOM import, Places are only merged if the Place Title and the
whole of the main location are identical.
2015-03-12 12:32:17 +00:00
kulath d25385328b Make a zip backup if schema is to be upgraded see 8134: Error converting
python2 utf-8 strings to python3 str when loading data from database
2015-03-02 17:42:51 +00:00
kulath 5c6259edbc 0007824: Regression: running gramps from crontab fails 2015-03-01 16:48:35 +00:00
kulath 1452b499ff 0008380: tag_map is not initialized 2015-02-28 20:48:16 +00:00
kulath 63a8a2955d 8233: Fix bad handle in explanation note for unknown event 2015-02-27 18:22:23 +00:00
Paul Franklin 97762815bc 8316: Family with children but no parents is lost on filtered export 2015-02-23 10:35:59 -08:00
kulath fed7d5e5b8 0008347: GEDCOM import of embedded notes attached to media does not work 2015-02-16 22:51:26 +00:00
Jérôme Rapinat d3f346808f fix typos, thank you phcook 2015-02-16 20:08:50 +01:00
kulath c1e356769e 0007014: Errors handling owner/submitter information in GEDCOM files.
Only import researcher from GEDCOM or XML if the family tree was
originally empty.
2015-02-02 18:57:16 +00:00
Nick Hall 31a222a754 7533: Check for active person in session log gramplet 2015-01-21 23:04:43 +00:00
Nick Hall bbe5e0ec84 7770: Always display main participants 2015-01-21 18:56:43 +00:00
Nick Hall 57209001cb 7299: Fix bug when family has no parents 2015-01-21 17:40:21 +00:00
kulath 7c3094b5b5 Merge branch 'maintenance/gramps34' of ssh://git.code.sf.net/p/gramps/source into maintenance/gramps34 2015-01-08 17:44:42 +00:00
kulath 489d12d484 0008283: GEDCOM export does not export media attached to citations. Fix
for gramps34
2015-01-07 17:57:20 +00:00
Jérôme Rapinat a6659515d5 New year... 2015-01-02 10:12:04 +01:00
Enno Borgsteede b094b4b7a7 Fix missing mediaattrembedlist reference for building 2015-01-02 10:11:16 +01:00
Paul Franklin bf20905761 specify SVG font size is in points, for stupid viewers 2014-12-30 10:50:55 -08:00
Paul Franklin 555a244a45 8240: can't disable box shadow in SVG descendant tree 2014-12-30 10:42:14 -08:00
Paul Franklin 78ec6a26a2 8237: descendant tree graphical report, syntax error in svg output 2014-12-17 19:37:45 -08:00
kulath 942b51945c Merge branch 'maintenance/gramps34' of ssh://kulath@git.code.sf.net/p/gramps/source into maintenance/gramps34 2014-12-14 17:53:28 +00:00
kulath 6a5b630a05 Fix 0008234: Various problems with docgen.TextDoc.add_media_object part
(1) for gramps34 branch
2014-12-14 17:48:04 +00:00
Jérôme Rapinat c97aeb0f1a 6934: backport environment for better managing custom attributes on Media, new MediaAttrEmbedList class 2014-12-12 09:42:46 +01:00
kulath 503d3bf6ca 8196: Spurious spaces in CLI List Family Trees, tab delimited output.
Print statements changed to assemble the whole line before output.
2014-11-24 18:13:06 +00:00
noirauds 951e9341cf bug 7929: HTML View fails to load on Debian unstable. 2014-11-22 23:04:11 +01:00
Jérôme Rapinat c864804eac 8122: DB lock not checked when opening database from the recent opened trees 2014-10-24 09:43:54 +02:00
Paul Franklin 87a5ae428e enhance Serbian date handler to handle Cyrillic dates 2014-10-17 18:10:42 -07:00
Jérôme Rapinat 6b55af1e03 8103: sidebarfilter gramplet does not fit well into People, Events, Citations or Media views 2014-10-15 22:00:46 +02:00
Luigi Toscano 9dc8e62951 Fix few messages 2014-09-27 23:38:39 +02:00
Paul Franklin e398d3db2d sync gramps34's _Date_sr.py with gramps41's _date_sr.py 2014-09-25 10:03:44 -07:00
Zdeněk Hataš 320bbeb0b6 8064: translation fixes 2014-09-18 12:26:57 +02:00
Zdeněk Hataš 7af4bf5d5f Typo fix. 2014-09-14 20:20:29 +02:00
Petr Hejl 9fb493415a 8051: Can't fill in calculated and estimated dates in cs locale 2014-09-11 18:02:14 +02:00
John Ralls 7c35586ae2 Change OsmGpsMaps to git branch gtk2 from tarball
Prereq for cherry-picking Open Street Maps and Google Maps fixes.
2014-09-09 17:55:56 -07:00
Paul Franklin 82294e6a82 revert part of 8014 patch, pending further review 2014-08-25 11:27:46 -07:00
Björn Samvik 2203f28b28 8014: Importing gedcom files containing multibyte UTF-8 characters fails 2014-08-25 10:47:46 -07:00
Paul Franklin 7c27167042 tweak to "default" CSS choice for the narrated web report 2014-08-20 07:54:11 -07:00
Paul Franklin 6cb766326f enable the "default" CSS choice for the narrated web report
Otherwise, whenever you start the report, you get this:

WARNING: _enumeratedlist.py: line 124: Value 'default' not found for option 'StyleSheet'
2014-08-17 12:46:19 -07:00
Paul Franklin 716096be44 7888: crash while scrolling in person view 2014-07-20 13:25:19 -07:00
Paul Franklin 58d5d61789 7861: In Ahnentafel Report, Use Christening Date if no Birth Date 2014-07-11 15:38:05 -07:00
Paul Franklin 01ee2d9a30 7739: [Narweb:] Missing webpage for media [under some circumstances] 2014-07-10 09:24:26 -07:00
Paul Franklin 755eeaf1dc more translated strings in gramps34 Chinese date handler
(but it is still not enabled, as it awaits more testing)
2014-06-26 19:20:07 -07:00
Mirko Leonhaeuser fd2db583c1 Fixed 0006655 and 0007840 2014-06-22 18:08:10 +02:00
Paul Franklin 16cbe024ec 7398: Gedcom import deletes first char of notes 2014-06-11 10:05:08 -07:00
Paul Franklin 97a1419281 7784 "IndexError: list index out of range" on [initial CLI "gramps -t"] 2014-06-05 08:01:14 -07:00
Jérôme Rapinat 2d4e36a074 5024 7770: typo around 'Last Change' column into Person Selector 2014-06-02 17:55:52 +02:00
John Ralls f2c9e7cfc8 Patch PIL to build with Freetype2 2014-05-30 10:12:20 -07:00
John Ralls a006b930d9 Update mac packaging for 3.4.8 release. 2014-05-30 09:54:18 -07:00
Jérôme Rapinat 29dc9bdc54 bump to 3.4.9 2014-05-29 19:41:38 +02:00
Jérôme Rapinat af39c293b7 make official '3.4.8' release 2014-05-29 19:32:48 +02:00
Peter Landgren a2f8526bb7 Updated Swedish translation 2014-05-29 17:38:23 +02:00
Omar Kohl 803e515afa Git Merge Request #9: Spanish typo 2014-05-29 15:56:06 +02:00
Zdeněk Hataš 32cb8f4e63 typo 2014-05-28 21:33:15 +02:00
Zdeněk Hataš 9b91f40c28 czech translation update 2014-05-24 23:13:49 +02:00
Ondrej Krc 1daa4b0493 Merge Request #8: Typo fix in slovak translation 2014-05-23 14:54:16 +01:00
John Ralls 73d9c3052e Update remote location of gtk-osx modulesets to gnome.org. 2014-05-20 11:08:11 -07:00
John Ralls 630351daa5 7598: No narrative.css File After Running Narrated Website Report 2014-05-20 11:08:11 -07:00
Nick Hall 679dcf1b6e 7152: Fix error when importing database from the CLI 2014-05-20 13:29:51 +01:00
Paul Franklin 89d6a819d7 5690: Can create multiple events with same Gramps-ID 2014-05-13 14:16:26 -07:00
Paul Franklin ce9753fe99 5690: Can create multiple events with same Gramps-ID 2014-05-11 10:33:23 -07:00
donfano 14eb354a4b 7685: Correction of the LDS ordinance names in French 2014-05-11 10:33:57 +02:00
Pitxyoki e5ba3d1894 7671: Typo on Portuguese translation for 'third grandson/daughter' 2014-05-09 12:20:31 +02:00
Jérôme Rapinat 33dc25a323 update template; consistency on translation strings 2014-05-04 15:54:54 +02:00
Paul Franklin d4c3cfaac2 use a standard string, not a unique string 2014-05-03 15:14:47 -07:00
verthezp fd62969f5a 7662: Missing closing bracket in Web_Basic-Spruce.css 2014-05-03 17:37:22 +02:00
Jérôme Rapinat e84aff4c0e update template and french translation 2014-04-29 10:55:34 +02:00
Paul Franklin 2a9a6a4373 translate the new GVFamilyLines strings 2014-04-26 09:56:28 -07:00
Mirko Leonhaeuser 69a8ebb61c update German translation 2014-04-23 18:35:02 +02:00
Paul Franklin 419bf93d42 7620: 'Display as' field in Name Editor reverts to Preferences default ... 2014-04-21 13:52:18 -07:00
Paul Franklin f09c5d1a69 flag some semicolons, for translation in Arabic 2014-04-20 16:32:25 -07:00
Vassilii Khachaturov 17e7135d93 RU: update translation from gramps40 2014-04-11 09:24:48 +03:00
Nick Hall 114a8ff173 Fix bug in family events gramplet 2014-04-10 18:44:41 +01:00
Nick Hall c74c91a9e0 Fix family editor callback 2014-04-10 18:18:02 +01:00
Nick Hall 64d87eaeb2 7119: Register history objects at startup 2014-04-10 17:17:12 +01:00
Zdeněk Hataš f8f4ab1751 czech translation update 2014-04-10 10:23:03 +02:00
Paul Franklin 8129b4036b make gramps XML the initial default export type 2014-04-08 19:24:26 -07:00
Mirko Leonhaeuser 08d8124bc3 update German translation 2014-04-07 18:08:34 +02:00
Nick Hall e7ca43f996 7584: Fix update of active object after merge 2014-04-05 19:08:30 +01:00
Mirko Leonhaeuser 5576b266d3 update German translation 2014-04-04 22:41:23 +02:00
Jérôme Rapinat 2ddcb79a2f Update template (~4 modified/new strings) and the french translation 2014-04-04 15:51:32 +02:00
Nick Hall ba1eafdf44 More informative messages in citation editor 2014-04-03 18:47:30 +01:00
Nick Hall 34df591118 Fix drag & drop in citation editor 2014-04-03 16:05:50 +01:00
Nick Hall 7a713e84d2 7137: Fix updating of events gramplets 2014-03-29 23:50:04 +00:00
Nick Hall 3d64617ca1 7559: Fix bug in abandon changes and quit 2014-03-29 19:46:59 +00:00
Jérôme Rapinat ee80c46747 7559: more accurate word for 'Undo' on french translation 2014-03-25 11:59:05 +01:00
Igal Shapira a9407cd4f5 Updated Hebrew translations - update to latest gramps.pot and some minor fixes 2014-03-25 09:47:08 +01:00
Luigi Toscano b729a2f0c5 Italian translation updates (3.4.x) 2014-03-23 02:44:14 +01:00
Zdeněk Hataš 6b96dbbf17 czech translation update 2014-03-20 16:42:13 +01:00
Jérôme Rapinat 3d3a7d4115 Update template and french translation, new string on gvfamilylines [93f724] 2014-03-19 09:10:58 +01:00
Paul Franklin 93f724bc47 fix translation of children count to use ngettext 2014-03-18 18:24:58 -07:00
Mirko Leonhaeuser 4d8b2bb7bc update German translation 2014-03-18 22:30:20 +01:00
Peter Landgren 042e599d8b Swedish translation update. 2014-03-18 16:03:02 +01:00
Jérôme Rapinat aac85d6b57 7276: [82078e] update template and french translation 2014-03-17 19:04:09 +01:00
Paul Franklin 82078e6956 7276: translate some punctuation marks -- partial 2014-03-17 08:40:58 -07:00
Jérôme Rapinat bfcf062368 6369 Couldn't find a target for a mnemonic activation on confidence into Citation Editor 2014-03-16 11:10:14 +01:00
Jérôme Rapinat 17ca1443fb [c9c8d3]: update translation template and french translation, new source selection and citation editor simplification 2014-03-15 21:30:38 +01:00
Nick Hall c9c8d31902 Simplify citation editor and add source selection 2014-03-15 18:52:42 +00:00
Mirko Leonhaeuser 7ecc9a7f8c update German translation 2014-03-15 16:35:53 +01:00
Jérôme Rapinat c2965640a4 7510: do not drag and drop more than one data into editor tabs 2014-03-15 11:16:26 +01:00
Muhammad Bashir Al-Noimi 0d5c20db79 update Arabic translation 2014-03-13 20:26:55 +01:00
Jérôme Rapinat 9bd9d118d0 update template and french translation 2014-03-07 14:52:45 +01:00
kulath 56c67576d5 6194: Database corrupted - TypeError: unhashable type: 'list'
Fixed upgrade to deal with sourceref in media references in Sources.
Also fixed Check and Repair to repair previously broken databases.
2014-03-04 19:11:57 +00:00
Peter Landgren b971373182 Update Swedish translation. 2014-03-04 10:39:35 -08:00
Nick Hall ed65d4e7df 7342: Update column order in editor event tabs 2014-02-28 14:00:13 +00:00
Nick Hall a0bb7ddfd1 7342: Split details column in events gramplet 2014-02-28 13:56:07 +00:00
Nick Hall da3bff2ec4 7342: Update default columns in event view
Add main participant.
Change order to be consistent with selector.
2014-02-28 12:52:28 +00:00
Nick Hall 591263e4bb 7342: Better column order in event selector 2014-02-28 12:50:27 +00:00
Nick Hall 04f9d46451 Add author column to source selector 2014-02-28 12:14:47 +00:00
Vassilii Khachaturov 17a4147644 7097: EditNote hangs initially on misspelled note
reapply [4182ac] from gramps40
2014-02-27 18:57:21 +02:00
Paul Franklin 7f2bd919a1 7276: translate some punctuation marks -- partial 2014-02-26 10:20:11 -08:00
John Ralls 8ee6525f06 Move icu module to gtk-osx-unsupported.modules 2014-02-25 15:19:33 -08:00
Vassilii Khachaturov 4ede3aa4ab 7097: spell.py hangs on a note for tens of secods
Back-port my fix from gramps40: [ef1027] [c81ff4] [ee9151]
2014-02-19 16:33:12 +02:00
Jérôme Rapinat 567a526857 566 7477: Translate 'New Style' and 'Default' on StyleEditor; update template for translation strings 2014-02-19 15:27:54 +01:00
Mirko Leonhaeuser 574124a688 fix bug #0007487 and update German translation 2014-02-18 21:43:26 +01:00
noirauds a588afb395 0007488: After creating narrative web report, some temporary files remains in /tmp 2014-02-17 09:46:54 +01:00
Paul Franklin 3e8ca5613e 7477: Users should not be allowed to delete 'default' style in Style Editor 2014-02-16 11:25:54 -08:00
Paul Franklin 5a1694b981 translate some paper names, suggested in 0566 2014-02-16 11:16:47 -08:00
Paul Franklin 7434da9f63 0566: Translate the "New Style" and "Default" on StyleEditor.py 2014-02-16 11:11:53 -08:00
Paul Franklin 67b5308f6f encode every "style" file in utf-8 2014-02-09 13:33:39 -08:00
noirauds 2c2f42be55 bug 7368 : os.environ['http_proxy'] gives an error if http_proxy is not set. 2014-02-09 11:02:01 +01:00
noirauds ca8f2626c4 bug 7368 : Geography gramplet does not communicate over proxy server with autorisation. 2014-02-08 12:53:34 +01:00
Paul Franklin 7f757e0304 7439: pre-load alert dialogs crash w/o DISPLAY 2014-02-04 20:22:47 -08:00
Jérôme Rapinat e4abd21dae 3 new strings [221541] 2014-02-04 18:50:27 +01:00
Nick Hall 4fbcb530cf Fix person sidebar filter 2014-02-04 15:38:39 +00:00
Nick Hall 2215416396 Add HasDayOfWeek rule 2014-02-03 21:58:04 +00:00
Nick Hall 600043913b 7419: HasEventBase should not include primary role 2014-02-02 16:08:06 +00:00
Nick Hall c31dfcb767 7429: Fix bug when an empty string is used as custom type 2014-02-02 15:35:19 +00:00
John Ralls 27c25b876d Don't load quartz input module on OSX 10.5 2014-02-01 13:11:35 -08:00
Jérôme Rapinat ed8847b3d9 7427: do not depend on osmgpsmap and pyexiv2 (debian package); include gramps-autogen.sh into next tarballs 2014-01-31 19:47:56 +01:00
Mirko Leonhaeuser 1baa31be41 update German translation 2014-01-29 18:22:23 +01:00
John Ralls abc534ee44 Updates for 3.4.7 2014-01-28 16:29:58 -08:00
Nick Hall f277f6c00c 7419: Fix HasEvent filter in sidebar gramplet 2014-01-28 19:14:41 +00:00
Jérôme Rapinat 427a47b642 7413: COPYING file is missing into debian package 2014-01-27 18:18:33 +01:00
Jérôme Rapinat f25cd60b64 Bump to '3.4.8' 2014-01-27 11:04:46 +01:00
138 changed files with 43692 additions and 36473 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
SUBDIRS = m4 po src data example
EXTRA_DIST = \
config.rpath autogen.sh \
config.rpath autogen.sh gramps-autogen.sh \
FAQ COPYING \
intltool-extract.in intltool-merge.in intltool-update.in
+72
View File
@@ -1,3 +1,75 @@
2014-04-30
Version 3.4.9 of Gramps! "I am no longer infected", a maintenance release.
* Error converting python2 utf-8 strings to python3 str when loading data from database
* Gedcom input: SUBN and SUBM record handling
* [Gedcom] import/export round trip causes lost information
* [Gedcom] Gramps can't import estim. date period exported by itself
* [Gedcom] import deletes first char of notes
* [Gedcom] import of embedded notes attached to media does not work
* [Gedcom] NameError in importer
* [Gedcom] export does not export media attached to citations
* [Gedcom] Errors handling owner/submitter information
* [Gedcom] Event address is lost on import, i.e. disconnected from event
* [Gedcom] Entering a witness to an event such as marriage might be ignored
* [Gedcom] Importing file containing multibyte UTF-8 characters fails
* Event list in editors does not display content into 'Main Participants' column
* Fix 'Last Change' column into Person Selector
* Support creating directories in various scenarios
* tag_map is not initialized
* Fix bad handle in explanation note for unknown event
* Narrative website: Missing webpage for media with missing thumbnail on person page
* Enable the "default" CSS choice for the narrated web report
* Crash while scrolling in person view
* Crash when attempting to create Places Report
* Error in Session Log gramplet with no active person
* In Ahnentafel Report, Use Christening Date if no Birth Date Present
* Family with children but no parents is lost on filtered export
* Some labels now fit better on citations sidebar filter
* Can't disable box shadow in SVG descendant tree
* Descendant tree graphical report, syntax error in svg output
* Various problems with docgen.TextDoc.add_media_object
* Spurious spaces in CLI List Family Trees, tab delimited output. Print statements changed to assemble the whole line before output.
* GuiColorOption missing avail-changed event handler
* Regression: running gramps from crontab fails
* Better support for handling custom media attributes on edition
* DB lock not checked when opening database from the recent opened trees menu item
* List index out of range" on [initial CLI "gramps -t"]
* HTML View fails to load on Debian unstable
* Fix unknown gender relationships hander for the french locale
* Can't fill in calculated and estimated dates in czech locale
* Enhance Serbian date handler to handle Cyrillic dates
* Updated translations: cs, de, fr, hu, it
* Fix mac menubar setting
* Fix mac OsmGpsMaps setting
* Enable PIL with Freetype2 support on mac
2014-05-29
Version 3.4.8 of Gramps! "Forget about your sin, give the audience a grin", a maintenance release.
* Database corrupted - TypeError: unhashable type: 'list'
* Fix bug in abandon changes and quit
* Fix error when importing database from the CLI
* 'Display as' field in Name Editor reverts to Preferences default
* Geography does not communicate over proxy server with autorisation
* Event gramplet filter does not have field for primary role
* New HasDayOfWeek filter rule
* Error when leaving a Gramps type field blank in an editor
* Fix creation of events with same Gramps-ID
* Enhancements and consitency on events gramplet, selector and view
* Enhanced Citation Editor
* Fix update of active object after merge
* Do not drag and drop more than one data into editor tabs
* Media Editor error if Path value was changed to a non existing file
* Register history objects at startup
* Users should not be allowed to edit and delete 'default' style into Style Editor
* Missing closing bracket in Web_Basic-Spruce.css
* Some temporary files remains in /tmp with NarrativeWeb report
* Some fixes and enhancements
* No narrative.css File After Running Narrated Website Report
* Paper names and Styles values are now translated
* Translate some punctuation marks
* Fix Relationships handler for Portuguese
* Updated translations: ar, cs, de, es, fr, he, it, ru, sk, sv
2014-01-27
Version 3.4.7 of Gramps! "Ask me tomorrow, but not today", a maintenance release.
* Gramps project web hosting now has an HTTPS interface; the old HTTP URLs redirect to it.
+1 -1
View File
@@ -5,7 +5,7 @@ dnl May need to run automake && aclocal first
AC_PREREQ(2.57)
dnl NOTE: arg to macro below becomes the "VERSION"
AC_INIT(gramps, 3.4.7, [gramps-bugs@lists.sourceforge.net])
AC_INIT(gramps, 3.4.9, [gramps-bugs@lists.sourceforge.net])
AC_CONFIG_SRCDIR(configure.in)
AM_INIT_AUTOMAKE([1.6.3 foreign])
+2 -2
View File
@@ -11,8 +11,8 @@ Homepage: http://www.gramps-project.org/
Package: gramps
Architecture: all
Depends: ${python:Depends}, librsvg2-common, python-gtk2, xdg-utils, python-pyexiv2, python-osmgpsmap, ${misc:Depends}
Recommends: graphviz, python-pyicu
Depends: ${python:Depends}, librsvg2-common, python-gtk2, xdg-utils, ${misc:Depends}
Recommends: graphviz, python-pyicu, python-pyexiv2, python-osmgpsmap,
Suggests: ttf-freefont, python-gtkspell, python-pygoocanvas, python-webkit
Description: Genealogical research program
GRAMPS is an Open Source genealogy program written in Python, using
+2 -1
View File
@@ -9,7 +9,8 @@
# Remove COPYING file (duplicates standard copyright)
override_dh_install:
dh_install
rm debian/gramps/usr/share/gramps/COPYING
# Need COPYING file into About dialog
#rm debian/gramps/usr/share/gramps/COPYING
# Test packager mode to avoid installing mime type
override_dh_auto_configure:
+32 -32
View File
@@ -25,7 +25,7 @@
1 BIRT
2 TYPE Birth of Anna Hansdotter
2 DATE 2 OCT 1864
2 PLAC Loderup, Malmous Lan, Sweden
2 PLAC Löderup, Malmöhus Län, Sweden
1 DEAT
2 TYPE Death of Anna Hansdotter
2 DATE 29 SEP 1945
@@ -55,7 +55,7 @@
1 BIRT
2 TYPE Birth of Hans Peter Smith
2 DATE 17 APR 1904
2 PLAC Ronne, Bornholm, Denmark
2 PLAC Rønne, Bornholm, Denmark
1 DEAT
2 TYPE Death of Hans Peter Smith
2 DATE 29 JAN 1977
@@ -74,7 +74,7 @@
1 BIRT
2 TYPE Birth of Hanna Smith
2 DATE 29 JAN 1821
2 PLAC Gladsax, Kristianstad Lan, Sweden
2 PLAC Gladsax, Kristianstad Län, Sweden
1 FAMC @F0@
1 CHAN
2 DATE 21 DEC 2007
@@ -87,7 +87,7 @@
1 BIRT
2 TYPE Birth of Herman Julius Nielsen
2 DATE 31 AUG 1889
2 PLAC Ronne, Bornholm, Denmark
2 PLAC Rønne, Bornholm, Denmark
1 DEAT
2 TYPE Death of Herman Julius Nielsen
2 DATE 1945
@@ -128,7 +128,7 @@
1 BIRT
2 TYPE Birth of Gus Smith
2 DATE 11 SEP 1897
2 PLAC Ronne, Bornholm, Denmark
2 PLAC Rønne, Bornholm, Denmark
1 DEAT
2 TYPE Death of Gus Smith
2 DATE 21 OCT 1963
@@ -146,7 +146,7 @@
1 BIRT
2 TYPE Birth of Jennifer Anderson
2 DATE 5 NOV 1907
2 PLAC Ronne, Bornholm, Denmark
2 PLAC Rønne, Bornholm, Denmark
1 DEAT
2 TYPE Death of Jennifer Anderson
2 DATE 29 MAY 1985
@@ -163,7 +163,7 @@
1 BIRT
2 TYPE Birth of Lillie Harriet Jones
2 DATE 2 MAY 1910
2 PLAC Ronne, Bornholm, Denmark
2 PLAC Rønne, Bornholm, Denmark
1 DEAT
2 TYPE Death of Lillie Harriet Jones
2 DATE 26 JUN 1990
@@ -227,7 +227,7 @@
1 BIRT
2 TYPE Birth of Carl Emil Smith
2 DATE 20 DEC 1899
2 PLAC Ronne, Bornholm, Denmark
2 PLAC Rønne, Bornholm, Denmark
1 DEAT
2 TYPE Death of Carl Emil Smith
2 DATE 28 JAN 1959
@@ -245,11 +245,11 @@
1 BIRT
2 TYPE Birth of Hjalmar Smith
2 DATE 31 JAN 1893
2 PLAC Ronne, Bornholm, Denmark
2 PLAC Rønne, Bornholm, Denmark
1 DEAT
2 TYPE Death of Hjalmar Smith
2 DATE 25 SEP 1894
2 PLAC Ronne, Bornholm, Denmark
2 PLAC Rønne, Bornholm, Denmark
1 FAMC @F3@
1 CHAN
2 DATE 21 DEC 2007
@@ -262,7 +262,7 @@
1 BIRT
2 TYPE Birth of Martin Smith
2 DATE 19 NOV 1830
2 PLAC Gladsax, Kristianstad Lan, Sweden
2 PLAC Gladsax, Kristianstad Län, Sweden
1 DEAT
2 TYPE Death of Martin Smith
2 DATE BET 1899 AND 1905
@@ -270,7 +270,7 @@
1 BAPM
2 TYPE Baptism of Martin Smith
2 DATE 23 NOV 1830
2 PLAC Gladsax, Kristianstad Lan, Sweden
2 PLAC Gladsax, Kristianstad Län, Sweden
1 FAMC @F0@
1 FAMS @F2@
1 NOTE @N0002@
@@ -285,7 +285,7 @@
1 BIRT
2 TYPE Birth of Astrid Shermanna Augusta Smith
2 DATE 31 JAN 1889
2 PLAC Ronne, Bornholm, Denmark
2 PLAC Rønne, Bornholm, Denmark
1 DEAT
2 TYPE Death of Astrid Shermanna Augusta Smith
2 DATE 21 DEC 1963
@@ -304,7 +304,7 @@
1 BIRT
2 TYPE Birth of Gustaf Smith, Sr.
2 DATE 28 NOV 1862
2 PLAC Grostorp, Kristianstad Lan, Sweden
2 PLAC Grostorp, Kristianstad Län, Sweden
1 DEAT
2 TYPE Death of Gustaf Smith, Sr.
2 DATE BEF 23 JUL 1930
@@ -316,7 +316,7 @@
1 CHR
2 TYPE Christening of Gustaf Smith, Sr.
2 DATE 7 DEC 1862
2 PLAC Gladsax, Kristianstad Lan, Sweden
2 PLAC Gladsax, Kristianstad Län, Sweden
1 FAMC @F2@
1 FAMS @F3@
1 CHAN
@@ -343,7 +343,7 @@
1 BIRT
2 TYPE Birth of Kirsti Marie Smith
2 DATE 15 DEC 1886
2 PLAC Ronne, Bornholm, Denmark
2 PLAC Rønne, Bornholm, Denmark
1 DEAT
2 TYPE Death of Kirsti Marie Smith
2 DATE 18 JUL 1966
@@ -378,7 +378,7 @@
1 DEAT
2 TYPE Death of Anna Streiffert
2 DATE 2 FEB 1927
2 PLAC Ronne, Bornholm, Denmark
2 PLAC Rønne, Bornholm, Denmark
1 FAMS @F11@
1 CHAN
2 DATE 21 DEC 2007
@@ -407,11 +407,11 @@
1 BIRT
2 TYPE Birth of Magnes Smith
2 DATE 6 OCT 1858
2 PLAC Simrishamn, Kristianstad Lan, Sweden
2 PLAC Simrishamn, Kristianstad Län, Sweden
1 DEAT
2 TYPE Death of Magnes Smith
2 DATE 20 FEB 1910
2 PLAC Ronne, Bornholm, Denmark
2 PLAC Rønne, Bornholm, Denmark
1 FAMC @F2@
1 FAMS @F11@
1 CHAN
@@ -515,14 +515,14 @@
1 BIRT
2 TYPE Birth of Elna Jefferson
2 DATE 14 SEP 1800
2 PLAC Gladsax, Kristianstad Lan, Sweden
2 PLAC Gladsax, Kristianstad Län, Sweden
1 DEAT
2 TYPE Death of Elna Jefferson
2 PLAC Sweden
1 CHR
2 TYPE Christening of Elna Jefferson
2 DATE 16 SEP 1800
2 PLAC Gladsax, Kristianstad Lan, Sweden
2 PLAC Gladsax, Kristianstad Län, Sweden
1 FAMS @F0@
1 CHAN
2 DATE 21 DEC 2007
@@ -560,7 +560,7 @@
1 BIRT
2 TYPE Birth of Kerstina Hansdotter
2 DATE 29 NOV 1832
2 PLAC Smestorp, Kristianstad Lan, Sweden
2 PLAC Smestorp, Kristianstad Län, Sweden
1 DEAT
2 TYPE Death of Kerstina Hansdotter
2 DATE BEF 1908
@@ -577,7 +577,7 @@
1 BIRT
2 TYPE Birth of Martin Smith
2 DATE BET 1794 AND 1796
2 PLAC Tommarp, Kristianstad Lan, Sweden
2 PLAC Tommarp, Kristianstad Län, Sweden
1 DEAT
2 TYPE Death of Martin Smith
2 PLAC Sweden
@@ -594,7 +594,7 @@
1 BIRT
2 TYPE Birth of Ingeman Smith
2 DATE 29 JAN 1826
2 PLAC Gladsax, Kristianstad Lan, Sweden
2 PLAC Gladsax, Kristianstad Län, Sweden
1 FAMC @F0@
1 CHAN
2 DATE 21 DEC 2007
@@ -661,7 +661,7 @@
1 BIRT
2 TYPE Birth of Ingar Smith
2 DATE AFT 1823
2 PLAC Gladsax, Kristianstad Lan, Sweden
2 PLAC Gladsax, Kristianstad Län, Sweden
1 FAMC @F0@
1 CHAN
2 DATE 21 DEC 2007
@@ -674,7 +674,7 @@
1 BIRT
2 TYPE Birth of Hjalmar Smith
2 DATE 7 APR 1895
2 PLAC Ronne, Bornholm, Denmark
2 PLAC Rønne, Bornholm, Denmark
1 DEAT
2 TYPE Death of Hjalmar Smith
2 DATE 26 JUN 1975
@@ -682,7 +682,7 @@
1 BAPM
2 TYPE Baptism of Hjalmar Smith
2 DATE 3 JUN 1895
2 PLAC Ronne Bornholm, Denmark
2 PLAC Rønne Bornholm, Denmark
1 EVEN
2 TYPE Immi
2 DATE 14 NOV 1912
@@ -701,7 +701,7 @@
1 BIRT
2 TYPE Birth of Emil Smith
2 DATE 27 SEP 1860
2 PLAC Simrishamn, Kristianstad Lan, Sweden
2 PLAC Simrishamn, Kristianstad Län, Sweden
1 FAMC @F2@
1 CHAN
2 DATE 21 DEC 2007
@@ -712,7 +712,7 @@
1 MARR
2 TYPE Marriage of Martin Smith and Elna Jefferson
2 DATE ABT 1816
2 PLAC Gladsax, Kristianstad Lan, Sweden
2 PLAC Gladsax, Kristianstad Län, Sweden
1 CHIL @I11@
1 CHIL @I7@
1 CHIL @I4@
@@ -748,7 +748,7 @@
1 MARR
2 TYPE Marriage of Magnes Smith and Anna Streiffert
2 DATE 24 AUG 1884
2 PLAC Ronne, Bornholm, Denmark
2 PLAC Rønne, Bornholm, Denmark
1 CHAN
2 DATE 21 DEC 2007
3 TIME 01:35:26
@@ -805,7 +805,7 @@
1 MARR
2 TYPE Marriage of Gustaf Smith, Sr. and Anna Hansdotter
2 DATE 27 NOV 1885
2 PLAC Ronne, Bornholm, Denmark
2 PLAC Rønne, Bornholm, Denmark
1 CHIL @I26@
1 CHIL @I23@
1 CHIL @I21@
@@ -831,7 +831,7 @@
1 MARR
2 TYPE Marriage of Herman Julius Nielsen and Astrid Shermanna Augusta Smith
2 DATE 30 NOV 1912
2 PLAC Ronne, Bornholm, Denmark
2 PLAC Rønne, Bornholm, Denmark
1 CHAN
2 DATE 21 DEC 2007
3 TIME 01:35:26
+27
View File
@@ -0,0 +1,27 @@
*** a/_imagingft.c Sat Oct 31 17:44:12 2009
--- b/_imagingft.c Thu May 22 12:30:02 2014
***************
*** 70,76 ****
--- 70,80 ----
const char* message;
} ft_errors[] =
+ #if defined(USE_FREETYPE_2_1)
+ #include <freetype2/fterrors.h>
+ #else
#include <freetype/fterrors.h>
+ #endif
/* -------------------------------------------------------------------- */
/* font objects */
--- a/setup.py Sun Nov 15 08:06:10 2009
+++ b/setup.py Fri May 23 11:26:20 2014
@@ -348,7 +348,7 @@
dir = os.path.join(root, "Tk.framework", "Headers")
add_directory(self.compiler.include_dirs, dir, 1)
break
- if frameworks:
+ if False:
exts.append(Extension(
"_imagingtk", ["_imagingtk.c", "Tk/tkImaging.c"],
extra_compile_args=frameworks, extra_link_args=frameworks
+4 -4
View File
@@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>Gramps</string>
<key>CFBundleGetInfoString</key>
<string>Gramps 3.4.6-1, (C) 1997-2013 The Gramps Team http://www.gramps-project.org</string>
<string>Gramps 3.4.9-1, (C) 1997-2015 The Gramps Team http://www.gramps-project.org</string>
<key>CFBundleIconFile</key>
<string>gramps.icns</string>
<key>CFBundleIdentifier</key>
@@ -17,15 +17,15 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.4.6-1</string>
<string>3.4.9-1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleName</key>
<string>Gramps</string>
<key>CFBundleVersion</key>
<string>3.4.6-1</string>
<string>3.4.9-1</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright 1997 - 2013 The Gramps Team, GNU General Public License.</string>
<string>Copyright 1997 - 2015 The Gramps Team, GNU General Public License.</string>
<key>LSMinimumSystemVersion</key>
<string>10.5</string>
</dict>
+6 -6
View File
@@ -72,7 +72,7 @@
</binary>
<binary>
${prefix}/lib/libgtkmacintegration.2.dylib
${prefix}/lib/libgtkmacintegration-gtk2.2.dylib
</binary>
<binary>
@@ -100,7 +100,7 @@
</binary>
<binary>
${prefix}/lib/libtiff.3.dylib
${prefix}/lib/libtiff.5.dylib
</binary>
<binary dest="${bundle}/Contents/MacOS/">
@@ -138,10 +138,6 @@
${prefix}/include/python2.7/pyconfig.h
</data>
<data>
${prefix}/etc/pango/
</data>
<data recurse="True">
${prefix}/share/gramps/*.py
</data>
@@ -158,6 +154,10 @@
${prefix}/share/gramps/images/
</data>
<data>
${prefix}/share/gramps/plugins/webstuff/
</data>
<!--data>
${prefix}/share/webkit-1.0/
</data-->
+6 -3
View File
@@ -23,8 +23,10 @@ export GTK_PATH="$bundle_res"
export PANGO_RC_FILE="$bundle_etc/pango/pangorc"
export PANGO_SYSCONFDIR="$bundle_etc"
export PANGO_LIBDIR="$bundle_lib"
export GDK_PIXBUF_MODULE_FILE="$bundle_etc/gtk-2.0/gdk-pixbuf.loaders"
export GTK_IM_MODULE_FILE="$bundle_etc/gtk-2.0/gtk.immodules"
export GDK_PIXBUF_MODULE_FILE="$bundle_lib/gdk-pixbuf-2.0/2.10.0/loaders.cache"
if [ `uname -r | cut -d . -f 1` -ge 10 ]; then
export GTK_IM_MODULE_FILE="$bundle_etc/gtk-2.0/gtk.immodules"
fi
export GTK2_RC_FILES="$bundle_etc/gtk-2.0/gtkrc"
export GVBINDIR="$bundle_lib/graphviz"
@@ -38,7 +40,8 @@ export PYTHONPATH="$bundle_lib/python$PYVER/site-packages/gtk-2.0:$PYTHONPATH"
export GRAMPSDIR="$bundle_data"/gramps
export GRAMPSI18N="$bundle_data"/locale
export GRAMPSHOME="$HOME/Library/Application Support"
export USERPROFILE="$HOME"
export APPDATA="$HOME/Library/Application Support"
# Strip out the argument added by the OS.
if /bin/expr "x$1" : '^x-psn_' > /dev/null; then
+15 -31
View File
@@ -21,8 +21,8 @@
href="http://download.oracle.com/"/>
<repository type="tarball" name="pymodules"
href="http://pypi.python.org/packages/source/"/>
<repository type="tarball" name="stowers"
href="http://www.johnstowers.co.nz/files/"/>
<repository type="git" name="github"
href="git://github.com/"/>
<repository type="tarball" name="graphviz"
href="http://www.graphviz.org/pub/graphviz/stable/SOURCES/"/>
<repository type="tarball" name="launchpad"
@@ -59,11 +59,11 @@ ige-mac-bundler gtk-osx-build/projects/gramps/gramps.bundle
<include href="https://raw.github.com/jralls/gtk-osx-build/master/modulesets-stable/gtk-osx.modules"/>
<include href="http://git.gnome.org/browse/gtk-osx/plain/modulesets-stable/gtk-osx.modules"/>
<!--include href="/Users/john/Development/GTK-OSX/gtk-osx-build/modulesets-stable/gtk-osx.modules"/-->
<autotools id="gramps" autogen-sh="configure">
<branch module="gramps/gramps-3.4.6.tar.gz" version="3.4.6"
<branch module="gramps/gramps-3.4.9.tar.gz" version="3.4.9"
repo="sourceforge">
</branch>
<dependencies>
@@ -74,7 +74,7 @@ ige-mac-bundler gtk-osx-build/projects/gramps/gramps.bundle
<dep package="shared-mime-info"/>
<dep package="hunspell"/>
<dep package="pygtk-extras"/>
<dep package="osmgpsmap-py"/>
<dep package="osmgpsmap"/>
<dep package="graphviz"/>
<dep package="pyicu"/>
</dependencies>
@@ -93,7 +93,7 @@ ige-mac-bundler gtk-osx-build/projects/gramps/gramps.bundle
<dep package="shared-mime-info"/>
<dep package="hunspell"/>
<dep package="pygtk-extras"/>
<dep package="osmgpsmap-py"/>
<dep package="osmgpsmap"/>
<dep package="graphviz"/>
</dependencies>
<after>
@@ -138,27 +138,15 @@ ige-mac-bundler gtk-osx-build/projects/gramps/gramps.bundle
<branch module="xdg-utils-1.0.2.tgz" version="1.0.2" repo="xdg-utils"/>
</autotools>
<autotools id="osmgpsmap" autogenargs="--disable-introspection"
autogen-sh="configure">
<branch module="osm-gps-map/osm-gps-map-0.7.3.tar.gz" repo="stowers"
version="0.7.3"/>
<autotools id="osmgpsmap" skip-autogen="never"
supports-non-srcdir-builds="no">
<branch module="nzjrs/osm-gps-map" revision="gtk2" repo="github"/>
<dependencies>
<dep package="gtk+"/>
<dep package="libsoup"/>
</dependencies>
</autotools>
<distutils id="osmgpsmap-py" autogen-sh="gnome-autogen.sh">
<branch module="osm-gps-map/python-osmgpsmap-0.7.3.tar.gz" repo="stowers"
version="0.7.3"/>
<dependencies>
<dep package="osmgpsmap"/>
<dep package="pygtk"/>
<dep package="pycairo-python2.6"/>
<dep package="pygobject"/>
</dependencies>
</distutils>
<autotools id="graphviz" autogen-sh="configure"
autogenargs="--disable-sharp --disable-guile --disable-java --disable-lua --disable-ocaml --disable-perl --disable-php --disable-r --disable-ruby --disable-tcl --without-x --with-pangocairo --with-included-ltdl=yes">
<branch module="graphviz-2.28.0.tar.gz" version="2.28.0" repo="graphviz"/>
@@ -169,11 +157,11 @@ ige-mac-bundler gtk-osx-build/projects/gramps/gramps.bundle
</dependencies>
</autotools>
<autotools id="exiv2">
<autotools id="exiv2" supports-non-srcdir-builds="no">
<branch module="exiv2-0.21.1.tar.gz" repo="exiv2.org" version="0.21.1"/>
</autotools>
<autotools id="boost">
<autotools id="boost" supports-non-srcdir-builds="no">
<branch module="boost/boost_1_46_1.tar.bz2" repo="sourceforge"
version="1.46.1"/>
</autotools>
@@ -182,7 +170,7 @@ ige-mac-bundler gtk-osx-build/projects/gramps/gramps.bundle
<branch repo="sourceforge" module="scons/scons-2.0.1.tar.gz" version="2.0.1"/>
</distutils>
<autotools id="pyexiv2">
<autotools id="pyexiv2" supports-non-srcdir-builds="no">
<branch module="pyexiv2/0.3.x/0.3/+download/pyexiv2-0.3.0.tar.bz2"
repo="launchpad" version="0.3.0"/>
<dependencies>
@@ -196,15 +184,11 @@ ige-mac-bundler gtk-osx-build/projects/gramps/gramps.bundle
</autotools>
<distutils id="pil">
<branch module="Imaging-1.1.7.tar.gz" version="1.1.7" repo="pythonware"/>
<branch module="Imaging-1.1.7.tar.gz" version="1.1.7" repo="pythonware">
<patch file="Imaging-Freetype2.patch" strip="1"/>
</branch>
</distutils>
<autotools id='icu' autogen-sh='source/configure'
makeargs='CFLAGS="$CFLAGS -DU_CHARSET_IS_UTF8=1 -DU_USING_ICU_NAMESPACE=0"'>
<branch repo='icu' version='50.1.2' checkoutdir='icu'
module='icu4c/50.1.2/icu4c-50_1_2-src.tgz'/>
</autotools>
<distutils id='pyicu'>
<branch version='1.5' repo='pymodules'
module='P/PyICU/PyICU-1.5.tar.gz'/>
+4
View File
@@ -50,6 +50,7 @@ src/gen/lib/familyreltype.py
src/gen/lib/grampstype.py
src/gen/lib/ldsord.py
src/gen/lib/markertype.py
src/gen/lib/name.py
src/gen/lib/nametype.py
src/gen/lib/nameorigintype.py
src/gen/lib/notetype.py
@@ -72,6 +73,7 @@ src/gen/plug/utils.py
# gen docgen API
src/gen/plug/docgen/graphdoc.py
src/gen/plug/docgen/paperstyle.py
# plugin report base API (was ReportBase)
src/gen/plug/report/_constants.py
@@ -116,6 +118,7 @@ src/gui/editors/editperson.py
src/gui/editors/editpersonref.py
src/gui/editors/editplace.py
src/gui/editors/editprimary.py
src/gui/editors/editreference.py
src/gui/editors/editreporef.py
src/gui/editors/editrepository.py
src/gui/editors/editsource.py
@@ -576,6 +579,7 @@ src/Filters/Rules/Event/_EventPrivate.py
src/Filters/Rules/Event/_HasAttribute.py
src/Filters/Rules/Event/_HasCitation.py
src/Filters/Rules/Event/_HasData.py
src/Filters/Rules/Event/_HasDayOfWeek.py
src/Filters/Rules/Event/_HasGallery.py
src/Filters/Rules/Event/_HasIdOf.py
src/Filters/Rules/Event/_HasNote.py
+1 -3
View File
@@ -124,7 +124,6 @@ src/gen/lib/locationbase.py
src/gen/lib/mediaobj.py
src/gen/lib/mediabase.py
src/gen/lib/mediaref.py
src/gen/lib/name.py
src/gen/lib/note.py
src/gen/lib/notebase.py
src/gen/lib/personref.py
@@ -186,7 +185,6 @@ src/gen/plug/docgen/fontscale.py
src/gen/plug/docgen/fontstyle.py
src/gen/plug/docgen/graphdoc.py
src/gen/plug/docgen/graphicstyle.py
src/gen/plug/docgen/paperstyle.py
src/gen/plug/docgen/paragraphstyle.py
src/gen/plug/docgen/stylesheet.py
src/gen/plug/docgen/tablestyle.py
@@ -222,7 +220,6 @@ src/gui/user.py
# gui/editors - the GUI editors package
src/gui/editors/__init__.py
src/gui/editors/editreference.py
src/gui/editors/editsecondary.py
# gui/editors/displaytabs - the GUI display tabs package
@@ -237,6 +234,7 @@ src/gui/editors/displaytabs/grampstab.py
src/gui/editors/displaytabs/groupembeddedlist.py
src/gui/editors/displaytabs/ldsmodel.py
src/gui/editors/displaytabs/locationmodel.py
src/gui/editors/displaytabs/mediaattrembedlist.py
src/gui/editors/displaytabs/mediabackreflist.py
src/gui/editors/displaytabs/notebackreflist.py
src/gui/editors/displaytabs/personrefmodel.py
+3734 -5049
View File
File diff suppressed because it is too large Load Diff
+4 -2
View File
@@ -13994,8 +13994,10 @@ msgstr "No heu especificat ningú"
#: ../src/plugins/graph/GVFamilyLines.py:921
#, python-format
msgid "%d children"
msgstr "%d fills"
msgid "%d child"
msgid_plural "%d children"
msgstr[0] "%d fill"
msgstr[1] "%d fills"
#: ../src/plugins/graph/GVHourGlass.py:57
#: ../src/plugins/graph/GVRelGraph.py:68
Executable → Regular
+33
View File
@@ -115,6 +115,38 @@ class Check_named_fmt( Check ):
msgstr = msg.msgstr[1]
self.__process( msg, msgid, msgstr )
class Check_mapping_fmt( Check ):
# A pattern to find all {}
find_map_pat = re.compile('\{ \w+ \}', re.VERBOSE)
def __init__( self ):
Check.__init__( self )
self.diag_header = "-------- {} name mismatches --------------"
self.summary_text = "{} name mismatches:"
def __process( self, msg, msgid, msgstr ):
# Same number of named formats?
fmts1 = self.find_map_pat.findall( msgid )
fmts2 = self.find_map_pat.findall( msgstr )
if len( fmts1 ) != len( fmts2 ):
self.msgs.append( msg )
else:
# Do we have the same named formats?
fmts1.sort()
fmts2.sort()
if fmts1 != fmts2:
self.msgs.append( msg )
def process( self, msg ):
msgid = msg.msgid
msgstr = msg.msgstr[0]
self.__process( msg, msgid, msgstr )
if msg.msgidp and len(msg.msgstr) >= 2:
msgid = msg.msgidp
msgstr = msg.msgstr[1]
self.__process( msg, msgid, msgstr )
class Check_missing_sd( Check ):
# A pattern to find %() without s or d
# Here is a command to use for testing
@@ -512,6 +544,7 @@ def analyze_msgs( options, fname, msgs, nr_templates = None, nth = 0 ):
checks.append( Check_fmt( '%s' ) )
checks.append( Check_fmt( '%d' ) )
checks.append( Check_named_fmt() )
checks.append( Check_mapping_fmt() )
checks.append( Check_missing_sd() )
checks.append( Check_runaway() )
checks.append( Check_xml_chars() )
+6582 -4400
View File
File diff suppressed because it is too large Load Diff
+4 -2
View File
@@ -13258,8 +13258,10 @@ msgstr "Du angav ikke nogen"
#: ../src/plugins/graph/GVFamilyLines.py:921
#, python-format
msgid "%d children"
msgstr "%d børn"
msgid "%d child"
msgid_plural "%d children"
msgstr[0] "%d barn"
msgstr[1] "%d børn"
#: ../src/plugins/graph/GVHourGlass.py:57
#: ../src/plugins/graph/GVRelGraph.py:68
+1931 -1723
View File
File diff suppressed because it is too large Load Diff
+4 -2
View File
@@ -14140,8 +14140,10 @@ msgstr "Δεν προσδιορίσατε κανέναν"
#: ../src/plugins/graph/GVFamilyLines.py:921
#, python-format
msgid "%d children"
msgstr "%d τέκνα"
msgid "%d child"
msgid_plural "%d children"
msgstr[0] "%d τέκνο"
msgstr[1] "%d τέκνα"
#: ../src/plugins/graph/GVHourGlass.py:57
#: ../src/plugins/graph/GVRelGraph.py:68
+5 -3
View File
@@ -14362,8 +14362,10 @@ msgstr "No especificó ninguna persona"
#: ../src/plugins/graph/GVFamilyLines.py:921
#, python-format
msgid "%d children"
msgstr "%d hijos"
msgid "%d child"
msgid_plural "%d children"
msgstr[0] "%d hijo"
msgstr[1] "%d hijos"
#: ../src/plugins/graph/GVHourGlass.py:57
#: ../src/plugins/graph/GVRelGraph.py:68
@@ -31128,7 +31130,7 @@ msgstr ""
"resuelve un problema persistente en genealogía: cómo manejar las variaciones "
"ortográficas. La utilidad SoundEx toma un apellido y genera una forma "
"simplificada que es equivalente para dos apellidos que suenan parecido. "
"Conocer el Código SoundEx de un apellido es muy útil al inverstigar datos "
"Conocer el Código SoundEx de un apellido es muy útil al investigar datos "
"del censo (en microficha) en una biblioteca u otro local de investigación. "
"Para obtener los códigos SoundEx de los apellidos de su base de datos, vaya "
"a &quot;Herramientas &gt; Utilidades &gt; Generar códigos SoundEx...&quot;."
+4 -2
View File
@@ -13416,8 +13416,10 @@ msgstr ""
#: ../src/plugins/graph/GVFamilyLines.py:921
#, python-format
msgid "%d children"
msgstr "%d lasta"
msgid "%d child"
msgid_plural "%d children"
msgstr[0] "%d lapsi"
msgstr[1] "%d lasta"
#: ../src/plugins/graph/GVHourGlass.py:57
#: ../src/plugins/graph/GVRelGraph.py:68
+1767 -1625
View File
File diff suppressed because it is too large Load Diff
+1692 -1551
View File
File diff suppressed because it is too large Load Diff
+8752 -6138
View File
File diff suppressed because it is too large Load Diff
+5 -2
View File
@@ -13419,8 +13419,11 @@ msgstr "Niste nikoga odabrali"
#: ../src/plugins/graph/GVFamilyLines.py:921
#, python-format
msgid "%d children"
msgstr "%d djece"
msgid "%d child"
msgid_plural "%d children"
msgstr[0] "%d dijete"
msgstr[1] "%d djece"
msgstr[2] "%d djece"
#: ../src/plugins/graph/GVHourGlass.py:57
#: ../src/plugins/graph/GVRelGraph.py:68
+8069 -6316
View File
File diff suppressed because it is too large Load Diff
+5980 -5365
View File
File diff suppressed because it is too large Load Diff
+4 -2
View File
@@ -13287,8 +13287,10 @@ msgstr ""
#: ../src/plugins/graph/GVFamilyLines.py:921
#, python-format
msgid "%d children"
msgstr "%d 人の子供"
msgid "%d child"
msgid_plural "%d children"
msgstr[0] "%d 人の子供"
msgstr[1] "%d 人の子供"
#: ../src/plugins/graph/GVHourGlass.py:57
#: ../src/plugins/graph/GVRelGraph.py:68
+8 -5
View File
@@ -14337,8 +14337,11 @@ msgstr "Nieko nenurodėte!"
#: ../src/plugins/graph/GVFamilyLines.py:921
#, python-format
msgid "%d children"
msgstr "%d vaikai"
msgid "%d child"
msgid_plural "%d children"
msgstr[0] "%d vaikas"
msgstr[1] "%d vaikai"
msgstr[2] "%d vaikų"
#: ../src/plugins/graph/GVHourGlass.py:57
#: ../src/plugins/graph/GVRelGraph.py:68
@@ -23706,9 +23709,9 @@ msgstr "Prašom paleisti \"Tikrinti ir Taisyti duomenų bazę\" įrankį"
#, python-format
msgid " (%d child)"
msgid_plural " (%d children)"
msgstr[0] "(%d vaikas)"
msgstr[1] "(%d vaikai)"
msgstr[2] "(%d vaikų)"
msgstr[0] " (%d vaikas)"
msgstr[1] " (%d vaikai)"
msgstr[2] " (%d vaikų)"
#: ../src/plugins/view/relview.py:1328
#: ../src/plugins/view/relview.py:1375
+4 -2
View File
@@ -13319,8 +13319,10 @@ msgstr "Du valgte ingen"
#: ../src/plugins/graph/GVFamilyLines.py:921
#, python-format
msgid "%d children"
msgstr "%d barn"
msgid "%d child"
msgid_plural "%d children"
msgstr[0] "%d barn"
msgstr[1] "%d barn"
#: ../src/plugins/graph/GVHourGlass.py:57
#: ../src/plugins/graph/GVRelGraph.py:68
+4 -2
View File
@@ -14463,8 +14463,10 @@ msgstr "U heeft niemand opgegeven"
#: ../src/plugins/graph/GVFamilyLines.py:921
#, python-format
msgid "%d children"
msgstr "%d kinderen"
msgid "%d child"
msgid_plural "%d children"
msgstr[0] "%d kind"
msgstr[1] "%d kinderen"
#: ../src/plugins/graph/GVHourGlass.py:57
#: ../src/plugins/graph/GVRelGraph.py:68
+4 -2
View File
@@ -13161,8 +13161,10 @@ msgstr "Du spesifiserte ingen"
#: ../src/plugins/graph/GVFamilyLines.py:921
#, python-format
msgid "%d children"
msgstr "%d barn"
msgid "%d child"
msgid_plural "%d children"
msgstr[0] "%d barn"
msgstr[1] "%d barn"
#: ../src/plugins/graph/GVHourGlass.py:57
#: ../src/plugins/graph/GVRelGraph.py:68
+8 -5
View File
@@ -13347,8 +13347,11 @@ msgstr "Nie określiłeś nikogo"
#: ../src/plugins/graph/GVFamilyLines.py:921
#, python-format
msgid "%d children"
msgstr "%d dzieci"
msgid "%d child"
msgid_plural "%d children"
msgstr[0] "%d dziecko"
msgstr[1] "%d dzieci"
msgstr[2] "%d dzieci"
#: ../src/plugins/graph/GVHourGlass.py:57
#: ../src/plugins/graph/GVRelGraph.py:68
@@ -22435,9 +22438,9 @@ msgstr "Proszę najpierw uruchomić narzędzie Sprawdź i napraw bazę danych"
#, python-format
msgid " (%d child)"
msgid_plural " (%d children)"
msgstr[0] "(%d dziecko)"
msgstr[1] "(%d dzieci)"
msgstr[2] "(%d dzieci)"
msgstr[0] " (%d dziecko)"
msgstr[1] " (%d dzieci)"
msgstr[2] " (%d dzieci)"
#: ../src/plugins/view/relview.py:1328 ../src/plugins/view/relview.py:1375
msgid " (no children)"
+4 -2
View File
@@ -14111,8 +14111,10 @@ msgstr "Você não especificou ninguém"
#: ../src/plugins/graph/GVFamilyLines.py:921
#, python-format
msgid "%d children"
msgstr "%d filhos"
msgid "%d child"
msgid_plural "%d children"
msgstr[0] "%d filho(a)"
msgstr[1] "%d filhos(as)"
#: ../src/plugins/graph/GVHourGlass.py:57
#: ../src/plugins/graph/GVRelGraph.py:68
+4 -2
View File
@@ -13201,8 +13201,10 @@ msgstr "Você não especificou ninguém"
#: ../src/plugins/graph/GVFamilyLines.py:921
#, python-format
msgid "%d children"
msgstr "%d filhos"
msgid "%d child"
msgid_plural "%d children"
msgstr[0] "%d filho"
msgstr[1] "%d filhos"
#: ../src/plugins/graph/GVHourGlass.py:57
#: ../src/plugins/graph/GVRelGraph.py:68
+1470 -1223
View File
File diff suppressed because it is too large Load Diff
+5 -3
View File
@@ -14020,8 +14020,10 @@ msgstr "Nevybrali ste nikoho"
#: ../src/plugins/graph/GVFamilyLines.py:921
#, python-format
msgid "%d children"
msgstr "Počet detí %d"
msgid "%d child"
msgid_plural "%d children"
msgstr[0] "%d dieťa"
msgstr[1] "%d detí"
#: ../src/plugins/graph/GVHourGlass.py:57
#: ../src/plugins/graph/GVRelGraph.py:68
@@ -24092,7 +24094,7 @@ msgstr "Zrakovo postihnutí"
#: ../src/plugins/webreport/NarrativeWeb.py:1754
#: ../src/plugins/webreport/NarrativeWeb.py:1904
msgid "Html|Home"
msgstr "Domovská Htnl"
msgstr "Domovská Html"
#: ../src/plugins/webreport/NarrativeWeb.py:1755
#: ../src/plugins/webreport/NarrativeWeb.py:1861
+6 -2
View File
@@ -13099,8 +13099,12 @@ msgstr ""
#: ../src/plugins/graph/GVFamilyLines.py:921
#, python-format
msgid "%d children"
msgstr "Št. otrok: %d"
msgid "%d child"
msgid_plural "%d children"
msgstr[0] "%d otrok"
msgstr[1] "%d otrok"
msgstr[2] "%d otroka"
msgstr[3] "%d otroci"
#: ../src/plugins/graph/GVHourGlass.py:57
#: ../src/plugins/graph/GVRelGraph.py:68
+1586 -1372
View File
File diff suppressed because it is too large Load Diff
+5 -2
View File
@@ -13391,8 +13391,11 @@ msgstr "Ви нікого не вказали"
#: ../src/plugins/graph/GVFamilyLines.py:921
#, python-format
msgid "%d children"
msgstr "%d дітей"
msgid "%d child"
msgid_plural "%d children"
msgstr[0] "%d дитина"
msgstr[1] "%d дитини"
msgstr[2] "%d дітей"
#: ../src/plugins/graph/GVHourGlass.py:57
#: ../src/plugins/graph/GVRelGraph.py:68
+3 -2
View File
@@ -13466,8 +13466,9 @@ msgstr "Bạn chưa nêu một người nào"
#: ../src/plugins/graph/GVFamilyLines.py:921
#, python-format
msgid "%d children"
msgstr "%d con cái "
msgid "%d child"
msgid_plural "%d children"
msgstr[0] "%d con cái "
#: ../src/plugins/graph/GVHourGlass.py:57
#: ../src/plugins/graph/GVRelGraph.py:68
+4 -3
View File
@@ -13208,8 +13208,9 @@ msgstr ""
#: ../src/plugins/graph/GVFamilyLines.py:921
#, python-format
msgid "%d children"
msgstr "%d 子女"
msgid "%d child"
msgid_plural "%d children"
msgstr[0] "%d 子女"
#: ../src/plugins/graph/GVHourGlass.py:57
#: ../src/plugins/graph/GVRelGraph.py:68
@@ -21889,7 +21890,7 @@ msgstr "请运行检查和修复数据库工具"
#, python-format
msgid " (%d child)"
msgid_plural " (%d children)"
msgstr[0] "(%d 子女)"
msgstr[0] " (%d 子女)"
#: ../src/plugins/view/relview.py:1328 ../src/plugins/view/relview.py:1375
msgid " (no children)"
+1 -2
View File
@@ -271,8 +271,7 @@ class StandardCustomSelector(object):
instance.
"""
if isinstance(event_type, basestring):
if event_type:
return (self.custom_key, event_type)
return (self.custom_key, event_type)
elif isinstance(event_type, tuple):
if event_type[1]:
return (event_type[0], event_type[1])
+10 -8
View File
@@ -166,8 +166,10 @@ class DateParserCZ(DateParser):
}
quality_to_int = {
u'přibližně' : Date.QUAL_ESTIMATED,
u'odhadované' : Date.QUAL_ESTIMATED,
u'odh.' : Date.QUAL_ESTIMATED,
u'vypočteno' : Date.QUAL_CALCULATED,
u'vypočtené' : Date.QUAL_CALCULATED,
u'vyp.' : Date.QUAL_CALCULATED,
}
@@ -238,14 +240,14 @@ class DateDisplayCZ(DateDisplay):
return date.get_text()
elif start == Date.EMPTY:
return ""
elif mod == Date.MOD_NONE:
date_decl_string = self.display_cal[cal](start)
date_decl_string = date_decl_string.replace(u"den ", u"dna ")
date_decl_string = date_decl_string.replace(u"or ", u"ora ")
date_decl_string = date_decl_string.replace(u"en ", u"na ")
date_decl_string = date_decl_string.replace(u"ad ", u"adu ")
date_decl_string = date_decl_string.replace(u"ec ", u"ce ")
return date_decl_string
# elif mod == Date.MOD_NONE:
# date_decl_string = self.display_cal[cal](start)
# date_decl_string = date_decl_string.replace(u"den ", u"dna ")
# date_decl_string = date_decl_string.replace(u"or ", u"ora ")
# date_decl_string = date_decl_string.replace(u"en ", u"na ")
# date_decl_string = date_decl_string.replace(u"ad ", u"adu ")
# date_decl_string = date_decl_string.replace(u"ec ", u"ce ")
# return date_decl_string
elif mod == Date.MOD_SPAN:
dat1 = self.display_cal[cal](start)
dat2 = self.display_cal[cal](date.get_stop_date())
+235 -178
View File
@@ -16,10 +16,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# DateHandler/_Date_sr.py
# $Id$
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Serbian version by Vlada Perić <vlada.peric@gmail.com>, 2009.
@@ -28,7 +25,7 @@
"""
Serbian-specific classes for parsing and displaying dates.
"""
from __future__ import unicode_literals
#-------------------------------------------------------------------------
#
# Python modules
@@ -57,153 +54,153 @@ class DateParserSR(DateParser):
"""
month_to_int = DateParser.month_to_int
month_to_int[u"januar"] = 1
month_to_int[u"januara"] = 1
month_to_int[u"jan"] = 1
month_to_int[u"јан"] = 1
month_to_int[u"јануара"] = 1
month_to_int[u"јануар"] = 1
month_to_int[u"i"] = 1
month_to_int["januar"] = 1
month_to_int["januara"] = 1
month_to_int["jan"] = 1
month_to_int["јан"] = 1
month_to_int["јануара"] = 1
month_to_int["јануар"] = 1
month_to_int["i"] = 1
month_to_int[u"februar"] = 2
month_to_int[u"februara"] = 2
month_to_int[u"feb"] = 2
month_to_int[u"феб"] = 2
month_to_int[u"фебруар"] = 2
month_to_int[u"фебруара"] = 2
month_to_int[u"ii"] = 2
month_to_int["februar"] = 2
month_to_int["februara"] = 2
month_to_int["feb"] = 2
month_to_int["феб"] = 2
month_to_int["фебруар"] = 2
month_to_int["фебруара"] = 2
month_to_int["ii"] = 2
month_to_int[u"mart"] = 3
month_to_int[u"marta"] = 3
month_to_int[u"mar"] = 3
month_to_int[u"мар"] = 3
month_to_int[u"март"] = 3
month_to_int[u"марта"] = 3
month_to_int[u"iii"] = 3
month_to_int["mart"] = 3
month_to_int["marta"] = 3
month_to_int["mar"] = 3
month_to_int["мар"] = 3
month_to_int["март"] = 3
month_to_int["марта"] = 3
month_to_int["iii"] = 3
month_to_int[u"april"] = 4
month_to_int[u"aprila"] = 4
month_to_int[u"apr"] = 4
month_to_int[u"апр"] = 4
month_to_int[u"април"] = 4
month_to_int[u"априла"] = 4
month_to_int[u"iv"] = 4
month_to_int["april"] = 4
month_to_int["aprila"] = 4
month_to_int["apr"] = 4
month_to_int["апр"] = 4
month_to_int["април"] = 4
month_to_int["априла"] = 4
month_to_int["iv"] = 4
month_to_int[u"maj"] = 5
month_to_int[u"maja"] = 5
month_to_int[u"мај"] = 5
month_to_int[u"маја"] = 5
month_to_int[u"v"] = 5
month_to_int["maj"] = 5
month_to_int["maja"] = 5
month_to_int["мај"] = 5
month_to_int["маја"] = 5
month_to_int["v"] = 5
month_to_int[u"jun"] = 6
month_to_int[u"juna"] = 6
month_to_int[u"јун"] = 6
month_to_int[u"јуна"] = 6
month_to_int[u"vi"] = 6
month_to_int["jun"] = 6
month_to_int["juna"] = 6
month_to_int["јун"] = 6
month_to_int["јуна"] = 6
month_to_int["vi"] = 6
month_to_int[u"jul"] = 7
month_to_int[u"jula"] = 7
month_to_int[u"јул"] = 7
month_to_int[u"јула"] = 7
month_to_int[u"vii"] = 7
month_to_int["jul"] = 7
month_to_int["jula"] = 7
month_to_int["јул"] = 7
month_to_int["јула"] = 7
month_to_int["vii"] = 7
month_to_int[u"avgust"] = 8
month_to_int[u"avgusta"] = 8
month_to_int[u"avg"] = 8
month_to_int[u"авг"] = 8
month_to_int[u"август"] = 8
month_to_int[u"августа"] = 8
month_to_int[u"viii"] = 8
month_to_int["avgust"] = 8
month_to_int["avgusta"] = 8
month_to_int["avg"] = 8
month_to_int["авг"] = 8
month_to_int["август"] = 8
month_to_int["августа"] = 8
month_to_int["viii"] = 8
month_to_int[u"septembar"] = 9
month_to_int[u"septembra"] = 9
month_to_int[u"sep"] = 9
month_to_int[u"сеп"] = 9
month_to_int[u"септембар"] = 9
month_to_int[u"септембра"] = 9
month_to_int[u"ix"] = 9
month_to_int["septembar"] = 9
month_to_int["septembra"] = 9
month_to_int["sep"] = 9
month_to_int["сеп"] = 9
month_to_int["септембар"] = 9
month_to_int["септембра"] = 9
month_to_int["ix"] = 9
month_to_int[u"oktobar"] = 10
month_to_int[u"oktobra"] = 10
month_to_int[u"okt"] = 10
month_to_int[u"окт"] = 10
month_to_int[u"октобар"] = 10
month_to_int[u"октобра"] = 10
month_to_int[u"x"] = 10
month_to_int["oktobar"] = 10
month_to_int["oktobra"] = 10
month_to_int["okt"] = 10
month_to_int["окт"] = 10
month_to_int["октобар"] = 10
month_to_int["октобра"] = 10
month_to_int["x"] = 10
month_to_int[u"novembar"] = 11
month_to_int[u"novembra"] = 11
month_to_int[u"nov"] = 11
month_to_int[u"нов"] = 11
month_to_int[u"новембар"] = 11
month_to_int[u"новембра"] = 11
month_to_int[u"xi"] = 11
month_to_int["novembar"] = 11
month_to_int["novembra"] = 11
month_to_int["nov"] = 11
month_to_int["нов"] = 11
month_to_int["новембар"] = 11
month_to_int["новембра"] = 11
month_to_int["xi"] = 11
month_to_int[u"decembar"] = 12
month_to_int[u"decembra"] = 12
month_to_int[u"dec"] = 12
month_to_int[u"дец"] = 12
month_to_int[u"децембар"] = 12
month_to_int[u"децембра"] = 12
month_to_int[u"xii"] = 12
month_to_int["decembar"] = 12
month_to_int["decembra"] = 12
month_to_int["dec"] = 12
month_to_int["дец"] = 12
month_to_int["децембар"] = 12
month_to_int["децембра"] = 12
month_to_int["xii"] = 12
modifier_to_int = {
u'pre' : Date.MOD_BEFORE,
u'posle' : Date.MOD_AFTER,
u'oko' : Date.MOD_ABOUT,
u'cca' : Date.MOD_ABOUT,
'pre' : Date.MOD_BEFORE,
'posle' : Date.MOD_AFTER,
'oko' : Date.MOD_ABOUT,
'cca' : Date.MOD_ABOUT,
u'пре' : Date.MOD_BEFORE,
u'после' : Date.MOD_AFTER,
u'око' : Date.MOD_ABOUT,
'пре' : Date.MOD_BEFORE,
'после' : Date.MOD_AFTER,
'око' : Date.MOD_ABOUT,
}
calendar_to_int = {
u'gregorijanski' : Date.CAL_GREGORIAN,
u'greg.' : Date.CAL_GREGORIAN,
u'julijanski' : Date.CAL_JULIAN,
u'jul.' : Date.CAL_JULIAN,
u'hebrejski' : Date.CAL_HEBREW,
u'hebr.' : Date.CAL_HEBREW,
u'islamski' : Date.CAL_ISLAMIC,
u'isl.' : Date.CAL_ISLAMIC,
u'francuski republikanski': Date.CAL_FRENCH,
u'franc.' : Date.CAL_FRENCH,
u'persijski' : Date.CAL_PERSIAN,
u'pers. ' : Date.CAL_PERSIAN,
u'švedski' : Date.CAL_SWEDISH,
u'šv.' : Date.CAL_SWEDISH,
'gregorijanski' : Date.CAL_GREGORIAN,
'greg.' : Date.CAL_GREGORIAN,
'julijanski' : Date.CAL_JULIAN,
'jul.' : Date.CAL_JULIAN,
'hebrejski' : Date.CAL_HEBREW,
'hebr.' : Date.CAL_HEBREW,
'islamski' : Date.CAL_ISLAMIC,
'isl.' : Date.CAL_ISLAMIC,
'francuski republikanski': Date.CAL_FRENCH,
'franc.' : Date.CAL_FRENCH,
'persijski' : Date.CAL_PERSIAN,
'pers. ' : Date.CAL_PERSIAN,
'švedski' : Date.CAL_SWEDISH,
'šv.' : Date.CAL_SWEDISH,
u'грегоријански' : Date.CAL_GREGORIAN,
u'грег.' : Date.CAL_GREGORIAN,
u'јулијански' : Date.CAL_JULIAN,
u'јул.' : Date.CAL_JULIAN,
u'хебрејски' : Date.CAL_HEBREW,
u'хебр.' : Date.CAL_HEBREW,
u'исламски' : Date.CAL_ISLAMIC,
u'исл.' : Date.CAL_ISLAMIC,
u'француски републикански': Date.CAL_FRENCH,
u'франц.' : Date.CAL_FRENCH,
u'персијски' : Date.CAL_PERSIAN,
u'перс. ' : Date.CAL_PERSIAN,
u'шведски' : Date.CAL_SWEDISH,
u'шв' : Date.CAL_SWEDISH,
'грегоријански' : Date.CAL_GREGORIAN,
'грег.' : Date.CAL_GREGORIAN,
'јулијански' : Date.CAL_JULIAN,
'јул.' : Date.CAL_JULIAN,
'хебрејски' : Date.CAL_HEBREW,
'хебр.' : Date.CAL_HEBREW,
'исламски' : Date.CAL_ISLAMIC,
'исл.' : Date.CAL_ISLAMIC,
'француски републикански': Date.CAL_FRENCH,
'франц.' : Date.CAL_FRENCH,
'персијски' : Date.CAL_PERSIAN,
'перс. ' : Date.CAL_PERSIAN,
'шведски' : Date.CAL_SWEDISH,
'шв' : Date.CAL_SWEDISH,
}
quality_to_int = {
u'procenjeno' : Date.QUAL_ESTIMATED,
u'pro.' : Date.QUAL_ESTIMATED,
u'izračunato' : Date.QUAL_CALCULATED,
u'izr.' : Date.QUAL_CALCULATED,
'procenjeno' : Date.QUAL_ESTIMATED,
'pro.' : Date.QUAL_ESTIMATED,
'izračunato' : Date.QUAL_CALCULATED,
'izr.' : Date.QUAL_CALCULATED,
u'процењено' : Date.QUAL_ESTIMATED,
u'про.' : Date.QUAL_ESTIMATED,
u'израчунато' : Date.QUAL_CALCULATED,
u'изр.' : Date.QUAL_CALCULATED,
'процењено' : Date.QUAL_ESTIMATED,
'про.' : Date.QUAL_ESTIMATED,
'израчунато' : Date.QUAL_CALCULATED,
'изр.' : Date.QUAL_CALCULATED,
}
bce = [u"пре нове ере", u"пре Христа", u"п.н.е."
u"pre nove ere", u"pre Hrista", u"p.n.e."] + DateParser.bce
bce = ["пре нове ере", "пре Христа", "п.н.е."
"pre nove ere", "pre Hrista", "p.n.e."] + DateParser.bce
def init_strings(self):
"""
@@ -217,10 +214,10 @@ class DateParserSR(DateParser):
# match Day.Month.Year.
self._numeric = re.compile("((\d+)[/\. ])?\s*((\d+)[/\.])?\s*(\d+)\.?$")
_span_1 = [u'od', u'од']
_span_2 = [u'do', u'до']
_range_1 = [u'između', u'између']
_range_2 = [u'i', u'и']
_span_1 = ['od', 'од']
_span_2 = ['do', 'до']
_range_1 = ['između', 'између']
_range_2 = ['i', 'и']
self._span = re.compile("(%s)\s+(?P<start>.+)\s+(%s)\s+(?P<stop>.+)" %
('|'.join(_span_1), '|'.join(_span_2)),
re.IGNORECASE)
@@ -233,46 +230,15 @@ class DateParserSR(DateParser):
# Serbian display
#
#-------------------------------------------------------------------------
class DateDisplaySR_latin(DateDisplay):
class DateDisplaySR_Base(DateDisplay):
"""
Serbian (latin) date display class
Serbian (base) date display class
"""
long_months = ("",
u"januara", u"februara", u"marta", u"aprila",
u"maja", u"juna", u"jula", u"avgusta",
u"septembra", u"oktobra", u"novembra", u"decembra"
)
short_months = ("",
u"jan", u"feb", u"mar", u"apr", u"maj", u"jun",
u"jul", u"avg", u"sep", u"okt", u"nov", u"dec"
)
roman_months = (
"", "I", "II", "III", "IV", "V", "VI",
"VII", "VIII", "IX", "X", "XI", "XII"
)
calendar = (
"", u"julijanski", u"hebrejski",
u"francuski republikanski", u"persijski", u"islamski",
u"švedski"
)
_mod_str = ("", "pre ", "posle ", "oko ", "", "", "")
_qual_str = ("", "procenjeno ", "izračunato ")
_bce_str = "%s p.n.e."
formats = (
"GGGG-MM-DD (ISO-8601)",
"Numerički (DD.MM.GGGG.)",
"D. MMM GGGG.",
"D. Mesec GGGG.",
"D. Rb GGGG."
)
# this definition must agree with its "_display_gregorian" method
def _display_gregorian(self, date_val):
"""
@@ -299,27 +265,27 @@ class DateDisplaySR_latin(DateDisplay):
# day. month_abbreviation year.
if date_val[0] == 0:
if date_val[1] == 0:
value = u"%s." % year
value = "%s." % year
else:
value = u"%s %s." % (self.short_months[date_val[1]], year)
value = "%s %s." % (self.short_months[date_val[1]], year)
else:
value = u"%d. %s %s." % (date_val[0],
self.short_months[date_val[1]], year)
value = "%d. %s %s." % (date_val[0],
self.short_months[date_val[1]], year)
elif self.format == 3:
# day. month_name year.
if date_val[0] == 0:
if date_val[1] == 0:
value = u"%s." % year
value = "%s." % year
else:
value = u"%s %s." % (self.long_months[date_val[1]], year)
value = "%s %s." % (self.long_months[date_val[1]], year)
else:
value = u"%d. %s %s." % (date_val[0],
self.long_months[date_val[1]], year)
value = "%d. %s %s." % (date_val[0],
self.long_months[date_val[1]], year)
else:
# day. Roman_number_month year.
if date_val[0] == 0:
if date_val[1] == 0:
value = u"%s." % year
value = "%s." % year
else:
value = "%s %s." % (self.roman_months[date_val[1]], year)
else:
@@ -341,6 +307,10 @@ class DateDisplaySR_latin(DateDisplay):
newyear = date.get_new_year()
qual_str = self._qual_str[qual]
span1 = self._span1
span2 = self._span2
range1 = self._range1
range2 = self._range2
if mod == Date.MOD_TEXTONLY:
return date.get_text()
@@ -350,13 +320,13 @@ class DateDisplaySR_latin(DateDisplay):
d_1 = self.display_cal[cal](start)
d_2 = self.display_cal[cal](date.get_stop_date())
scal = self.format_extras(cal, newyear)
return "%s%s %s %s %s%s" % (qual_str, u'od', d_1, u'do', d_2,
return "%s%s %s %s %s%s" % (qual_str, span1, d_1, span2, d_2,
scal)
elif mod == Date.MOD_RANGE:
d_1 = self.display_cal[cal](start)
d_2 = self.display_cal[cal](date.get_stop_date())
scal = self.format_extras(cal, newyear)
return "%s%s %s %s %s%s" % (qual_str, u'između', d_1, u'i', d_2,
return "%s%s %s %s %s%s" % (qual_str, range1, d_1, range2, d_2,
scal)
else:
text = self.display_cal[date.get_calendar()](start)
@@ -364,11 +334,98 @@ class DateDisplaySR_latin(DateDisplay):
return "%s%s%s%s" % (qual_str, self._mod_str[mod], text,
scal)
class DateDisplaySR_Latin(DateDisplaySR_Base):
"""
Serbian (Latin) date display class
"""
long_months = ("",
"januara", "februara", "marta", "aprila",
"maja", "juna", "jula", "avgusta",
"septembra", "oktobra", "novembra", "decembra"
)
short_months = ("",
"jan", "feb", "mar", "apr", "maj", "jun",
"jul", "avg", "sep", "okt", "nov", "dec"
)
calendar = (
"", "julijanski", "hebrejski",
"francuski republikanski", "persijski", "islamski",
"švedski"
)
_mod_str = ("", "pre ", "posle ", "oko ", "", "", "")
_qual_str = ("", "procenjeno ", "izračunato ")
_bce_str = "%s p.n.e."
formats = (
"GGGG-MM-DD (ISO-8601)",
"Numerički (DD.MM.GGGG.)",
"D. MMM GGGG.",
"D. Mesec GGGG.",
"D. Rb GGGG."
)
# this definition must agree with its "_display_gregorian" method
_span1 = 'od'
_span2 = 'do'
_range1 = 'između'
_range2 = 'i'
class DateDisplaySR_Cyrillic(DateDisplaySR_Base):
"""
Serbian (Cyrillic) date display class
"""
long_months = ("",
"Јануар", "Фебруар", "Март", "Април",
"Мај", "Јуне", "Јули", "Аугуст",
"Септембар", "Оцтобер", "Новембер", "Децембар"
)
short_months = ("",
"Јан", "Феб", "Мар", "Апр", "Мај", "Јун",
"Јул", "Авг", "Сеп", "Окт", "Нов", "Дец"
)
calendar = (
"", "Јулиан", "хебрејски",
"француски републиканац", "Персиан", "исламски",
"шведски"
)
_mod_str = ("", "пре ", "после ", "око ", "", "", "")
_qual_str = ("", "процењено ", "израчунато ")
_bce_str = "%s п.н.е."
formats = (
"ГГГГ-ММ-ДД (ISO-8601)",
"Нумеричка (ДД.ММ.ГГГГ.)",
"Д. МММ ГГГГ.",
"Д. Месец ГГГГ.",
"Д. Rb ГГГГ."
)
# this definition must agree with its "_display_gregorian" method
_span1 = 'из'
_span2 = 'до'
_range1 = 'између'
_range2 = 'и'
#-------------------------------------------------------------------------
#
# Register classes
#
#-------------------------------------------------------------------------
register_datehandler(('sr', 'serbian', 'srpski', 'sr_RS'),
DateParserSR, DateDisplaySR_latin)
register_datehandler(('srpski', 'Srpski',
'sr_Latn', 'sr_Latn_RS', 'sr_RS@latin'),
DateParserSR, DateDisplaySR_Latin)
register_datehandler(('sr', 'српски', 'Српски', 'serbian',
'sr_RS', 'sr_Cyrl', 'sr_Cyrl_RS'),
DateParserSR, DateDisplaySR_Cyrillic)
+90 -131
View File
@@ -18,20 +18,17 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# DateHandler/_Date_zh.py
# $Id$
#
"""
Simplified-Chinese-specific classes for parsing and displaying dates.
"""
#-------------------------------------------------------------------------
#
# Python modules
#
#-------------------------------------------------------------------------
"""
Chinese-specific classes for parsing and displaying dates.
"""
from __future__ import unicode_literals
import re
#-------------------------------------------------------------------------
@@ -39,7 +36,6 @@ import re
# GRAMPS modules
#
#-------------------------------------------------------------------------
from gen.lib import Date
from _DateParser import DateParser
from _DateDisplay import DateDisplay
@@ -47,147 +43,128 @@ from _DateHandler import register_datehandler
#-------------------------------------------------------------------------
#
# Chinese parser
# Simplified-Chinese parser
#
#-------------------------------------------------------------------------
class DateParserZH(DateParser):
class DateParserZH_CN(DateParser):
"""
Convert a text string into a Date object. If the date cannot be
converted, the text string is assigned.
"""
# translate english strings into chinese
# modifiers before the date
modifier_to_int = {
u'before' : Date.MOD_BEFORE, u'bef' : Date.MOD_BEFORE,
u'bef.' : Date.MOD_BEFORE, u'after' : Date.MOD_AFTER,
u'aft' : Date.MOD_AFTER, u'aft.' : Date.MOD_AFTER,
u'about' : Date.MOD_ABOUT, u'abt.' : Date.MOD_ABOUT,
u'abt' : Date.MOD_ABOUT, u'circa' : Date.MOD_ABOUT,
u'c.' : Date.MOD_ABOUT, u'around' : Date.MOD_ABOUT,
'以前' : Date.MOD_BEFORE,
'以后' : Date.MOD_AFTER,
'大约' : Date.MOD_ABOUT,
}
month_to_int = DateParser.month_to_int
month_to_int[u""] = 1
month_to_int[u""] = 1
month_to_int[u"zhēngyuè"] = 1
month_to_int[u""] = 2
month_to_int[u"èryuè"] = 2
month_to_int[u""] = 3
month_to_int[u"sānyuè"] = 3
month_to_int[u""] = 4
month_to_int[u"sìyuè"] = 4
month_to_int[u""] = 5
month_to_int[u"wǔyuè"] = 5
month_to_int[u""] = 6
month_to_int[u"liùyuè"] = 6
month_to_int[u""] = 7
month_to_int[u"qīyuè"] = 7
month_to_int[u""] = 8
month_to_int[u"bāyuè"] = 8
month_to_int[u""] = 9
month_to_int[u"jiǔyuè"] = 9
month_to_int[u""] = 10
month_to_int[u"shíyuè"] = 10
month_to_int[u"十一"] = 11
month_to_int[u"shíyīyuè"] = 11
month_to_int[u"十二"] = 12
month_to_int[u"shí'èryuè"] = 12
month_to_int[u"假閏"] = 13
month_to_int[u"jiǎ rùn yùe"] = 13
# translate english strings into chinese
month_to_int[""] = 1
month_to_int[""] = 1
month_to_int["zhēngyuè"] = 1
month_to_int[""] = 2
month_to_int["èryuè"] = 2
month_to_int[""] = 3
month_to_int["sānyuè"] = 3
month_to_int[""] = 4
month_to_int["sìyuè"] = 4
month_to_int[""] = 5
month_to_int["wǔyuè"] = 5
month_to_int[""] = 6
month_to_int["liùyuè"] = 6
month_to_int[""] = 7
month_to_int["qīyuè"] = 7
month_to_int[""] = 8
month_to_int["bāyuè"] = 8
month_to_int[""] = 9
month_to_int["jiǔyuè"] = 9
month_to_int[""] = 10
month_to_int["shíyuè"] = 10
month_to_int["十一"] = 11
month_to_int["shíyīyuè"] = 11
month_to_int["十二"] = 12
month_to_int["shí'èryuè"] = 12
month_to_int["假閏"] = 13
month_to_int["jiǎ rùn yùe"] = 13
calendar_to_int = {
'gregorian' : Date.CAL_GREGORIAN,
'阳历' : Date.CAL_GREGORIAN,
'g' : Date.CAL_GREGORIAN,
'julian' : Date.CAL_JULIAN,
'儒略历' : Date.CAL_JULIAN,
'j' : Date.CAL_JULIAN,
'hebrew' : Date.CAL_HEBREW,
'希伯来历' : Date.CAL_HEBREW,
'h' : Date.CAL_HEBREW,
'islamic' : Date.CAL_ISLAMIC,
'伊斯兰历' : Date.CAL_ISLAMIC,
'i' : Date.CAL_ISLAMIC,
'french' : Date.CAL_FRENCH,
'french republican': Date.CAL_FRENCH,
'法国共和历' : Date.CAL_FRENCH,
'f' : Date.CAL_FRENCH,
'persian' : Date.CAL_PERSIAN,
'伊郎历' : Date.CAL_PERSIAN,
'p' : Date.CAL_PERSIAN,
'swedish' : Date.CAL_SWEDISH,
'瑞典历' : Date.CAL_SWEDISH,
's' : Date.CAL_SWEDISH,
}
# translate english strings into chinese
quality_to_int = {
u'estimated' : Date.QUAL_ESTIMATED,
u'est.' : Date.QUAL_ESTIMATED,
u'est' : Date.QUAL_ESTIMATED,
u'calc.' : Date.QUAL_CALCULATED,
u'calc' : Date.QUAL_CALCULATED,
u'calculated' : Date.QUAL_CALCULATED,
'据估计' : Date.QUAL_ESTIMATED,
'据计算' : Date.QUAL_CALCULATED,
}
# translate english strings into chinese
bce = [u"before calendar", u"negative year"] + DateParser.bce
# FIXME translate these English strings into simplified-Chinese ones
bce = ["before calendar", "negative year"] + DateParser.bce
def init_strings(self):
"""
This method compiles regular expression strings for matching dates.
Most of the re's in most languages can stay as is. span and range
most likely will need to change. Whatever change is done, this method
may be called first as DateParser.init_strings(self) so that the
invariant expresions don't need to be repeteadly coded. All differences
can be coded after DateParser.init_strings(self) call, that way they
override stuff from this method. See DateParserRU() as an example.
"""
DateParser.init_strings(self)
# day: 日 ; month : 月 ; year : 年
# See DateParser class; translate english strings (from/to, between/and) into chinese
# do not translate <start> and <stop>
self._span = re.compile(u"(from)\s+(?P<start>.+)\s+to\s+(?P<stop>.+)",
re.IGNORECASE)
self._range = re.compile(u"(bet|bet.|between)\s+(?P<start>.+)\s+and\s+(?P<stop>.+)",
re.IGNORECASE)
_span_1 = ['']
_span_2 = ['']
_range_1 = ['介于']
_range_2 = ['']
self._span = re.compile("(%s)\s+(?P<start>.+)\s+(%s)\s+(?P<stop>.+)" %
('|'.join(_span_1), '|'.join(_span_2)),
re.IGNORECASE)
self._range = re.compile("(%s)\s+(?P<start>.+)\s+(%s)\s+(?P<stop>.+)" %
('|'.join(_range_1), '|'.join(_range_2)),
re.IGNORECASE)
#def _parse_lunisolar(self, date_val=text):
#text = text.strip() # otherwise spaces can make it a bad date
#date = Date(self._qual_str, self._mod_str, self._cal_str, text, self._ny_str)
#return unicode(text)
#-------------------------------------------------------------------------
#
# Chinese display
# Simplified-Chinese display
#
#-------------------------------------------------------------------------
class DateDisplayZH(DateDisplay):
class DateDisplayZH_CN(DateDisplay):
"""
Chinese language date display class.
Simplified-Chinese language date display class.
"""
# translate english strings into chinese
long_months = ( u"", u"January", u"February", u"March", u"April", u"May",
u"June", u"July", u"August", u"September", u"October",
u"November", u"December" )
# this is used to display the 12 gregorian months
long_months = ( "", "正月", "二月", "三月", "四月", "五月",
"六月", "七月", "八月", "九月", "十月",
"十一月", "十二月" )
short_months = ( u"", u"Jan", u"Feb", u"Mar", u"Apr", u"May", u"Jun",
u"Jul", u"Aug", u"Sep", u"Oct", u"Nov", u"Dec" )
short_months = ( "", "一月", "二月", "三月", "四月", "五月", "六月",
"七月", "八月", "九月", "十月", "十一月", "十二月" )
formats = (
"年年年年-月月-日日 (ISO)", "数字格式", "月 日,年",
"月 日,年", "日 月 年", "日 月 年",
)
# this must agree with DateDisplayEn's "formats" definition
# (since no locale-specific _display_gregorian exists, here)
calendar = (
"", u"Julian", u"Hebrew", u"French Republican",
u"Persian", u"Islamic", u"Swedish"
"", "儒略历", "希伯来历", "法国共和历",
"伊郎历", "伊斯兰历", "瑞典历"
)
_mod_str = ("", u"before ", u"after ", u"around ", "", "", "")
_mod_str = ("", "以前 ", "以后 ", "大约 ", "", "", "")
_qual_str = ("", u"estimated ", u"calculated ", "")
_qual_str = ("", "据估计 ", "据计算 ", "")
# FIXME translate these English strings into simplified-Chinese ones
_bce_str = "%s B.C.E."
@@ -195,7 +172,6 @@ class DateDisplayZH(DateDisplay):
"""
Return a text string representing the date.
"""
mod = date.get_modifier()
cal = date.get_calendar()
qual = date.get_quality()
@@ -209,45 +185,28 @@ class DateDisplayZH(DateDisplay):
elif start == Date.EMPTY:
return ""
elif mod == Date.MOD_SPAN:
date1 = self.display_cal[cal](start)
date2 = self.display_cal[cal](date.get_stop_date())
d1 = self.display_cal[cal](start)
d2 = self.display_cal[cal](date.get_stop_date())
scal = self.format_extras(cal, newyear)
# translate english strings into chinese
return "%s%s %s %s %s%s" % (qual_str, u'from', date1, u'to',
date2, scal)
return "%s%s %s %s %s%s" % (qual_str, '', d1, '', d2, scal)
elif mod == Date.MOD_RANGE:
date1 = self.display_cal[cal](start)
date2 = self.display_cal[cal](date.get_stop_date())
d1 = self.display_cal[cal](start)
d2 = self.display_cal[cal](date.get_stop_date())
scal = self.format_extras(cal, newyear)
# translate english strings into chinese
return "%s%s %s %s %s%s" % (qual_str, u'between', date1, u'and',
date2, scal)
return "%s%s %s %s %s%s之间" % (qual_str, '介于', d1, '',
d2, scal)
else:
text = self.display_cal[date.get_calendar()](start)
scal = self.format_extras(cal, newyear)
return "%s%s%s%s" % (qual_str, (self._mod_str)[mod], text,
scal)
#def _display_chinese(self, date_val):
#self._tformat = '%Y年%m月%d日'
#year = self._slash_year(date_val[2], date_val[3])
#if date_val[3]:
#return self.display_iso(date_val)
#else:
#if date_val[0] == date_val[1] == 0:
#value = u'%Y年' % date_val[2]
#else:
#value = self._tformat.replace('%m月', str(self.lunisolar[date_val[1]]))
#value = u'%m月' % date_val[1]
#value = u'%d日' % date_val[0]
#value = u'%Y年' % date_val[2]
#-------------------------------------------------------------------------
#
# Register classes
#
#-------------------------------------------------------------------------
register_datehandler(('zh_CN', 'zh_TW', 'zh_SG', 'zh_HK', 'zh', 'chinese', 'Chinese'),
DateParserZH, DateDisplayZH)
register_datehandler(('zh_CN', 'zh_SG', 'zh_TW', 'zh_HK',
'zh', 'chinese', 'Chinese'),
DateParserZH_CN, DateDisplayZH_CN)
+1
View File
@@ -24,6 +24,7 @@ pkgpython_PYTHON = \
_MatchesSourceConfidence.py\
_MatchesSourceFilter.py\
_HasAttribute.py\
_HasDayOfWeek.py\
__init__.py
pkgpyexecdir = @pkgpyexecdir@/Filters/Rules/Event
+53
View File
@@ -0,0 +1,53 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2013 Nick Hall
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
from gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
# Gramps modules
#
#-------------------------------------------------------------------------
from Filters.Rules import Rule
#-------------------------------------------------------------------------
#
# HasDayOfWeek
#
#-------------------------------------------------------------------------
class HasDayOfWeek(Rule):
"""Rule that matches an event occurring on a particular day of the week."""
labels = [ _('Day of Week:') ]
name = _('Events occurring on a particular day of the week')
description = _('Matches events occurring on a particular day of the week')
category = _('General filters')
def apply(self, db, event):
if not self.list[0]:
return False
else:
dow = event.get_date_object().get_dow()
return dow == int(self.list[0])
+3 -1
View File
@@ -48,6 +48,7 @@ from _HasAttribute import HasAttribute
from _HasData import HasData
from _ChangedSince import ChangedSince
from _MatchesPlaceFilter import MatchesPlaceFilter
from _HasDayOfWeek import HasDayOfWeek
editor_rule_list = [
AllEvents,
@@ -68,5 +69,6 @@ editor_rule_list = [
HasAttribute,
HasData,
ChangedSince,
MatchesPlaceFilter
MatchesPlaceFilter,
HasDayOfWeek
]
+1 -2
View File
@@ -50,8 +50,7 @@ class HasEventBase(Rule):
_('Date:'),
_('Place:'),
_('Description:'),
_('Main Participants:'),
_('Primary Role:') ]
_('Main Participants:') ]
name = _('Events matching parameters')
description = _("Matches events with particular parameters")
category = _('Event filters')
+2 -1
View File
@@ -201,7 +201,8 @@ class PersonSidebarFilter(SidebarFilter):
# Build an event filter if needed
if etype:
rule = HasEvent([etype, u'', u'', u'', u''], use_regex=regex)
rule = HasEvent([etype, u'', u'', u'', u'', True],
use_regex=regex)
generic_filter.add_rule(rule)
# Build birth event filter if needed
+1 -2
View File
@@ -156,8 +156,7 @@ class MergeCitations(ManagedWindow.ManagedWindow):
titanic = self.citation1
# Add second handle to history so that when merge is complete,
# phoenix is the selected row.
self.uistate.viewmanager.active_page.get_history().push(
phoenix.get_handle())
self.uistate.set_active(phoenix.get_handle(), 'Citation')
if self.get_widget("page_btn1").get_active() ^ use_handle1:
phoenix.set_page(titanic.get_page())
+1 -2
View File
@@ -170,8 +170,7 @@ class MergeEvents(ManagedWindow.ManagedWindow):
titanic = self.ev1
# Add second handle to history so that when merge is complete,
# phoenix is the selected row.
self.uistate.viewmanager.active_page.get_history().push(
phoenix.get_handle())
self.uistate.set_active(phoenix.get_handle(), 'Event')
if self.get_widget("type_btn1").get_active() ^ use_handle1:
phoenix.set_type(titanic.get_type())
+1 -2
View File
@@ -202,8 +202,7 @@ class MergeFamilies(ManagedWindow.ManagedWindow):
titanic = self.fy1
# Add second handle to history so that when merge is complete,
# phoenix is the selected row.
self.uistate.viewmanager.active_page.get_history().push(
phoenix.get_handle())
self.uistate.set_active(phoenix.get_handle(), 'Family')
phoenix_fh = phoenix.get_father_handle()
phoenix_mh = phoenix.get_mother_handle()
+1 -2
View File
@@ -152,8 +152,7 @@ class MergeMediaObjects(ManagedWindow.ManagedWindow):
titanic = self.mo1
# Add second handle to history so that when merge is complete,
# phoenix is the selected row.
self.uistate.viewmanager.active_page.get_history().push(
phoenix.get_handle())
self.uistate.set_active(phoenix.get_handle(), 'Media')
if self.get_widget("path_btn1").get_active() ^ use_handle1:
phoenix.set_path(titanic.get_path())
+1 -2
View File
@@ -165,8 +165,7 @@ class MergeNotes(ManagedWindow.ManagedWindow):
titanic = self.no1
# Add second handle to history so that when merge is complete,
# phoenix is the selected row.
self.uistate.viewmanager.active_page.get_history().push(
phoenix.get_handle())
self.uistate.set_active(phoenix.get_handle(), 'Note')
if self.get_widget("text_btn1").get_active() ^ use_handle1:
phoenix.set_styledtext(titanic.get_styledtext())
+1 -2
View File
@@ -313,8 +313,7 @@ class MergePeople(ManagedWindow.ManagedWindow):
titanic = self.pr1
# Add second handle to history so that when merge is complete,
# phoenix is the selected row.
self.uistate.viewmanager.active_page.get_history().push(
phoenix.get_handle())
self.uistate.set_active(phoenix.get_handle(), 'Person')
if self.get_widget("name_btn1").get_active() ^ use_handle1:
swapname = phoenix.get_primary_name()
+1 -3
View File
@@ -174,9 +174,7 @@ class MergePlaces(ManagedWindow.ManagedWindow):
titanic = self.pl1
# Add second handle to history so that when merge is complete,
# phoenix is the selected row.
self.uistate.viewmanager.active_page.get_history().push(
phoenix.get_handle())
self.uistate.set_active(phoenix.get_handle(), 'Place')
if self.get_widget("title_btn1").get_active() ^ use_handle1:
phoenix.set_title(titanic.get_title())
+1 -2
View File
@@ -141,8 +141,7 @@ class MergeRepositories(ManagedWindow.ManagedWindow):
titanic = self.rp1
# Add second handle to history so that when merge is complete,
# phoenix is the selected row.
self.uistate.viewmanager.active_page.get_history().push(
phoenix.get_handle())
self.uistate.set_active(phoenix.get_handle(), 'Repository')
if self.get_widget("name_btn1").get_active() ^ use_handle1:
phoenix.set_name(titanic.get_name())
+1 -2
View File
@@ -165,8 +165,7 @@ class MergeSources(ManagedWindow.ManagedWindow):
titanic = self.src1
# Add second handle to history so that when merge is complete,
# phoenix is the selected row.
self.uistate.viewmanager.active_page.get_history().push(
phoenix.get_handle())
self.uistate.set_active(phoenix.get_handle(), 'Source')
if self.get_widget("title_btn1").get_active() ^ use_handle1:
phoenix.set_title(titanic.get_title())
+3 -1
View File
@@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2005-2006 Donald N. Allingham
# Copyright (C) 2014 Vassilii Khachaturov
#
# 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
@@ -97,7 +98,8 @@ class Spell(object):
return
else:
try:
gtkspell_spell = gtkspell.Spell(self.textview)
with self.textview.undo_disabled():
gtkspell_spell = gtkspell.Spell(self.textview)
self._active_spellcheck = spellcheck_code
except:
# attaching the spellchecker will fail if
+15 -17
View File
@@ -392,7 +392,7 @@ class ArgHandler(object):
@param: climan: the manager of a CLI session
@type: CLIManager object
"""
# Handle the "-l" List Family Trees option.
if self.list:
print _('List of known family trees in your database path\n').\
encode(sys.getfilesystemencoding())
@@ -403,6 +403,7 @@ class ArgHandler(object):
'f_t_name' : name}).encode(sys.getfilesystemencoding())
sys.exit(0)
# Handle the "-L" List Family Trees in detail option.
if self.list_more:
print _('Gramps Family Trees:').encode(sys.getfilesystemencoding())
summary_list = self.dbman.family_tree_summary()
@@ -418,25 +419,28 @@ class ArgHandler(object):
encode(sys.getfilesystemencoding())
sys.exit(0)
# Handle the "-t" List Family Trees, tab delimited option.
if self.list_table:
print _('Gramps Family Trees:').encode(sys.getfilesystemencoding())
summary_list = self.dbman.family_tree_summary()
print _("Family Tree").encode(sys.getfilesystemencoding()),
if not summary_list:
sys.exit(0)
# We have to construct the line elements together, to avoid
# insertion of blank spaces when print on the same line is used
line_list = [_("Family Tree").encode(sys.getfilesystemencoding())]
for key in sorted(summary_list[0]):
if key != _("Family tree"):
print "\t ",
print key.encode(sys.getfilesystemencoding()),
print
line_list += [key.encode(sys.getfilesystemencoding())]
print "\t".join(line_list)
for summary in sorted(summary_list,
key=lambda sum: sum[_("Family tree")].lower()):
print '"%s"'.\
encode(sys.getfilesystemencoding()) % summary[_("Family tree")],
line_list = [('"%s"' % summary[_("Family tree")]).\
encode(sys.getfilesystemencoding())]
for item in sorted(summary):
if item != _("Family tree"):
print "\t ",
print ('"%s"' % summary[item]).\
encode(sys.getfilesystemencoding()),
print
line_list += [('"%s"' % summary[item]).\
encode(sys.getfilesystemencoding())]
print "\t".join(line_list)
sys.exit(0)
self.__open_action()
@@ -560,12 +564,6 @@ class ArgHandler(object):
if family_tree_format == plugin.get_extension():
import_function = plugin.get_import_function()
import_function(self.dbstate.db, filename, None)
if not self.cl:
if self.imp_db_path:
return self.sm.open_activate(self.imp_db_path)
else:
return self.sm.open_activate(self.open)
#-------------------------------------------------------------------------
#
+11 -1
View File
@@ -238,6 +238,13 @@ class CLIManager(object):
_("Family Tree does not exist, as it has been deleted."))
return
if os.path.isfile(os.path.join(filename, "lock")):
self._errordialog(
_("The database is locked."),
_("Use the --force-unlock option if you are sure "
"that the database is not in use."))
return
if self.db_loader.read_file(filename):
# Attempt to figure out the database title
path = os.path.join(filename, "name.txt")
@@ -279,7 +286,10 @@ class CLIManager(object):
# apply preferred researcher if loaded file has none
res = self.dbstate.db.get_researcher()
owner = get_researcher()
if res.get_name() == "" and owner.get_name() != "":
# If the DB Owner Info is empty and
# [default] Researcher is not empty and
# database is empty, then copy default researcher to DB owner
if res.is_empty() and not owner.is_empty() and self.dbstate.db.is_empty():
self.dbstate.db.set_researcher(owner)
name_displayer.set_name_format(self.dbstate.db.name_formats)
+1 -1
View File
@@ -299,7 +299,7 @@ class CommandLineReport(object):
self.options_help['papers'][2] = \
[ paper.get_name() for paper in paper_sizes
if paper.get_name() != _("Custom Size") ]
if paper.get_name() != 'Custom Size' ]
self.options_help['papero'][2] = [
"%d\tPortrait" % PAPER_PORTRAIT,
+1 -1
View File
@@ -144,7 +144,7 @@ register('behavior.max-sib-age-diff', 20)
register('behavior.min-generation-years', 13)
register('behavior.owner-warn', False)
register('behavior.pop-plugin-status', False)
register('behavior.recent-export-type', 1)
register('behavior.recent-export-type', 3)
register('behavior.spellcheck', False)
register('behavior.startup', 0)
register('behavior.surname-guessing', 0)
+3 -3
View File
@@ -43,10 +43,10 @@ from gen.ggettext import sgettext as _
#-------------------------------------------------------------------------
PROGRAM_NAME = "Gramps"
if "@VERSIONSTRING@" == "@" + "VERSIONSTRING" + "@":
VERSION = "3.4.7"
VERSION = "3.4.9"
else:
VERSION = "@VERSIONSTRING@"
VERSION_TUPLE = (3, 4, 7)
VERSION_TUPLE = (3, 4, 9)
#-------------------------------------------------------------------------
#
@@ -199,7 +199,7 @@ else:
#
#-------------------------------------------------------------------------
COPYRIGHT_MSG = u"\u00A9 2001-2006 Donald N. Allingham\n" \
u"\u00A9 2007-2014 The Gramps Developers"
u"\u00A9 2007-2015 The Gramps Developers"
COMMENTS = _("Gramps (Genealogical Research and Analysis "
"Management Programming System) is a personal "
"genealogy program.")
+2 -1
View File
@@ -40,7 +40,7 @@ __all__ = (
('DBPAGE', 'DBMODE', 'DBCACHE', 'DBLOCKS', 'DBOBJECTS', 'DBUNDO',
'DBEXT', 'DBMODE_R', 'DBMODE_W', 'DBUNDOFN', 'DBLOCKFN',
'DBRECOVFN','BDBVERSFN', 'DBLOGNAME', 'DBFLAGS_O', 'DBFLAGS_R',
'DBFLAGS_D',
'DBFLAGS_D', 'SCHVERSFN'
) +
('PERSON_KEY', 'FAMILY_KEY', 'SOURCE_KEY', 'CITATION_KEY',
@@ -56,6 +56,7 @@ DBUNDOFN = "undo.db" # File name of 'undo' database
DBLOCKFN = "lock" # File name of lock file
DBRECOVFN = "need_recover" # File name of recovery file
BDBVERSFN = "bdbversion.txt"# File name of Berkeley DB version file
SCHVERSFN = "schemaversion.txt"# File name of schema version file
DBLOGNAME = ".Db" # Name of logger
DBMODE_R = "r" # Read-only access
DBMODE_W = "w" # Full Read/Write access
+13
View File
@@ -355,6 +355,7 @@ class DbBsddbRead(DbReadBase, Callback):
self.citation_map = {}
self.repository_map = {}
self.note_map = {}
self.tag_map = {}
self.media_map = {}
self.event_map = {}
self.metadata = {}
@@ -908,6 +909,18 @@ class DbBsddbRead(DbReadBase, Callback):
"""
return self.get_number_of_records(self.tag_map)
def is_empty(self):
"""
Return true if there are no [primary] records in the database
"""
for obj_map in [self.person_map, self.family_map, self.event_map,
self.place_map, self.source_map, self.citation_map,
self.media_map, self.repository_map, self.note_map,
self.tag_map]:
if self.get_number_of_records(obj_map) > 0:
return False
return True
def all_handles(self, table):
return table.keys(txn=self.txn)
+74 -32
View File
@@ -27,7 +27,7 @@ from gen.lib.markertype import MarkerType
from gen.lib.tag import Tag
import time
import logging
LOG = logging.getLogger(".citation")
LOG = logging.getLogger(".upgrade")
from gen.ggettext import gettext as _
@@ -43,7 +43,7 @@ from gen.db import BSDDBTxn
from gen.lib.nameorigintype import NameOriginType
from gen.db.write import _mkname, SURNAMES
from gen.db.dbconst import (PERSON_KEY, FAMILY_KEY, EVENT_KEY,
MEDIA_KEY, PLACE_KEY, REPOSITORY_KEY)
MEDIA_KEY, PLACE_KEY, REPOSITORY_KEY, SOURCE_KEY)
from QuestionDialog import (InfoDialog)
def gramps_upgrade_16(self):
@@ -58,26 +58,30 @@ def gramps_upgrade_16(self):
(4) add backlinks for references from object to Citations
(5) add backlinks for references from Citation to Source
the backlinks are all updated at the end by calling
reindex_reference_map
the backlinks are all updated on return to write.py gramps_upgrade by
calling reindex_reference_map
"""
length = (len(self.note_map) + len(self.person_map) +
# Only People, Families, Events, Media Objects, Places, Sources and
# Repositories need to be updated, because these are the only primary
# objects that can have source citations.
length = (len(self.person_map) +
len(self.event_map) + len(self.family_map) +
len(self.repository_map) + len(self.media_map) +
len(self.place_map) + len(self.source_map)) + 10
len(self.place_map) + len(self.source_map))
self.set_total(length)
# Setup data for upgrade statistics information dialogue
keyorder = [PERSON_KEY, FAMILY_KEY, EVENT_KEY, MEDIA_KEY,
PLACE_KEY, REPOSITORY_KEY]
PLACE_KEY, REPOSITORY_KEY, SOURCE_KEY]
key2data = {
PERSON_KEY : 0,
FAMILY_KEY : 1,
EVENT_KEY: 2,
MEDIA_KEY: 3,
PLACE_KEY: 4,
REPOSITORY_KEY: 5,
REPOSITORY_KEY: 5,
SOURCE_KEY : 6,
}
key2string = {
PERSON_KEY : _('%6d People upgraded with %6d citations in %6d secs\n'),
@@ -86,8 +90,9 @@ def gramps_upgrade_16(self):
MEDIA_KEY : _('%6d Media Objects upgraded with %6d citations in %6d secs\n'),
PLACE_KEY : _('%6d Places upgraded with %6d citations in %6d secs\n'),
REPOSITORY_KEY : _('%6d Repositories upgraded with %6d citations in %6d secs\n'),
SOURCE_KEY : _('%6d Sources upgraded with %6d citations in %6d secs\n'),
}
data_upgradeobject = [0] * 6
data_upgradeobject = [0] * 7
# Initialise the citation gramps ID number
self.cmap_index = 0
@@ -99,6 +104,15 @@ def gramps_upgrade_16(self):
start_time = time.time()
for person_handle in self.person_map.keys():
person = self.person_map[person_handle]
try:
# The parameters are evaluated before deciding whether logging is on
# or not. Since the retrieval of names is so complex, I think it is
# safer to protect this with a try except block, even though it
# seems to work for names being present and not.
LOG.debug("upgrade person %s %s" % (person[3][4],
" ".join([name[0] for name in person[3][5]])))
except:
pass
(handle, gramps_id, gender, primary_name, alternate_names,
death_ref_index, birth_ref_index, event_ref_list, family_list,
parent_family_list, media_list, address_list, attribute_list,
@@ -141,6 +155,7 @@ def gramps_upgrade_16(self):
attribute_list, urls, lds_seal_list,
new_citation_list, note_list, change, tag_list,
private, person_ref_list)
LOG.debug(" upgrade new_person %s" % [new_person])
with BSDDBTxn(self.env, self.person_map) as txn:
txn.put(str(handle), new_person)
self.update()
@@ -160,7 +175,7 @@ def gramps_upgrade_16(self):
start_time = time.time()
for media_handle in self.media_map.keys():
media = self.media_map[media_handle]
LOG.debug("upgrade media %s" % media[4])
LOG.debug("upgrade media object %s" % media[4])
(handle, gramps_id, path, mime, desc,
attribute_list, source_list, note_list, change,
date, tag_list, private) = media
@@ -175,12 +190,11 @@ def gramps_upgrade_16(self):
LOG.debug(" upgrade new_media %s" % [new_media])
with BSDDBTxn(self.env, self.media_map) as txn:
txn.put(str(handle), new_media)
LOG.debug(" update ref map media %s" % [handle,
self.get_object_from_handle(handle) ])
self.update()
LOG.debug("Media upgrade %d citations upgraded in %d seconds" %
(self.cmap_index - start_num_citations,
LOG.debug("%d media objects upgraded with %d citations in %d seconds" %
(len(self.media_map.keys()),
self.cmap_index - start_num_citations,
int(time.time() - start_time)))
data_upgradeobject[key2data[MEDIA_KEY]] = (len(self.media_map.keys()),
self.cmap_index - start_num_citations,
@@ -193,6 +207,7 @@ def gramps_upgrade_16(self):
start_time = time.time()
for place_handle in self.place_map.keys():
place = self.place_map[place_handle]
LOG.debug("upgrade place %s" % place[2])
(handle, gramps_id, title, long, lat,
main_loc, alt_loc, urls, media_list, source_list, note_list,
change, private) = place
@@ -209,6 +224,7 @@ def gramps_upgrade_16(self):
long, lat, main_loc, alt_loc, urls,
media_list, new_citation_list, note_list,
change, private)
LOG.debug(" upgrade new_place %s" % [new_place])
with BSDDBTxn(self.env, self.place_map) as txn:
txn.put(str(handle), new_place)
self.update()
@@ -228,6 +244,7 @@ def gramps_upgrade_16(self):
start_time = time.time()
for family_handle in self.family_map.keys():
family = self.family_map[family_handle]
LOG.debug("upgrade family (gramps_id) %s" % family[1])
(handle, gramps_id, father_handle, mother_handle,
child_ref_list, the_type, event_ref_list, media_list,
attribute_list, lds_seal_list, source_list, note_list,
@@ -257,11 +274,12 @@ def gramps_upgrade_16(self):
child_ref_list, the_type, event_ref_list, media_list,
attribute_list, lds_seal_list, new_citation_list,
note_list, change, tag_list, private)
LOG.debug(" upgrade new_family %s" % [new_family])
with BSDDBTxn(self.env, self.family_map) as txn:
txn.put(str(handle), new_family)
self.update()
LOG.debug("%d familys upgraded with %d citations in %d seconds. " %
LOG.debug("%d families upgraded with %d citations in %d seconds. " %
(len(self.family_map.keys()),
self.cmap_index - start_num_citations,
time.time() - start_time))
@@ -271,13 +289,11 @@ def gramps_upgrade_16(self):
# ---------------------------------
# Modify Events
# ---------------------------------
upgrade_time = 0
backlink_time = 0
start_num_citations = self.cmap_index
start_time = time.time()
for event_handle in self.event_map.keys():
t1 = time.time()
event = self.event_map[event_handle]
LOG.debug("upgrade event %s" % event[4])
(handle, gramps_id, the_type, date, description, place,
source_list, note_list, media_list, attribute_list,
change, private) = event
@@ -297,19 +313,15 @@ def gramps_upgrade_16(self):
new_citation_list, note_list, media_list,
attribute_list,
change, private)
LOG.debug(" upgrade new_event %s" % [new_event])
with BSDDBTxn(self.env, self.event_map) as txn:
txn.put(str(handle), new_event)
t2 = time.time()
upgrade_time += t2 - t1
t3 = time.time()
backlink_time += t3 - t2
self.update()
LOG.debug("%d events upgraded with %d citations in %d seconds. "
"Backlinks took %d seconds" %
LOG.debug("%d events upgraded with %d citations in %d seconds. " %
(len(self.event_map.keys()),
self.cmap_index - start_num_citations,
int(upgrade_time), int(backlink_time)))
time.time() - start_time))
data_upgradeobject[key2data[EVENT_KEY]] = (len(self.event_map.keys()),
self.cmap_index - start_num_citations,
time.time() - start_time)
@@ -321,6 +333,7 @@ def gramps_upgrade_16(self):
start_time = time.time()
for repository_handle in self.repository_map.keys():
repository = self.repository_map[repository_handle]
LOG.debug("upgrade repository %s" % repository[3])
(handle, gramps_id, the_type, name, note_list,
address_list, urls, change, private) = repository
if address_list:
@@ -329,17 +342,52 @@ def gramps_upgrade_16(self):
if address_list:
new_repository = (handle, gramps_id, the_type, name, note_list,
address_list, urls, change, private)
LOG.debug(" upgrade new_repository %s" % [new_repository])
with BSDDBTxn(self.env, self.repository_map) as txn:
txn.put(str(handle), new_repository)
self.update()
LOG.debug("%d repositorys upgraded with %d citations in %d seconds. " %
LOG.debug("%d repositories upgraded with %d citations in %d seconds. " %
(len(self.repository_map.keys()),
self.cmap_index - start_num_citations,
time.time() - start_time))
data_upgradeobject[key2data[REPOSITORY_KEY]] = (len(self.repository_map.keys()),
self.cmap_index - start_num_citations,
time.time() - start_time)
# ---------------------------------
# Modify Source
# ---------------------------------
start_num_citations = self.cmap_index
start_time = time.time()
for source_handle in self.source_map.keys():
source = self.source_map[source_handle]
LOG.debug("upgrade source %s" % source[2])
(handle, gramps_id, title, author,
pubinfo, note_list, media_list,
abbrev, change, datamap, reporef_list,
private) = source
if media_list:
media_list = upgrade_media_list_16(
self, media_list)
new_source = (handle, gramps_id, title, author,
pubinfo, note_list, media_list,
abbrev, change, datamap, reporef_list,
private)
LOG.debug(" upgrade new_source %s" % [new_source])
with BSDDBTxn(self.env, self.source_map) as txn:
txn.put(str(handle), new_source)
self.update()
LOG.debug("%d sources upgraded with %d citations in %d seconds" %
(len(self.source_map.keys()),
self.cmap_index - start_num_citations,
int(time.time() - start_time)))
data_upgradeobject[key2data[SOURCE_KEY]] = (len(self.source_map.keys()),
self.cmap_index - start_num_citations,
time.time() - start_time)
# ---------------------------------
@@ -535,12 +583,6 @@ def convert_source_list_to_citation_list_16(self, source_list):
with BSDDBTxn(self.env, self.citation_map) as txn:
txn.put(str(new_handle), new_citation)
self.cmap_index += 1
# # add backlinks for references from Citation to Source
# with BSDDBTxn(self.env) as txn:
# self.update_reference_map(
# self.get_citation_from_handle(new_handle),
# transaction,
# txn.txn)
citation_list.append((new_handle))
return citation_list
+24 -5
View File
@@ -558,6 +558,18 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
self.__check_python_version(name, force_python_upgrade)
# Check for schema upgrade
versionpath = os.path.join(self.path, SCHVERSFN)
if os.path.isfile(versionpath):
with open(versionpath, "r") as version_file:
schema_version = int(version_file.read().strip())
else:
schema_version = 0
if not self.readonly and schema_version < _DBVERSION and \
force_schema_upgrade:
_LOG.debug("Make backup in case there is a schema upgrade")
self.__make_zip_backup(name)
# Set up database environment
self.env = db.DBEnv()
self.env.set_cachesize(0, DBCACHE)
@@ -664,7 +676,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
versionpath = os.path.join(name, BDBVERSFN)
with open(versionpath, "w") as version_file:
version_file.write(str(db.version()))
_LOG.debug("Updated BDBVERSFN file to %s" % str(db.version()))
_LOG.debug("Updated bsddb version file to %s" % str(db.version()))
if self.update_python_version:
versionpath = os.path.join(name, "pythonversion.txt")
@@ -683,6 +695,10 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
(oldschema, newschema))
if force_schema_upgrade == True:
self.gramps_upgrade(callback)
versionpath = os.path.join(name, SCHVERSFN)
with open(versionpath, "w") as version_file:
version_file.write(str(_DBVERSION))
_LOG.debug("Updated schema version file to %s" % str(_DBVERSION))
else:
self.__close_early()
clear_lock_file(name)
@@ -2027,12 +2043,10 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
self.undo_history_callback()
def undo(self, update_history=True):
self.undodb.undo(update_history)
return
return self.undodb.undo(update_history)
def redo(self, update_history=True):
self.undodb.redo(update_history)
return
return self.undodb.redo(update_history)
def gramps_upgrade(self, callback=None):
UpdateCallback.__init__(self, callback)
@@ -2127,6 +2141,11 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
with open(versionpath, "w") as version_file:
version_file.write(str(version_info[0]))
versionpath = os.path.join(name, SCHVERSFN)
_LOG.debug("Write schema version file to %s" % str(_DBVERSION))
with open(versionpath, "w") as version_file:
version_file.write(str(_DBVERSION))
self.metadata.close()
self.env.close()
+14 -2
View File
@@ -501,14 +501,16 @@ class Span(object):
return retval
if diff_tuple[1] != 0:
if retval != "":
retval += ", "
# translators: needed for Arabic, ignore otherwise
retval += _(", ")
retval += ngettext("%d month", "%d months", diff_tuple[1]) % diff_tuple[1]
detail += 1
if self.precision == detail:
return retval
if diff_tuple[2] != 0:
if retval != "":
retval += ", "
# translators: needed for Arabic, ignore otherwise
retval += _(", ")
retval += ngettext("%d day", "%d days", diff_tuple[2]) % diff_tuple[2]
detail += 1
if self.precision == detail:
@@ -1492,6 +1494,16 @@ class Date(object):
"""
return self.text
def get_dow(self):
"""
Return an integer representing the day of the week associated with the
date (Monday=0).
If the day is not defined, a None is returned. If the date is a
compound date, the lower date day is returned.
"""
return self.sortval % 7 if self.is_regular() else None
def _zero_adjust_ymd(self, y, m, d):
year = y if y != 0 else 1
month = max(m, 1)
+11 -5
View File
@@ -39,6 +39,7 @@ from gen.lib.datebase import DateBase
from gen.lib.surnamebase import SurnameBase
from gen.lib.nametype import NameType
from gen.lib.const import IDENTICAL, EQUAL, DIFFERENT
from gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
@@ -401,9 +402,11 @@ class Name(SecondaryObject, PrivacyBase, SurnameBase, CitationBase, NoteBase,
first = self.first_name
surname = self.get_surname()
if self.suffix:
return "%s, %s %s" % (surname, first, self.suffix)
# translators: needed for Arabic, ignore otherwise
return _("%s, %s %s") % (surname, first, self.suffix)
else:
return "%s, %s" % (surname, first)
# translators: needed for Arabic, ignore otherwise
return _("%s, %s") % (surname, first)
def get_upper_name(self):
"""
@@ -413,9 +416,11 @@ class Name(SecondaryObject, PrivacyBase, SurnameBase, CitationBase, NoteBase,
first = self.first_name
surname = self.get_surname().upper()
if self.suffix:
return "%s, %s %s" % (surname, first, self.suffix)
# translators: needed for Arabic, ignore otherwise
return _("%s, %s %s") % (surname, first, self.suffix)
else:
return "%s, %s" % (surname, first)
# translators: needed for Arabic, ignore otherwise
return _("%s, %s") % (surname, first)
def get_regular_name(self):
"""
@@ -427,7 +432,8 @@ class Name(SecondaryObject, PrivacyBase, SurnameBase, CitationBase, NoteBase,
if (self.suffix == ""):
return "%s %s" % (first, surname)
else:
return "%s %s, %s" % (first, surname, self.suffix)
# translators: needed for Arabic, ignore otherwise
return _("%s %s, %s") % (first, surname, self.suffix)
def get_gedcom_parts(self):
"""
+7
View File
@@ -114,3 +114,10 @@ class Researcher(LocationBase):
['name', 'addr', 'locality', 'city', 'state',
'country', 'postal', 'phone', 'email']
]
def is_empty(self):
for attr in ['name', 'addr', 'locality', 'city', 'state',
'country', 'postal', 'phone', 'email']:
if getattr(self, attr) != "":
return False
return True
+9
View File
@@ -36,6 +36,7 @@
# GRAMPS modules
#
#-------------------------------------------------------------------------
from gen.ggettext import sgettext as _
#-------------------------------------------------------------------------
#
@@ -74,6 +75,14 @@ class PaperSize(object):
self.name = name
self.height = height
self.width = width
if self.name == 'Letter':
self.trans_pname = _('paper size|Letter')
elif self.name == 'Legal':
self.trans_pname = _('paper size|Legal')
elif self.name == 'Custom Size':
self.trans_pname = _('Custom Size')
else:
self.trans_pname = None
def get_name(self):
"Return the name of the paper style"
+1 -1
View File
@@ -149,7 +149,7 @@ class StyleSheetList(object):
Saves the current StyleSheet definitions to the associated file.
"""
xml_file = open(self.__file, "w")
xml_file.write("<?xml version=\"1.0\"?>\n")
xml_file.write('<?xml version="1.0" encoding="utf-8"?>\n')
xml_file.write('<stylelist>\n')
for name, sheet in self.map.iteritems():
+2 -2
View File
@@ -88,7 +88,7 @@ try:
the_file = open(const.PAPERSIZE)
parser.parse(the_file)
the_file.close()
paper_sizes.append(PaperSize(_("Custom Size"), -1, -1))
paper_sizes.append(PaperSize("Custom Size", -1, -1)) # always in English
except (IOError, OSError, SAXParseException):
paper_sizes = [
PaperSize("Letter",27.94,21.59),
@@ -110,5 +110,5 @@ except (IOError, OSError, SAXParseException):
PaperSize("C",55.88,43.18),
PaperSize("D",86.36, 55.88),
PaperSize("E",111.76,86.36),
PaperSize(_("Custom Size"),-1,-1)
PaperSize("Custom Size",-1,-1) # always in English
]
+2 -1
View File
@@ -230,7 +230,8 @@ def get_address_str(addr):
if str == "":
str = info
else:
str = "%s, %s" % (str, info)
# translators: needed for Arabic, ignore otherwise
str = _("%s, %s") % (str, info)
return str
#-------------------------------------------------------------------------
+1
View File
@@ -79,6 +79,7 @@ class FilterProxyDb(ProxyDbBase):
person = self.db.get_person_from_handle(handle)
if person:
self.flist.update(person.get_family_handle_list())
self.flist.update(person.get_parent_family_handle_list())
def get_person_from_handle(self, handle):
"""
+351 -603
View File
@@ -3,612 +3,24 @@
<!-- interface-requires gtk+ 2.12 -->
<!-- interface-requires grampswidgets 0.0 -->
<!-- interface-naming-policy project-wide -->
<object class="GtkListStore" id="confidence_model">
<columns>
<!-- column-name gchararray1 -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkDialog" id="editcitation">
<property name="can_focus">False</property>
<property name="default_width">600</property>
<property name="type_hint">dialog</property>
<child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox17">
<property name="visible">True</property>
<child>
<object class="GtkLabel" id="label602">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="xpad">6</property>
<property name="ypad">3</property>
<property name="label" translatable="yes">&lt;b&gt;Citation information&lt;/b&gt;</property>
<property name="use_markup">True</property>
<property name="use_underline">True</property>
<property name="justify">center</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkNotebook" id="notebook_ref">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="border_width">6</property>
<child>
<object class="GtkTable" id="table67">
<property name="visible">True</property>
<property name="border_width">12</property>
<property name="n_rows">5</property>
<property name="n_columns">3</property>
<property name="column_spacing">12</property>
<property name="row_spacing">6</property>
<child>
<object class="GtkLabel" id="label612">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">_Date:</property>
<property name="use_underline">True</property>
<property name="justify">center</property>
<property name="mnemonic_widget">date_entry</property>
</object>
<packing>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkButton" id="date_stat">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="has_tooltip">True</property>
<property name="tooltip_text" translatable="yes">Invoke date editor</property>
<property name="relief">none</property>
<accelerator key="d" signal="activate" modifiers="GDK_CONTROL_MASK"/>
<child internal-child="accessible">
<object class="AtkObject" id="date_stat-atkobject">
<property name="AtkObject::accessible-name" translatable="yes">Date</property>
</object>
</child>
<child>
<object class="GtkImage" id="image2682">
<property name="visible">True</property>
<property name="icon_name">gramps-date</property>
<child internal-child="accessible">
<object class="AtkObject" id="image2682-atkobject">
<property name="AtkObject::accessible-description" translatable="yes">Date</property>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="UndoableEntry" id="volume">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">Specific location within the information referenced. For a published work, this could include the volume of a multi-volume work and the page number(s). For a periodical, it could include volume, issue, and page numbers. For a newspaper, it could include a column number and page number. For an unpublished source, this could be a sheet number, page number, frame number, etc. A census record might have a line number or dwelling and family numbers in addition to the page number. </property>
<property name="invisible_char">●</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label613">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">_Volume/Page:</property>
<property name="use_underline">True</property>
<property name="justify">center</property>
<property name="mnemonic_widget">volume</property>
</object>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label614">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Con_fidence:</property>
<property name="use_underline">True</property>
<property name="justify">center</property>
<property name="mnemonic_widget">confidence</property>
</object>
<packing>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="confidence">
<property name="visible">True</property>
<property name="tooltip_text" translatable="yes">Conveys the submitter's quantitative evaluation of the credibility of a piece of information, based upon its supporting evidence. It is not intended to eliminate the receiver's need to evaluate the evidence for themselves.
Very Low =Unreliable evidence or estimated data
Low =Questionable reliability of evidence (interviews, census, oral genealogies, or potential for bias for example, an autobiography)
High =Secondary evidence, data officially recorded sometime after event
Very High =Direct and primary evidence used, or by dominance of the evidence </property>
<property name="model">confidence_model</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext1"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="ValidatableMaskedEntry" id="date_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">The date of the entry in the source you are referencing, e.g. the date a house was visited during a census, or the date an entry was made in a birth log/registry. </property>
<property name="invisible_char">●</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkHBox" id="warn_box2">
<property name="visible">True</property>
<property name="spacing">12</property>
<child>
<object class="GtkImage" id="warn_icon2">
<property name="visible">True</property>
<property name="stock">gtk-dialog-warning</property>
<property name="icon-size">6</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="warn_text2">
<property name="width_request">500</property>
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="ypad">3</property>
<property name="label" translatable="yes">&lt;b&gt;Note:&lt;/b&gt; Any changes in the shared citation information will be reflected in the citation itself, for all items that reference the citation.</property>
<property name="use_markup">True</property>
<property name="use_underline">True</property>
<property name="wrap">True</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="right_attach">3</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="spacing">12</property>
<child>
<object class="UndoableEntry" id="gid2">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">A unique ID to identify the citation</property>
<property name="invisible_char">•</property>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="privacy">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
<accelerator key="p" signal="activate" modifiers="GDK_CONTROL_MASK"/>
<child internal-child="accessible">
<object class="AtkObject" id="privacy-atkobject">
<property name="AtkObject::accessible-name" translatable="yes">Private</property>
</object>
</child>
<child>
<object class="GtkImage" id="image2677">
<property name="visible">True</property>
<property name="icon_name">gtk-dialog-authentication</property>
<child internal-child="accessible">
<object class="AtkObject" id="image2677-atkobject">
<property name="AtkObject::accessible-description" translatable="yes">Privacy</property>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">_ID:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">gid2</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
</child>
<child type="tab">
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;General&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
<packing>
<property name="tab_fill">False</property>
</packing>
</child>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkExpander" id="src_expander">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="border_width">6</property>
<property name="expanded">True</property>
<property name="spacing">6</property>
<child>
<object class="GtkNotebook" id="notebook_src">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="show_border">False</property>
<child>
<object class="GtkTable" id="table68">
<property name="visible">True</property>
<property name="border_width">12</property>
<property name="n_rows">6</property>
<property name="n_columns">2</property>
<property name="column_spacing">12</property>
<property name="row_spacing">6</property>
<child>
<object class="GtkLabel" id="label603">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Title:</property>
<property name="use_underline">True</property>
<property name="justify">center</property>
<property name="mnemonic_widget">title</property>
</object>
<packing>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label604">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Author:</property>
<property name="use_underline">True</property>
<property name="justify">center</property>
<property name="mnemonic_widget">author</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label606">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="ypad">3</property>
<property name="label" translatable="yes">A_bbreviation:</property>
<property name="use_underline">True</property>
<property name="justify">center</property>
<property name="mnemonic_widget">abbrev</property>
</object>
<packing>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label607">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Pub. Info.:</property>
<property name="use_underline">True</property>
<property name="justify">center</property>
<property name="mnemonic_widget">pub_info</property>
</object>
<packing>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="UndoableEntry" id="author">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">Authors of the source.</property>
<property name="invisible_char">●</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkHBox" id="warn_box">
<property name="border_width">6</property>
<property name="spacing">12</property>
<child>
<object class="GtkImage" id="warn_icon">
<property name="visible">True</property>
<property name="stock">gtk-dialog-warning</property>
<property name="icon-size">6</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="warn_text">
<property name="width_request">500</property>
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="ypad">3</property>
<property name="label" translatable="yes">&lt;b&gt;Note:&lt;/b&gt; Any changes in the shared source information will be reflected in the source itself, for all items that reference the source.</property>
<property name="use_markup">True</property>
<property name="use_underline">True</property>
<property name="wrap">True</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="right_attach">2</property>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
<property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="UndoableEntry" id="abbrev">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">Provide a short title used for sorting, filing, and retrieving source records.</property>
<property name="invisible_char">●</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="UndoableEntry" id="pub_info">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">Publication Information, such as city and year of publication, name of publisher, ...</property>
<property name="invisible_char">●</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label611">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_ID:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">gid</property>
</object>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox135">
<property name="visible">True</property>
<property name="spacing">12</property>
<child>
<object class="UndoableEntry" id="gid">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">A unique ID to identify the source</property>
<property name="invisible_char">●</property>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="private">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
<child internal-child="accessible">
<object class="AtkObject" id="private-atkobject">
<property name="AtkObject::accessible-name" translatable="yes">Private</property>
</object>
</child>
<child>
<object class="GtkImage" id="image2709">
<property name="visible">True</property>
<property name="icon_name">gtk-dialog-authentication</property>
<child internal-child="accessible">
<object class="AtkObject" id="image2709-atkobject">
<property name="AtkObject::accessible-description" translatable="yes">Privacy</property>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="UndoableEntry" id="title">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">Title of the source.</property>
<property name="invisible_char">●</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="y_options"></property>
</packing>
</child>
</object>
<packing>
<property name="tab_fill">False</property>
</packing>
</child>
<child type="tab">
<object class="GtkHBox" id="hbox127">
<property name="visible">True</property>
<child>
<object class="GtkImage" id="image2681">
<property name="stock">gtk-file</property>
<property name="icon-size">1</property>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label609">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;General&lt;/b&gt;</property>
<property name="use_markup">True</property>
<property name="justify">center</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="tab_fill">False</property>
</packing>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label610">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Shared source information&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
<property name="can_focus">False</property>
<child internal-child="action_area">
<object class="GtkHButtonBox" id="dialog-action_area17">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="help">
@@ -658,10 +70,352 @@ Very High =Direct and primary evidence used, or by dominance of the evidence </p
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkTable" id="table67">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">12</property>
<property name="n_rows">5</property>
<property name="n_columns">4</property>
<property name="column_spacing">12</property>
<property name="row_spacing">6</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<object class="GtkLabel" id="label612">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Date:</property>
<property name="use_underline">True</property>
<property name="justify">center</property>
<property name="mnemonic_widget">date_entry</property>
</object>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkButton" id="date_stat">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="has_tooltip">True</property>
<property name="tooltip_text" translatable="yes">Invoke date editor</property>
<property name="relief">none</property>
<accelerator key="d" signal="activate" modifiers="GDK_CONTROL_MASK"/>
<child internal-child="accessible">
<object class="AtkObject" id="date_stat-atkobject">
<property name="AtkObject::accessible-name" translatable="yes">Date</property>
</object>
</child>
<child>
<object class="GtkImage" id="image2682">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">gramps-date</property>
<child internal-child="accessible">
<object class="AtkObject" id="image2682-atkobject">
<property name="AtkObject::accessible-description" translatable="yes">Date</property>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="left_attach">3</property>
<property name="right_attach">4</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"/>
</packing>
</child>
<child>
<object class="UndoableEntry" id="volume">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">Specific location within the information referenced. For a published work, this could include the volume of a multi-volume work and the page number(s). For a periodical, it could include volume, issue, and page numbers. For a newspaper, it could include a column number and page number. For an unpublished source, this could be a sheet number, page number, frame number, etc. A census record might have a line number or dwelling and family numbers in addition to the page number. </property>
<property name="invisible_char">•</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">3</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkLabel" id="label613">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Volume/Page:</property>
<property name="use_underline">True</property>
<property name="justify">center</property>
<property name="mnemonic_widget">volume</property>
</object>
<packing>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkLabel" id="label614">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Con_fidence:</property>
<property name="use_underline">True</property>
<property name="justify">center</property>
<property name="mnemonic_widget">confidence</property>
</object>
<packing>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"/>
</packing>
</child>
<child>
<object class="ValidatableMaskedEntry" id="date_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">The date of the entry in the source you are referencing, e.g. the date a house was visited during a census, or the date an entry was made in a birth log/registry. </property>
<property name="invisible_char">•</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">3</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">12</property>
<child>
<object class="GtkComboBox" id="confidence">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">Conveys the submitter's quantitative evaluation of the credibility of a piece of information, based upon its supporting evidence. It is not intended to eliminate the receiver's need to evaluate the evidence for themselves.
Very Low =Unreliable evidence or estimated data
Low =Questionable reliability of evidence (interviews, census, oral genealogies, or potential for bias for example, an autobiography)
High =Secondary evidence, data officially recorded sometime after event
Very High =Direct and primary evidence used, or by dominance of the evidence </property>
<property name="model">confidence_model</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext1"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">_ID:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">gid</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="UndoableEntry" id="gid">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">A unique ID to identify the citation</property>
<property name="invisible_char">•</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">3</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Source:</property>
</object>
<packing>
<property name="x_options">GTK_FILL</property>
<property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkButton" id="add_del_source">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="right_attach">4</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkLabel" id="source">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="select_source">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">3</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="privacy">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
<accelerator key="p" signal="activate" modifiers="GDK_CONTROL_MASK"/>
<child internal-child="accessible">
<object class="AtkObject" id="privacy-atkobject">
<property name="AtkObject::accessible-name" translatable="yes">Private</property>
</object>
</child>
<child>
<object class="GtkImage" id="image2677">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">gtk-dialog-authentication</property>
<child internal-child="accessible">
<object class="AtkObject" id="image2677-atkobject">
<property name="AtkObject::accessible-description" translatable="yes">Privacy</property>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="left_attach">3</property>
<property name="right_attach">4</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Author:</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkLabel" id="author">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">3</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"/>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
<action-widgets>
@@ -670,10 +424,4 @@ Very High =Direct and primary evidence used, or by dominance of the evidence </p
<action-widget response="-5">ok</action-widget>
</action-widgets>
</object>
<object class="GtkListStore" id="confidence_model">
<columns>
<!-- column-name gchararray1 -->
<column type="gchararray"/>
</columns>
</object>
</interface>
+1
View File
@@ -31,6 +31,7 @@ pkgpython_PYTHON = \
locationembedlist.py \
locationmodel.py \
mediabackreflist.py \
mediaattrembedlist.py \
nameembedlist.py \
namemodel.py \
notebackreflist.py \
+1
View File
@@ -47,6 +47,7 @@ from familyldsembedlist import FamilyLdsEmbedList
from gallerytab import GalleryTab
from ldsembedlist import LdsEmbedList
from locationembedlist import LocationEmbedList
from mediaattrembedlist import MediaAttrEmbedList
from mediabackreflist import MediaBackRefList
from nameembedlist import NameEmbedList
from notebackreflist import NoteBackRefList
+14 -13
View File
@@ -50,14 +50,14 @@ from gui.selectors import SelectorFactory
#-------------------------------------------------------------------------
class EventEmbedList(DbGUIElement, GroupEmbeddedList):
_HANDLE_COL = 7
_HANDLE_COL = 8
_DND_TYPE = DdTargets.EVENTREF
_DND_EXTRA = DdTargets.EVENT
_WORKGROUP = EventRefModel._ROOTINDEX
_WORKNAME = _("Family Events")
_FATHNAME = _("Events father")
_MOTHNAME = _("Events mother")
_WORKNAME = _("Family")
_FATHNAME = _("Father")
_MOTHNAME = _("Mother")
_MSG = {
'add' : _('Add a new family event'),
@@ -71,14 +71,15 @@ class EventEmbedList(DbGUIElement, GroupEmbeddedList):
#index = column in model. Value =
# (name, sortcol in model, width, markup/text, weigth_col
_column_names = [
(_('Description'), -1, 240, 0, EventRefModel.COL_FONTWEIGHT[0]),
(_('Type'), EventRefModel.COL_TYPE[0], 100, 0,
EventRefModel.COL_FONTWEIGHT[0]),
(_('ID'), EventRefModel.COL_GID[0], 60, 0,
(_('Description'), EventRefModel.COL_DESCR[0], 150, 0, -1),
(_('Type'), EventRefModel.COL_TYPE[0], 120, 0,
EventRefModel.COL_FONTWEIGHT[0]),
(_('ID'), -1, 100, 0, -1),
(_('Date'), EventRefModel.COL_SORTDATE[0], 150, 1, -1),
(_('Place'), EventRefModel.COL_PLACE[0], 140, 0, -1),
(_('Place'), EventRefModel.COL_PLACE[0], 240, 0, -1),
(_('Role'), EventRefModel.COL_ROLE[0], 80, 0, -1),
(_('Main Participants'), EventRefModel.COL_PARTIC[0], 240, 0,
EventRefModel.COL_FONTWEIGHT[0]),
None,
None,
None
@@ -150,14 +151,14 @@ class EventEmbedList(DbGUIElement, GroupEmbeddedList):
#family events
if not self._data or self.changed:
self._data = [self.obj.get_event_ref_list()]
self._groups = [(self.obj.get_handle(), self._WORKNAME)]
self._groups = [(self.obj.get_handle(), self._WORKNAME, '')]
#father events
fhandle = self.obj.get_father_handle()
if fhandle:
fdata = self.dbstate.db.get_person_from_handle(fhandle).\
get_event_ref_list()
if fdata:
self._groups.append((fhandle, self._FATHNAME))
self._groups.append((fhandle, self._FATHNAME, ''))
self._data.append(fdata)
#mother events
mhandle = self.obj.get_mother_handle()
@@ -165,7 +166,7 @@ class EventEmbedList(DbGUIElement, GroupEmbeddedList):
mdata = self.dbstate.db.get_person_from_handle(mhandle).\
get_event_ref_list()
if mdata:
self._groups.append((mhandle, self._MOTHNAME))
self._groups.append((mhandle, self._MOTHNAME, ''))
self._data.append(mdata)
#we register all events that need to be tracked
for group in self._data:
@@ -186,7 +187,7 @@ class EventEmbedList(DbGUIElement, GroupEmbeddedList):
The columns to show as a tuple containing
tuples (show/noshow, model column)
"""
return ((1, 0), (1, 1), (1, 2), (1, 3), (1, 4), (1, 5))
return ((1, 1), (1, 6), (1, 3), (1, 4), (1, 0), (1, 5), (1, 2))
def default_types(self):
return [
+14 -5
View File
@@ -42,8 +42,10 @@ import cgi
# GRAMPS classes
#
#-------------------------------------------------------------------------
from gen.lib import EventRoleType
import DateHandler
import config
import Utils
#-------------------------------------------------------------------------
#
@@ -68,12 +70,13 @@ class EventRefModel(gtk.TreeStore):
COL_DATE = (3, str)
COL_PLACE = (4, str)
COL_ROLE = (5, str)
COL_SORTDATE = (6, str)
COL_EVENTREF = (7, object)
COL_FONTWEIGHT = (8, int)
COL_PARTIC = (6, str)
COL_SORTDATE = (7, str)
COL_EVENTREF = (8, object)
COL_FONTWEIGHT = (9, int)
COLS = (COL_DESCR, COL_TYPE, COL_GID, COL_DATE, COL_PLACE, COL_ROLE,
COL_SORTDATE, COL_EVENTREF, COL_FONTWEIGHT)
COL_PARTIC, COL_SORTDATE, COL_EVENTREF, COL_FONTWEIGHT)
def __init__(self, event_list, db, groups):
"""
@@ -96,7 +99,9 @@ class EventRefModel(gtk.TreeStore):
def row_group(self, index, group):
name = self.namegroup(index, len(group))
return [name, '', '', '', '', '', '', (index, None), WEIGHT_BOLD]
spouse = self.groups[index][2]
return ['', name, '', '', '', '', spouse, '', (index, None),
WEIGHT_BOLD]
def namegroup(self, groupindex, length):
return self._GROUPSTRING % {'groupname': self.groups[groupindex][1],
@@ -109,6 +114,7 @@ class EventRefModel(gtk.TreeStore):
self.column_date(eventref),
self.column_place(eventref),
self.column_role(eventref),
self.column_participant(eventref),
self.column_sort_date(eventref),
(index, eventref),
self.colweight(index),
@@ -144,3 +150,6 @@ class EventRefModel(gtk.TreeStore):
if place_handle:
return self.db.get_place_from_handle(place_handle).get_title()
return u""
def column_participant(self, event_ref):
return Utils.get_participant_from_event(self.db, event_ref.ref)
@@ -157,7 +157,13 @@ class GroupEmbeddedList(EmbeddedList):
and decide if this is a move or a reorder.
"""
if sel_data and sel_data.data:
(mytype, selfid, obj, row_from) = pickle.loads(sel_data.data)
# make sure data = 1 row
# pickle.loads(sel_data.data)[3] = 0
try:
(mytype, selfid, obj, row_from) = pickle.loads(sel_data.data)
except ValueError:
return
# make sure this is the correct DND type for this object
if mytype == self._DND_TYPE.drag_type:
@@ -0,0 +1,43 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2014 Nick Hall
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#-------------------------------------------------------------------------
#
# Gramps classes
#
#-------------------------------------------------------------------------
from attrembedlist import AttrEmbedList
#-------------------------------------------------------------------------
#
# MediaAttrEmbedList
#
#-------------------------------------------------------------------------
class MediaAttrEmbedList(AttrEmbedList):
def __init__(self, dbstate, uistate, track, data):
AttrEmbedList.__init__(self, dbstate, uistate, track, data)
def get_editor(self):
from .. import EditAttribute
return EditAttribute
def get_user_values(self):
return self.dbstate.db.get_media_attribute_types()
@@ -47,8 +47,9 @@ import Errors
#-------------------------------------------------------------------------
class PersonEventEmbedList(EventEmbedList):
_WORKNAME = _("Personal Events")
_FAMNAME = _("With %(namepartner)s (%(famid)s)")
_WORKNAME = _("Personal")
#_FAMNAME = _("With %(namepartner)s (%(famid)s)")
_FAMNAME = _("Family")
_UNKNOWNNAME = _("<Unknown>")
_MSG = {
@@ -67,7 +68,7 @@ class PersonEventEmbedList(EventEmbedList):
def get_data(self):
if not self._data or self.changed:
self._data = [self.obj.get_event_ref_list()]
self._groups = [(self.obj.get_handle(), self._WORKNAME)]
self._groups = [(self.obj.get_handle(), self._WORKNAME, '')]
# own family events
family_handle_list = self.obj.get_family_handle_list()
if family_handle_list:
@@ -86,10 +87,8 @@ class PersonEventEmbedList(EventEmbedList):
else:
groupname = self._UNKNOWNNAME
self._data.append(family.get_event_ref_list())
self._groups.append((family_handle, self._FAMNAME % {
'namepartner': groupname,
'famid': family.get_gramps_id()
}))
self._groups.append((family_handle, self._FAMNAME,
groupname))
self.changed = False
return self._data
+67 -266
View File
@@ -3,7 +3,8 @@
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2009 Gary Burton
# Copyright (C) 2011 Tim G L Lyons, Nick Hall
# Copyright (C) 2011 Tim G L Lyons
# Copyright (C) 2011,2014 Nick Hall
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -20,10 +21,8 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# $Id$
"""
EditCitation class for GRAMPS.
EditCitation class for Gramps.
"""
#-------------------------------------------------------------------------
@@ -35,6 +34,13 @@ from gen.ggettext import gettext as _
import logging
LOG = logging.getLogger(".citation")
#-------------------------------------------------------------------------
#
# GTK/Gnome modules
#
#-------------------------------------------------------------------------
import gtk
#-------------------------------------------------------------------------
#
# gramps modules
@@ -43,13 +49,11 @@ LOG = logging.getLogger(".citation")
import gen.lib
from gen.db import DbTxn
from editprimary import EditPrimary
from displaytabs import (NoteTab, GalleryTab, DataEmbedList,
SourceBackRefList, RepoEmbedList, CitationBackRefList)
from objectentries import SourceEntry
from displaytabs import NoteTab, GalleryTab, DataEmbedList, CitationBackRefList
from gui.widgets import (MonitoredEntry, PrivacyButton, MonitoredMenu,
MonitoredDate)
MonitoredDate)
from QuestionDialog import ErrorDialog
from editreference import RefTab
from glade import Glade
#-------------------------------------------------------------------------
@@ -77,50 +81,12 @@ class EditCitation(EditPrimary):
The obj parameter is mandatory. If the source parameter is not
provided, it will be deduced from the obj Citation object.
"""
if not source and obj.get_reference_handle():
source = dbstate.db.get_source_from_handle(
obj.get_reference_handle())
self.source = source
if source:
obj.set_reference_handle(source.get_handle())
self.callertitle = callertitle
EditPrimary.__init__(self, dbstate, uistate, track, obj,
dbstate.db.get_citation_from_handle,
dbstate.db.get_citation_from_gramps_id, callback)
# FIXME: EitPrimary calls ManagedWindow.__init__, which checks whether
# a window is already open which is editing obj. However, for
# EditCitation, not only do we need to protect obj (which will be
# a Citation, but we also need to protect the associated Source.
def build_window_key(self, obj):
"""
Return a key for the edit window that is opened.
This function overrides the build_window_key in EditPrimary.
There is a problem with database object locking. The database locking is
handled by the ManagedWindow class, which will only allow one primary
object to be edited at a time.
Normally, the window key is derived from the obj that is being edited.
However, in the case of EditCitation, there are two objects being
edited, the Citation and the Source. Both must be protected against
against the user trying to edit them twice.
What we do here is to derive the window key from the Source object, if
one exists. A Citation always points to exactly one Source object, so if
we try to edit the same Citation twice, the associated Source objects
will be the same so this will be prevented. If we try to edit a Source
object and a Citation object that refers to the same Source, then again,
the window key will be the same and this will be prevented.
"""
if obj and obj.get_reference_handle():
# citation already points to source
return obj.get_reference_handle()
elif self.source and self.source.get_handle():
# Citation doesn't yet point to source, but source exists and has a
# handle
return self.source.get_handle()
else:
return id(self)
def empty_object(self):
"""
Return an empty Citation object for comparison for changes.
@@ -155,68 +121,27 @@ class EditCitation(EditPrimary):
title = _('New Citation')
return title
# The functions define_warn_box, enable_warn_box and define_expander
# are normally inherited from editreference,
# but have to be defined here because this class inherits from
# EditPrimary instead
def define_warn_box(self, box):
self.warn_box = box
def enable_warnbox(self):
self.warn_box.show()
def define_warn_box2(self, box):
self.warn_box2 = box
def enable_warnbox2(self):
self.warn_box2.show()
def define_expander(self, expander):
expander.set_expanded(True)
def _local_init(self):
"""Local initialization function.
"""
Local initialization function.
Perform basic initialization, including setting up widgets
and the glade interface. It is called by the base class L{EditPrimary},
and overridden here.
"""
self.width_key = 'interface.citation-width'
self.height_key = 'interface.citation-height'
assert(self.obj)
self.glade = Glade()
self.set_window(self.glade.toplevel, None,
self.get_menu_title())
self.define_warn_box(self.glade.get_object("warn_box"))
self.define_warn_box2(self.glade.get_object("warn_box2"))
self.define_expander(self.glade.get_object("src_expander"))
tblref = self.glade.get_object('table67')
notebook = self.glade.get_object('notebook_ref')
#recreate start page as GrampsTab
notebook.remove_page(0)
self.reftab = RefTab(self.dbstate, self.uistate, self.track,
_('General'), tblref)
tblref = self.glade.get_object('table68')
notebook = self.glade.get_object('notebook_src')
#recreate start page as GrampsTab
notebook.remove_page(0)
self.primtab = RefTab(self.dbstate, self.uistate, self.track,
_('General'), tblref)
def _post_init(self):
title = self.glade.get_object('title')
volume = self.glade.get_object('volume')
if not title.get_text_length():
title.grab_focus();
elif not volume.get_text_length():
volume.grab_focus();
self.share_btn = self.glade.get_object('select_source')
self.add_del_btn = self.glade.get_object('add_del_source')
def _connect_signals(self):
"""Connects any signals that need to be connected.
"""
Connects any signals that need to be connected.
Called by the init routine of the base class L{EditPrimary}.
"""
@@ -233,21 +158,20 @@ class EditCitation(EditPrimary):
whilst editing it. If the object is deleted we need to close the editor
windows and clean up. If the database emits a rebuild signal for the
database object type we also abort the edit.
The Citation editor edits two primary objects, and therefore we need to
check if either have been deleted. If the source is deleted, the
citation must have been deleted first and will emit a signal, so we
shouldn't have to connect to the source-delete signal. It should not be
necessary to connect to the source- rebuild signal for similar reasons.
"""
self._add_db_signal('citation-rebuild', self._do_close)
self._add_db_signal('citation-delete', self.check_for_close)
def _setup_fields(self):
"""Get control widgets and attach them to Citation's attributes."""
# Populate the Citation section
"""
Get control widgets and attach them to Citation's attributes.
"""
self.source_field = SourceEntry(self.dbstate, self.uistate, self.track,
self.glade.get_object("source"),
self.obj.set_reference_handle,
self.obj.get_reference_handle,
self.add_del_btn, self.share_btn,
callback=self.source_changed)
self.date = MonitoredDate(
self.glade.get_object("date_entry"),
@@ -258,7 +182,7 @@ class EditCitation(EditPrimary):
self.db.readonly)
self.gid = MonitoredEntry(
self.glade.get_object('gid2'), self.obj.set_gramps_id,
self.glade.get_object('gid'), self.obj.set_gramps_id,
self.obj.get_gramps_id,self.db.readonly)
self.volume = MonitoredEntry(
@@ -278,105 +202,49 @@ class EditCitation(EditPrimary):
self.ref_privacy = PrivacyButton(
self.glade.get_object('privacy'), self.obj, self.db.readonly)
# Populate the Source section
self.title = MonitoredEntry(
self.glade.get_object('title'),
self.source.set_title,
self.source.get_title,
self.db.readonly)
self.author = MonitoredEntry(
self.glade.get_object('author'), self.source.set_author,
self.source.get_author,self.db.readonly)
self.gid = MonitoredEntry(
self.glade.get_object('gid'), self.source.set_gramps_id,
self.source.get_gramps_id,self.db.readonly)
self.source_privacy = PrivacyButton(
self.glade.get_object("private"),
self.source, self.db.readonly)
self.abbrev = MonitoredEntry(
self.glade.get_object('abbrev'), self.source.set_abbreviation,
self.source.get_abbreviation,self.db.readonly)
self.pubinfo = MonitoredEntry(
self.glade.get_object('pub_info'), self.source.set_publication_info,
self.source.get_publication_info,self.db.readonly)
def _create_tabbed_pages(self):
"""
Create the notebook tabs and inserts them into the main
window.
"""
# create notebook tabs for Citation
notebook_ref = self.glade.get_object('notebook_ref')
self._add_tab(notebook_ref, self.reftab)
notebook = gtk.Notebook()
self.comment_tab = NoteTab(self.dbstate, self.uistate, self.track,
self.note_tab = NoteTab(self.dbstate, self.uistate, self.track,
self.obj.get_note_list(), self.get_menu_title(),
notetype=gen.lib.NoteType.CITATION)
self._add_tab(notebook_ref, self.comment_tab)
self.track_ref_for_deletion("comment_tab")
self._add_tab(notebook, self.note_tab)
self.track_ref_for_deletion("note_tab")
self.gallery_tab = GalleryTab(self.dbstate, self.uistate, self.track,
self.obj.get_media_list())
self._add_tab(notebook_ref, self.gallery_tab)
self._add_tab(notebook, self.gallery_tab)
self.track_ref_for_deletion("gallery_tab")
self.data_tab = DataEmbedList(self.dbstate, self.uistate, self.track,
self.obj)
self._add_tab(notebook_ref, self.data_tab)
self._add_tab(notebook, self.data_tab)
self.track_ref_for_deletion("data_tab")
self.citationref_list = CitationBackRefList(self.dbstate, self.uistate,
self.track,
self.db.find_backlink_handles(self.obj.handle),
self.enable_warnbox2)
self._add_tab(notebook_ref, self.citationref_list)
self.db.find_backlink_handles(self.obj.handle))
self._add_tab(notebook, self.citationref_list)
self.track_ref_for_deletion("citationref_list")
# Create notebook tabs for Source
notebook_src = self.glade.get_object('notebook_src')
self._add_tab(notebook_src, self.primtab)
self.note_tab = NoteTab(self.dbstate, self.uistate, self.track,
self.source.get_note_list(),
self.get_menu_title(),
notetype=gen.lib.NoteType.SOURCE)
self._add_tab(notebook_src, self.note_tab)
self.track_ref_for_deletion("note_tab")
self.gallery_tab = GalleryTab(self.dbstate, self.uistate, self.track,
self.source.get_media_list())
self._add_tab(notebook_src, self.gallery_tab)
self.track_ref_for_deletion("gallery_tab")
self.data_tab = DataEmbedList(self.dbstate, self.uistate, self.track,
self.source)
self._add_tab(notebook_src, self.data_tab)
self.track_ref_for_deletion("data_tab")
self.repo_tab = RepoEmbedList(self.dbstate, self.uistate, self.track,
self.source.get_reporef_list())
self._add_tab(notebook_src, self.repo_tab)
self.track_ref_for_deletion("repo_tab")
self.srcref_list = SourceBackRefList(self.dbstate, self.uistate,
self.track,
self.db.find_backlink_handles(self.source.handle),
self.enable_warnbox)
self._add_tab(notebook_src, self.srcref_list)
self.track_ref_for_deletion("srcref_list")
self._setup_notebook_tabs(notebook)
self._setup_notebook_tabs(notebook_src)
self._setup_notebook_tabs(notebook_ref)
notebook.show_all()
self.glade.get_object('dialog-vbox17').pack_start(notebook, True)
def source_changed(self):
handle = self.obj.get_reference_handle()
if handle:
source = self.db.get_source_from_handle(handle)
author = source.get_author()
else:
author = ''
self.glade.get_object("author").set_text(author)
def build_menu_names(self, source):
"""
@@ -386,12 +254,19 @@ class EditCitation(EditPrimary):
return (_('Edit Citation'), self.get_menu_title())
def save(self, *obj):
"""Save the data."""
"""
Save the data.
"""
self.ok_button.set_sensitive(False)
if self.source_is_empty(self.source):
ErrorDialog(_("Cannot save source"),
_("No data exists for this source. Please "
"enter data or cancel the edit."))
if not self.obj.get_reference_handle():
ErrorDialog(_("No source selected"),
_("A source is anything (personal testimony, "
"video recording, photograph, newspaper column, "
"gravestone...) from which information can be "
"derived. To create a citation, first select the "
"required source, and then record the location of "
"the information referenced within the source in the "
"'Volume/Page' field."))
self.ok_button.set_sensitive(True)
return
@@ -401,87 +276,32 @@ class EditCitation(EditPrimary):
name = prim_object.get_page()
msg1 = _("Cannot save citation. ID already exists.")
msg2 = _("You have attempted to use the existing Gramps ID with "
"value %(gramps_id)s. This value is already used by '"
"value %(id)s. This value is already used by '"
"%(prim_object)s'. Please enter a different ID or leave "
"blank to get the next available ID value.") % {
'gramps_id' : gramps_id, 'prim_object' : name }
ErrorDialog(msg1, msg2)
self.ok_button.set_sensitive(True)
return
(uses_dupe_id, gramps_id) = self.source_uses_duplicate_id(self.source)
if uses_dupe_id:
prim_object = self.db.get_source_from_gramps_id(gramps_id)
name = prim_object.get_title()
msg1 = _("Cannot save source. ID already exists.")
msg2 = _("You have attempted to use the existing Gramps ID with "
"value %(gramps_id)s. This value is already used by '"
"%(prim_object)s'. Please enter a different ID or leave "
"blank to get the next available ID value.") % {
'gramps_id' : gramps_id, 'prim_object' : name }
'id' : gramps_id, 'prim_object' : name }
ErrorDialog(msg1, msg2)
self.ok_button.set_sensitive(True)
return
with DbTxn('', self.db) as trans:
# First commit the Source Primary object
if not self.source.get_handle():
self.db.add_source(self.source, trans)
msg = _("Add Source (%s)") % self.source.get_title()
else:
if not self.source.get_gramps_id():
self.source.set_gramps_id(
self.db.find_next_source_gramps_id())
self.db.commit_source(self.source, trans)
msg = _("Edit Source (%s)") % self.source.get_title()
self.obj.set_reference_handle(self.source.handle)
# Now commit the Citation Primary object
if not self.obj.get_handle():
self.db.add_citation(self.obj, trans)
msg += "\n" + _("Add Citation (%s)") % self.obj.get_page()
msg = _("Add Citation (%s)") % self.obj.get_page()
else:
if not self.obj.get_gramps_id():
self.obj.set_gramps_id(
self.db.find_next_citation_gramps_id())
self.db.commit_citation(self.obj, trans)
msg += "\n" + _("Edit Citation (%s)") % self.obj.get_page()
msg = _("Edit Citation (%s)") % self.obj.get_page()
trans.set_description(msg)
if self.callback:
self.callback(self.obj.get_handle())
self.close()
def source_is_empty(self, obj):
empty_object = gen.lib.Source()
return cmp(obj.serialize()[1:],
empty_object.serialize()[1:]) == 0
def source_uses_duplicate_id(self, obj):
"""
Check whether a changed or added GRAMPS ID already exists in the DB.
Return True if a duplicate GRAMPS ID has been detected.
"""
original = self.db.get_source_from_handle(obj.get_handle())
if original and original.get_gramps_id() == obj.get_gramps_id():
return (False, 0)
else:
idval = obj.get_gramps_id()
if self.db.get_source_from_gramps_id(idval):
return (True, idval)
return (False, 0)
def data_has_changed(self):
return self.citation_data_has_changed() or \
self.source_data_has_changed()
def citation_data_has_changed(self):
"""
This checks whether the citation data has changed
A date comparison can fail incorrectly because we have made the
decision to store entered text in the date. However, there is no
entered date when importing from a XML file, so we can get an
@@ -502,25 +322,6 @@ class EditCitation(EditPrimary):
return cmp(cmp_obj.serialize(True)[1:],
self.obj.serialize()[1:]) != 0
def source_data_has_changed(self):
"""
This checks whether the source data has changed
"""
if self.db.readonly:
return False
elif self.source.handle:
orig = self.db.get_source_from_handle(self.source.handle)
if orig:
cmp_obj = orig
else:
cmp_obj = gen.lib.Source()
return cmp(cmp_obj.serialize()[1:],
self.source.serialize()[1:]) != 0
else:
cmp_obj = gen.lib.Source()
return cmp(cmp_obj.serialize()[1:],
self.source.serialize()[1:]) != 0
class DeleteCitationQuery(object):
def __init__(self, dbstate, uistate, citation, the_lists):
self.citation = citation
+2
View File
@@ -248,6 +248,8 @@ class EditEventRef(EditReference):
with DbTxn(_("Modify Event"), self.db) as trans:
self.commit_event(self.source,trans)
else:
if self.check_for_duplicate_id('Event'):
return
with DbTxn(_("Add Event"), self.db) as trans:
self.add_event(self.source,trans)
self.source_ref.ref = self.source.handle
+6 -2
View File
@@ -334,11 +334,12 @@ class EditFamily(EditPrimary):
QR_CATEGORY = CATEGORY_QR_FAMILY
def __init__(self, dbstate, uistate, track, family):
def __init__(self, dbstate, uistate, track, family, callback=None):
EditPrimary.__init__(self, dbstate, uistate, track,
family, dbstate.db.get_family_from_handle,
dbstate.db.get_family_from_gramps_id)
dbstate.db.get_family_from_gramps_id,
callback)
# look for the scenerio of a child and no parents on a new
# family
@@ -1080,6 +1081,9 @@ class EditFamily(EditPrimary):
self.db.commit_family(self.obj, trans)
self._do_close()
if self.callback:
self.callback(self.obj)
self.callback = None
def no_name(self):
"""
+2 -2
View File
@@ -51,7 +51,7 @@ import Utils
from editprimary import EditPrimary
from gui.widgets import (MonitoredDate, MonitoredEntry, PrivacyButton,
MonitoredTagList)
from displaytabs import (CitationEmbedList, AttrEmbedList, NoteTab,
from displaytabs import (CitationEmbedList, MediaAttrEmbedList, NoteTab,
MediaBackRefList)
from addmedia import AddMediaObject
from QuestionDialog import ErrorDialog
@@ -200,7 +200,7 @@ class EditMedia(EditPrimary):
self._add_tab(notebook, self.citation_tab)
self.track_ref_for_deletion("citation_tab")
self.attr_tab = AttrEmbedList(self.dbstate,
self.attr_tab = MediaAttrEmbedList(self.dbstate,
self.uistate,
self.track,
self.obj.get_attribute_list())
+6 -3
View File
@@ -51,7 +51,7 @@ import Utils
from gen.lib import NoteType
from gen.db import DbTxn
from glade import Glade
from displaytabs import (CitationEmbedList, AttrEmbedList, MediaBackRefList,
from displaytabs import (CitationEmbedList, MediaAttrEmbedList, MediaBackRefList,
NoteTab)
from gui.widgets import (MonitoredSpinButton, MonitoredEntry, PrivacyButton,
MonitoredDate, MonitoredTagList)
@@ -615,7 +615,7 @@ class EditMediaRef(EditReference):
self._add_tab(notebook_ref, self.srcref_list)
self.track_ref_for_deletion("srcref_list")
self.attr_list = AttrEmbedList(self.dbstate,self.uistate,self.track,
self.attr_list = MediaAttrEmbedList(self.dbstate,self.uistate,self.track,
self.source_ref.get_attribute_list())
self._add_tab(notebook_ref, self.attr_list)
self.track_ref_for_deletion("attr_list")
@@ -640,7 +640,7 @@ class EditMediaRef(EditReference):
self._add_tab(notebook_src, self.src_srcref_list)
self.track_ref_for_deletion("src_srcref_list")
self.src_attr_list = AttrEmbedList(self.dbstate,self.uistate,self.track,
self.src_attr_list = MediaAttrEmbedList(self.dbstate,self.uistate,self.track,
self.source.get_attribute_list())
self._add_tab(notebook_src, self.src_attr_list)
self.track_ref_for_deletion("src_attr_list")
@@ -655,12 +655,15 @@ class EditMediaRef(EditReference):
self._setup_notebook_tabs(notebook_ref)
def save(self,*obj):
#first save primary object
if self.source.handle:
with DbTxn(_("Edit Media Object (%s)") %
self.source.get_description(), self.db) as trans:
self.db.commit_media_object(self.source, trans)
else:
if self.check_for_duplicate_id('Media'):
return
with DbTxn(_("Add Media Object (%s)") %
self.source.get_description(), self.db) as trans:
self.db.add_object(self.source, trans)
+2 -1
View File
@@ -270,7 +270,8 @@ class EditNote(EditPrimary):
# setup initial values for textview and textbuffer
if self.obj:
self.empty = False
self.texteditor.set_text(self.obj.get_styledtext())
with self.texteditor.undo_disabled():
self.texteditor.set_text(self.obj.get_styledtext())
# Reset the undoable buffer:
self.texteditor.reset()
_LOG.debug("Initial Note: %s" % str(self.texteditor.get_text()))
+43
View File
@@ -3,6 +3,7 @@
#
# Copyright (C) 2000-2006 Donald N. Allingham
# 2009 Gary Burton
# Copyright (C) 2014 Paul Franklin
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -33,6 +34,8 @@ import gtk
# gramps modules
#
#-------------------------------------------------------------------------
from gen.ggettext import gettext as _
from QuestionDialog import ErrorDialog
import ManagedWindow
from displaytabs import GrampsTab
import config
@@ -255,3 +258,43 @@ class EditReference(ManagedWindow.ManagedWindow, DbGUIElement):
of the main interface, not of the displaytabs.
"""
pass
def check_for_duplicate_id(self, type):
"""
check to see if the gramps ID (if any) already exists
type : the gramps primary object type, a string
returns : True if the gramps ID already exists, else False
N.B. the various strings, string variables, and titles existed already
"""
new_id = self.source.get_gramps_id()
if new_id:
old_primary = self.db.get_from_name_and_gramps_id(type, new_id)
if old_primary:
if type == 'Event':
msg1 = _("Cannot save event. ID already exists.")
description = old_primary.get_description()
elif type == 'Media':
msg1 = _("Cannot save media object. ID already exists.")
description = old_primary.get_description()
elif type == 'Repository':
msg1 = _("Cannot save repository. ID already exists.")
description = old_primary.get_name()
if description:
msg2 = _("You have attempted to use the existing Gramps "
"ID with value %(id)s. This value is already "
"used by '%(prim_object)s'. Please enter a "
"different ID or leave blank to get the next "
"available ID value.") % {
'id' : new_id, 'prim_object' : description }
else:
msg2 = _("You have attempted to use the existing Gramps "
"ID with value %(id)s. This value is already "
"used. Please enter a "
"different ID or leave blank to get the next "
"available ID value.") % {
'id' : new_id}
ErrorDialog(msg1, msg2)
return True
return False
+2
View File
@@ -194,6 +194,8 @@ class EditRepoRef(EditReference):
with DbTxn(_("Modify Repository"), self.db) as trans:
self.db.commit_repository(self.source,trans)
else:
if self.check_for_duplicate_id('Repository'):
return
with DbTxn(_("Add Repository"), self.db) as trans:
self.db.add_repository(self.source,trans)
self.source_ref.ref = self.source.handle
+4 -2
View File
@@ -62,11 +62,11 @@ from glade import Glade
class EditSource(EditPrimary):
def __init__(self, dbstate, uistate, track, source):
def __init__(self, dbstate, uistate, track, source, callback=None):
EditPrimary.__init__(self, dbstate, uistate, track, source,
dbstate.db.get_source_from_handle,
dbstate.db.get_source_from_gramps_id)
dbstate.db.get_source_from_gramps_id, callback)
def empty_object(self):
return gen.lib.Source()
@@ -210,6 +210,8 @@ class EditSource(EditPrimary):
trans.set_description(msg)
self.close()
if self.callback:
self.callback(self.obj)
class DeleteSrcQuery(object):
def __init__(self, dbstate, uistate, source, the_lists):
+62 -3
View File
@@ -44,8 +44,9 @@ from pango import ELLIPSIZE_END
# Gramps modules
#
#-------------------------------------------------------------------------
from gen.lib import (Place, MediaObject, Note)
from gen.lib import (Place, Source, MediaObject, Note)
from editplace import EditPlace
from editsource import EditSource
from editmedia import EditMedia
from editnote import EditNote
from gui.selectors import SelectorFactory
@@ -71,7 +72,7 @@ class ObjEntry(object):
DEL_STR = ""
def __init__(self, dbstate, uistate, track, label, set_val,
get_val, add_edt, share):
get_val, add_edt, share, callback=None):
"""Pass the dbstate and uistate and present track.
label is a gtk.Label that shows the persent value
set_val is function that is called when handle changes, use it
@@ -91,6 +92,7 @@ class ObjEntry(object):
self.set_val = set_val
self.uistate = uistate
self.track = track
self.callback = callback
#connect drag and drop
self._init_dnd()
@@ -134,6 +136,8 @@ class ObjEntry(object):
else:
self.label.set_text(name)
self.label.set_ellipsize(ELLIPSIZE_END)
if self.callback:
self.callback()
def _init_dnd(self):
"""inheriting objects must set this
@@ -160,6 +164,8 @@ class ObjEntry(object):
def after_edit(self, obj):
name = self.get_label(obj)
self.label.set_text(name)
if self.callback:
self.callback()
def add_edt_clicked(self, obj):
""" if value, edit, if no value, call editor on new object
@@ -183,7 +189,7 @@ class ObjEntry(object):
def drag_data_received(self, widget, context, x, y, selection, info, time):
(drag_type, idval, obj, val) = pickle.loads(selection.data)
data = self.db.get_place_from_handle(obj)
data = self.get_from_handle(obj)
self.obj_added(data)
def obj_added(self, data):
@@ -191,6 +197,8 @@ class ObjEntry(object):
self.set_val(data.handle)
self.label.set_text(self.get_label(data))
self.set_button(True)
if self.callback:
self.callback()
def share_clicked(self, obj):
""" if value, delete connect, in no value, select existing object
@@ -200,6 +208,8 @@ class ObjEntry(object):
self.label.set_text(self.EMPTY_TEXT)
self.label.set_use_markup(True)
self.set_button(False)
if self.callback:
self.callback()
else:
select = self.call_selector()
obj = select.run()
@@ -291,6 +301,55 @@ class PlaceEntry(ObjEntry):
cls = SelectorFactory('Place')
return cls(self.dbstate, self.uistate, self.track)
class SourceEntry(ObjEntry):
"""
Handles the selection of a existing or new Source. Supports Drag and Drop
to select a source.
"""
EMPTY_TEXT = "<i>%s</i>" % _('First add a source using the buttons')
EMPTY_TEXT_RED = "<i>%s</i>" % _('First add a source using the button')
EDIT_STR = _('Edit source')
SHARE_STR = _('Select an existing source')
ADD_STR = _('Add a new source')
DEL_STR = _('Remove source')
def __init__(self, dbstate, uistate, track, label, set_val,
get_val, add_edt, share, callback):
ObjEntry.__init__(self, dbstate, uistate, track, label, set_val,
get_val, add_edt, share, callback)
def _init_dnd(self):
"""connect drag and drop of sources
"""
self.label.drag_dest_set(gtk.DEST_DEFAULT_ALL,
[DdTargets.SOURCE_LINK.target()],
gtk.gdk.ACTION_COPY)
self.label.connect('drag_data_received', self.drag_data_received)
def get_from_handle(self, handle):
""" return the object given the handle
"""
return self.db.get_source_from_handle(handle)
def get_label(self, source):
return "%s [%s]" % (source.get_title(), source.gramps_id)
def call_editor(self, obj=None):
if obj is None:
source = Source()
func = self.obj_added
else:
source = obj
func = self.after_edit
try:
EditSource(self.dbstate, self.uistate, self.track, source, func)
except WindowActiveError:
pass
def call_selector(self):
cls = SelectorFactory('Source')
return cls(self.dbstate, self.uistate, self.track)
# FIXME isn't used anywhere
class MediaEntry(ObjEntry):
"""
+4
View File
@@ -69,6 +69,7 @@ from gui.selectors import SelectorFactory
from gen.display.name import displayer as _nd
import Utils
from gui.widgets import DateEntry
from GrampsLocale import long_days
#-------------------------------------------------------------------------
#
@@ -581,6 +582,9 @@ class EditRule(ManagedWindow.ManagedWindow):
[Utils.confidence[i] for i in range(5)])
elif v == _('Date:'):
t = DateEntry(self.uistate, self.track)
elif v == _('Day of Week:'):
days_of_week = long_days[2:] + long_days[1:2]
t = MyList(map(str, range(7)), days_of_week)
else:
t = MyEntry()
tlist.append(t)
+11
View File
@@ -237,6 +237,9 @@ class GuiColorOption(gtk.ColorButton):
self.changekey = self.connect('color-set', self.__color_changed)
self.valuekey = self.__option.connect('value-changed', self.__value_changed)
self.conkey = self.__option.connect('avail-changed', self.__update_avail)
self.__update_avail()
self.set_tooltip_text(self.__option.get_help())
def __color_changed(self, obj): # IGNORE:W0613 - obj is unused
@@ -253,6 +256,13 @@ class GuiColorOption(gtk.ColorButton):
self.__option.set_value(value)
self.__option.enable_signals()
def __update_avail(self):
"""
Update the availability (sensitivity) of this widget.
"""
avail = self.__option.get_available()
self.set_sensitive(avail)
def __value_changed(self):
"""
Handle the change made programmatically
@@ -266,6 +276,7 @@ class GuiColorOption(gtk.ColorButton):
remove stuff that blocks garbage collection
"""
self.__option.disconnect(self.valuekey)
self.__option.disconnect(self.conkey)
self.__option = None
#-------------------------------------------------------------------------
+11 -7
View File
@@ -65,10 +65,13 @@ class PaperComboBox(gtk.ComboBox):
index = 0
start_index = 0
for key in paper_sizes:
self.mapping[key.get_name()] = key
self.store.append(row=[key.get_name()])
if key.get_name() == default_name:
key_name = key.get_name()
if default_name == key_name or default_name == key.trans_pname:
start_index = index
self.mapping[key_name] = key # always use the English paper name
if key.trans_pname:
key_name = key.trans_pname # display the translated paper name
self.store.append(row=[key_name])
index += 1
self.set_active(start_index)
@@ -78,6 +81,9 @@ class PaperComboBox(gtk.ComboBox):
if active < 0:
return None
key = unicode(self.store[active][0])
for paper in paper_sizes:
if key == paper.trans_pname:
key = paper.get_name()
return (self.mapping[key],key)
#-------------------------------------------------------------------------
@@ -179,7 +185,7 @@ class PaperFrame(gtk.HBox):
"""Paper size combobox 'changed' callback."""
size, name = self.get_paper_size()
is_custom = name == _("Custom Size")
is_custom = name == "Custom Size"
self.pwidth.set_sensitive(is_custom)
self.pheight.set_sensitive(is_custom)
@@ -238,9 +244,7 @@ class PaperFrame(gtk.HBox):
"""
papersize, papername = self.papersize_menu.get_value()
# FIXME it is wrong to use translatable text in comparison.
# How can we distinguish custom size though?
if papername == _('Custom Size'):
if papername == 'Custom Size':
try:
h = float(unicode(self.pheight.get_text().replace(",", ".")))
w = float(unicode(self.pwidth.get_text().replace(",", ".") ))

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