diff --git a/.gitignore b/.gitignore index f2c69be..24db16d 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ dist kindlegen* .DS_Store Thumbs.db +UnRAR.exe diff --git a/KCC-OSX.ui b/KCC-OSX.ui index fc8eca0..dbe63ec 100644 --- a/KCC-OSX.ui +++ b/KCC-OSX.ui @@ -88,15 +88,18 @@ Qt::NoFocus - <html><head/><body><p><span style=" font-size:12pt;">Enable image upscaling.<br/>Aspect ratio will be preserved.</span></p></body></html> + <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> - Upscale images + Stretch/Upscale + + + true - + 11 @@ -106,10 +109,10 @@ Qt::NoFocus - <html><head/><body><p><span style=" font-size:12pt;">Enable image stretching.<br/>Aspect ratio will be not preserved.</span></p></body></html> + <html><head/><body><p><span style=" font-weight:600;">EXPERIMENTAL!<br/></span>Enable auto-splitting of webstrips like <span style=" font-style:italic;">Tower of God</span> or <span style=" font-style:italic;">Noblesse</span>.<br/>Files with a low width, high height and vertical panel flow.</p></body></html> - Stretch images + Webstrip mode diff --git a/KCC.ui b/KCC.ui index bb5b149..3ec6959 100644 --- a/KCC.ui +++ b/KCC.ui @@ -81,23 +81,26 @@ Qt::NoFocus - <html><head/><body><p>Enable image upscaling.<br/>Aspect ratio will be preserved.</p></body></html> + <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> - Upscale images + Stretch/Upscale + + + true - + Qt::NoFocus - <html><head/><body><p>Enable image stretching.<br/>Aspect ratio will be not preserved.</p></body></html> + <html><head/><body><p><span style=" font-weight:600;">EXPERIMENTAL!<br/></span>Enable auto-splitting of webstrips like <span style=" font-style:italic;">Tower of God</span> or <span style=" font-style:italic;">Noblesse</span>.<br/>Files with a low width, high height and vertical panel flow.</p></body></html> - Stretch images + Webstrip mode diff --git a/kcc/KCC_gui.py b/kcc/KCC_gui.py index 11b9bdc..636476d 100644 --- a/kcc/KCC_gui.py +++ b/kcc/KCC_gui.py @@ -128,16 +128,18 @@ class WorkerThread(QtCore.QThread): if self.parent.currentMode > 1: if GUI.ProcessingBox.isChecked(): argv.append("--noprocessing") - if GUI.UpscaleBox.isChecked(): - argv.append("--upscale") if GUI.NoRotateBox.isChecked(): argv.append("--nosplitrotate") if GUI.BorderBox.isChecked(): argv.append("--blackborders") - if GUI.StretchBox.isChecked(): + if GUI.UpscaleBox.checkState() == 1: argv.append("--stretch") + elif GUI.UpscaleBox.checkState() == 2: + argv.append("--upscale") if GUI.NoDitheringBox.isChecked(): argv.append("--forcepng") + if GUI.WebstripBox.isChecked(): + argv.append("--webstrip") if float(self.parent.GammaValue) > 0.09: argv.append("--gamma=" + self.parent.GammaValue) if str(GUI.FormatBox.currentText()) == 'CBZ': @@ -426,6 +428,19 @@ class Ui_KCC(object): GUI.GammaLabel.setText('Gamma: ' + str(value)) self.GammaValue = value + def toggleWebstripBox(self, value): + if value: + GUI.RotateBox.setEnabled(False) + GUI.RotateBox.setChecked(True) + GUI.QualityBox.setEnabled(False) + GUI.QualityBox.setChecked(False) + GUI.BorderBox.setEnabled(False) + GUI.BorderBox.setChecked(False) + else: + GUI.RotateBox.setEnabled(True) + GUI.QualityBox.setEnabled(True) + GUI.BorderBox.setEnabled(True) + def toggleNoSplitRotate(self, value): if value: GUI.RotateBox.setEnabled(False) @@ -433,14 +448,6 @@ class Ui_KCC(object): else: GUI.RotateBox.setEnabled(True) - def toggleUpscale(self, value): - if value: - GUI.StretchBox.setChecked(False) - - def toggleStretch(self, value): - if value: - GUI.UpscaleBox.setChecked(False) - def changeDevice(self, value): if value == 12: GUI.BasicModeButton.setEnabled(False) @@ -491,7 +498,6 @@ class Ui_KCC(object): def updateProgressbar(self, new=False, status=False): if new == "status": - pass GUI.ProgressBar.setFormat(status) elif new: GUI.ProgressBar.setMaximum(new - 1) @@ -537,7 +543,7 @@ class Ui_KCC(object): 'UpscaleBox': GUI.UpscaleBox.checkState(), 'NoRotateBox': GUI.NoRotateBox.checkState(), 'BorderBox': GUI.BorderBox.checkState(), - 'StretchBox': GUI.StretchBox.checkState(), + 'WebstripBox': GUI.WebstripBox.checkState(), 'NoDitheringBox': GUI.NoDitheringBox.checkState(), 'ColorBox': GUI.ColorBox.checkState(), 'customWidth': GUI.customWidth.text(), @@ -599,8 +605,7 @@ class Ui_KCC(object): GUI.ConvertButton.clicked.connect(self.convertStart) GUI.GammaSlider.valueChanged.connect(self.changeGamma) GUI.NoRotateBox.stateChanged.connect(self.toggleNoSplitRotate) - GUI.UpscaleBox.stateChanged.connect(self.toggleUpscale) - GUI.StretchBox.stateChanged.connect(self.toggleStretch) + GUI.WebstripBox.stateChanged.connect(self.toggleWebstripBox) GUI.DeviceBox.activated.connect(self.changeDevice) KCC.connect(self.worker, QtCore.SIGNAL("progressBarTick"), self.updateProgressbar) KCC.connect(self.worker, QtCore.SIGNAL("modeConvert"), self.modeConvert) @@ -633,6 +638,8 @@ 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": + 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 bcbbb29..53e8cf9 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: Thu Jul 04 15:30:15 2013 +# Created: Mon Aug 12 13:54:39 2013 # by: PyQt4 UI code generator 4.10.2 # # WARNING! All changes made in this file will be lost! @@ -55,12 +55,13 @@ class Ui_KCC(object): self.gridLayout.addWidget(self.ProcessingBox, 1, 0, 1, 1) self.UpscaleBox = QtGui.QCheckBox(self.OptionsAdvanced) self.UpscaleBox.setFocusPolicy(QtCore.Qt.NoFocus) + self.UpscaleBox.setTristate(True) self.UpscaleBox.setObjectName(_fromUtf8("UpscaleBox")) self.gridLayout.addWidget(self.UpscaleBox, 1, 1, 1, 1) - self.StretchBox = QtGui.QCheckBox(self.OptionsAdvanced) - self.StretchBox.setFocusPolicy(QtCore.Qt.NoFocus) - self.StretchBox.setObjectName(_fromUtf8("StretchBox")) - self.gridLayout.addWidget(self.StretchBox, 3, 1, 1, 1) + self.WebstripBox = QtGui.QCheckBox(self.OptionsAdvanced) + self.WebstripBox.setFocusPolicy(QtCore.Qt.NoFocus) + self.WebstripBox.setObjectName(_fromUtf8("WebstripBox")) + self.gridLayout.addWidget(self.WebstripBox, 3, 1, 1, 1) self.NoDitheringBox = QtGui.QCheckBox(self.OptionsAdvanced) self.NoDitheringBox.setFocusPolicy(QtCore.Qt.NoFocus) self.NoDitheringBox.setObjectName(_fromUtf8("NoDitheringBox")) @@ -263,10 +264,10 @@ 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", "

