From d8acf8e875a06cf89b2cc4d59ed63730539244af Mon Sep 17 00:00:00 2001 From: Vassilii Khachaturov Date: Sat, 16 Nov 2013 10:21:12 +0200 Subject: [PATCH] 7198: Date editor crashes on invalid date 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. --- gramps/gui/editors/editdate.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gramps/gui/editors/editdate.py b/gramps/gui/editors/editdate.py index e0dce0473..6eb67d54c 100644 --- a/gramps/gui/editors/editdate.py +++ b/gramps/gui/editors/editdate.py @@ -224,9 +224,11 @@ class EditDate(ManagedWindow): value=the_value, text=the_text, newyear=the_newyear) - except DateError: - self.return_date.set(modifier=Date.MOD_TEXTONLY, - text=the_text) + except DateError: + # Switch to text only mode, leave the dialog open + # so the user sees the old data. + self.type_box.set_active(len(MOD_TEXT)-1) + continue self.close() break