From d972b647704ce08b67dce3172497e9752e359d4b Mon Sep 17 00:00:00 2001 From: Charles Haley Date: Thu, 23 Oct 2014 14:58:51 +0200 Subject: [PATCH] Make CTRL-space clear numeric custom fields in metadata edit --- src/calibre/gui2/custom_column_widgets.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/custom_column_widgets.py b/src/calibre/gui2/custom_column_widgets.py index 69de55df61..c8901fe7d8 100644 --- a/src/calibre/gui2/custom_column_widgets.py +++ b/src/calibre/gui2/custom_column_widgets.py @@ -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)