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.
This commit is contained in:
@ -225,8 +225,10 @@ class EditDate(ManagedWindow):
|
|||||||
text=the_text,
|
text=the_text,
|
||||||
newyear=the_newyear)
|
newyear=the_newyear)
|
||||||
except DateError:
|
except DateError:
|
||||||
self.return_date.set(modifier=Date.MOD_TEXTONLY,
|
# Switch to text only mode, leave the dialog open
|
||||||
text=the_text)
|
# so the user sees the old data.
|
||||||
|
self.type_box.set_active(len(MOD_TEXT)-1)
|
||||||
|
continue
|
||||||
self.close()
|
self.close()
|
||||||
break
|
break
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user