mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Pressing the up arrow in an date edit with undefined value should jump to the current date rather than Feb 101
This commit is contained in:
parent
c3730a21a7
commit
fcc685661d
@ -57,6 +57,7 @@ def save_dialog(parent, title, msg, det_msg=''):
|
||||
def clean_text(x):
|
||||
return re.sub(r'\s', ' ', x.strip())
|
||||
|
||||
|
||||
'''
|
||||
The interface common to all widgets used to set basic metadata
|
||||
class BasicMetadataWidget(object):
|
||||
@ -1731,6 +1732,8 @@ class DateEdit(make_undoable(QDateTimeEdit), ToMetadataMixin):
|
||||
elif ev.key() == Qt.Key_Equal:
|
||||
ev.accept()
|
||||
self.setDateTime(QDateTime.currentDateTime())
|
||||
elif ev.key() == Qt.Key_Up and is_date_undefined(self.current_val):
|
||||
self.setDateTime(QDateTime.currentDateTime())
|
||||
else:
|
||||
return super(DateEdit, self).keyPressEvent(ev)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user