mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Add select all/none buttons to the polish dialog
This commit is contained in:
parent
b3e81e4444
commit
19b77f2d98
@ -98,11 +98,22 @@ class Polish(QDialog): # {{{
|
|||||||
self.load_button = lb = bb.addButton(_('&Load Settings'), bb.ActionRole)
|
self.load_button = lb = bb.addButton(_('&Load Settings'), bb.ActionRole)
|
||||||
self.load_menu = QMenu(lb)
|
self.load_menu = QMenu(lb)
|
||||||
lb.setMenu(self.load_menu)
|
lb.setMenu(self.load_menu)
|
||||||
|
self.all_button = b = bb.addButton(_('Select &all'), bb.ActionRole)
|
||||||
|
b.clicked.connect(partial(self.select_all, True))
|
||||||
|
self.none_button = b = bb.addButton(_('Select &none'), bb.ActionRole)
|
||||||
|
b.clicked.connect(partial(self.select_all, False))
|
||||||
l.addWidget(bb, count+1, 0, 1, -1)
|
l.addWidget(bb, count+1, 0, 1, -1)
|
||||||
self.setup_load_button()
|
self.setup_load_button()
|
||||||
|
|
||||||
self.resize(QSize(900, 600))
|
self.resize(QSize(900, 600))
|
||||||
|
|
||||||
|
def select_all(self, enable):
|
||||||
|
for action in self.all_actions:
|
||||||
|
x = getattr(self, 'opt_'+action)
|
||||||
|
x.blockSignals(True)
|
||||||
|
x.setChecked(enable)
|
||||||
|
x.blockSignals(False)
|
||||||
|
|
||||||
def save_settings(self):
|
def save_settings(self):
|
||||||
if not self.something_selected:
|
if not self.something_selected:
|
||||||
return error_dialog(self, _('No actions selected'),
|
return error_dialog(self, _('No actions selected'),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user