mirror of
https://github.com/ciromattia/kcc
synced 2025-12-13 01:36:27 +00:00
Add Title gui
Allow to set custom title on mobi without editing metadata.
This commit is contained in:
22
gui/KCC.ui
22
gui/KCC.ui
@@ -516,6 +516,28 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
|
<widget class="QLineEdit" name="titleEdit">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::FocusPolicy::ClickFocus</enum>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Default Title</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>Default Title</string>
|
||||||
|
</property>
|
||||||
|
<property name="clearButtonEnabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
<widget class="QLineEdit" name="authorEdit">
|
<widget class="QLineEdit" name="authorEdit">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
|
|||||||
@@ -346,6 +346,8 @@ class WorkerThread(QThread):
|
|||||||
options.customheight = str(GUI.heightBox.value())
|
options.customheight = str(GUI.heightBox.value())
|
||||||
if GUI.targetDirectory != '':
|
if GUI.targetDirectory != '':
|
||||||
options.output = GUI.targetDirectory
|
options.output = GUI.targetDirectory
|
||||||
|
if GUI.titleEdit.text():
|
||||||
|
options.title = str(GUI.titleEdit.text())
|
||||||
if GUI.authorEdit.text():
|
if GUI.authorEdit.text():
|
||||||
options.author = str(GUI.authorEdit.text())
|
options.author = str(GUI.authorEdit.text())
|
||||||
if GUI.chunkSizeCheckBox.isChecked():
|
if GUI.chunkSizeCheckBox.isChecked():
|
||||||
@@ -745,6 +747,14 @@ class KCCGUI(KCC_ui.Ui_mainWindow):
|
|||||||
def togglechunkSizeCheckBox(self, value):
|
def togglechunkSizeCheckBox(self, value):
|
||||||
GUI.chunkSizeWidget.setVisible(value)
|
GUI.chunkSizeWidget.setVisible(value)
|
||||||
|
|
||||||
|
def toggletitleEdit(self, value):
|
||||||
|
if value:
|
||||||
|
self.metadataTitleBox.setChecked(False)
|
||||||
|
|
||||||
|
def togglemetadataTitleBox(self, value):
|
||||||
|
if value:
|
||||||
|
GUI.titleEdit.setText(None)
|
||||||
|
|
||||||
def changeGamma(self, value):
|
def changeGamma(self, value):
|
||||||
valueRaw = int(5 * round(float(value) / 5))
|
valueRaw = int(5 * round(float(value) / 5))
|
||||||
value = '%.2f' % (float(valueRaw) / 100)
|
value = '%.2f' % (float(valueRaw) / 100)
|
||||||
@@ -1257,6 +1267,8 @@ class KCCGUI(KCC_ui.Ui_mainWindow):
|
|||||||
GUI.chunkSizeCheckBox.stateChanged.connect(self.togglechunkSizeCheckBox)
|
GUI.chunkSizeCheckBox.stateChanged.connect(self.togglechunkSizeCheckBox)
|
||||||
GUI.deviceBox.activated.connect(self.changeDevice)
|
GUI.deviceBox.activated.connect(self.changeDevice)
|
||||||
GUI.formatBox.activated.connect(self.changeFormat)
|
GUI.formatBox.activated.connect(self.changeFormat)
|
||||||
|
GUI.titleEdit.textChanged.connect(self.toggletitleEdit)
|
||||||
|
GUI.metadataTitleBox.stateChanged.connect(self.togglemetadataTitleBox)
|
||||||
MW.progressBarTick.connect(self.updateProgressbar)
|
MW.progressBarTick.connect(self.updateProgressbar)
|
||||||
MW.modeConvert.connect(self.modeConvert)
|
MW.modeConvert.connect(self.modeConvert)
|
||||||
MW.addMessage.connect(self.addMessage)
|
MW.addMessage.connect(self.addMessage)
|
||||||
|
|||||||
@@ -289,7 +289,16 @@ class Ui_mainWindow(object):
|
|||||||
self.authorEdit.setFocusPolicy(Qt.FocusPolicy.ClickFocus)
|
self.authorEdit.setFocusPolicy(Qt.FocusPolicy.ClickFocus)
|
||||||
self.authorEdit.setClearButtonEnabled(False)
|
self.authorEdit.setClearButtonEnabled(False)
|
||||||
|
|
||||||
self.gridLayout_2.addWidget(self.authorEdit, 0, 0, 1, 1)
|
self.gridLayout_2.addWidget(self.authorEdit, 0, 1, 1, 1)
|
||||||
|
|
||||||
|
self.titleEdit = QLineEdit(self.optionWidget)
|
||||||
|
self.titleEdit.setObjectName(u"titleEdit")
|
||||||
|
sizePolicy3.setHeightForWidth(self.titleEdit.sizePolicy().hasHeightForWidth())
|
||||||
|
self.titleEdit.setSizePolicy(sizePolicy3)
|
||||||
|
self.titleEdit.setFocusPolicy(Qt.FocusPolicy.ClickFocus)
|
||||||
|
self.titleEdit.setClearButtonEnabled(False)
|
||||||
|
|
||||||
|
self.gridLayout_2.addWidget(self.titleEdit, 0, 0, 1, 1)
|
||||||
|
|
||||||
self.rotateFirstBox = QCheckBox(self.optionWidget)
|
self.rotateFirstBox = QCheckBox(self.optionWidget)
|
||||||
self.rotateFirstBox.setObjectName(u"rotateFirstBox")
|
self.rotateFirstBox.setObjectName(u"rotateFirstBox")
|
||||||
@@ -563,6 +572,10 @@ class Ui_mainWindow(object):
|
|||||||
self.authorEdit.setToolTip(QCoreApplication.translate("mainWindow", u"Default Author is KCC", None))
|
self.authorEdit.setToolTip(QCoreApplication.translate("mainWindow", u"Default Author is KCC", None))
|
||||||
#endif // QT_CONFIG(tooltip)
|
#endif // QT_CONFIG(tooltip)
|
||||||
self.authorEdit.setPlaceholderText(QCoreApplication.translate("mainWindow", u"Default Author", None))
|
self.authorEdit.setPlaceholderText(QCoreApplication.translate("mainWindow", u"Default Author", None))
|
||||||
|
#if QT_CONFIG(tooltip)
|
||||||
|
self.titleEdit.setToolTip(QCoreApplication.translate("mainWindow", u"Default Title is based on filename, directory name or metadata", None))
|
||||||
|
#endif // QT_CONFIG(tooltip)
|
||||||
|
self.titleEdit.setPlaceholderText(QCoreApplication.translate("mainWindow", u"Default Title", None))
|
||||||
#if QT_CONFIG(tooltip)
|
#if QT_CONFIG(tooltip)
|
||||||
self.rotateFirstBox.setToolTip(QCoreApplication.translate("mainWindow", u"<html><head/><body><p>When the spread splitter option is partially checked,</p><p><span style=\" font-weight:600; text-decoration: underline;\">Unchecked - Rotate Last<br/></span>Put the rotated 2 page spread after the split spreads.</p><p><span style=\" font-weight:600; text-decoration: underline;\">Checked - Rotate First<br/></span>Put the rotated 2 page spread before the split spreads.</p></body></html>", None))
|
self.rotateFirstBox.setToolTip(QCoreApplication.translate("mainWindow", u"<html><head/><body><p>When the spread splitter option is partially checked,</p><p><span style=\" font-weight:600; text-decoration: underline;\">Unchecked - Rotate Last<br/></span>Put the rotated 2 page spread after the split spreads.</p><p><span style=\" font-weight:600; text-decoration: underline;\">Checked - Rotate First<br/></span>Put the rotated 2 page spread before the split spreads.</p></body></html>", None))
|
||||||
#endif // QT_CONFIG(tooltip)
|
#endif // QT_CONFIG(tooltip)
|
||||||
|
|||||||
Reference in New Issue
Block a user