From b5947ad55ebf0c779550b5e88db475765c0c4c74 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 14 Feb 2013 11:54:45 +0530 Subject: [PATCH] ... --- src/calibre/gui2/actions/polish.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/calibre/gui2/actions/polish.py b/src/calibre/gui2/actions/polish.py index 6b03bfb9f4..853ead986d 100644 --- a/src/calibre/gui2/actions/polish.py +++ b/src/calibre/gui2/actions/polish.py @@ -9,6 +9,7 @@ __docformat__ = 'restructuredtext en' import os, weakref, shutil from collections import OrderedDict +from functools import partial from PyQt4.Qt import (QDialog, QGridLayout, QIcon, QCheckBox, QLabel, QFrame, QApplication, QDialogButtonBox, Qt, QSize, QSpacerItem, @@ -66,6 +67,7 @@ class Polish(QDialog): # {{{ for name, text in self.all_actions.iteritems(): count += 1 x = QCheckBox(text, self) + x.stateChanged.connect(partial(self.option_toggled, name)) l.addWidget(x, count, 0, 1, 1) setattr(self, 'opt_'+name, x) la = QLabel(' %s'%(name, _('About'))) @@ -94,6 +96,10 @@ class Polish(QDialog): # {{{ self.resize(QSize(800, 600)) + def option_toggled(self, name, *args): + if getattr(self, 'opt_'+name).isChecked(): + self.help_label.setText(self.help_text[name]) + def help_link_activated(self, link): link = unicode(link)[1:] self.help_label.setText(self.help_text[link])