diff options
author | blue <playbynumbers@gmail.com> | 2014-05-18 00:59:39 +0100 |
---|---|---|
committer | Paweł Jastrzębski <pawelj@vulturis.eu> | 2014-05-29 18:28:33 +0200 |
commit | d5502e85b082fc052860126f22a3031f80bb89bb (patch) | |
tree | fcc03f83412988cc80359f59de90420e65caac1e | |
parent | Split comic2ebook.py main in two again (diff) | |
download | kcc-d5502e85b082fc052860126f22a3031f80bb89bb.tar.gz kcc-d5502e85b082fc052860126f22a3031f80bb89bb.tar.bz2 kcc-d5502e85b082fc052860126f22a3031f80bb89bb.zip |
Use makeParser() for options in KCC_gui
KCC_gui now uses comic2ebook.makeParser() and setting global variable in comic2ebook to handle options for ebook creation.
-rw-r--r-- | kcc/KCC_gui.py | 55 |
1 files changed, 35 insertions, 20 deletions
diff --git a/kcc/KCC_gui.py b/kcc/KCC_gui.py index 0e4a2e0..c9016d4 100644 --- a/kcc/KCC_gui.py +++ b/kcc/KCC_gui.py @@ -367,49 +367,64 @@ class WorkerThread(QtCore.QThread): def run(self): MW.modeConvert.emit(0) + + parser = comic2ebook.makeParser() + options, _ = parser.parse_args() + profile = GUI.profiles[str(GUI.DeviceBox.currentText())]['Label'] - argv = ["--profile=" + profile] + options.profile = profile + argv = '' currentJobs = [] + + # Basic mode settings if GUI.MangaBox.isChecked(): - argv.append("--manga-style") + options.righttoleft = True if GUI.RotateBox.isChecked(): - argv.append("--rotate") + options.roate = True if GUI.QualityBox.checkState() == 1: - argv.append("--quality=1") + options.quality = 1 elif GUI.QualityBox.checkState() == 2: - argv.append("--quality=2") + options.quality = 2 if str(GUI.FormatBox.currentText()) == 'CBZ': - argv.append("--cbz-output") + options.cbzoutput = True if GUI.currentMode == 1: if profile in ['KFHD', 'KFHD8', 'KFHDX', 'KFHDX8']: - argv.append("--upscale") + options.upscale = True + + # Advanced mode settings if GUI.currentMode > 1: if GUI.ProcessingBox.isChecked(): - argv.append("--noprocessing") + options.imgproc = False if GUI.NoRotateBox.isChecked(): - argv.append("--nosplitrotate") + options.nosplitrotate = True if GUI.UpscaleBox.checkState() == 1: - argv.append("--stretch") + options.stretch = True elif GUI.UpscaleBox.checkState() == 2: - argv.append("--upscale") + options.upscale = True if GUI.BorderBox.checkState() == 1: - argv.append("--whiteborders") + options.white_borders = True elif GUI.BorderBox.checkState() == 2: - argv.append("--blackborders") + options.black_borders = True if GUI.NoDitheringBox.isChecked(): - argv.append("--forcepng") + options.forcepng = True if GUI.WebtoonBox.isChecked(): - argv.append("--webtoon") + options.webtoon = True if float(GUI.GammaValue) > 0.09: # noinspection PyTypeChecker - argv.append("--gamma=" + GUI.GammaValue) + options.gamma = float(GUI.GammaValue) if str(GUI.FormatBox.currentText()) == 'MOBI': - argv.append("--batchsplit") + options.batchsplit = True + + # Other/custom settings. if GUI.currentMode > 2: - argv.append("--customwidth=" + str(GUI.customWidth.text())) - argv.append("--customheight=" + str(GUI.customHeight.text())) + options.customwidth = str(GUI.customWidth.text()) + options.customheight = str(GUI.customHeight.text()) if GUI.ColorBox.isChecked(): - argv.append("--forcecolor") + options.forcecolor = True + + comic2ebook.options = options + comic2ebook.checkOptions() + for i in range(GUI.JobList.count()): # Make sure that we don't consider any system message as job to do if GUI.JobList.item(i).icon().isNull(): |