1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-17 11:41:47 +00:00

import CheckedState

This commit is contained in:
Alexander Xu
2023-06-30 10:39:19 -07:00
parent ada3232a0a
commit b51c87e3bc

View File

@@ -27,6 +27,7 @@ from shutil import move, rmtree
from subprocess import STDOUT, PIPE from subprocess import STDOUT, PIPE
# noinspection PyUnresolvedReferences # noinspection PyUnresolvedReferences
from PySide6 import QtGui, QtCore, QtWidgets, QtNetwork from PySide6 import QtGui, QtCore, QtWidgets, QtNetwork
from PySide6.QtCore import Qt
from xml.sax.saxutils import escape from xml.sax.saxutils import escape
from psutil import Popen, Process from psutil import Popen, Process
from copy import copy from copy import copy
@@ -222,28 +223,28 @@ class WorkerThread(QtCore.QThread):
options.format = gui_current_format options.format = gui_current_format
if GUI.mangaBox.isChecked(): if GUI.mangaBox.isChecked():
options.righttoleft = True options.righttoleft = True
if GUI.rotateBox.checkState() == QtCore.Qt.CheckState.PartiallyChecked: if GUI.rotateBox.checkState() == Qt.CheckState.PartiallyChecked:
options.splitter = 2 options.splitter = 2
elif GUI.rotateBox.checkState() == QtCore.Qt.CheckState.Checked: elif GUI.rotateBox.checkState() == Qt.CheckState.Checked:
options.splitter = 1 options.splitter = 1
if GUI.qualityBox.checkState() == QtCore.Qt.CheckState.PartiallyChecked: if GUI.qualityBox.checkState() == Qt.CheckState.PartiallyChecked:
options.autoscale = True options.autoscale = True
elif GUI.qualityBox.checkState() == QtCore.Qt.CheckState.Checked: elif GUI.qualityBox.checkState() == Qt.CheckState.Checked:
options.hq = True options.hq = True
if GUI.webtoonBox.isChecked(): if GUI.webtoonBox.isChecked():
options.webtoon = True options.webtoon = True
if GUI.upscaleBox.checkState() == QtCore.Qt.CheckState.PartiallyChecked: if GUI.upscaleBox.checkState() == Qt.CheckState.PartiallyChecked:
options.stretch = True options.stretch = True
elif GUI.upscaleBox.checkState() == QtCore.Qt.CheckState.Checked: elif GUI.upscaleBox.checkState() == Qt.CheckState.Checked:
options.upscale = True options.upscale = True
if GUI.gammaBox.isChecked() and float(GUI.gammaValue) > 0.09: if GUI.gammaBox.isChecked() and float(GUI.gammaValue) > 0.09:
options.gamma = float(GUI.gammaValue) options.gamma = float(GUI.gammaValue)
options.cropping = GUI.croppingBox.checkState().value options.cropping = GUI.croppingBox.checkState().value
if GUI.croppingBox.checkState() != QtCore.Qt.CheckState.Unchecked: if GUI.croppingBox.checkState() != Qt.CheckState.Unchecked:
options.croppingp = float(GUI.croppingPowerValue) options.croppingp = float(GUI.croppingPowerValue)
if GUI.borderBox.checkState() == QtCore.Qt.CheckState.PartiallyChecked: if GUI.borderBox.checkState() == Qt.CheckState.PartiallyChecked:
options.white_borders = True options.white_borders = True
elif GUI.borderBox.checkState() == QtCore.Qt.CheckState.Checked: elif GUI.borderBox.checkState() == Qt.CheckState.Checked:
options.black_borders = True options.black_borders = True
if GUI.outputSplit.isChecked(): if GUI.outputSplit.isChecked():
options.batchsplit = 2 options.batchsplit = 2
@@ -255,9 +256,9 @@ class WorkerThread(QtCore.QThread):
options.noprocessing = True options.noprocessing = True
if GUI.deleteBox.isChecked(): if GUI.deleteBox.isChecked():
options.delete = True options.delete = True
if GUI.mozJpegBox.checkState() == QtCore.Qt.CheckState.PartiallyChecked: if GUI.mozJpegBox.checkState() == Qt.CheckState.PartiallyChecked:
options.forcepng = True options.forcepng = True
elif GUI.mozJpegBox.checkState() == QtCore.Qt.CheckState.Checked: elif GUI.mozJpegBox.checkState() == Qt.CheckState.Checked:
options.mozjpeg = True options.mozjpeg = True
if GUI.currentMode > 2: if GUI.currentMode > 2:
options.customwidth = str(GUI.widthBox.value()) options.customwidth = str(GUI.widthBox.value())