From 99405ab8a601a93777c9ce404e6e1edca1c90c18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Wed, 18 Jun 2014 09:59:41 +0200 Subject: [PATCH] Disabled ultra quality mode for CBZ format --- kcc/KCC_gui.py | 13 ++++++++++--- kcc/comic2ebook.py | 3 +++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/kcc/KCC_gui.py b/kcc/KCC_gui.py index 1161491..2ff0e93 100644 --- a/kcc/KCC_gui.py +++ b/kcc/KCC_gui.py @@ -829,6 +829,9 @@ class KCCGUI(KCC_ui.Ui_KCC): if value == 2 and 'Kobo' in str(GUI.DeviceBox.currentText()): self.addMessage('Kobo devices can\'t use ultra quality mode!', 'warning') GUI.QualityBox.setCheckState(0) + elif value == 2 and 'CBZ' in str(GUI.FormatBox.currentText()): + self.addMessage('CBZ format don\'t support ultra quality mode!', 'warning') + GUI.QualityBox.setCheckState(0) def changeGamma(self, value): value = float(value) @@ -856,7 +859,7 @@ class KCCGUI(KCC_ui.Ui_KCC): GUI.AdvModeButton.setEnabled(True) if self.currentMode == 3: self.modeBasic() - self.changeFormat() + self.changeFormat(event=False) GUI.GammaSlider.setValue(0) self.changeGamma(0) if profile['DefaultUpscale']: @@ -865,7 +868,7 @@ class KCCGUI(KCC_ui.Ui_KCC): self.addMessage('' 'List of supported Non-Kindle devices.', 'info') - def changeFormat(self, outputFormat=None): + def changeFormat(self, outputFormat=None, event=True): profile = GUI.profiles[str(GUI.DeviceBox.currentText())] if outputFormat is not None: GUI.FormatBox.setCurrentIndex(outputFormat) @@ -890,6 +893,10 @@ class KCCGUI(KCC_ui.Ui_KCC): if GUI.ProcessingBox.isChecked(): GUI.QualityBox.setEnabled(False) GUI.QualityBox.setChecked(False) + if event and GUI.QualityBox.isEnabled() and 'CBZ' in str(GUI.FormatBox.currentText()) and\ + GUI.QualityBox.checkState() == 2: + self.addMessage('CBZ format don\'t support ultra quality mode!', 'warning') + GUI.QualityBox.setCheckState(0) def stripTags(self, html): s = HTMLStripper() @@ -1277,7 +1284,7 @@ class KCCGUI(KCC_ui.Ui_KCC): GUI.DeviceBox.setCurrentIndex(self.lastDevice) self.changeDevice() if self.currentFormat != self.profiles[str(GUI.DeviceBox.currentText())]['DefaultFormat']: - self.changeFormat(self.currentFormat) + self.changeFormat(self.currentFormat, False) for option in self.options: if str(option) == "customWidth": GUI.customWidth.setText(str(self.options[option])) diff --git a/kcc/comic2ebook.py b/kcc/comic2ebook.py index 81145b5..1316cb0 100755 --- a/kcc/comic2ebook.py +++ b/kcc/comic2ebook.py @@ -1015,6 +1015,9 @@ def checkOptions(): # CBZ files on Kindle DX/DXG support higher resolution if options.profile == 'KDX' and options.cbzoutput: options.customheight = 1200 + # Ultra mode don't work with CBZ format + if options.quality == 2 and options.cbzoutput: + options.quality = 1 # Override profile data if options.customwidth != 0 or options.customheight != 0: X = image.ProfileData.Profiles[options.profile][1][0]