Make CTRL-space clear numeric custom fields in metadata edit

This commit is contained in:
Charles Haley 2014-10-23 14:58:51 +02:00
parent e63e7cca43
commit d972b64770

View File

@ -20,6 +20,7 @@ from calibre.gui2.dialogs.tag_editor import TagEditor
from calibre.utils.config import tweaks
from calibre.utils.icu import sort_key
from calibre.library.comments import comments_to_html
from calibre.gui2.library.delegates import ClearingDoubleSpinBox, ClearingSpinBox
class Base(object):
@ -91,7 +92,7 @@ class Int(Base):
def setup_ui(self, parent):
self.widgets = [QLabel('&'+self.col_metadata['name']+':', parent),
QSpinBox(parent)]
ClearingSpinBox(parent)]
w = self.widgets[1]
w.setRange(-1000000, 100000000)
w.setSpecialValueText(_('Undefined'))
@ -114,7 +115,7 @@ class Float(Int):
def setup_ui(self, parent):
self.widgets = [QLabel('&'+self.col_metadata['name']+':', parent),
QDoubleSpinBox(parent)]
ClearingDoubleSpinBox(parent)]
w = self.widgets[1]
w.setRange(-1000000., float(100000000))
w.setDecimals(2)