From 6a27961f0a1d1664ad0b8ff518ec69c2cc1ed8a7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 4 Sep 2010 10:26:47 -0600 Subject: [PATCH] Icons for conversion input/output preference widgets --- resources/images/mimetypes/epub.svg | 1054 ++++++-------------- resources/images/mimetypes/fb2.svg | 275 ++++- resources/images/mimetypes/mobi.svg | 636 +++--------- src/calibre/gui2/convert/comic_input.py | 1 + src/calibre/gui2/convert/epub_output.py | 1 + src/calibre/gui2/convert/fb2_input.py | 1 + src/calibre/gui2/convert/fb2_output.py | 1 + src/calibre/gui2/convert/lrf_output.py | 1 + src/calibre/gui2/convert/mobi_output.py | 1 + src/calibre/gui2/convert/pdb_input.py | 1 + src/calibre/gui2/convert/pdb_output.py | 1 + src/calibre/gui2/convert/pdf_input.py | 1 + src/calibre/gui2/convert/pdf_output.py | 1 + src/calibre/gui2/convert/rb_output.py | 1 + src/calibre/gui2/convert/txt_input.py | 1 + src/calibre/gui2/convert/txt_output.py | 1 + src/calibre/gui2/preferences/conversion.py | 18 +- src/calibre/gui2/preferences/conversion.ui | 2 +- 18 files changed, 682 insertions(+), 1316 deletions(-) diff --git a/resources/images/mimetypes/epub.svg b/resources/images/mimetypes/epub.svg index 0c3a31964f..9f2648db6d 100644 --- a/resources/images/mimetypes/epub.svg +++ b/resources/images/mimetypes/epub.svg @@ -10,47 +10,162 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - version="1.0" width="128" height="128" - id="svg4486" - inkscape:version="0.47 r22583" - sodipodi:docname="epub.svg"> - - - - image/svg+xml - - - - - - + id="svg2606" + sodipodi:version="0.32" + inkscape:version="0.48.0 r9654" + version="1.0" + sodipodi:docname="epub.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape"> + id="defs2608"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + id="linearGradient3208"> + style="stop-color:#2b2b2b;stop-opacity:1;" + offset="0" + id="stop3210" /> + id="stop3212" + offset="0.5" + style="stop-color:#242424;stop-opacity:1;" /> + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + image/svg+xml + + + + - + inkscape:label="Livello 1" + inkscape:groupmode="layer" + id="layer1"> + style="opacity:0.5;fill:#000000;fill-opacity:1;filter:url(#filter2770)" + d="M 16,8 L 16,120 C 16,120 79.15625,120 79.15625,120 L 79.1875,120 C 79.187503,120 91.09375,110.09375 96.59375,104.59375 C 102.09375,99.09375 112,87.1875 112,87.1875 L 112,87.15625 L 112,8 L 16,8 z" + id="path7865" + sodipodi:nodetypes="csccscccc" + transform="matrix(1.0416667,0,0,1.0267857,-2.6666667,-1.2142891)" /> + style="fill:#ffffff;fill-opacity:1" + d="M 16.000001,8 L 16,120 C 16,120 79.146418,120 79.146418,120 L 112,87.14642 L 112,8 L 16.000001,8 z" + id="path34" + sodipodi:nodetypes="cccccc" /> + + + + + PUB + e - - - - - - - - PUB - - e diff --git a/resources/images/mimetypes/fb2.svg b/resources/images/mimetypes/fb2.svg index 009ca7d109..a88a4a8b8c 100644 --- a/resources/images/mimetypes/fb2.svg +++ b/resources/images/mimetypes/fb2.svg @@ -1,26 +1,249 @@ - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/resources/images/mimetypes/mobi.svg b/resources/images/mimetypes/mobi.svg index 88d19f6c0d..970456b0cb 100644 --- a/resources/images/mimetypes/mobi.svg +++ b/resources/images/mimetypes/mobi.svg @@ -8,121 +8,65 @@ xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.0" width="128" height="128" - id="svg4486" - inkscape:version="0.47 r22583" - sodipodi:docname="epub.svg"> - - - - image/svg+xml - - - - - - + id="svg2606"> + id="defs2608"> + id="linearGradient10207"> - - - - - - - - + x1="96" + y1="104" + x2="88.000198" + y2="96.000198" + id="XMLID_12_" + gradientUnits="userSpaceOnUse"> - - + id="stop85" + style="stop-color:#8c8e89;stop-opacity:1" + offset="0.0072" /> + id="stop87" + style="stop-color:#abaca9;stop-opacity:1" + offset="0.0673" /> - - + id="stop89" + style="stop-color:#c5c6c4;stop-opacity:1" + offset="0.1347" /> + id="stop91" + style="stop-color:#dbdbda;stop-opacity:1" + offset="0.2652576" /> + + + - - - - - - - - + id="filter6697"> + id="feGaussianBlur6699" + stdDeviation="1.9447689" /> - - + + + + gradientTransform="matrix(1,0,0,0.9996653,2e-6,0.00301608)" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + image/svg+xml + + + + + - + id="layer1"> + d="m 16,8 0,112 c 0,0 63.15625,0 63.15625,0 l 0.03125,0 c 3e-6,0 11.90625,-9.90625 17.40625,-15.40625 C 102.09375,99.09375 112,87.1875 112,87.1875 L 112,87.15625 112,8 16,8 z" + transform="matrix(1.0416667,0,0,1.0267857,-2.6666667,-1.2142891)" + id="path7865" + style="opacity:0.5;fill:#000000;fill-opacity:1;filter:url(#filter2770)" /> + d="M 16.000001,8 16,120 c 0,0 63.146418,0 63.146418,0 L 112,87.14642 112,8 16.000001,8 z" + id="path34" + style="fill:#ffffff;fill-opacity:1" /> + + + + mobi + + + - - - - - - - - mobi - - - diff --git a/src/calibre/gui2/convert/comic_input.py b/src/calibre/gui2/convert/comic_input.py index c2b6bfffaa..b29add2b13 100644 --- a/src/calibre/gui2/convert/comic_input.py +++ b/src/calibre/gui2/convert/comic_input.py @@ -15,6 +15,7 @@ class PluginWidget(Widget, Ui_Form): TITLE = _('Comic Input') HELP = _('Options specific to')+' comic '+_('input') COMMIT_NAME = 'comic_input' + ICON = I('mimetypes/png.svg') def __init__(self, parent, get_option, get_help, db=None, book_id=None): Widget.__init__(self, parent, diff --git a/src/calibre/gui2/convert/epub_output.py b/src/calibre/gui2/convert/epub_output.py index 2d1fcdfcd8..c5ee2d5b79 100644 --- a/src/calibre/gui2/convert/epub_output.py +++ b/src/calibre/gui2/convert/epub_output.py @@ -15,6 +15,7 @@ class PluginWidget(Widget, Ui_Form): TITLE = _('EPUB Output') HELP = _('Options specific to')+' EPUB '+_('output') COMMIT_NAME = 'epub_output' + ICON = I('mimetypes/epub.svg') def __init__(self, parent, get_option, get_help, db=None, book_id=None): Widget.__init__(self, parent, diff --git a/src/calibre/gui2/convert/fb2_input.py b/src/calibre/gui2/convert/fb2_input.py index 702f87754f..e23981a54c 100644 --- a/src/calibre/gui2/convert/fb2_input.py +++ b/src/calibre/gui2/convert/fb2_input.py @@ -12,6 +12,7 @@ class PluginWidget(Widget, Ui_Form): TITLE = _('FB2 Input') HELP = _('Options specific to')+' FB2 '+_('input') COMMIT_NAME = 'fb2_input' + ICON = I('mimetypes/fb2.svg') def __init__(self, parent, get_option, get_help, db=None, book_id=None): Widget.__init__(self, parent, diff --git a/src/calibre/gui2/convert/fb2_output.py b/src/calibre/gui2/convert/fb2_output.py index 145b14f8c9..40b377a6a5 100644 --- a/src/calibre/gui2/convert/fb2_output.py +++ b/src/calibre/gui2/convert/fb2_output.py @@ -14,6 +14,7 @@ class PluginWidget(Widget, Ui_Form): TITLE = _('FB2 Output') HELP = _('Options specific to')+' FB2 '+_('output') COMMIT_NAME = 'fb2_output' + ICON = I('mimetypes/fb2.svg') def __init__(self, parent, get_option, get_help, db=None, book_id=None): Widget.__init__(self, parent, ['inline_toc', 'sectionize_chapters']) diff --git a/src/calibre/gui2/convert/lrf_output.py b/src/calibre/gui2/convert/lrf_output.py index 1b4f1acad3..dafb4fd46b 100644 --- a/src/calibre/gui2/convert/lrf_output.py +++ b/src/calibre/gui2/convert/lrf_output.py @@ -19,6 +19,7 @@ class PluginWidget(Widget, Ui_Form): TITLE = _('LRF Output') HELP = _('Options specific to')+' LRF '+_('output') COMMIT_NAME = 'lrf_output' + ICON = I('mimetypes/lrf.svg') def __init__(self, parent, get_option, get_help, db=None, book_id=None): Widget.__init__(self, parent, diff --git a/src/calibre/gui2/convert/mobi_output.py b/src/calibre/gui2/convert/mobi_output.py index 7eff3b55a2..8ed2fe0e45 100644 --- a/src/calibre/gui2/convert/mobi_output.py +++ b/src/calibre/gui2/convert/mobi_output.py @@ -20,6 +20,7 @@ class PluginWidget(Widget, Ui_Form): TITLE = _('MOBI Output') HELP = _('Options specific to')+' MOBI '+_('output') COMMIT_NAME = 'mobi_output' + ICON = I('mimetypes/mobi.svg') def __init__(self, parent, get_option, get_help, db=None, book_id=None): Widget.__init__(self, parent, diff --git a/src/calibre/gui2/convert/pdb_input.py b/src/calibre/gui2/convert/pdb_input.py index 6adc49c3ed..f4d7c7e6c1 100644 --- a/src/calibre/gui2/convert/pdb_input.py +++ b/src/calibre/gui2/convert/pdb_input.py @@ -12,6 +12,7 @@ class PluginWidget(Widget, Ui_Form): TITLE = _('PDB Input') HELP = _('Options specific to')+' PDB '+_('input') COMMIT_NAME = 'pdb_input' + ICON = I('mimetypes/unknown.svg') def __init__(self, parent, get_option, get_help, db=None, book_id=None): Widget.__init__(self, parent, diff --git a/src/calibre/gui2/convert/pdb_output.py b/src/calibre/gui2/convert/pdb_output.py index 3f9d9ad3dc..69e9e6c8c2 100644 --- a/src/calibre/gui2/convert/pdb_output.py +++ b/src/calibre/gui2/convert/pdb_output.py @@ -16,6 +16,7 @@ class PluginWidget(Widget, Ui_Form): TITLE = _('PDB Output') HELP = _('Options specific to')+' PDB '+_('output') COMMIT_NAME = 'pdb_output' + ICON = I('mimetypes/unknown.svg') def __init__(self, parent, get_option, get_help, db=None, book_id=None): Widget.__init__(self, parent, ['format', 'inline_toc']) diff --git a/src/calibre/gui2/convert/pdf_input.py b/src/calibre/gui2/convert/pdf_input.py index 511091ae85..7318ad6677 100644 --- a/src/calibre/gui2/convert/pdf_input.py +++ b/src/calibre/gui2/convert/pdf_input.py @@ -12,6 +12,7 @@ class PluginWidget(Widget, Ui_Form): TITLE = _('PDF Input') HELP = _('Options specific to')+' PDF '+_('input') COMMIT_NAME = 'pdf_input' + ICON = I('mimetypes/pdf.svg') def __init__(self, parent, get_option, get_help, db=None, book_id=None): Widget.__init__(self, parent, diff --git a/src/calibre/gui2/convert/pdf_output.py b/src/calibre/gui2/convert/pdf_output.py index de0a34a508..0a6ad5bc8b 100644 --- a/src/calibre/gui2/convert/pdf_output.py +++ b/src/calibre/gui2/convert/pdf_output.py @@ -17,6 +17,7 @@ class PluginWidget(Widget, Ui_Form): TITLE = _('PDF Output') HELP = _('Options specific to')+' PDF '+_('output') COMMIT_NAME = 'pdf_output' + ICON = I('mimetypes/pdf.svg') def __init__(self, parent, get_option, get_help, db=None, book_id=None): Widget.__init__(self, parent, ['paper_size', diff --git a/src/calibre/gui2/convert/rb_output.py b/src/calibre/gui2/convert/rb_output.py index 5f8a961899..b1faac77d0 100644 --- a/src/calibre/gui2/convert/rb_output.py +++ b/src/calibre/gui2/convert/rb_output.py @@ -14,6 +14,7 @@ class PluginWidget(Widget, Ui_Form): TITLE = _('RB Output') HELP = _('Options specific to')+' RB '+_('output') COMMIT_NAME = 'rb_output' + ICON = I('mimetypes/unknown.svg') def __init__(self, parent, get_option, get_help, db=None, book_id=None): Widget.__init__(self, parent, ['inline_toc']) diff --git a/src/calibre/gui2/convert/txt_input.py b/src/calibre/gui2/convert/txt_input.py index 006c06dd00..860f0fd0d3 100644 --- a/src/calibre/gui2/convert/txt_input.py +++ b/src/calibre/gui2/convert/txt_input.py @@ -12,6 +12,7 @@ class PluginWidget(Widget, Ui_Form): TITLE = _('TXT Input') HELP = _('Options specific to')+' TXT '+_('input') COMMIT_NAME = 'txt_input' + ICON = I('mimetypes/txt.svg') def __init__(self, parent, get_option, get_help, db=None, book_id=None): Widget.__init__(self, parent, diff --git a/src/calibre/gui2/convert/txt_output.py b/src/calibre/gui2/convert/txt_output.py index 1accd08485..77f191bb03 100644 --- a/src/calibre/gui2/convert/txt_output.py +++ b/src/calibre/gui2/convert/txt_output.py @@ -16,6 +16,7 @@ class PluginWidget(Widget, Ui_Form): TITLE = _('TXT Output') HELP = _('Options specific to')+' TXT '+_('output') COMMIT_NAME = 'txt_output' + ICON = I('mimetypes/txt.svg') def __init__(self, parent, get_option, get_help, db=None, book_id=None): Widget.__init__(self, parent, diff --git a/src/calibre/gui2/preferences/conversion.py b/src/calibre/gui2/preferences/conversion.py index d9c206bd80..798e4da2a8 100644 --- a/src/calibre/gui2/preferences/conversion.py +++ b/src/calibre/gui2/preferences/conversion.py @@ -34,8 +34,6 @@ class Model(QStringListModel): class Base(ConfigWidgetBase, Ui_Form): - HAS_ICONS = False - def genesis(self, gui): log = Log() log.outputs = [] @@ -56,10 +54,8 @@ class Base(ConfigWidgetBase, Ui_Form): w.changed_signal.connect(self.changed_signal) self.stack.addWidget(w) - - #self.list.currentRowChanged.connect(self.stack.setCurrentIndex) - #self.list.setCurrentRow(0) - + self.list.currentChanged = self.category_current_changed + self.list.setCurrentIndex(self.model.index(0)) def initialize(self): ConfigWidgetBase.initialize(self) @@ -70,15 +66,16 @@ class Base(ConfigWidgetBase, Ui_Form): self.changed_signal.emit() def commit(self): - for widget in self.conversion_widgets: + for widget in self.model.widgets: if not widget.pre_commit_check(): raise AbortCommit('abort') widget.commit(save_defaults=True) return ConfigWidgetBase.commit(self) -class CommonOptions(Base): + def category_current_changed(self, n, p): + self.stack.setCurrentIndex(n.row()) - HAS_ICONS = True +class CommonOptions(Base): def load_conversion_widgets(self): self.conversion_widgets = [LookAndFeelWidget, PageSetupWidget, @@ -110,5 +107,6 @@ class OutputOptions(Base): if __name__ == '__main__': from PyQt4.Qt import QApplication app = QApplication([]) - test_widget('Conversion', 'Common Options') + test_widget('Conversion', 'Input Options') + #test_widget('Conversion', 'Common Options') diff --git a/src/calibre/gui2/preferences/conversion.ui b/src/calibre/gui2/preferences/conversion.ui index 2f4f042805..d9f335d443 100644 --- a/src/calibre/gui2/preferences/conversion.ui +++ b/src/calibre/gui2/preferences/conversion.ui @@ -65,7 +65,7 @@ QListView::TopToBottom - 20 + 10 QListView::ListMode