Enable image upscaling.
Aspect ratio will be preserved.

", None)) - self.UpscaleBox.setText(_translate("KCC", "Upscale images", None)) - self.StretchBox.setToolTip(_translate("KCC", "

Enable image stretching.
Aspect ratio will be not preserved.

", None)) - self.StretchBox.setText(_translate("KCC", "Stretch images", 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.WebstripBox.setToolTip(_translate("KCC", "

EXPERIMENTAL!
Enable auto-splitting of webstrips like Tower of God or Noblesse.
Files with a low width, high height and vertical panel flow.

", None)) + self.WebstripBox.setText(_translate("KCC", "Webstrip mode", None)) self.NoDitheringBox.setToolTip(_translate("KCC", "

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

", None)) self.NoDitheringBox.setText(_translate("KCC", "PNG output", None)) self.BorderBox.setToolTip(_translate("KCC", "Fill space around images with black color.", None)) diff --git a/kcc/KCC_ui_osx.py b/kcc/KCC_ui_osx.py index 8f218c1..090139b 100644 --- a/kcc/KCC_ui_osx.py +++ b/kcc/KCC_ui_osx.py @@ -2,8 +2,8 @@ # Form implementation generated from reading ui file 'KCC-OSX.ui' # -# Created: Fri Jun 21 18:23:35 2013 -# by: PyQt4 UI code generator 4.10.1 +# Created: Mon Aug 12 13:54:37 2013 +# by: PyQt4 UI code generator 4.10.2 # # WARNING! All changes made in this file will be lost! @@ -60,15 +60,16 @@ class Ui_KCC(object): font.setPointSize(11) self.UpscaleBox.setFont(font) self.UpscaleBox.setFocusPolicy(QtCore.Qt.NoFocus) + self.UpscaleBox.setTristate(True) self.UpscaleBox.setObjectName(_fromUtf8("UpscaleBox")) self.gridLayout.addWidget(self.UpscaleBox, 1, 1, 1, 1) - self.StretchBox = QtGui.QCheckBox(self.OptionsAdvanced) + self.WebstripBox = QtGui.QCheckBox(self.OptionsAdvanced) font = QtGui.QFont() font.setPointSize(11) - self.StretchBox.setFont(font) - self.StretchBox.setFocusPolicy(QtCore.Qt.NoFocus) - self.StretchBox.setObjectName(_fromUtf8("StretchBox")) - self.gridLayout.addWidget(self.StretchBox, 3, 1, 1, 1) + self.WebstripBox.setFont(font) + self.WebstripBox.setFocusPolicy(QtCore.Qt.NoFocus) + self.WebstripBox.setObjectName(_fromUtf8("WebstripBox")) + self.gridLayout.addWidget(self.WebstripBox, 3, 1, 1, 1) self.NoDitheringBox = QtGui.QCheckBox(self.OptionsAdvanced) font = QtGui.QFont() font.setPointSize(11) @@ -321,10 +322,10 @@ 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", "

Enable image upscaling.
Aspect ratio will be preserved.

", None)) - self.UpscaleBox.setText(_translate("KCC", "Upscale images", None)) - self.StretchBox.setToolTip(_translate("KCC", "

Enable image stretching.
Aspect ratio will be not preserved.

", None)) - self.StretchBox.setText(_translate("KCC", "Stretch images", 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.WebstripBox.setToolTip(_translate("KCC", "

EXPERIMENTAL!
Enable auto-splitting of webstrips like Tower of God or Noblesse.
Files with a low width, high height and vertical panel flow.

", None)) + self.WebstripBox.setText(_translate("KCC", "Webstrip mode", None)) self.NoDitheringBox.setToolTip(_translate("KCC", "

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

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

Fill space around images with black color.

", None))