mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Add tooltips for buttons on bool data editor
This commit is contained in:
parent
f64382a1a1
commit
885553d827
@ -154,7 +154,8 @@ class LongText(Base):
|
|||||||
class Bool(Base):
|
class Bool(Base):
|
||||||
|
|
||||||
def setup_ui(self, parent):
|
def setup_ui(self, parent):
|
||||||
self.widgets = [QLabel(label_string(self.col_metadata['name']), parent)]
|
name = self.col_metadata['name']
|
||||||
|
self.widgets = [QLabel(label_string(name), parent)]
|
||||||
w = QWidget(parent)
|
w = QWidget(parent)
|
||||||
self.widgets.append(w)
|
self.widgets.append(w)
|
||||||
|
|
||||||
@ -166,17 +167,20 @@ class Bool(Base):
|
|||||||
|
|
||||||
c = QToolButton(parent)
|
c = QToolButton(parent)
|
||||||
c.setText(_('Yes'))
|
c.setText(_('Yes'))
|
||||||
|
c.setToolTip(_('Set {} to yes').format(name))
|
||||||
l.addWidget(c)
|
l.addWidget(c)
|
||||||
c.clicked.connect(self.set_to_yes)
|
c.clicked.connect(self.set_to_yes)
|
||||||
|
|
||||||
c = QToolButton(parent)
|
c = QToolButton(parent)
|
||||||
c.setText(_('No'))
|
c.setText(_('No'))
|
||||||
|
c.setToolTip(_('Set {} to no').format(name))
|
||||||
l.addWidget(c)
|
l.addWidget(c)
|
||||||
c.clicked.connect(self.set_to_no)
|
c.clicked.connect(self.set_to_no)
|
||||||
|
|
||||||
if self.db.new_api.pref('bools_are_tristate'):
|
if self.db.new_api.pref('bools_are_tristate'):
|
||||||
c = QToolButton(parent)
|
c = QToolButton(parent)
|
||||||
c.setText(_('Clear'))
|
c.setText(_('Clear'))
|
||||||
|
c.setToolTip(_('Clear {}').format(name))
|
||||||
l.addWidget(c)
|
l.addWidget(c)
|
||||||
c.clicked.connect(self.set_to_cleared)
|
c.clicked.connect(self.set_to_cleared)
|
||||||
|
|
||||||
@ -272,6 +276,7 @@ class Float(Int):
|
|||||||
self.editor.setRange(-1000000., float(100000000))
|
self.editor.setRange(-1000000., float(100000000))
|
||||||
self.editor.setDecimals(2)
|
self.editor.setDecimals(2)
|
||||||
|
|
||||||
|
|
||||||
class Rating(Base):
|
class Rating(Base):
|
||||||
|
|
||||||
def setup_ui(self, parent):
|
def setup_ui(self, parent):
|
||||||
@ -1024,6 +1029,7 @@ class BulkInt(BulkBase):
|
|||||||
def set_to_undefined(self):
|
def set_to_undefined(self):
|
||||||
self.main_widget.setValue(-1000000)
|
self.main_widget.setValue(-1000000)
|
||||||
|
|
||||||
|
|
||||||
class BulkFloat(BulkInt):
|
class BulkFloat(BulkInt):
|
||||||
|
|
||||||
def setup_ui(self, parent):
|
def setup_ui(self, parent):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user