mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Allow adding the "Manage Snippets" action to the toolbar, for easy access
This commit is contained in:
parent
57eee6d2f7
commit
04dfbe41d4
42
imgsrc/snippets.svg
Normal file
42
imgsrc/snippets.svg
Normal file
@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
version="1.1"
|
||||
width="128"
|
||||
height="128"
|
||||
id="svg2">
|
||||
<defs
|
||||
id="defs4" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
transform="translate(0,-924.36218)"
|
||||
id="layer1">
|
||||
<text
|
||||
x="6.9818249"
|
||||
y="1031.5"
|
||||
transform="scale(1.0074934,0.99256234)"
|
||||
id="text2985"
|
||||
xml:space="preserve"
|
||||
style="font-size:119.50392914px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"><tspan
|
||||
x="6.9818249"
|
||||
y="1031.5"
|
||||
id="tspan2987">{|}</tspan></text>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.2 KiB |
BIN
resources/images/snippets.png
Normal file
BIN
resources/images/snippets.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
@ -1353,6 +1353,10 @@ class Boss(QObject):
|
||||
def insert_character(self):
|
||||
self.gui.insert_char.show()
|
||||
|
||||
def manage_snippets(self):
|
||||
from calibre.gui2.tweak_book.editor.snippets import UserSnippets
|
||||
UserSnippets(self.gui).exec_()
|
||||
|
||||
# Shutdown {{{
|
||||
|
||||
def quit(self):
|
||||
|
@ -548,6 +548,7 @@ class UserSnippets(Dialog):
|
||||
|
||||
def __init__(self, parent=None):
|
||||
Dialog.__init__(self, _('Create/Edit snippets'), 'snippet-editor', parent=parent)
|
||||
self.setWindowIcon(QIcon(I('snippets.png')))
|
||||
|
||||
def setup_ui(self):
|
||||
self.setWindowIcon(QIcon(I('modified.png')))
|
||||
|
@ -460,6 +460,9 @@ class Main(MainWindow):
|
||||
'Split HTML file at multiple locations'))
|
||||
self.action_compare_book = treg('diff.png', _('&Compare to another book'), self.boss.compare_book, 'compare-book', (), _(
|
||||
'Compare to another book'))
|
||||
self.action_manage_snippets = treg(
|
||||
'snippets.png', _('Manage &Snippets'), self.boss.manage_snippets, 'manage-snippets', (), _(
|
||||
'Manage user created snippets'))
|
||||
|
||||
self.plugin_menu_actions = []
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user