mirror of
https://github.com/ciromattia/kcc
synced 2026-10-04 00:22:31 +00:00
add 1 page landscape option (#1344)
This commit is contained in:
@@ -297,6 +297,7 @@ OUTPUT SETTINGS:
|
|||||||
-b BATCHSPLIT, --batchsplit BATCHSPLIT
|
-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]
|
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
|
--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.
|
--norotate Do not rotate double page spreads in spread splitter option.
|
||||||
--rotateright Rotate double page spreads in opposite direction.
|
--rotateright Rotate double page spreads in opposite direction.
|
||||||
--rotatefirst Put rotated spread first in spread splitter option.
|
--rotatefirst Put rotated spread first in spread splitter option.
|
||||||
|
|||||||
+11
-1
@@ -883,7 +883,7 @@ Ignored for Kindle EPUB/MOBI and all PDF.</string>
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="12" column="1">
|
<item row="12" column="2">
|
||||||
<widget class="QCheckBox" name="tempDirBox">
|
<widget class="QCheckBox" name="tempDirBox">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string><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></string>
|
<string><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></string>
|
||||||
@@ -893,6 +893,16 @@ Ignored for Kindle EPUB/MOBI and all PDF.</string>
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="12" column="1">
|
||||||
|
<widget class="QCheckBox" name="onePageLandscapeBox">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><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></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>1 Page Landscape</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -344,6 +344,8 @@ class WorkerThread(QThread):
|
|||||||
options.tempdir = True
|
options.tempdir = True
|
||||||
if GUI.spreadShiftBox.isChecked():
|
if GUI.spreadShiftBox.isChecked():
|
||||||
options.spreadshift = True
|
options.spreadshift = True
|
||||||
|
if GUI.onePageLandscapeBox.isChecked():
|
||||||
|
options.onepagelandscape = True
|
||||||
if GUI.fileFusionBox.isChecked():
|
if GUI.fileFusionBox.isChecked():
|
||||||
options.filefusion = True
|
options.filefusion = True
|
||||||
else:
|
else:
|
||||||
@@ -1097,6 +1099,7 @@ class KCCGUI(KCC_ui.Ui_mainWindow):
|
|||||||
'deleteBox': GUI.deleteBox.checkState(),
|
'deleteBox': GUI.deleteBox.checkState(),
|
||||||
'tempDirBox': GUI.tempDirBox.checkState(),
|
'tempDirBox': GUI.tempDirBox.checkState(),
|
||||||
'spreadShiftBox': GUI.spreadShiftBox.checkState(),
|
'spreadShiftBox': GUI.spreadShiftBox.checkState(),
|
||||||
|
'onePageLandscapeBox': GUI.onePageLandscapeBox.checkState(),
|
||||||
'fileFusionBox': GUI.fileFusionBox.checkState(),
|
'fileFusionBox': GUI.fileFusionBox.checkState(),
|
||||||
'defaultOutputFolderBox': GUI.defaultOutputFolderBox.checkState(),
|
'defaultOutputFolderBox': GUI.defaultOutputFolderBox.checkState(),
|
||||||
'noRotateBox': GUI.noRotateBox.checkState(),
|
'noRotateBox': GUI.noRotateBox.checkState(),
|
||||||
|
|||||||
@@ -453,7 +453,12 @@ class Ui_mainWindow(object):
|
|||||||
self.tempDirBox = QCheckBox(self.optionWidget)
|
self.tempDirBox = QCheckBox(self.optionWidget)
|
||||||
self.tempDirBox.setObjectName(u"tempDirBox")
|
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)
|
self.gridLayout.addWidget(self.optionWidget, 5, 0, 1, 2)
|
||||||
@@ -828,6 +833,10 @@ class Ui_mainWindow(object):
|
|||||||
self.tempDirBox.setToolTip(QCoreApplication.translate("mainWindow", u"<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>", None))
|
self.tempDirBox.setToolTip(QCoreApplication.translate("mainWindow", u"<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>", None))
|
||||||
#endif // QT_CONFIG(tooltip)
|
#endif // QT_CONFIG(tooltip)
|
||||||
self.tempDirBox.setText(QCoreApplication.translate("mainWindow", u"Temp Directory", None))
|
self.tempDirBox.setText(QCoreApplication.translate("mainWindow", u"Temp Directory", None))
|
||||||
|
#if QT_CONFIG(tooltip)
|
||||||
|
self.onePageLandscapeBox.setToolTip(QCoreApplication.translate("mainWindow", u"<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>", None))
|
||||||
|
#endif // QT_CONFIG(tooltip)
|
||||||
|
self.onePageLandscapeBox.setText(QCoreApplication.translate("mainWindow", u"1 Page Landscape", None))
|
||||||
#if QT_CONFIG(tooltip)
|
#if QT_CONFIG(tooltip)
|
||||||
self.convertButton.setToolTip(QCoreApplication.translate("mainWindow", u"<html><head/><body><p style='white-space:pre'>Shift+Click to select the output directory for this list.</p></body></html>", None))
|
self.convertButton.setToolTip(QCoreApplication.translate("mainWindow", u"<html><head/><body><p style='white-space:pre'>Shift+Click to select the output directory for this list.</p></body></html>", None))
|
||||||
#endif // QT_CONFIG(tooltip)
|
#endif // QT_CONFIG(tooltip)
|
||||||
|
|||||||
@@ -469,6 +469,8 @@ def buildOPF(dstdir, title, filelist, originalpath, cover=None):
|
|||||||
pageside = "right"
|
pageside = "right"
|
||||||
|
|
||||||
for entry, prop in zip(reflist, page_spread_property_list):
|
for entry, prop in zip(reflist, page_spread_property_list):
|
||||||
|
if options.onepagelandscape:
|
||||||
|
prop = 'center'
|
||||||
f.write(f'<itemref idref="page_{entry}" {pageSpreadProperty(prop)}/>\n')
|
f.write(f'<itemref idref="page_{entry}" {pageSpreadProperty(prop)}/>\n')
|
||||||
|
|
||||||
f.write("</spine>\n</package>\n")
|
f.write("</spine>\n</package>\n")
|
||||||
@@ -1456,6 +1458,8 @@ def makeParser():
|
|||||||
"2: Consider every subdirectory as separate volume [Default=0]")
|
"2: Consider every subdirectory as separate volume [Default=0]")
|
||||||
output_options.add_argument("--spreadshift", action="store_true", dest="spreadshift", default=False,
|
output_options.add_argument("--spreadshift", action="store_true", dest="spreadshift", default=False,
|
||||||
help="Shift first page to opposite side in landscape for spread alignment")
|
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,
|
output_options.add_argument("--norotate", action="store_true", dest="norotate", default=False,
|
||||||
help="Do not rotate double page spreads in spread splitter option.")
|
help="Do not rotate double page spreads in spread splitter option.")
|
||||||
output_options.add_argument("--rotateright", action="store_true", dest="rotateright", default=False,
|
output_options.add_argument("--rotateright", action="store_true", dest="rotateright", default=False,
|
||||||
|
|||||||
Reference in New Issue
Block a user