From 84e0dac816c40c7b04a415aff6b06b380e6f8e49 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 30 May 2009 16:37:33 -0700 Subject: [PATCH] Make welcome wizard a little more colorful --- src/calibre/ebooks/mobi/output.py | 9 +- src/calibre/ebooks/mobi/writer.py | 2 +- src/calibre/gui2/images/welcome_wizard.svg | 1712 ++++++++++++++++++++ src/calibre/gui2/wizard/__init__.py | 3 + 4 files changed, 1724 insertions(+), 2 deletions(-) create mode 100644 src/calibre/gui2/images/welcome_wizard.svg diff --git a/src/calibre/ebooks/mobi/output.py b/src/calibre/ebooks/mobi/output.py index 1c1e4795b6..c5f94b5c28 100644 --- a/src/calibre/ebooks/mobi/output.py +++ b/src/calibre/ebooks/mobi/output.py @@ -35,6 +35,11 @@ class MOBIOutput(OutputFormatPlugin): recommended_value=False, level=OptionRecommendation.LOW, help=_('Disable generation of MOBI index.') ), + OptionRecommendation(name='dont_compress', + recommended_value=False, level=OptionRecommendation.LOW, + help=_('Disable compression of the file contents.') + ), + ]) @@ -44,7 +49,8 @@ class MOBIOutput(OutputFormatPlugin): def convert(self, oeb, output_path, input_plugin, opts, log): self.log, self.opts, self.oeb = log, opts, oeb - from calibre.ebooks.mobi.writer import PALM_MAX_IMAGE_SIZE, MobiWriter + from calibre.ebooks.mobi.writer import PALM_MAX_IMAGE_SIZE, \ + MobiWriter, PALMDOC, UNCOMPRESSED from calibre.ebooks.mobi.mobiml import MobiMLizer from calibre.ebooks.oeb.transforms.manglecase import CaseMangler from calibre.ebooks.oeb.transforms.rasterize import SVGRasterizer @@ -59,6 +65,7 @@ class MOBIOutput(OutputFormatPlugin): mobimlizer = MobiMLizer(ignore_tables=opts.linearize_tables) mobimlizer(oeb, opts) writer = MobiWriter(opts, imagemax=imagemax, + compression=UNCOMPRESSED if opts.dont_compress else PALMDOC, prefer_author_sort=opts.prefer_author_sort) writer(oeb, output_path) diff --git a/src/calibre/ebooks/mobi/writer.py b/src/calibre/ebooks/mobi/writer.py index 4b747c92ab..4548ead3a5 100644 --- a/src/calibre/ebooks/mobi/writer.py +++ b/src/calibre/ebooks/mobi/writer.py @@ -307,7 +307,7 @@ class MobiWriter(object): COLLAPSE_RE = re.compile(r'[ \t\r\n\v]+') def __init__(self, opts, compression=PALMDOC, imagemax=None, - prefer_author_sort=False): + prefer_author_sort=False): self.opts = opts self._compression = compression or UNCOMPRESSED self._imagemax = imagemax or OTHER_MAX_IMAGE_SIZE diff --git a/src/calibre/gui2/images/welcome_wizard.svg b/src/calibre/gui2/images/welcome_wizard.svg new file mode 100644 index 0000000000..d8ed0e69c9 --- /dev/null +++ b/src/calibre/gui2/images/welcome_wizard.svg @@ -0,0 +1,1712 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/calibre/gui2/wizard/__init__.py b/src/calibre/gui2/wizard/__init__.py index 3e18a638aa..1a0b626fbb 100644 --- a/src/calibre/gui2/wizard/__init__.py +++ b/src/calibre/gui2/wizard/__init__.py @@ -468,6 +468,9 @@ class Wizard(QWizard): p.loadFromData(server_resources['calibre.png']) self.setPixmap(self.LogoPixmap, p.scaledToHeight(80, Qt.SmoothTransformation)) + self.setPixmap(self.WatermarkPixmap, + QPixmap(':/images/welcome_wizard.svg')) + self.setPixmap(self.BackgroundPixmap, QPixmap(':/images/wizard.svg')) self.device_page = DevicePage() self.library_page = LibraryPage() self.finish_page = FinishPage()