mirror of
https://github.com/ciromattia/kcc
synced 2025-12-17 19:51:45 +00:00
Expert mode GUI
This commit is contained in:
91
KCC.ui
91
KCC.ui
@@ -7,19 +7,19 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>420</width>
|
||||
<height>345</height>
|
||||
<height>380</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>420</width>
|
||||
<height>345</height>
|
||||
<height>380</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>420</width>
|
||||
<height>345</height>
|
||||
<height>380</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
@@ -426,9 +426,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="ExpertModeButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>260</x>
|
||||
@@ -492,7 +489,7 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
<enum>Qt::ClickFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>When converting color images setting this option to 1.0 <span style=" font-weight:600;">might</span> improve readability.</p></body></html></string>
|
||||
@@ -507,6 +504,86 @@
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<zorder>GammaLabel</zorder>
|
||||
<zorder>GammaSlider</zorder>
|
||||
<zorder>OptionsExpert</zorder>
|
||||
<zorder>OptionsExpert</zorder>
|
||||
</widget>
|
||||
<widget class="QFrame" name="OptionsExpert">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>340</y>
|
||||
<width>381</width>
|
||||
<height>40</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="wLabel">
|
||||
<property name="toolTip">
|
||||
<string>Device profile width will be overwritten by this value.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Custom width: </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="customWidth">
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::ClickFocus</enum>
|
||||
</property>
|
||||
<property name="acceptDrops">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Device profile width will be overwritten by this value.</string>
|
||||
</property>
|
||||
<property name="inputMask">
|
||||
<string>0000; </string>
|
||||
</property>
|
||||
<property name="maxLength">
|
||||
<number>4</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="hLabel">
|
||||
<property name="toolTip">
|
||||
<string>Device profile height will be overwritten by this value.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Custom height: </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QLineEdit" name="customHeight">
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::ClickFocus</enum>
|
||||
</property>
|
||||
<property name="acceptDrops">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Device profile height will be overwritten by this value.</string>
|
||||
</property>
|
||||
<property name="inputMask">
|
||||
<string>0000; </string>
|
||||
</property>
|
||||
<property name="maxLength">
|
||||
<number>4</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<action name="ActionBasic">
|
||||
|
||||
@@ -36,8 +36,8 @@ from PyQt4 import QtGui, QtCore
|
||||
# noinspection PyBroadException
|
||||
class Ui_KCC(object):
|
||||
def selectDir(self):
|
||||
if self.firstStart:
|
||||
self.firstStart = False
|
||||
if self.needClean:
|
||||
self.needClean = False
|
||||
GUI.JobList.clear()
|
||||
dname = QtGui.QFileDialog.getExistingDirectory(MainWindow, 'Select directory', '')
|
||||
# Lame UTF-8 security measure
|
||||
@@ -51,8 +51,8 @@ class Ui_KCC(object):
|
||||
self.clearEmptyJobs()
|
||||
|
||||
def selectFile(self):
|
||||
if self.firstStart:
|
||||
self.firstStart = False
|
||||
if self.needClean:
|
||||
self.needClean = False
|
||||
GUI.JobList.clear()
|
||||
if self.UnRAR:
|
||||
fname = QtGui.QFileDialog.getOpenFileName(MainWindow, 'Select file', '', '*.cbz *.cbr *.zip *.rar *.pdf')
|
||||
@@ -87,6 +87,7 @@ class Ui_KCC(object):
|
||||
GUI.FormatBox.setEnabled(False)
|
||||
GUI.OptionsAdvanced.setEnabled(False)
|
||||
GUI.OptionsAdvancedGamma.setEnabled(False)
|
||||
GUI.OptionsExpert.setEnabled(False)
|
||||
GUI.ProcessingBox.hide()
|
||||
GUI.UpscaleBox.hide()
|
||||
GUI.NoRotateBox.hide()
|
||||
@@ -97,6 +98,8 @@ class Ui_KCC(object):
|
||||
GUI.StretchBox.setChecked(False)
|
||||
GUI.NoDitheringBox.setChecked(False)
|
||||
GUI.GammaSlider.setValue(0)
|
||||
GUI.customWidth.setText('')
|
||||
GUI.customHeight.setText('')
|
||||
|
||||
def modeAdvanced(self):
|
||||
MainWindow.setMinimumSize(QtCore.QSize(420, 345))
|
||||
@@ -111,10 +114,19 @@ class Ui_KCC(object):
|
||||
GUI.NoRotateBox.show()
|
||||
GUI.OptionsAdvancedGamma.setEnabled(True)
|
||||
GUI.OptionsAdvanced.setEnabled(True)
|
||||
GUI.OptionsExpert.setEnabled(False)
|
||||
GUI.customWidth.setText('')
|
||||
GUI.customHeight.setText('')
|
||||
|
||||
def modeExpert(self):
|
||||
#TODO
|
||||
pass
|
||||
self.modeAdvanced()
|
||||
MainWindow.setMinimumSize(QtCore.QSize(420, 380))
|
||||
MainWindow.setMaximumSize(QtCore.QSize(420, 380))
|
||||
MainWindow.resize(420, 380)
|
||||
GUI.BasicModeButton.setStyleSheet('font-weight:Normal;')
|
||||
GUI.AdvModeButton.setStyleSheet('font-weight:Normal;')
|
||||
GUI.ExpertModeButton.setStyleSheet('font-weight:Bold;')
|
||||
GUI.OptionsExpert.setEnabled(True)
|
||||
|
||||
def modeConvert(self, enable):
|
||||
GUI.BasicModeButton.setEnabled(enable)
|
||||
@@ -150,12 +162,12 @@ class Ui_KCC(object):
|
||||
MainWindow.repaint()
|
||||
|
||||
def convertStart(self):
|
||||
if self.firstStart:
|
||||
self.firstStart = False
|
||||
if self.needClean:
|
||||
self.needClean = False
|
||||
GUI.JobList.clear()
|
||||
if GUI.JobList.count() == 0:
|
||||
self.addMessage('No files selected! Please choose files to convert.', self.errorIcon)
|
||||
self.firstStart = True
|
||||
self.needClean = True
|
||||
return
|
||||
self.modeConvert(False)
|
||||
profile = ProfileData.ProfileLabels[str(GUI.DeviceBox.currentText())]
|
||||
@@ -248,7 +260,7 @@ class Ui_KCC(object):
|
||||
os.remove(outputPath)
|
||||
self.addMessage('Created EPUB file is too big for KindleGen!', self.errorIcon)
|
||||
self.addMessage('Try converting smaller batch.', self.errorIcon)
|
||||
self.firstStart = True
|
||||
self.needClean = True
|
||||
self.addMessage('All jobs completed.', self.warningIcon)
|
||||
self.modeConvert(True)
|
||||
|
||||
@@ -259,7 +271,7 @@ class Ui_KCC(object):
|
||||
profiles = sorted(ProfileData.ProfileLabels.iterkeys())
|
||||
kindleIcon = QtGui.QIcon()
|
||||
kindleIcon.addPixmap(QtGui.QPixmap(":/Devices/icons/Kindle.ico"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
self.firstStart = True
|
||||
self.needClean = True
|
||||
self.GammaValue = 0
|
||||
self.infoIcon = QtGui.QIcon()
|
||||
self.infoIcon.addPixmap(QtGui.QPixmap(":/Status/icons/info.ico"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# Form implementation generated from reading ui file 'KCC.ui'
|
||||
#
|
||||
# Created: Mon Jun 10 17:51:15 2013
|
||||
# Created: Mon Jun 10 20:06:36 2013
|
||||
# by: PyQt4 UI code generator 4.10.1
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
@@ -26,9 +26,9 @@ except AttributeError:
|
||||
class Ui_KCC(object):
|
||||
def setupUi(self, KCC):
|
||||
KCC.setObjectName(_fromUtf8("KCC"))
|
||||
KCC.resize(420, 345)
|
||||
KCC.setMinimumSize(QtCore.QSize(420, 345))
|
||||
KCC.setMaximumSize(QtCore.QSize(420, 345))
|
||||
KCC.resize(420, 380)
|
||||
KCC.setMinimumSize(QtCore.QSize(420, 380))
|
||||
KCC.setMaximumSize(QtCore.QSize(420, 380))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
KCC.setFont(font)
|
||||
@@ -167,7 +167,6 @@ class Ui_KCC(object):
|
||||
self.AdvModeButton.setFocusPolicy(QtCore.Qt.NoFocus)
|
||||
self.AdvModeButton.setObjectName(_fromUtf8("AdvModeButton"))
|
||||
self.ExpertModeButton = QtGui.QPushButton(self.Form)
|
||||
self.ExpertModeButton.setEnabled(False)
|
||||
self.ExpertModeButton.setGeometry(QtCore.QRect(260, 10, 151, 32))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
@@ -186,11 +185,36 @@ class Ui_KCC(object):
|
||||
self.GammaLabel.setObjectName(_fromUtf8("GammaLabel"))
|
||||
self.GammaSlider = QtGui.QSlider(self.OptionsAdvancedGamma)
|
||||
self.GammaSlider.setGeometry(QtCore.QRect(140, 10, 261, 22))
|
||||
self.GammaSlider.setFocusPolicy(QtCore.Qt.NoFocus)
|
||||
self.GammaSlider.setFocusPolicy(QtCore.Qt.ClickFocus)
|
||||
self.GammaSlider.setMaximum(500)
|
||||
self.GammaSlider.setSingleStep(5)
|
||||
self.GammaSlider.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.GammaSlider.setObjectName(_fromUtf8("GammaSlider"))
|
||||
self.OptionsExpert = QtGui.QFrame(self.Form)
|
||||
self.OptionsExpert.setGeometry(QtCore.QRect(20, 340, 381, 40))
|
||||
self.OptionsExpert.setFrameShape(QtGui.QFrame.StyledPanel)
|
||||
self.OptionsExpert.setFrameShadow(QtGui.QFrame.Raised)
|
||||
self.OptionsExpert.setObjectName(_fromUtf8("OptionsExpert"))
|
||||
self.gridLayout_2 = QtGui.QGridLayout(self.OptionsExpert)
|
||||
self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
|
||||
self.wLabel = QtGui.QLabel(self.OptionsExpert)
|
||||
self.wLabel.setObjectName(_fromUtf8("wLabel"))
|
||||
self.gridLayout_2.addWidget(self.wLabel, 0, 0, 1, 1)
|
||||
self.customWidth = QtGui.QLineEdit(self.OptionsExpert)
|
||||
self.customWidth.setFocusPolicy(QtCore.Qt.ClickFocus)
|
||||
self.customWidth.setAcceptDrops(False)
|
||||
self.customWidth.setMaxLength(4)
|
||||
self.customWidth.setObjectName(_fromUtf8("customWidth"))
|
||||
self.gridLayout_2.addWidget(self.customWidth, 0, 1, 1, 1)
|
||||
self.hLabel = QtGui.QLabel(self.OptionsExpert)
|
||||
self.hLabel.setObjectName(_fromUtf8("hLabel"))
|
||||
self.gridLayout_2.addWidget(self.hLabel, 0, 2, 1, 1)
|
||||
self.customHeight = QtGui.QLineEdit(self.OptionsExpert)
|
||||
self.customHeight.setFocusPolicy(QtCore.Qt.ClickFocus)
|
||||
self.customHeight.setAcceptDrops(False)
|
||||
self.customHeight.setMaxLength(4)
|
||||
self.customHeight.setObjectName(_fromUtf8("customHeight"))
|
||||
self.gridLayout_2.addWidget(self.customHeight, 0, 3, 1, 1)
|
||||
KCC.setCentralWidget(self.Form)
|
||||
self.ActionBasic = QtGui.QAction(KCC)
|
||||
self.ActionBasic.setCheckable(True)
|
||||
@@ -241,6 +265,14 @@ class Ui_KCC(object):
|
||||
self.GammaLabel.setToolTip(_translate("KCC", "When converting color images setting this option to 1.0 MIGHT improve readability.", None))
|
||||
self.GammaLabel.setText(_translate("KCC", "Gamma correction: Auto", None))
|
||||
self.GammaSlider.setToolTip(_translate("KCC", "<html><head/><body><p>When converting color images setting this option to 1.0 <span style=\" font-weight:600;\">might</span> improve readability.</p></body></html>", None))
|
||||
self.wLabel.setToolTip(_translate("KCC", "Device profile width will be overwritten by this value.", None))
|
||||
self.wLabel.setText(_translate("KCC", "Custom width: ", None))
|
||||
self.customWidth.setToolTip(_translate("KCC", "Device profile width will be overwritten by this value.", None))
|
||||
self.customWidth.setInputMask(_translate("KCC", "0000; ", None))
|
||||
self.hLabel.setToolTip(_translate("KCC", "Device profile height will be overwritten by this value.", None))
|
||||
self.hLabel.setText(_translate("KCC", "Custom height: ", None))
|
||||
self.customHeight.setToolTip(_translate("KCC", "Device profile height will be overwritten by this value.", None))
|
||||
self.customHeight.setInputMask(_translate("KCC", "0000; ", None))
|
||||
self.ActionBasic.setText(_translate("KCC", "Basic", None))
|
||||
self.ActionAdvanced.setText(_translate("KCC", "Advanced", None))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user