mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Make CTRL-space clear numeric custom fields in metadata edit
This commit is contained in:
parent
e63e7cca43
commit
d972b64770
@ -20,6 +20,7 @@ from calibre.gui2.dialogs.tag_editor import TagEditor
|
|||||||
from calibre.utils.config import tweaks
|
from calibre.utils.config import tweaks
|
||||||
from calibre.utils.icu import sort_key
|
from calibre.utils.icu import sort_key
|
||||||
from calibre.library.comments import comments_to_html
|
from calibre.library.comments import comments_to_html
|
||||||
|
from calibre.gui2.library.delegates import ClearingDoubleSpinBox, ClearingSpinBox
|
||||||
|
|
||||||
class Base(object):
|
class Base(object):
|
||||||
|
|
||||||
@ -91,7 +92,7 @@ class Int(Base):
|
|||||||
|
|
||||||
def setup_ui(self, parent):
|
def setup_ui(self, parent):
|
||||||
self.widgets = [QLabel('&'+self.col_metadata['name']+':', parent),
|
self.widgets = [QLabel('&'+self.col_metadata['name']+':', parent),
|
||||||
QSpinBox(parent)]
|
ClearingSpinBox(parent)]
|
||||||
w = self.widgets[1]
|
w = self.widgets[1]
|
||||||
w.setRange(-1000000, 100000000)
|
w.setRange(-1000000, 100000000)
|
||||||
w.setSpecialValueText(_('Undefined'))
|
w.setSpecialValueText(_('Undefined'))
|
||||||
@ -114,7 +115,7 @@ class Float(Int):
|
|||||||
|
|
||||||
def setup_ui(self, parent):
|
def setup_ui(self, parent):
|
||||||
self.widgets = [QLabel('&'+self.col_metadata['name']+':', parent),
|
self.widgets = [QLabel('&'+self.col_metadata['name']+':', parent),
|
||||||
QDoubleSpinBox(parent)]
|
ClearingDoubleSpinBox(parent)]
|
||||||
w = self.widgets[1]
|
w = self.widgets[1]
|
||||||
w.setRange(-1000000., float(100000000))
|
w.setRange(-1000000., float(100000000))
|
||||||
w.setDecimals(2)
|
w.setDecimals(2)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user