Port my fixes based on the patch from Matthias Basler from gramps34
[2eca30] 7290: use simpler math in image_dpi
[2f5e22] 7290: align warning with the image_dpi fix logic
[36f84e] 7290: image_dpi default calc based on gtk.gdk
[161ce3] 7290: ImgManip.image_dpi shouldn't return None
[460e63] 7288/7290 refactor out crop_percentage_to_pixel
[a8a38f] 7288/7290 refactor out crop_percentage_to_subpixel
[0d61bb] 7288/7290: refactor fix from matthiasbasler
[088146] rm relict RCS kwd
[76df5d] 7288/7290: image cropping fixes in ODFDoc
Using legacy gtk interface in image.py at the moment, need to port
to the new style.
Tested with python2.
If the date is invalid, it will be converted to text mode,
and the text field will be set to the problematic XML.
A warning will be printed on the console as well.
The log message will use the invalid date attached as
DateError.date, see [8e1659].
Revalidate the date upon every change, and disable
OKing the dialog when it is not valid, for usability review.
If it is not good, we can always revert this commit.
when Date.set throws during the date fields sanity
check validation, it now attaches an (undocumented) .date field
to the exception -- proof of concept for 7198 and potentially
for 7212 as well
Improve user experience as promised in [98d8e6].
Now, if one clicks OK in the date editor and the date is invalid,
it's switched into text mode and the dialog remains open,
so the user can either correct the date or type it as text,
no more loss of entered data happens.
Now it just autoconverts into MOD_TEXT and returns whatever
text was there. This fixes the crash on the master branch,
but is not the final user experience yet.
All date tests pass cleanly on gramps40 branch.
Merged the following commits.
commit a90139cb9a
Author: Vassilii Khachaturov <vassilii@tarunz.org>
Date: Fri Nov 15 15:04:03 2013 +0200
7197, 7100: missing recalc_sort_value in ny code
Fix bug #7197
commit baae6ac615
Author: Vassilii Khachaturov <vassilii@tarunz.org>
Date: Thu Nov 14 22:45:42 2013 +0200
7197: readjust sanity date wrt newyear/slash
Attempt to fix the failing
DateHandlerTest.test_invalid_month_with_ny
(see 7197:32625). Tests still fail, investigation shows
there's a problem in Date.set setting Julian+Mar25 date even if the
date validation check is disabled by inserting a return before
the validation block, i.e., before this line
if modifier != Date.MOD_TEXTONLY:
which seems to be the root cause of the remaining failing tests.
which seems to be the root cause of the remaining failing tests.
To investigate, add the return and try
LC_ALL=en_GB.utf8 LANG=en_GB.utf8 GRAMPS_RESOURCES=$PWD \
python -m unittest -v \
gramps.gen.lib.test.date_test.MatchDateTest.test_match
commit 4147721112
Author: Vassilii Khachaturov <vassilii@tarunz.org>
Date: Wed Nov 13 22:34:24 2013 +0200
7197: refactor code
extract Date._adjust_newyear out of Date.set
commit b3ab87bc5a
Author: Vassilii Khachaturov <vassilii@tarunz.org>
Date: Wed Nov 13 22:02:21 2013 +0200
7197: refactor code
replace all copies of logging with a single point at the exception
rethrow point
commit c4daa151a5
Author: Vassilii Khachaturov <vassilii@tarunz.org>
Date: Wed Nov 13 17:39:47 2013 +0200
7197: date sanity check breaks on Julian+Mar25
Date.convert_calendar resets the new year setting to 0,
so the sanity check fails. Commit the initial fix that
unblocks the failing test.