From 431cb73e619e1554dffe26b9a1be6fb34ea1248e Mon Sep 17 00:00:00 2001 From: Paweł Jastrzębski Date: Wed, 18 Sep 2013 12:21:05 +0200 Subject: GUI tweaks --- KCC-OSX.ui | 8 ++++---- KCC.ui | 2 +- kcc/KCC_gui.py | 28 +++++++++++++++++++++------- kcc/KCC_ui.py | 4 ++-- kcc/KCC_ui_osx.py | 10 +++++----- 5 files changed, 33 insertions(+), 19 deletions(-) diff --git a/KCC-OSX.ui b/KCC-OSX.ui index 33db33c..b4f690d 100644 --- a/KCC-OSX.ui +++ b/KCC-OSX.ui @@ -88,7 +88,7 @@ Qt::NoFocus - <html><head/><body><p><span style=" font-weight:600; text-decoration: underline;">Unchecked - Nothing<br/></span>Images smaller than device resolution will not be resized.</p><p><span style=" font-weight:600; text-decoration: underline;">Indeterminate - Stretching<br/></span>Images smaller than device resolution will be resized. Aspect ratio will be not preserved.</p><p><span style=" font-weight:600; text-decoration: underline;">Checked - Upscaling<br/></span>Images smaller than device resolution will be resized. Aspect ratio will be preserved.</p></body></html> + <html><head/><body><p><span style=" font-size:12pt; font-weight:600; text-decoration: underline;">Unchecked - Nothing<br/></span><span style=" font-size:12pt;">Images smaller than device resolution will not be resized.</span></p><p><span style=" font-size:12pt; font-weight:600; text-decoration: underline;">Indeterminate - Stretching<br/></span><span style=" font-size:12pt;">Images smaller than device resolution will be resized. Aspect ratio will be not preserved.</span></p><p><span style=" font-size:12pt; font-weight:600; text-decoration: underline;">Checked - Upscaling<br/></span><span style=" font-size:12pt;">Images smaller than device resolution will be resized. Aspect ratio will be preserved.</span></p></body></html> Stretch/Upscale @@ -109,7 +109,7 @@ Qt::NoFocus - <html><head/><body><p>Enable auto-splitting of webtoons like <span style=" font-style:italic;">Tower of God</span> or <span style=" font-style:italic;">Noblesse</span>.<br/>Pages with a low width, high height and vertical panel flow.</p></body></html> + <html><head/><body><p><span style=" font-size:12pt;">Enable auto-splitting of webtoons like </span><span style=" font-size:12pt; font-style:italic;">Tower of God</span><span style=" font-size:12pt;"> or </span><span style=" font-size:12pt; font-style:italic;">Noblesse</span><span style=" font-size:12pt;">.<br/>Pages with a low width, high height and vertical panel flow.</span></p></body></html> Webtoon mode @@ -127,7 +127,7 @@ Qt::NoFocus - <html><head/><body><p><span style=" font-size:12pt;">Create PNG files instead JPEG.<br/></span><span style=" font-size:12pt; font-weight:600;">Only for non-Kindle devices!</span></p></body></html> + <html><head/><body><p><span style=" font-size:12pt;">Create PNG files instead JPEG.</span></p></body></html> PNG output @@ -145,7 +145,7 @@ Qt::NoFocus - <html><head/><body><p><span style=" font-weight:600; text-decoration: underline;">Unchecked - Autodetection<br/></span>Color of margins fill will be detected automatically.</p><p><span style=" font-weight:600; text-decoration: underline;">Indeterminate - White<br/></span>Margins will be filled with white color.</p><p><span style=" font-weight:600; text-decoration: underline;">Checked - Black<br/></span>Margins will be filled with black color.</p></body></html> + <html><head/><body><p><span style=" font-size:12pt; font-weight:600; text-decoration: underline;">Unchecked - Autodetection<br/></span><span style=" font-size:12pt;">Color of margins fill will be detected automatically.</span></p><p><span style=" font-size:12pt; font-weight:600; text-decoration: underline;">Indeterminate - White<br/></span><span style=" font-size:12pt;">Margins will be filled with white color.</span></p><p><span style=" font-size:12pt; font-weight:600; text-decoration: underline;">Checked - Black<br/></span><span style=" font-size:12pt;">Margins will be filled with black color.</span></p></body></html> W/B margins diff --git a/KCC.ui b/KCC.ui index a627a2d..9d90feb 100644 --- a/KCC.ui +++ b/KCC.ui @@ -110,7 +110,7 @@ Qt::NoFocus - <html><head/><body><p>Create PNG files instead JPEG.<br/><span style=" font-weight:600;">Only for non-Kindle devices!</span></p></body></html> + <html><head/><body><p>Create PNG files instead JPEG.</p></body></html> PNG output diff --git a/kcc/KCC_gui.py b/kcc/KCC_gui.py index 1f6e289..fda5a2e 100644 --- a/kcc/KCC_gui.py +++ b/kcc/KCC_gui.py @@ -440,15 +440,12 @@ class Ui_KCC(object): GUI.NoRotateBox.setChecked(True) GUI.QualityBox.setEnabled(False) GUI.QualityBox.setChecked(False) - GUI.BorderBox.setEnabled(False) - GUI.BorderBox.setChecked(False) GUI.MangaBox.setEnabled(False) GUI.MangaBox.setChecked(False) self.addMessage('If images are color setting Gamma to 1.0 is recommended.', 'info') else: GUI.NoRotateBox.setEnabled(True) GUI.QualityBox.setEnabled(True) - GUI.BorderBox.setEnabled(True) GUI.MangaBox.setEnabled(True) def toggleNoSplitRotate(self, value): @@ -477,7 +474,13 @@ class Ui_KCC(object): GUI.QualityBox.setCheckState(0) GUI.QualityBox.setEnabled(False) else: - GUI.QualityBox.setEnabled(True) + if not GUI.WebtoonBox.isChecked(): + GUI.QualityBox.setEnabled(True) + if not value in [8]: + GUI.NoDitheringBox.setCheckState(0) + GUI.NoDitheringBox.setEnabled(False) + else: + GUI.NoDitheringBox.setEnabled(True) def stripTags(self, html): s = HTMLStripper() @@ -549,10 +552,12 @@ class Ui_KCC(object): event.ignore() if not GUI.ConvertButton.isEnabled(): event.ignore() + self.settings.setValue('settingsVersion', __version__) self.settings.setValue('lastPath', self.lastPath) self.settings.setValue('lastDevice', GUI.DeviceBox.currentIndex()) self.settings.setValue('currentFormat', GUI.FormatBox.currentIndex()) self.settings.setValue('currentMode', self.currentMode) + self.settings.setValue('firstStart', False) self.settings.setValue('options', QtCore.QVariant({'MangaBox': GUI.MangaBox.checkState(), 'RotateBox': GUI.RotateBox.checkState(), 'QualityBox': GUI.QualityBox.checkState(), @@ -572,12 +577,20 @@ class Ui_KCC(object): global GUI, MainWindow GUI = UI MainWindow = KCC + # User settings will be reverted to default ones if were created in one of the following versions + # Empty string cover all versions before this system was implemented + purgeSettingsVersions = [''] self.icons = Icons() self.settings = QtCore.QSettings('KindleComicConverter', 'KindleComicConverter') + self.settingsVersion = self.settings.value('settingsVersion', '', type=str) + if self.settingsVersion in purgeSettingsVersions: + QtCore.QSettings.clear(self.settings) + self.settingsVersion = self.settings.value('settingsVersion', '', type=str) self.lastPath = self.settings.value('lastPath', '', type=str) - self.lastDevice = self.settings.value('lastDevice', 10, type=int) + self.lastDevice = self.settings.value('lastDevice', 0, type=int) self.currentMode = self.settings.value('currentMode', 1, type=int) self.currentFormat = self.settings.value('currentFormat', 0, type=int) + self.firstStart = self.settings.value('firstStart', True, type=bool) self.options = self.settings.value('options', QtCore.QVariant({'GammaSlider': 0})) self.options = self.options.toPyObject() self.worker = WorkerThread(self) @@ -587,6 +600,9 @@ class Ui_KCC(object): self.addMessage('Welcome!', 'info') self.addMessage('Remember: All options have additional informations in tooltips.', 'info') + if self.firstStart: + self.addMessage('Since you are using KCC for first time please see few ' + 'important tips.', 'info') if call('kindlegen -locale en', stdout=PIPE, stderr=STDOUT, shell=True) == 0: self.KindleGen = True formats = ['MOBI', 'EPUB', 'CBZ'] @@ -660,8 +676,6 @@ class Ui_KCC(object): elif str(option) == "GammaSlider": GUI.GammaSlider.setValue(int(self.options[option])) self.changeGamma(int(self.options[option])) - elif str(option) == "StretchBox" or str(option) == "WebstripBox": - pass else: eval('GUI.' + str(option)).setCheckState(self.options[option]) if self.currentMode == 1: diff --git a/kcc/KCC_ui.py b/kcc/KCC_ui.py index 2fd98d8..a997ead 100644 --- a/kcc/KCC_ui.py +++ b/kcc/KCC_ui.py @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'KCC.ui' # -# Created: Sun Sep 15 16:18:37 2013 +# Created: Wed Sep 18 12:12:45 2013 # by: PyQt4 UI code generator 4.10.3 # # WARNING! All changes made in this file will be lost! @@ -269,7 +269,7 @@ class Ui_KCC(object): self.UpscaleBox.setText(_translate("KCC", "Stretch/Upscale", None)) self.WebtoonBox.setToolTip(_translate("KCC", "

Enable auto-splitting of webtoons like Tower of God or Noblesse.
Pages with a low width, high height and vertical panel flow.

", None)) self.WebtoonBox.setText(_translate("KCC", "Webtoon mode", None)) - self.NoDitheringBox.setToolTip(_translate("KCC", "

Create PNG files instead JPEG.
Only for non-Kindle devices!

", None)) + self.NoDitheringBox.setToolTip(_translate("KCC", "

Create PNG files instead JPEG.

", None)) self.NoDitheringBox.setText(_translate("KCC", "PNG output", None)) self.BorderBox.setToolTip(_translate("KCC", "

Unchecked - Autodetection
Color of margins fill will be detected automatically.

Indeterminate - White
Margins will be filled with white color.

Checked - Black
Margins will be filled with black color.

", None)) self.BorderBox.setText(_translate("KCC", "W/B margins", None)) diff --git a/kcc/KCC_ui_osx.py b/kcc/KCC_ui_osx.py index 84474e5..8102940 100644 --- a/kcc/KCC_ui_osx.py +++ b/kcc/KCC_ui_osx.py @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'KCC-OSX.ui' # -# Created: Sun Sep 15 16:18:48 2013 +# Created: Wed Sep 18 12:13:05 2013 # by: PyQt4 UI code generator 4.10.3 # # WARNING! All changes made in this file will be lost! @@ -323,13 +323,13 @@ class Ui_KCC(object): KCC.setWindowTitle(_translate("KCC", "Kindle Comic Converter", None)) self.ProcessingBox.setToolTip(_translate("KCC", "

Disable image optimizations.

", None)) self.ProcessingBox.setText(_translate("KCC", "No optimisation", None)) - self.UpscaleBox.setToolTip(_translate("KCC", "

Unchecked - Nothing
Images smaller than device resolution will not be resized.

Indeterminate - Stretching
Images smaller than device resolution will be resized. Aspect ratio will be not preserved.

Checked - Upscaling
Images smaller than device resolution will be resized. Aspect ratio will be preserved.

", None)) + self.UpscaleBox.setToolTip(_translate("KCC", "

Unchecked - Nothing
Images smaller than device resolution will not be resized.

Indeterminate - Stretching
Images smaller than device resolution will be resized. Aspect ratio will be not preserved.

Checked - Upscaling
Images smaller than device resolution will be resized. Aspect ratio will be preserved.

", None)) self.UpscaleBox.setText(_translate("KCC", "Stretch/Upscale", None)) - self.WebtoonBox.setToolTip(_translate("KCC", "

Enable auto-splitting of webtoons like Tower of God or Noblesse.
Pages with a low width, high height and vertical panel flow.

", None)) + self.WebtoonBox.setToolTip(_translate("KCC", "

Enable auto-splitting of webtoons like Tower of God or Noblesse.
Pages with a low width, high height and vertical panel flow.

", None)) self.WebtoonBox.setText(_translate("KCC", "Webtoon mode", None)) - self.NoDitheringBox.setToolTip(_translate("KCC", "

Create PNG files instead JPEG.
Only for non-Kindle devices!

", None)) + self.NoDitheringBox.setToolTip(_translate("KCC", "

Create PNG files instead JPEG.

", None)) self.NoDitheringBox.setText(_translate("KCC", "PNG output", None)) - self.BorderBox.setToolTip(_translate("KCC", "

Unchecked - Autodetection
Color of margins fill will be detected automatically.

Indeterminate - White
Margins will be filled with white color.

Checked - Black
Margins will be filled with black color.

", None)) + self.BorderBox.setToolTip(_translate("KCC", "

Unchecked - Autodetection
Color of margins fill will be detected automatically.

Indeterminate - White
Margins will be filled with white color.

Checked - Black
Margins will be filled with black color.

", None)) self.BorderBox.setText(_translate("KCC", "W/B margins", None)) self.NoRotateBox.setToolTip(_translate("KCC", "

Disable splitting and rotation.

", None)) self.NoRotateBox.setText(_translate("KCC", "No split/rotate", None)) -- cgit 1.4.1