mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
String changes
This commit is contained in:
parent
f62b832d1b
commit
495f5ddd45
@ -57,14 +57,14 @@ That is the basic work flow for editing books -- Open a file, make changes,
|
|||||||
preview and save. The rest of this manual will discuss the various tools and
|
preview and save. The rest of this manual will discuss the various tools and
|
||||||
features present to allow you to perform specific tasks efficiently.
|
features present to allow you to perform specific tasks efficiently.
|
||||||
|
|
||||||
The File Browser
|
The File browser
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
.. image:: images/files_browser.png
|
.. image:: images/files_browser.png
|
||||||
:alt: The File Browser
|
:alt: The File browser
|
||||||
:class: float-left-img
|
:class: float-left-img
|
||||||
|
|
||||||
The :guilabel:`File Browser` gives you an overview of the various files inside
|
The :guilabel:`File browser` gives you an overview of the various files inside
|
||||||
the book you are editing. The files are arranged by category, with text (HTML)
|
the book you are editing. The files are arranged by category, with text (HTML)
|
||||||
files at the top, followed by stylesheet (CSS) files, images and so on. Simply
|
files at the top, followed by stylesheet (CSS) files, images and so on. Simply
|
||||||
double click on a file to start editing it. Editing is supported for HTML, CSS
|
double click on a file to start editing it. Editing is supported for HTML, CSS
|
||||||
@ -136,10 +136,10 @@ little fiddly until you get used to it.
|
|||||||
Marking the cover
|
Marking the cover
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
E-books typically have a cover image. This image is indicated in the Files
|
E-books typically have a cover image. This image is indicated in the
|
||||||
Browser by the icon of a brown book next to the image name. If you want to
|
:guilabel:`File browser` by the icon of a brown book next to the image name. If
|
||||||
designate some other image as the cover, you can do so by right clicking on the
|
you want to designate some other image as the cover, you can do so by right
|
||||||
file and choosing :guilabel:`Mark as cover`.
|
clicking on the file and choosing :guilabel:`Mark as cover`.
|
||||||
|
|
||||||
In addition, EPUB files has the concept of a *titlepage*. A title page is a
|
In addition, EPUB files has the concept of a *titlepage*. A title page is a
|
||||||
HTML file that acts as the title page/cover for the book. You can mark an HTML
|
HTML file that acts as the title page/cover for the book. You can mark an HTML
|
||||||
@ -194,7 +194,7 @@ being replaced.
|
|||||||
Linking stylesheets to HTML files efficiently
|
Linking stylesheets to HTML files efficiently
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
As a convenience, you can select multiple HTML files in the File Browser,
|
As a convenience, you can select multiple HTML files in the File browser,
|
||||||
right click and choose Link stylesheets to have calibre automatically insert the
|
right click and choose Link stylesheets to have calibre automatically insert the
|
||||||
<link> tags for those stylesheets into all the selected HTML files.
|
<link> tags for those stylesheets into all the selected HTML files.
|
||||||
|
|
||||||
@ -736,7 +736,7 @@ the files inside the EPUB are arranged haphazardly, in different sub-folders.
|
|||||||
This tool allows you to automatically move all files into sub-folders based on
|
This tool allows you to automatically move all files into sub-folders based on
|
||||||
their types. Access it via :guilabel:`Tools->Arrange into folders`. Note that
|
their types. Access it via :guilabel:`Tools->Arrange into folders`. Note that
|
||||||
this tool only changes how the files are arranged inside the EPUB, it does not
|
this tool only changes how the files are arranged inside the EPUB, it does not
|
||||||
change how they are displayed in the File Browser.
|
change how they are displayed in the File browser.
|
||||||
|
|
||||||
Importing files in other e-book formats as EPUB
|
Importing files in other e-book formats as EPUB
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
Function Mode for Search & Replace in the Editor
|
Function Mode for Search & Replace in the Editor
|
||||||
================================================
|
================================================
|
||||||
|
|
||||||
The Search & Replace tool in the editor support a *function mode*. In this
|
The :guilabel:`Search & replace` tool in the editor support a *function mode*.
|
||||||
mode, you can combine regular expressions (see :doc:`regexp`) with
|
In this mode, you can combine regular expressions (see :doc:`regexp`) with
|
||||||
arbitrarily powerful python functions to do all sorts of advanced text
|
arbitrarily powerful python functions to do all sorts of advanced text
|
||||||
processing.
|
processing.
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ function and copy the python code from below.
|
|||||||
def replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):
|
def replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):
|
||||||
return match.group().replace('--', '—').replace('-', '—')
|
return match.group().replace('--', '—').replace('-', '—')
|
||||||
|
|
||||||
Every Search & Replace custom function must have a unique name and consist of a
|
Every :guilabel:`Search & replace` custom function must have a unique name and consist of a
|
||||||
python function named replace, that accepts all the arguments shown above.
|
python function named replace, that accepts all the arguments shown above.
|
||||||
For the moment, we wont worry about all the different arguments to
|
For the moment, we wont worry about all the different arguments to
|
||||||
``replace()`` function. Just focus on the ``match`` argument. It represents a
|
``replace()`` function. Just focus on the ``match`` argument. It represents a
|
||||||
@ -201,7 +201,7 @@ And use it with the find expression::
|
|||||||
<(h[12]) [^<>]* id=['"]([^'"]+)['"][^<>]*>([^<>]+)
|
<(h[12]) [^<>]* id=['"]([^'"]+)['"][^<>]*>([^<>]+)
|
||||||
|
|
||||||
Run the search on :guilabel:`All text files` and at the end of the search, a
|
Run the search on :guilabel:`All text files` and at the end of the search, a
|
||||||
window will popup with "Debug Output from your function" which will have the
|
window will popup with "Debug output from your function" which will have the
|
||||||
HTML Table of Contents, ready to be pasted into :file:`toc.html`.
|
HTML Table of Contents, ready to be pasted into :file:`toc.html`.
|
||||||
|
|
||||||
The function above is heavily commented, so it should be easy to follow. The
|
The function above is heavily commented, so it should be easy to follow. The
|
||||||
|
@ -441,10 +441,10 @@ calibre allows you to save a frequently used search under a special name and the
|
|||||||
|
|
||||||
Now you can access your saved search in the Tag Browser under "Searches". A single click will allow you to reuse any arbitrarily complex search easily, without needing to re-create it.
|
Now you can access your saved search in the Tag Browser under "Searches". A single click will allow you to reuse any arbitrarily complex search easily, without needing to re-create it.
|
||||||
|
|
||||||
Virtual Libraries
|
Virtual libraries
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
A :guilabel:`Virtual Library` is a way to pretend that your calibre library has
|
A :guilabel:`Virtual library` is a way to pretend that your calibre library has
|
||||||
only a few books instead of its full collection. This is an excellent way to
|
only a few books instead of its full collection. This is an excellent way to
|
||||||
partition your large collection of books into smaller, manageable chunks. To
|
partition your large collection of books into smaller, manageable chunks. To
|
||||||
learn how to create and use virtual libraries, see the tutorial:
|
learn how to create and use virtual libraries, see the tutorial:
|
||||||
|
@ -52,7 +52,7 @@ The normal edit metadata dialog also has Next and Previous buttons that you can
|
|||||||
Search and replace
|
Search and replace
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
The Bulk metadata edit dialog allows you to perform arbitrarily powerful search and replace operations on the selected books. By default it uses a simple text search and replace, but it also support *regular expressions*. For more on regular expressions, see :ref:`regexptutorial`.
|
The :guilabel:`Bulk metadata edit` dialog allows you to perform arbitrarily powerful search and replace operations on the selected books. By default it uses a simple text search and replace, but it also support *regular expressions*. For more on regular expressions, see :ref:`regexptutorial`.
|
||||||
|
|
||||||
As noted above, there are two search and replace modes: character match and regular expression. Character match will look in the `Search field` you choose for the characters you type in the `search for` box and replace those characters with what you type in the `replace with` box. Each occurance of the search characters in the field will be replaced. For example, assume the field being searched contains `a bad cat`. If you search for `a` to be replaced with `HELLO`, then the result will be `HELLO bHELLOd cHELLOt`.
|
As noted above, there are two search and replace modes: character match and regular expression. Character match will look in the `Search field` you choose for the characters you type in the `search for` box and replace those characters with what you type in the `replace with` box. Each occurance of the search characters in the field will be replaced. For example, assume the field being searched contains `a bad cat`. If you search for `a` to be replaced with `HELLO`, then the result will be `HELLO bHELLOd cHELLOt`.
|
||||||
|
|
||||||
|
@ -25,8 +25,8 @@ The following discussion of the built-in snippets should help illustrate the
|
|||||||
power of the snippets system.
|
power of the snippets system.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
You can also use snippets in the text entry fields in the Search and
|
You can also use snippets in the text entry fields in the :guilabel:`Search & replace`
|
||||||
Replace panel, however, placeholders (using |ct| to jump around) will not
|
panel, however, placeholders (using |ct| to jump around) will not
|
||||||
work.
|
work.
|
||||||
|
|
||||||
The built-in snippets
|
The built-in snippets
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
.. _virtual_libraries:
|
.. _virtual_libraries:
|
||||||
|
|
||||||
|
|
||||||
Virtual Libraries
|
Virtual libraries
|
||||||
============================
|
============================
|
||||||
|
|
||||||
In calibre, a virtual library is a way to tell calibre to open only a subset of a
|
In calibre, a virtual library is a way to tell calibre to open only a subset of a
|
||||||
@ -20,14 +20,14 @@ the left. The Tag Browser will only show tags, authors, series, publishers, etc.
|
|||||||
that come from the books in the virtual library. A virtual library thus behaves
|
that come from the books in the virtual library. A virtual library thus behaves
|
||||||
as though the actual library contains only the restricted set of books.
|
as though the actual library contains only the restricted set of books.
|
||||||
|
|
||||||
Creating Virtual Libraries
|
Creating Virtual libraries
|
||||||
----------------------------
|
----------------------------
|
||||||
|
|
||||||
.. |vlb| image:: images/virtual_library_button.png
|
.. |vlb| image:: images/virtual_library_button.png
|
||||||
:class: float-left-img
|
:class: float-left-img
|
||||||
|
|
||||||
|vlb| To use a virtual library click the :guilabel:`Virtual Library` button located
|
|vlb| To use a virtual library click the :guilabel:`Virtual library` button located
|
||||||
to the left of the search bar and select the :guilabel:`Create Virtual Library`
|
to the left of the search bar and select the :guilabel:`Create Virtual library`
|
||||||
option. As a first example, let's create a virtual library that shows us only
|
option. As a first example, let's create a virtual library that shows us only
|
||||||
the books by a particular author. Click the :guilabel:`Authors` link as shown
|
the books by a particular author. Click the :guilabel:`Authors` link as shown
|
||||||
in the image below and choose the author you want to use and click OK.
|
in the image below and choose the author you want to use and click OK.
|
||||||
@ -35,26 +35,26 @@ in the image below and choose the author you want to use and click OK.
|
|||||||
.. image:: images/vl_by_author.png
|
.. image:: images/vl_by_author.png
|
||||||
:align: center
|
:align: center
|
||||||
|
|
||||||
The Create Virtual Library dialog has been filled in for you. Click OK and you
|
The Create Virtual library dialog has been filled in for you. Click OK and you
|
||||||
will see that a new Virtual Library has been created, and automatically
|
will see that a new Virtual library has been created, and automatically
|
||||||
switched to, that displays only the books by the selected author. As far as
|
switched to, that displays only the books by the selected author. As far as
|
||||||
calibre is concerned, it is as if your library contains only the books by the
|
calibre is concerned, it is as if your library contains only the books by the
|
||||||
selected author.
|
selected author.
|
||||||
|
|
||||||
You can switch back to the full library at any time by once again clicking the
|
You can switch back to the full library at any time by once again clicking the
|
||||||
:guilabel:`Virtual Library` and selecting the entry named :guilabel:`<None>`.
|
:guilabel:`Virtual library` and selecting the entry named :guilabel:`<None>`.
|
||||||
|
|
||||||
Virtual Libraries are based on *searches*. You can use any search as the
|
Virtual libraries are based on *searches*. You can use any search as the
|
||||||
basis of a virtual library. The virtual library will contain only the
|
basis of a virtual library. The virtual library will contain only the
|
||||||
books matched by that search. First, type in the search you want to use
|
books matched by that search. First, type in the search you want to use
|
||||||
in the search bar or build a search using the :guilabel:`Tag Browser`.
|
in the search bar or build a search using the :guilabel:`Tag Browser`.
|
||||||
When you are happy with the returned results, click the Virtual Library
|
When you are happy with the returned results, click the Virtual library
|
||||||
button, choose Create Library and enter a name for the new virtual
|
button, choose Create Library and enter a name for the new virtual
|
||||||
library. The virtual library will then be created based on the search
|
library. The virtual library will then be created based on the search
|
||||||
you just typed in. Searches are very powerful, for examples of the kinds
|
you just typed in. Searches are very powerful, for examples of the kinds
|
||||||
of things you can do with them, see :ref:`search_interface`.
|
of things you can do with them, see :ref:`search_interface`.
|
||||||
|
|
||||||
Examples of useful Virtual Libraries
|
Examples of useful Virtual libraries
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
* Books added to calibre in the last day::
|
* Books added to calibre in the last day::
|
||||||
@ -74,11 +74,11 @@ Examples of useful Virtual Libraries
|
|||||||
* Books with no covers::
|
* Books with no covers::
|
||||||
cover:false
|
cover:false
|
||||||
|
|
||||||
Working with Virtual Libraries
|
Working with Virtual libraries
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
|
|
||||||
You can edit a previously created virtual library or remove it, by clicking the
|
You can edit a previously created virtual library or remove it, by clicking the
|
||||||
:guilabel:`Virtual Library` and choosing the appropriate action.
|
:guilabel:`Virtual library` and choosing the appropriate action.
|
||||||
|
|
||||||
You can tell calibre that you always want to apply a particular virtual library
|
You can tell calibre that you always want to apply a particular virtual library
|
||||||
when the current library is opened, by going to
|
when the current library is opened, by going to
|
||||||
@ -88,12 +88,12 @@ If you use the calibre Content Server, you can have it share a virtual library
|
|||||||
instead of the full library by going to :guilabel:`Preferences->Sharing over the net`.
|
instead of the full library by going to :guilabel:`Preferences->Sharing over the net`.
|
||||||
|
|
||||||
You can quickly use the current search as a temporary virtual library by
|
You can quickly use the current search as a temporary virtual library by
|
||||||
clicking the :guilabel:`Virtual Library` button and choosing the
|
clicking the :guilabel:`Virtual library` button and choosing the
|
||||||
:guilabel:`*current search` entry.
|
:guilabel:`*current search` entry.
|
||||||
|
|
||||||
You can display all available virtual libraries as tabs above the book list.
|
You can display all available virtual libraries as tabs above the book list.
|
||||||
This is particularly handy if you like switching between virtual libraries very
|
This is particularly handy if you like switching between virtual libraries very
|
||||||
often. Click the :guilabel:`Virtual Library` button and select :guilabel:`Show
|
often. Click the :guilabel:`Virtual library` button and select :guilabel:`Show
|
||||||
virtual libraries as tabs`. You can re-arrange the tabs by drag and drop and
|
virtual libraries as tabs`. You can re-arrange the tabs by drag and drop and
|
||||||
close ones you do not want to see. Closed tabs can be restored by
|
close ones you do not want to see. Closed tabs can be restored by
|
||||||
right-clicking on the tab bar.
|
right-clicking on the tab bar.
|
||||||
@ -101,11 +101,11 @@ right-clicking on the tab bar.
|
|||||||
Using additional restrictions
|
Using additional restrictions
|
||||||
-------------------------------
|
-------------------------------
|
||||||
|
|
||||||
You can further restrict the books shown in a Virtual Library by using
|
You can further restrict the books shown in a Virtual library by using
|
||||||
:guilabel:`Additional restrictions`. An additional restriction is saved search
|
:guilabel:`Additional restrictions`. An additional restriction is saved search
|
||||||
you previously created that can be applied to the current Virtual Library to
|
you previously created that can be applied to the current Virtual library to
|
||||||
further restrict the books shown in a virtual library. For example, say you
|
further restrict the books shown in a virtual library. For example, say you
|
||||||
have a Virtual Library for books tagged as :guilabel:`Historical Fiction` and a
|
have a Virtual library for books tagged as :guilabel:`Historical Fiction` and a
|
||||||
saved search that shows you unread books, you can click the :guilabel:`Virtual
|
saved search that shows you unread books, you can click the :guilabel:`Virtual
|
||||||
Library` button and choose the :guilabel:`Additional restriction` option to
|
Library` button and choose the :guilabel:`Additional restriction` option to
|
||||||
show only unread Historical Fiction books. To learn about saved searches, see
|
show only unread Historical Fiction books. To learn about saved searches, see
|
||||||
|
@ -494,7 +494,7 @@ gui_view_history_size = 15
|
|||||||
# negative number to increase or decrease the font size.
|
# negative number to increase or decrease the font size.
|
||||||
change_book_details_font_size_by = 0
|
change_book_details_font_size_by = 0
|
||||||
|
|
||||||
#: Compile General Program Mode templates to Python
|
#: Compile general program Mode templates to Python
|
||||||
# Compiled general program mode templates are significantly faster than
|
# Compiled general program mode templates are significantly faster than
|
||||||
# interpreted templates. Setting this tweak to True causes calibre to compile
|
# interpreted templates. Setting this tweak to True causes calibre to compile
|
||||||
# (in most cases) general program mode templates. Setting it to False causes
|
# (in most cases) general program mode templates. Setting it to False causes
|
||||||
@ -548,9 +548,9 @@ numeric_collation = False
|
|||||||
# number here. The default is ten libraries.
|
# number here. The default is ten libraries.
|
||||||
many_libraries = 10
|
many_libraries = 10
|
||||||
|
|
||||||
#: Highlight the virtual library name when using a Virtual Library
|
#: Highlight the virtual library name when using a Virtual library
|
||||||
# The virtual library name next to the Virtual Library button is highlighted in
|
# The virtual library name next to the Virtual library button is highlighted in
|
||||||
# yellow when using a Virtual Library. You can choose the color used for the
|
# yellow when using a Virtual library. You can choose the color used for the
|
||||||
# highlight with this tweak. Set it to 'transparent' to disable highlighting.
|
# highlight with this tweak. Set it to 'transparent' to disable highlighting.
|
||||||
highlight_virtual_library = 'yellow'
|
highlight_virtual_library = 'yellow'
|
||||||
|
|
||||||
@ -569,9 +569,9 @@ restrict_output_formats = None
|
|||||||
# The value can be between 50 and 99
|
# The value can be between 50 and 99
|
||||||
content_server_thumbnail_compression_quality = 75
|
content_server_thumbnail_compression_quality = 75
|
||||||
|
|
||||||
#: Image file types to treat as ebooks when dropping onto the Book Details panel
|
#: Image file types to treat as ebooks when dropping onto the Book details panel
|
||||||
# Normally, if you drop any image file in a format known to calibre onto the
|
# Normally, if you drop any image file in a format known to calibre onto the
|
||||||
# Book Details panel, it will be used to set the cover. If you want to store
|
# Book details panel, it will be used to set the cover. If you want to store
|
||||||
# some image types as ebooks instead, you can set this tweak.
|
# some image types as ebooks instead, you can set this tweak.
|
||||||
# Examples:
|
# Examples:
|
||||||
# cover_drop_exclude = {'tiff', 'webp'}
|
# cover_drop_exclude = {'tiff', 'webp'}
|
||||||
|
@ -256,7 +256,7 @@ class ChooseLibraryAction(InterfaceAction):
|
|||||||
|
|
||||||
self.rename_separator = self.choose_menu.addSeparator()
|
self.rename_separator = self.choose_menu.addSeparator()
|
||||||
|
|
||||||
self.maintenance_menu = QMenu(_('Library Maintenance'))
|
self.maintenance_menu = QMenu(_('Library maintenance'))
|
||||||
ac = self.create_action(spec=(_('Library metadata backup status'),
|
ac = self.create_action(spec=(_('Library metadata backup status'),
|
||||||
'lt.png', None, None), attr='action_backup_status')
|
'lt.png', None, None), attr='action_backup_status')
|
||||||
ac.triggered.connect(self.backup_status, type=Qt.QueuedConnection)
|
ac.triggered.connect(self.backup_status, type=Qt.QueuedConnection)
|
||||||
@ -633,4 +633,3 @@ class ChooseLibraryAction(InterfaceAction):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
<widget class="QCheckBox" name="refresh_book_list">
|
<widget class="QCheckBox" name="refresh_book_list">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>If enabled, the book list will be re-sorted and any existing
|
<string>If enabled, the book list will be re-sorted and any existing
|
||||||
search or Virtual Library will be refreshed after the edit
|
search or Virtual library will be refreshed after the edit
|
||||||
is completed. This can be slow on large libraries.</string>
|
is completed. This can be slow on large libraries.</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -339,12 +339,12 @@ class VLTabs(QTabBar): # {{{
|
|||||||
self.gui.keyboard.register_shortcut(
|
self.gui.keyboard.register_shortcut(
|
||||||
'virtual-library-tab-bar-next', _('Next virtual library'), action=self.next_action,
|
'virtual-library-tab-bar-next', _('Next virtual library'), action=self.next_action,
|
||||||
default_keys=('Ctrl+Right',),
|
default_keys=('Ctrl+Right',),
|
||||||
description=_('Switch to the next Virtual Library in the Virtual Library tab bar')
|
description=_('Switch to the next Virtual library in the Virtual library tab bar')
|
||||||
)
|
)
|
||||||
self.gui.keyboard.register_shortcut(
|
self.gui.keyboard.register_shortcut(
|
||||||
'virtual-library-tab-bar-previous', _('Previous virtual library'), action=self.previous_action,
|
'virtual-library-tab-bar-previous', _('Previous virtual library'), action=self.previous_action,
|
||||||
default_keys=('Ctrl+Left',),
|
default_keys=('Ctrl+Left',),
|
||||||
description=_('Switch to the previous Virtual Library in the Virtual Library tab bar')
|
description=_('Switch to the previous Virtual library in the Virtual library tab bar')
|
||||||
)
|
)
|
||||||
|
|
||||||
def next_tab(self, delta=1):
|
def next_tab(self, delta=1):
|
||||||
|
@ -192,7 +192,7 @@ class SearchBar(QWidget): # {{{
|
|||||||
x.setObjectName('clear_vl')
|
x.setObjectName('clear_vl')
|
||||||
l.addWidget(x)
|
l.addWidget(x)
|
||||||
x.setVisible(False)
|
x.setVisible(False)
|
||||||
x.setToolTip(_('Close the Virtual Library'))
|
x.setToolTip(_('Close the Virtual library'))
|
||||||
parent.clear_vl = x
|
parent.clear_vl = x
|
||||||
|
|
||||||
x = QLabel(self)
|
x = QLabel(self)
|
||||||
|
@ -28,7 +28,7 @@ class SelectNames(QDialog): # {{{
|
|||||||
self.l = l = QVBoxLayout(self)
|
self.l = l = QVBoxLayout(self)
|
||||||
self.setLayout(l)
|
self.setLayout(l)
|
||||||
|
|
||||||
self.la = la = QLabel(_('Create a Virtual Library based on %s') % txt)
|
self.la = la = QLabel(_('Create a Virtual library based on %s') % txt)
|
||||||
l.addWidget(la)
|
l.addWidget(la)
|
||||||
|
|
||||||
self._names = QListWidget(self)
|
self._names = QListWidget(self)
|
||||||
@ -60,6 +60,7 @@ class SelectNames(QDialog): # {{{
|
|||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
|
||||||
MAX_VIRTUAL_LIBRARY_NAME_LENGTH = 40
|
MAX_VIRTUAL_LIBRARY_NAME_LENGTH = 40
|
||||||
|
|
||||||
|
|
||||||
@ -141,7 +142,7 @@ class CreateVirtualLibrary(QDialog): # {{{
|
|||||||
gl.setRowStretch(3,10)
|
gl.setRowStretch(3,10)
|
||||||
|
|
||||||
self.hl = hl = QLabel(_('''
|
self.hl = hl = QLabel(_('''
|
||||||
<h2>Virtual Libraries</h2>
|
<h2>Virtual libraries</h2>
|
||||||
|
|
||||||
<p>Using <i>virtual libraries</i> you can restrict calibre to only show
|
<p>Using <i>virtual libraries</i> you can restrict calibre to only show
|
||||||
you books that match a search. When a virtual library is in effect, calibre
|
you books that match a search. When a virtual library is in effect, calibre
|
||||||
@ -150,7 +151,7 @@ class CreateVirtualLibrary(QDialog): # {{{
|
|||||||
you do will only search within the books in the virtual library. This
|
you do will only search within the books in the virtual library. This
|
||||||
is a good way to partition your large library into smaller and easier to work with subsets.</p>
|
is a good way to partition your large library into smaller and easier to work with subsets.</p>
|
||||||
|
|
||||||
<p>For example you can use a Virtual Library to only show you books with the Tag <i>"Unread"</i>
|
<p>For example you can use a Virtual library to only show you books with the Tag <i>"Unread"</i>
|
||||||
or only books by <i>"My Favorite Author"</i> or only books in a particular series.</p>
|
or only books by <i>"My Favorite Author"</i> or only books in a particular series.</p>
|
||||||
|
|
||||||
<p>More information and examples are available in the
|
<p>More information and examples are available in the
|
||||||
@ -343,8 +344,8 @@ class SearchRestrictionMixin(object):
|
|||||||
self.search_restriction.setVisible(False)
|
self.search_restriction.setVisible(False)
|
||||||
self.search_count.setText(_("(all books)"))
|
self.search_count.setText(_("(all books)"))
|
||||||
self.ar_menu = QMenu(_('Additional restriction'))
|
self.ar_menu = QMenu(_('Additional restriction'))
|
||||||
self.edit_menu = QMenu(_('Edit Virtual Library'))
|
self.edit_menu = QMenu(_('Edit Virtual library'))
|
||||||
self.rm_menu = QMenu(_('Remove Virtual Library'))
|
self.rm_menu = QMenu(_('Remove Virtual library'))
|
||||||
self.search_restriction_list_built = False
|
self.search_restriction_list_built = False
|
||||||
|
|
||||||
def add_virtual_library(self, db, name, search):
|
def add_virtual_library(self, db, name, search):
|
||||||
@ -368,7 +369,7 @@ class SearchRestrictionMixin(object):
|
|||||||
m = self.virtual_library_menu
|
m = self.virtual_library_menu
|
||||||
m.clear()
|
m.clear()
|
||||||
|
|
||||||
a = m.addAction(_('Create Virtual Library'))
|
a = m.addAction(_('Create Virtual library'))
|
||||||
a.triggered.connect(partial(self.do_create_edit, name=None))
|
a.triggered.connect(partial(self.do_create_edit, name=None))
|
||||||
|
|
||||||
a = self.edit_menu
|
a = self.edit_menu
|
||||||
@ -636,6 +637,7 @@ class SearchRestrictionMixin(object):
|
|||||||
self.search_count.setVisible(False)
|
self.search_count.setVisible(False)
|
||||||
self.search_count.setText(t)
|
self.search_count.setText(t)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
from calibre.gui2 import Application
|
from calibre.gui2 import Application
|
||||||
from calibre.gui2.preferences import init_gui
|
from calibre.gui2.preferences import init_gui
|
||||||
@ -644,5 +646,3 @@ if __name__ == '__main__':
|
|||||||
gui = init_gui()
|
gui = init_gui()
|
||||||
d = CreateVirtualLibrary(gui, [])
|
d = CreateVirtualLibrary(gui, [])
|
||||||
d.exec_()
|
d.exec_()
|
||||||
|
|
||||||
|
|
||||||
|
@ -326,7 +326,7 @@ class MainWindowSettings(BasicSettings):
|
|||||||
l.addRow(nd)
|
l.addRow(nd)
|
||||||
|
|
||||||
nd = self('file_list_shows_full_pathname')
|
nd = self('file_list_shows_full_pathname')
|
||||||
nd.setText(_('Show full file paths in the File Browser'))
|
nd.setText(_('Show full file paths in the File browser'))
|
||||||
nd.setToolTip('<p>' + _(
|
nd.setToolTip('<p>' + _(
|
||||||
'Showing the full file paths is useful when editing books that contain'
|
'Showing the full file paths is useful when editing books that contain'
|
||||||
' multiple files with the same file name.'
|
' multiple files with the same file name.'
|
||||||
|
@ -137,7 +137,7 @@ class WhereBox(QComboBox):
|
|||||||
<dt><b>All style files</b></dt>
|
<dt><b>All style files</b></dt>
|
||||||
<dd>Search in all style (CSS) files</dd>
|
<dd>Search in all style (CSS) files</dd>
|
||||||
<dt><b>Selected files</b></dt>
|
<dt><b>Selected files</b></dt>
|
||||||
<dd>Search in the files currently selected in the File Browser</dd>
|
<dd>Search in the files currently selected in the File browser</dd>
|
||||||
<dt><b>Open files</b></dt>
|
<dt><b>Open files</b></dt>
|
||||||
<dd>Search in the files currently open in the editor</dd>
|
<dd>Search in the files currently open in the editor</dd>
|
||||||
<dt><b>Marked text</b></dt>
|
<dt><b>Marked text</b></dt>
|
||||||
@ -1260,7 +1260,7 @@ def validate_search_request(name, searchable_names, has_marked_text, state, gui_
|
|||||||
if name is None and where in {'current', 'selected-text'}:
|
if name is None and where in {'current', 'selected-text'}:
|
||||||
err = _('No file is being edited.')
|
err = _('No file is being edited.')
|
||||||
elif where == 'selected' and not searchable_names['selected']:
|
elif where == 'selected' and not searchable_names['selected']:
|
||||||
err = _('No files are selected in the File Browser')
|
err = _('No files are selected in the File browser')
|
||||||
elif where == 'selected-text' and not has_marked_text:
|
elif where == 'selected-text' and not has_marked_text:
|
||||||
err = _('No text is marked. First select some text, and then use'
|
err = _('No text is marked. First select some text, and then use'
|
||||||
' The "Mark selected text" action in the Search menu to mark it.')
|
' The "Mark selected text" action in the Search menu to mark it.')
|
||||||
|
@ -60,7 +60,7 @@ class WhereBox(QComboBox):
|
|||||||
<dt><b>All text files</b></dt>
|
<dt><b>All text files</b></dt>
|
||||||
<dd>Search in all text (HTML) files</dd>
|
<dd>Search in all text (HTML) files</dd>
|
||||||
<dt><b>Selected files</b></dt>
|
<dt><b>Selected files</b></dt>
|
||||||
<dd>Search in the files currently selected in the File Browser</dd>
|
<dd>Search in the files currently selected in the File browser</dd>
|
||||||
<dt><b>Open files</b></dt>
|
<dt><b>Open files</b></dt>
|
||||||
<dd>Search in the files currently open in the editor</dd>
|
<dd>Search in the files currently open in the editor</dd>
|
||||||
</dl>'''))
|
</dl>'''))
|
||||||
|
@ -689,13 +689,13 @@ class Main(MainWindow):
|
|||||||
setattr(self, oname.replace('-', '_'), d)
|
setattr(self, oname.replace('-', '_'), d)
|
||||||
return d
|
return d
|
||||||
|
|
||||||
d = create(_('File Browser'), 'files-browser')
|
d = create(_('File browser'), 'files-browser')
|
||||||
d.setAllowedAreas(Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea)
|
d.setAllowedAreas(Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea)
|
||||||
self.file_list = FileListWidget(d)
|
self.file_list = FileListWidget(d)
|
||||||
d.setWidget(self.file_list)
|
d.setWidget(self.file_list)
|
||||||
self.addDockWidget(Qt.LeftDockWidgetArea, d)
|
self.addDockWidget(Qt.LeftDockWidgetArea, d)
|
||||||
|
|
||||||
d = create(_('File Preview'), 'preview')
|
d = create(_('File preview'), 'preview')
|
||||||
d.setAllowedAreas(Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea)
|
d.setAllowedAreas(Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea)
|
||||||
self.preview = Preview(d)
|
self.preview = Preview(d)
|
||||||
d.setWidget(self.preview)
|
d.setWidget(self.preview)
|
||||||
@ -708,7 +708,7 @@ class Main(MainWindow):
|
|||||||
self.addDockWidget(Qt.RightDockWidgetArea, d)
|
self.addDockWidget(Qt.RightDockWidgetArea, d)
|
||||||
d.close() # Hidden by default
|
d.close() # Hidden by default
|
||||||
|
|
||||||
d = create(_('Check Book'), 'check-book')
|
d = create(_('Check book'), 'check-book')
|
||||||
d.setAllowedAreas(Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea | Qt.BottomDockWidgetArea | Qt.TopDockWidgetArea)
|
d.setAllowedAreas(Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea | Qt.BottomDockWidgetArea | Qt.TopDockWidgetArea)
|
||||||
d.setWidget(self.check_book)
|
d.setWidget(self.check_book)
|
||||||
self.addDockWidget(Qt.TopDockWidgetArea, d)
|
self.addDockWidget(Qt.TopDockWidgetArea, d)
|
||||||
@ -728,7 +728,7 @@ class Main(MainWindow):
|
|||||||
self.addDockWidget(Qt.LeftDockWidgetArea, d)
|
self.addDockWidget(Qt.LeftDockWidgetArea, d)
|
||||||
d.close() # Hidden by default
|
d.close() # Hidden by default
|
||||||
|
|
||||||
d = create(_('Text Search'), 'text-search')
|
d = create(_('Text search'), 'text-search')
|
||||||
d.setAllowedAreas(Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea | Qt.BottomDockWidgetArea | Qt.TopDockWidgetArea)
|
d.setAllowedAreas(Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea | Qt.BottomDockWidgetArea | Qt.TopDockWidgetArea)
|
||||||
d.setWidget(self.text_search)
|
d.setWidget(self.text_search)
|
||||||
self.addDockWidget(Qt.LeftDockWidgetArea, d)
|
self.addDockWidget(Qt.LeftDockWidgetArea, d)
|
||||||
@ -741,7 +741,7 @@ class Main(MainWindow):
|
|||||||
self.addDockWidget(Qt.LeftDockWidgetArea, d)
|
self.addDockWidget(Qt.LeftDockWidgetArea, d)
|
||||||
d.close() # Hidden by default
|
d.close() # Hidden by default
|
||||||
|
|
||||||
d = create(_('Saved Searches'), 'saved-searches')
|
d = create(_('Saved searches'), 'saved-searches')
|
||||||
d.setAllowedAreas(Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea | Qt.BottomDockWidgetArea | Qt.TopDockWidgetArea)
|
d.setAllowedAreas(Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea | Qt.BottomDockWidgetArea | Qt.TopDockWidgetArea)
|
||||||
d.setWidget(self.saved_searches)
|
d.setWidget(self.saved_searches)
|
||||||
self.addDockWidget(Qt.LeftDockWidgetArea, d)
|
self.addDockWidget(Qt.LeftDockWidgetArea, d)
|
||||||
|
@ -122,7 +122,7 @@ class RationalizeFolders(Dialog): # {{{
|
|||||||
l.addWidget(le, i + 1, 1)
|
l.addWidget(le, i + 1, 1)
|
||||||
self.la2 = la = QLabel(_(
|
self.la2 = la = QLabel(_(
|
||||||
'Note that this will only arrange files inside the book,'
|
'Note that this will only arrange files inside the book,'
|
||||||
' it will not affect how they are displayed in the File Browser'))
|
' it will not affect how they are displayed in the File browser'))
|
||||||
la.setWordWrap(True)
|
la.setWordWrap(True)
|
||||||
l.addWidget(la, i + 2, 0, 1, -1)
|
l.addWidget(la, i + 2, 0, 1, -1)
|
||||||
l.addWidget(self.bb, i + 3, 0, 1, -1)
|
l.addWidget(self.bb, i + 3, 0, 1, -1)
|
||||||
|
@ -151,7 +151,7 @@ def _builtin_field_metadata():
|
|||||||
'datatype':'text',
|
'datatype':'text',
|
||||||
'is_multiple':{},
|
'is_multiple':{},
|
||||||
'kind':'field',
|
'kind':'field',
|
||||||
'name':_('Author Sort'),
|
'name':_('Author sort'),
|
||||||
'search_terms':['author_sort'],
|
'search_terms':['author_sort'],
|
||||||
'is_custom':False,
|
'is_custom':False,
|
||||||
'is_category':False,
|
'is_category':False,
|
||||||
@ -213,7 +213,7 @@ def _builtin_field_metadata():
|
|||||||
'datatype':'text',
|
'datatype':'text',
|
||||||
'is_multiple':{},
|
'is_multiple':{},
|
||||||
'kind':'field',
|
'kind':'field',
|
||||||
'name':_('On Device'),
|
'name':_('On device'),
|
||||||
'search_terms':['ondevice'],
|
'search_terms':['ondevice'],
|
||||||
'is_custom':False,
|
'is_custom':False,
|
||||||
'is_category':False,
|
'is_category':False,
|
||||||
@ -263,7 +263,7 @@ def _builtin_field_metadata():
|
|||||||
'datatype':'text',
|
'datatype':'text',
|
||||||
'is_multiple':{},
|
'is_multiple':{},
|
||||||
'kind':'field',
|
'kind':'field',
|
||||||
'name':_('Series Sort'),
|
'name':_('Series sort'),
|
||||||
'search_terms':['series_sort'],
|
'search_terms':['series_sort'],
|
||||||
'is_custom':False,
|
'is_custom':False,
|
||||||
'is_category':False,
|
'is_category':False,
|
||||||
@ -273,7 +273,7 @@ def _builtin_field_metadata():
|
|||||||
'datatype':'text',
|
'datatype':'text',
|
||||||
'is_multiple':{},
|
'is_multiple':{},
|
||||||
'kind':'field',
|
'kind':'field',
|
||||||
'name':_('Title Sort'),
|
'name':_('Title sort'),
|
||||||
'search_terms':['title_sort'],
|
'search_terms':['title_sort'],
|
||||||
'is_custom':False,
|
'is_custom':False,
|
||||||
'is_category':False,
|
'is_category':False,
|
||||||
|
@ -1144,9 +1144,9 @@ def cli_index_strings():
|
|||||||
'On OS X, the command line tools are inside the calibre bundle, for example,'
|
'On OS X, the command line tools are inside the calibre bundle, for example,'
|
||||||
' if you installed calibre in :file:`/Applications` the command line tools'
|
' if you installed calibre in :file:`/Applications` the command line tools'
|
||||||
' are in :file:`/Applications/calibre.app/Contents/console.app/Contents/MacOS/`.'), _(
|
' are in :file:`/Applications/calibre.app/Contents/console.app/Contents/MacOS/`.'), _(
|
||||||
'Documented Commands'), _('Undocumented Commands'), _(
|
'Documented commands'), _('Undocumented commands'), _(
|
||||||
'You can see usage for undocumented commands by executing them without arguments in a terminal.'), _(
|
'You can see usage for undocumented commands by executing them without arguments in a terminal.'), _(
|
||||||
'Change Language')
|
'Change language')
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
@ -1509,7 +1509,7 @@ class BasicNewsRecipe(Recipe):
|
|||||||
for curl in self.canonicalize_internal_url(a.orig_url, is_link=False):
|
for curl in self.canonicalize_internal_url(a.orig_url, is_link=False):
|
||||||
aumap[curl].add(arelpath)
|
aumap[curl].add(arelpath)
|
||||||
parent.add_item(arelpath, None,
|
parent.add_item(arelpath, None,
|
||||||
a.title if a.title else _('Untitled Article'),
|
a.title if a.title else _('Untitled article'),
|
||||||
play_order=po, author=auth,
|
play_order=po, author=auth,
|
||||||
description=desc, toc_thumbnail=tt)
|
description=desc, toc_thumbnail=tt)
|
||||||
last = os.path.join(self.output_dir, ('%sindex.html'%adir).replace('/', os.sep))
|
last = os.path.join(self.output_dir, ('%sindex.html'%adir).replace('/', os.sep))
|
||||||
|
@ -226,10 +226,10 @@ class NavBarTemplate(Template):
|
|||||||
navbar.append(A(_('Next'), href=href))
|
navbar.append(A(_('Next'), href=href))
|
||||||
href = '%s../index.html#article_%d'%(prefix, art)
|
href = '%s../index.html#article_%d'%(prefix, art)
|
||||||
navbar.iterchildren(reversed=True).next().tail = ' | '
|
navbar.iterchildren(reversed=True).next().tail = ' | '
|
||||||
navbar.append(A(_('Section Menu'), href=href))
|
navbar.append(A(_('Section menu'), href=href))
|
||||||
href = '%s../../index.html#feed_%d'%(prefix, feed)
|
href = '%s../../index.html#feed_%d'%(prefix, feed)
|
||||||
navbar.iterchildren(reversed=True).next().tail = ' | '
|
navbar.iterchildren(reversed=True).next().tail = ' | '
|
||||||
navbar.append(A(_('Main Menu'), href=href))
|
navbar.append(A(_('Main menu'), href=href))
|
||||||
if art > 0 and not bottom:
|
if art > 0 and not bottom:
|
||||||
href = '%s../article_%d/index.html'%(prefix, art-1)
|
href = '%s../article_%d/index.html'%(prefix, art-1)
|
||||||
navbar.iterchildren(reversed=True).next().tail = ' | '
|
navbar.iterchildren(reversed=True).next().tail = ' | '
|
||||||
@ -428,4 +428,3 @@ class TouchscreenNavBarTemplate(Template):
|
|||||||
# print "\n%s\n" % etree.tostring(navbar, pretty_print=True)
|
# print "\n%s\n" % etree.tostring(navbar, pretty_print=True)
|
||||||
|
|
||||||
self.root = HTML(head, BODY(navbar))
|
self.root = HTML(head, BODY(navbar))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user