Add a dedicated icon for FTS

This commit is contained in:
Kovid Goyal 2022-06-14 13:29:16 +05:30
parent b51e85e98e
commit e1e490b66e
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
7 changed files with 81 additions and 11 deletions

68
imgsrc/fts.svg Normal file
View File

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="128.0px"
height="128.0px"
viewBox="0 0 128.0 128.0"
version="1.1"
id="SVGRoot"
sodipodi:docname="fts.svg"
inkscape:version="1.2 (dc2aedaf03, 2022-05-15)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview11"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
inkscape:showpageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#505050"
showgrid="false"
inkscape:zoom="10.429825"
inkscape:cx="7.5264925"
inkscape:cy="64.047096"
inkscape:window-width="3840"
inkscape:window-height="2101"
inkscape:window-x="0"
inkscape:window-y="59"
inkscape:window-maximized="1"
inkscape:current-layer="SVGRoot" />
<defs
id="defs9" />
<g
id="layer1"
transform="translate(6.2816136,0.20846979)">
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none"
x="10.757631"
y="51.605667"
id="text131"><tspan
id="tspan129" /></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:114.667px;line-height:1.25;font-family:Algerian;-inkscape-font-specification:'Algerian, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;letter-spacing:0px;word-spacing:0px;fill:#2271d5;fill-opacity:1;stroke:none;stroke-width:1.33577"
x="-2.1908071"
y="76.800011"
id="text189"><tspan
id="tspan187"
x="-2.1908071"
y="76.800011"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:114.667px;font-family:Algerian;-inkscape-font-specification:'Algerian, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;fill:#2271d5;fill-opacity:1;stroke-width:1.33577">F</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:114.667px;line-height:1.25;font-family:Algerian;-inkscape-font-specification:'Algerian, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;letter-spacing:0px;word-spacing:0px;fill:#2caf45;fill-opacity:1;stroke:none"
x="49.37608"
y="127.20905"
id="text301"><tspan
id="tspan299"
x="49.37608"
y="127.20905"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:114.667px;font-family:Algerian;-inkscape-font-specification:'Algerian, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal">T</tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -549,15 +549,16 @@ Now you can access your saved search in the Tag browser under :guilabel:`Saved s
Searching the full text of all books Searching the full text of all books
--------------------------------------- ---------------------------------------
calibre can *optionally* index the full text of books in the library to allow .. |ftsb| image:: images/fts-button.png
for instant searching of words inside any book. To enable this functionality :class: float-right-img
go to :guilabel:`Preferences->Toolbars & menus->The main toolbar` and add the
:guilabel:`Search full text` button to the toolbar.
Click the newly added button to show the full text search window. Enable |ftsb| calibre can *optionally* index the full text of books in the library to allow
indexing for the current library. Once indexing is complete you can search all for instant searching of words inside any book. To use this functionality
the text in the full library. When you add new books to the library, they will click the :guilabel:`FT` button at the left edge of the search bar.
be automatically indexed in the background.
Then, enable indexing for the current library. Once indexing is complete you can
search all the text in the full library. When you add new books to the library,
they will be automatically indexed in the background.
Virtual libraries Virtual libraries
------------------- -------------------

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

BIN
resources/images/fts.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -8,7 +8,7 @@ from calibre.gui2.actions import InterfaceAction
class FullTextSearchAction(InterfaceAction): class FullTextSearchAction(InterfaceAction):
name = 'Full Text Search' name = 'Full Text Search'
action_spec = (_('Search full text'), 'search.png', action_spec = (_('Search full text'), 'fts.png',
_('Search the full text of all books in the calibre library'), ('Ctrl+/', 'Ctrl+Alt+F')) _('Search the full text of all books in the calibre library'), ('Ctrl+/', 'Ctrl+Alt+F'))
dont_add_to = frozenset(('context-menu-device',)) dont_add_to = frozenset(('context-menu-device',))
action_type = 'current' action_type = 'current'

View File

@ -5,7 +5,7 @@
import os import os
from qt.core import ( from qt.core import (
QDialogButtonBox, QHBoxLayout, QLabel, QSize, QStackedWidget, QVBoxLayout QDialogButtonBox, QHBoxLayout, QIcon, QLabel, QSize, QStackedWidget, QVBoxLayout
) )
from calibre.gui2.fts.scan import ScanStatus from calibre.gui2.fts.scan import ScanStatus
@ -19,6 +19,7 @@ class FTSDialog(Dialog):
def __init__(self, parent=None): def __init__(self, parent=None):
super().__init__(_('Search the text of all books in the library'), 'library-fts-dialog-2', super().__init__(_('Search the text of all books in the library'), 'library-fts-dialog-2',
default_buttons=QDialogButtonBox.StandardButton.Close) default_buttons=QDialogButtonBox.StandardButton.Close)
self.setWindowIcon(QIcon.ic('fts.png'))
def setup_ui(self): def setup_ui(self):
l = QVBoxLayout(self) l = QVBoxLayout(self)

View File

@ -232,7 +232,7 @@ class SearchBar(QFrame): # {{{
x.setMinimumContentsLength(10) x.setMinimumContentsLength(10)
l.addWidget(x) l.addWidget(x)
parent.full_text_search_action = ac = parent.search.add_action('lt.png', QLineEdit.ActionPosition.LeadingPosition) parent.full_text_search_action = ac = parent.search.add_action('fts.png', QLineEdit.ActionPosition.LeadingPosition)
ac.setToolTip('<p>' + _('Search the full text of all books in the library, not just their metadata')) ac.setToolTip('<p>' + _('Search the full text of all books in the library, not just their metadata'))
ac.triggered.connect(self.do_fts) ac.triggered.connect(self.do_fts)