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.
Merge from master:
commit 93ca90f3b8
Author: Vassilii Khachaturov <vassilii@tarunz.org>
Date: Thu Nov 14 22:41:46 2013 +0200
7197: more failing tests
commit 78cae43a32
Author: Vassilii Khachaturov <vassilii@tarunz.org>
Date: Wed Nov 13 16:59:26 2013 +0200
7197: better diagnostics from test for debugging
Use unittest -v/--verbose flag to trigger it.
commit 626353a0b3
Author: Vassilii Khachaturov <vassilii@tarunz.org>
Date: Wed Nov 13 13:52:47 2013 +0200
7197: failing test demonstrating the bug
It's actually on both PPC and Intel, and it's from forgetting to update
gramps.accel after upgrading Gtk past 2.24.10, which changed the mapping
of alt/option from Mod5 to Mod1.
For gramps40 and master, the problem was masked by the bundler putting
the file in the wrong directory.