- ''')%(col, rule)
+ ''')%(col, prepare_string_for_xml(rule))
conditions = [self.condition_to_html(c) for c in rule.conditions]
return _('''\
Set the color of %s to %s if the following
@@ -439,9 +440,10 @@ class RulesModel(QAbstractListModel): # {{{
''') % (col, rule.color, ''.join(conditions))
def condition_to_html(self, condition):
+ c, a, v = condition
return (
_('
If the %s column %s value: %s') %
- tuple(condition))
+ (c, a, prepare_string_for_xml(v)))
# }}}
diff --git a/src/calibre/library/coloring.py b/src/calibre/library/coloring.py
index c8cafcf9eb..f458b9c04f 100644
--- a/src/calibre/library/coloring.py
+++ b/src/calibre/library/coloring.py
@@ -85,10 +85,10 @@ class Rule(object): # {{{
if dt == 'datetime':
return self.date_condition(col, action, val)
- if dt in ('comments', 'series', 'text', 'enumeration'):
+ if dt in ('comments', 'series', 'text', 'enumeration', 'composite'):
ism = m.get('is_multiple', False)
if ism:
- return self.multiple_condition(col, action, val, ism)
+ return self.multiple_condition(col, action, val, ',' if ism == '|' else ism)
return self.text_condition(col, action, val)
def identifiers_condition(self, col, action, val):
@@ -127,10 +127,12 @@ class Rule(object): # {{{
val, lt, eq, gt)
def multiple_condition(self, col, action, val, sep):
+ if not sep or sep == '|':
+ sep = ','
if action == 'is set':
- return "test('%s', '1', '')"%col
+ return "test(field('%s'), '1', '')"%col
if action == 'is not set':
- return "test('%s', '', '1')"%col
+ return "test(field('%s'), '', '1')"%col
if action == 'has':
return "str_in_list(field('%s'), '%s', \"%s\", '1', '')"%(col, sep, val)
if action == 'does not have':
@@ -142,9 +144,9 @@ class Rule(object): # {{{
def text_condition(self, col, action, val):
if action == 'is set':
- return "test('%s', '1', '')"%col
+ return "test(field('%s'), '1', '')"%col
if action == 'is not set':
- return "test('%s', '', '1')"%col
+ return "test(field('%s'), '', '1')"%col
if action == 'is':
return "strcmp(field('%s'), \"%s\", '', '1', '')"%(col, val)
if action == 'is not':
@@ -183,7 +185,7 @@ def conditionable_columns(fm):
m = fm[key]
dt = m['datatype']
if m.get('name', False) and dt in ('bool', 'int', 'float', 'rating', 'series',
- 'comments', 'text', 'enumeration', 'datetime'):
+ 'comments', 'text', 'enumeration', 'datetime', 'composite'):
if key == 'sort':
yield 'title_sort'
else:
diff --git a/src/calibre/manual/gui.rst b/src/calibre/manual/gui.rst
index e2758bc257..752c9c4881 100644
--- a/src/calibre/manual/gui.rst
+++ b/src/calibre/manual/gui.rst
@@ -74,10 +74,7 @@ Edit metadata
1. **Edit metadata individually**: This allows you to edit the metadata of books one-by-one, with the option of fetching metadata, including covers from the internet. It also allows you to add/remove particular ebook formats from a book.
2. **Edit metadata in bulk**: This allows you to edit common metadata fields for large numbers of books simulataneously. It operates on all the books you have selected in the :ref:`Library view `.
3. **Download metadata and covers**: Downloads metadata and covers (if available), for the books that are selected in the book list.
- 4. **Download only metadata**: Downloads only metadata (if available), for the books that are selected in the book list.
- 5. **Download only covers**: Downloads only covers (if available), for the books that are selected in the book list.
- 6. **Download only social metadata**: Downloads only social metadata such as tags and reviews (if available), for the books that are selected in the book list.
- 7. **Merge Book Records**: Gives you the capability of merging the metadata and formats of two or more book records together. You can choose to either delete or keep the records that were not clicked first.
+ 4. **Merge Book Records**: Gives you the capability of merging the metadata and formats of two or more book records together. You can choose to either delete or keep the records that were not clicked first.
For more details see :ref:`metadata`.
diff --git a/src/calibre/manual/portable.rst b/src/calibre/manual/portable.rst
index a9c9679512..7381617209 100644
--- a/src/calibre/manual/portable.rst
+++ b/src/calibre/manual/portable.rst
@@ -11,7 +11,7 @@ You can "install" calibre onto a USB stick that you can take with you and use on
* Run a Mobile Calibre installation with both the Calibre binaries and your ebook library resident on a USB disk or other portable media. In particular it is not necessary to have Calibre installed on the Windows PC that is to run Calibre. This batch file also does not care what drive letter is assigned when you plug in the USB device. It also will not affect any settings on the host machine being a completely self-contained Calibre installation.
* Run a networked Calibre installation optimised for performance when the ebook files are located on a networked share.
-If you find setting up the bat file too challenging, there is a third party portable calibre build available at `portableapps.com http://portableapps.com`_.
+If you find setting up the bat file too challenging, there is a third party portable calibre build available at `portableapps.com `_.
This calibre-portable.bat file is intended for use on Windows based systems, but the principles are easily adapted for use on Linux or OS X based systems. Note that calibre requires the Microsoft Visual C++ 2008 runtimes to run. Most windows computers have them installed already, but it may be a good idea to have the installer for installing them on your USB stick. The installer is available from `Microsoft `_.
diff --git a/src/calibre/manual/templates/search.html b/src/calibre/manual/templates/search.html
new file mode 100644
index 0000000000..58901c8fb4
--- /dev/null
+++ b/src/calibre/manual/templates/search.html
@@ -0,0 +1,49 @@
+{#
+ basic/search.html
+ ~~~~~~~~~~~~~~~~~
+
+ Template for the search page, using google adsense search
+
+ :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+#}
+{% extends "layout.html" %}
+{% set title = _('Search') %}
+{% block extrahead %}
+
+ {{ super() }}
+{% endblock %}
+{% block body %}
+
{{ _('Search') }}
+
+
+
+ {% trans %}Please activate JavaScript to enable the search
+ functionality.{% endtrans %}
+
+
+
+ {% trans %}From here you can search these documents. Enter your search
+ words into the box below and click "search". Note that the search
+ function will automatically search for all of the words. Pages
+ containing fewer words won't appear in the result list.{% endtrans %}
+