diff --git a/imgsrc/snippets.svg b/imgsrc/snippets.svg new file mode 100644 index 0000000000..9e2f08b257 --- /dev/null +++ b/imgsrc/snippets.svg @@ -0,0 +1,42 @@ + + + + + + + + + image/svg+xml + + + + + + + {|} + + diff --git a/resources/images/snippets.png b/resources/images/snippets.png new file mode 100644 index 0000000000..4779ea2da6 Binary files /dev/null and b/resources/images/snippets.png differ diff --git a/src/calibre/gui2/tweak_book/boss.py b/src/calibre/gui2/tweak_book/boss.py index fb50e79854..1b41d960c7 100644 --- a/src/calibre/gui2/tweak_book/boss.py +++ b/src/calibre/gui2/tweak_book/boss.py @@ -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): diff --git a/src/calibre/gui2/tweak_book/editor/snippets.py b/src/calibre/gui2/tweak_book/editor/snippets.py index a257f43acc..0e13b17a6d 100644 --- a/src/calibre/gui2/tweak_book/editor/snippets.py +++ b/src/calibre/gui2/tweak_book/editor/snippets.py @@ -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'))) diff --git a/src/calibre/gui2/tweak_book/ui.py b/src/calibre/gui2/tweak_book/ui.py index 1a2efd6e00..4cb13b4100 100644 --- a/src/calibre/gui2/tweak_book/ui.py +++ b/src/calibre/gui2/tweak_book/ui.py @@ -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 = []