mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
3e1090d48f
commit
b5947ad55e
@ -9,6 +9,7 @@ __docformat__ = 'restructuredtext en'
|
|||||||
|
|
||||||
import os, weakref, shutil
|
import os, weakref, shutil
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
from functools import partial
|
||||||
|
|
||||||
from PyQt4.Qt import (QDialog, QGridLayout, QIcon, QCheckBox, QLabel, QFrame,
|
from PyQt4.Qt import (QDialog, QGridLayout, QIcon, QCheckBox, QLabel, QFrame,
|
||||||
QApplication, QDialogButtonBox, Qt, QSize, QSpacerItem,
|
QApplication, QDialogButtonBox, Qt, QSize, QSpacerItem,
|
||||||
@ -66,6 +67,7 @@ class Polish(QDialog): # {{{
|
|||||||
for name, text in self.all_actions.iteritems():
|
for name, text in self.all_actions.iteritems():
|
||||||
count += 1
|
count += 1
|
||||||
x = QCheckBox(text, self)
|
x = QCheckBox(text, self)
|
||||||
|
x.stateChanged.connect(partial(self.option_toggled, name))
|
||||||
l.addWidget(x, count, 0, 1, 1)
|
l.addWidget(x, count, 0, 1, 1)
|
||||||
setattr(self, 'opt_'+name, x)
|
setattr(self, 'opt_'+name, x)
|
||||||
la = QLabel(' <a href="#%s">%s</a>'%(name, _('About')))
|
la = QLabel(' <a href="#%s">%s</a>'%(name, _('About')))
|
||||||
@ -94,6 +96,10 @@ class Polish(QDialog): # {{{
|
|||||||
|
|
||||||
self.resize(QSize(800, 600))
|
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):
|
def help_link_activated(self, link):
|
||||||
link = unicode(link)[1:]
|
link = unicode(link)[1:]
|
||||||
self.help_label.setText(self.help_text[link])
|
self.help_label.setText(self.help_text[link])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user