From 7ceeb29fae9c99d1a09a0c627808a8541763af8e Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Sun, 17 May 2026 11:55:46 -0700 Subject: [PATCH] add 1 page landscape option (#1344) --- README.md | 1 + gui/KCC.ui | 12 +++++++++++- kindlecomicconverter/KCC_gui.py | 3 +++ kindlecomicconverter/KCC_ui.py | 11 ++++++++++- kindlecomicconverter/comic2ebook.py | 4 ++++ 5 files changed, 29 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4a89344..6ff5197 100644 --- a/README.md +++ b/README.md @@ -297,6 +297,7 @@ OUTPUT SETTINGS: -b BATCHSPLIT, --batchsplit BATCHSPLIT Split output into multiple files. 0: Don't split 1: Automatic mode 2: Consider every subdirectory as separate volume [Default=0] --spreadshift Shift first page to opposite side in landscape for two page spread alignment + --onepagelandscape Show a single centered page in landscape --norotate Do not rotate double page spreads in spread splitter option. --rotateright Rotate double page spreads in opposite direction. --rotatefirst Put rotated spread first in spread splitter option. diff --git a/gui/KCC.ui b/gui/KCC.ui index fffbe9b..17e749d 100644 --- a/gui/KCC.ui +++ b/gui/KCC.ui @@ -883,7 +883,7 @@ Ignored for Kindle EPUB/MOBI and all PDF. - + <html><head/><body><p><span style=" font-weight:600; text-decoration: underline;">Unchecked - Main Drive<br/></span>Use dedicated temporary directory on main OS drive.</p><p><span style=" font-weight:600; text-decoration: underline;">Checked - Source File Drive<br/></span>Create temporary file directory on source file drive.</p></body></html> @@ -893,6 +893,16 @@ Ignored for Kindle EPUB/MOBI and all PDF. + + + + <html><head/><body><p><span style=" font-weight:600; text-decoration: underline;">Unchecked - 2 page landscape<br/></span>2 viewports for left and right pages</p><p><span style=" font-weight:600; text-decoration: underline;">Checked - 1 page landscape<br/></span>A single centered viewport for 1 page</p></body></html> + + + 1 Page Landscape + + + diff --git a/kindlecomicconverter/KCC_gui.py b/kindlecomicconverter/KCC_gui.py index 802b73d..dde7f0d 100644 --- a/kindlecomicconverter/KCC_gui.py +++ b/kindlecomicconverter/KCC_gui.py @@ -344,6 +344,8 @@ class WorkerThread(QThread): options.tempdir = True if GUI.spreadShiftBox.isChecked(): options.spreadshift = True + if GUI.onePageLandscapeBox.isChecked(): + options.onepagelandscape = True if GUI.fileFusionBox.isChecked(): options.filefusion = True else: @@ -1097,6 +1099,7 @@ class KCCGUI(KCC_ui.Ui_mainWindow): 'deleteBox': GUI.deleteBox.checkState(), 'tempDirBox': GUI.tempDirBox.checkState(), 'spreadShiftBox': GUI.spreadShiftBox.checkState(), + 'onePageLandscapeBox': GUI.onePageLandscapeBox.checkState(), 'fileFusionBox': GUI.fileFusionBox.checkState(), 'defaultOutputFolderBox': GUI.defaultOutputFolderBox.checkState(), 'noRotateBox': GUI.noRotateBox.checkState(), diff --git a/kindlecomicconverter/KCC_ui.py b/kindlecomicconverter/KCC_ui.py index c762dab..525fdb2 100644 --- a/kindlecomicconverter/KCC_ui.py +++ b/kindlecomicconverter/KCC_ui.py @@ -453,7 +453,12 @@ class Ui_mainWindow(object): self.tempDirBox = QCheckBox(self.optionWidget) self.tempDirBox.setObjectName(u"tempDirBox") - self.gridLayout_2.addWidget(self.tempDirBox, 12, 1, 1, 1) + self.gridLayout_2.addWidget(self.tempDirBox, 12, 2, 1, 1) + + self.onePageLandscapeBox = QCheckBox(self.optionWidget) + self.onePageLandscapeBox.setObjectName(u"onePageLandscapeBox") + + self.gridLayout_2.addWidget(self.onePageLandscapeBox, 12, 1, 1, 1) self.gridLayout.addWidget(self.optionWidget, 5, 0, 1, 2) @@ -828,6 +833,10 @@ class Ui_mainWindow(object): self.tempDirBox.setToolTip(QCoreApplication.translate("mainWindow", u"

Unchecked - Main Drive
Use dedicated temporary directory on main OS drive.

Checked - Source File Drive
Create temporary file directory on source file drive.

", None)) #endif // QT_CONFIG(tooltip) self.tempDirBox.setText(QCoreApplication.translate("mainWindow", u"Temp Directory", None)) +#if QT_CONFIG(tooltip) + self.onePageLandscapeBox.setToolTip(QCoreApplication.translate("mainWindow", u"

Unchecked - 2 page landscape
2 viewports for left and right pages

Checked - 1 page landscape
A single centered viewport for 1 page

", None)) +#endif // QT_CONFIG(tooltip) + self.onePageLandscapeBox.setText(QCoreApplication.translate("mainWindow", u"1 Page Landscape", None)) #if QT_CONFIG(tooltip) self.convertButton.setToolTip(QCoreApplication.translate("mainWindow", u"

Shift+Click to select the output directory for this list.

", None)) #endif // QT_CONFIG(tooltip) diff --git a/kindlecomicconverter/comic2ebook.py b/kindlecomicconverter/comic2ebook.py index 64667fc..28744d0 100755 --- a/kindlecomicconverter/comic2ebook.py +++ b/kindlecomicconverter/comic2ebook.py @@ -469,6 +469,8 @@ def buildOPF(dstdir, title, filelist, originalpath, cover=None): pageside = "right" for entry, prop in zip(reflist, page_spread_property_list): + if options.onepagelandscape: + prop = 'center' f.write(f'\n') f.write("\n\n") @@ -1456,6 +1458,8 @@ def makeParser(): "2: Consider every subdirectory as separate volume [Default=0]") output_options.add_argument("--spreadshift", action="store_true", dest="spreadshift", default=False, help="Shift first page to opposite side in landscape for spread alignment") + output_options.add_argument("--onepagelandscape", action="store_true", dest="onepagelandscape", default=False, + help="Show a single centered page in landscape") output_options.add_argument("--norotate", action="store_true", dest="norotate", default=False, help="Do not rotate double page spreads in spread splitter option.") output_options.add_argument("--rotateright", action="store_true", dest="rotateright", default=False,