Merge from trunk

This commit is contained in:
Charles Haley 2011-06-04 09:24:45 +01:00
commit d961391802
2 changed files with 6 additions and 2 deletions

View File

@ -117,4 +117,6 @@ class NOOK_TSR(NOOK):
EBOOK_DIR_MAIN = EBOOK_DIR_CARD_A = 'My Files/Books' EBOOK_DIR_MAIN = EBOOK_DIR_CARD_A = 'My Files/Books'
WINDOWS_MAIN_MEM = WINDOWS_CARD_A_MEM = 'EBOOK_DISK' WINDOWS_MAIN_MEM = WINDOWS_CARD_A_MEM = 'EBOOK_DISK'
def upload_cover(self, path, filename, metadata, filepath):
pass

View File

@ -12,6 +12,7 @@ from PyQt4.Qt import (QWidget, QDialog, QLabel, QGridLayout, QComboBox, QSize,
QScrollArea, QPushButton, QVBoxLayout, QDialogButtonBox, QToolButton, QScrollArea, QPushButton, QVBoxLayout, QDialogButtonBox, QToolButton,
QListView, QAbstractListModel, pyqtSignal, QSizePolicy, QSpacerItem) QListView, QAbstractListModel, pyqtSignal, QSizePolicy, QSpacerItem)
from calibre import prepare_string_for_xml
from calibre.utils.icu import sort_key from calibre.utils.icu import sort_key
from calibre.gui2 import error_dialog from calibre.gui2 import error_dialog
from calibre.gui2.dialogs.template_dialog import TemplateDialog from calibre.gui2.dialogs.template_dialog import TemplateDialog
@ -430,7 +431,7 @@ class RulesModel(QAbstractListModel): # {{{
return _(''' return _('''
<p>Advanced Rule for column <b>%s</b>: <p>Advanced Rule for column <b>%s</b>:
<pre>%s</pre> <pre>%s</pre>
''')%(col, rule) ''')%(col, prepare_string_for_xml(rule))
conditions = [self.condition_to_html(c) for c in rule.conditions] conditions = [self.condition_to_html(c) for c in rule.conditions]
return _('''\ return _('''\
<p>Set the color of <b>%s</b> to <b>%s</b> if the following <p>Set the color of <b>%s</b> to <b>%s</b> if the following
@ -439,9 +440,10 @@ class RulesModel(QAbstractListModel): # {{{
''') % (col, rule.color, ''.join(conditions)) ''') % (col, rule.color, ''.join(conditions))
def condition_to_html(self, condition): def condition_to_html(self, condition):
c, a, v = condition
return ( return (
_('<li>If the <b>%s</b> column <b>%s</b> value: <b>%s</b>') % _('<li>If the <b>%s</b> column <b>%s</b> value: <b>%s</b>') %
tuple(condition)) (c, a, prepare_string_for_xml(v)))
# }}} # }}}