mirror of
https://github.com/ciromattia/kcc
synced 2025-12-13 09:46:25 +00:00
Miscellaneous GUI tweaks
This commit is contained in:
@@ -581,7 +581,7 @@
|
|||||||
<x>10</x>
|
<x>10</x>
|
||||||
<y>10</y>
|
<y>10</y>
|
||||||
<width>401</width>
|
<width>401</width>
|
||||||
<height>35</height>
|
<height>29</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="font">
|
<property name="font">
|
||||||
@@ -592,9 +592,6 @@
|
|||||||
<bold>true</bold>
|
<bold>true</bold>
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="autoFillBackground">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
<property name="value">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
5
kcc.py
5
kcc.py
@@ -99,6 +99,11 @@ class QApplicationMessaging(QtWidgets.QApplication):
|
|||||||
self._server.newConnection.connect(self.handleMessage)
|
self._server.newConnection.connect(self.handleMessage)
|
||||||
self._server.listen(self._key)
|
self._server.listen(self._key)
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
if self._memory.isAttached():
|
||||||
|
self._memory.detach()
|
||||||
|
self._server.close()
|
||||||
|
|
||||||
def isRunning(self):
|
def isRunning(self):
|
||||||
return self._running
|
return self._running
|
||||||
|
|
||||||
|
|||||||
@@ -880,6 +880,8 @@ class KCCGUI(KCC_ui.Ui_KCC):
|
|||||||
GUI.ProgressBar.setValue(GUI.ProgressBar.value() + 1)
|
GUI.ProgressBar.setValue(GUI.ProgressBar.value() + 1)
|
||||||
elif command.isdigit():
|
elif command.isdigit():
|
||||||
GUI.ProgressBar.setMaximum(int(command) - 1)
|
GUI.ProgressBar.setMaximum(int(command) - 1)
|
||||||
|
GUI.BasicModeButton.hide()
|
||||||
|
GUI.AdvModeButton.hide()
|
||||||
GUI.ProgressBar.reset()
|
GUI.ProgressBar.reset()
|
||||||
GUI.ProgressBar.show()
|
GUI.ProgressBar.show()
|
||||||
else:
|
else:
|
||||||
@@ -909,6 +911,8 @@ class KCCGUI(KCC_ui.Ui_KCC):
|
|||||||
|
|
||||||
def hideProgressBar(self):
|
def hideProgressBar(self):
|
||||||
GUI.ProgressBar.hide()
|
GUI.ProgressBar.hide()
|
||||||
|
GUI.BasicModeButton.show()
|
||||||
|
GUI.AdvModeButton.show()
|
||||||
|
|
||||||
def saveSettings(self, event):
|
def saveSettings(self, event):
|
||||||
if self.conversionAlive:
|
if self.conversionAlive:
|
||||||
@@ -1017,15 +1021,18 @@ class KCCGUI(KCC_ui.Ui_KCC):
|
|||||||
if sys.platform.startswith('darwin'):
|
if sys.platform.startswith('darwin'):
|
||||||
self.listFontSize = 11
|
self.listFontSize = 11
|
||||||
self.statusBarFontSize = 10
|
self.statusBarFontSize = 10
|
||||||
self.statusBarStyle = 'QLabel{padding-top:5px;padding-bottom:5px;border-top:2px solid #C2C7CB}'
|
self.statusBarStyle = 'QLabel{padding-top:2px;padding-bottom:3px;}'
|
||||||
|
self.ProgressBar.setStyleSheet('QProgressBar{padding-top:5px;text-align:center;}')
|
||||||
elif sys.platform.startswith('linux'):
|
elif sys.platform.startswith('linux'):
|
||||||
self.listFontSize = 8
|
self.listFontSize = 8
|
||||||
self.statusBarFontSize = 8
|
self.statusBarFontSize = 8
|
||||||
self.statusBarStyle = 'QLabel{padding-top:2px;padding-bottom:3px;border-top:2px solid #C2C7CB}'
|
self.statusBarStyle = 'QLabel{padding-top:5px;padding-bottom:3px;}'
|
||||||
|
self.statusBar.setStyleSheet('QStatusBar::item{border:0px;border-top:2px solid #C2C7CB;}')
|
||||||
else:
|
else:
|
||||||
self.listFontSize = 9
|
self.listFontSize = 9
|
||||||
self.statusBarFontSize = 8
|
self.statusBarFontSize = 8
|
||||||
self.statusBarStyle = 'QLabel{padding-top:3px;padding-bottom:3px;border-top:2px solid #C2C7CB}'
|
self.statusBarStyle = 'QLabel{padding-top:3px;padding-bottom:3px}'
|
||||||
|
self.statusBar.setStyleSheet('QStatusBar::item{border:0px;border-top:2px solid #C2C7CB;}')
|
||||||
|
|
||||||
self.profiles = {
|
self.profiles = {
|
||||||
"Kindle Paperwhite": {'Quality': True, 'ForceExpert': False, 'DefaultFormat': 0,
|
"Kindle Paperwhite": {'Quality': True, 'ForceExpert': False, 'DefaultFormat': 0,
|
||||||
|
|||||||
@@ -239,14 +239,13 @@ class Ui_KCC(object):
|
|||||||
self.GammaSlider.setOrientation(QtCore.Qt.Horizontal)
|
self.GammaSlider.setOrientation(QtCore.Qt.Horizontal)
|
||||||
self.GammaSlider.setObjectName("GammaSlider")
|
self.GammaSlider.setObjectName("GammaSlider")
|
||||||
self.ProgressBar = QtWidgets.QProgressBar(self.Form)
|
self.ProgressBar = QtWidgets.QProgressBar(self.Form)
|
||||||
self.ProgressBar.setGeometry(QtCore.QRect(10, 10, 401, 35))
|
self.ProgressBar.setGeometry(QtCore.QRect(10, 10, 401, 29))
|
||||||
font = QtGui.QFont()
|
font = QtGui.QFont()
|
||||||
font.setFamily("Lucida Grande")
|
font.setFamily("Lucida Grande")
|
||||||
font.setPointSize(10)
|
font.setPointSize(10)
|
||||||
font.setBold(True)
|
font.setBold(True)
|
||||||
font.setWeight(75)
|
font.setWeight(75)
|
||||||
self.ProgressBar.setFont(font)
|
self.ProgressBar.setFont(font)
|
||||||
self.ProgressBar.setAutoFillBackground(True)
|
|
||||||
self.ProgressBar.setProperty("value", 0)
|
self.ProgressBar.setProperty("value", 0)
|
||||||
self.ProgressBar.setAlignment(QtCore.Qt.AlignJustify|QtCore.Qt.AlignVCenter)
|
self.ProgressBar.setAlignment(QtCore.Qt.AlignJustify|QtCore.Qt.AlignVCenter)
|
||||||
self.ProgressBar.setFormat("")
|
self.ProgressBar.setFormat("")
|
||||||
|
|||||||
@@ -584,8 +584,7 @@ def getWorkFolder(afile):
|
|||||||
path = cbx.extract(workdir)
|
path = cbx.extract(workdir)
|
||||||
except OSError:
|
except OSError:
|
||||||
rmtree(workdir, True)
|
rmtree(workdir, True)
|
||||||
print('UnRAR/7za not found or file failed to extract!')
|
raise UserWarning("Failed to extract file.")
|
||||||
sys.exit(21)
|
|
||||||
else:
|
else:
|
||||||
rmtree(workdir, True)
|
rmtree(workdir, True)
|
||||||
raise TypeError
|
raise TypeError
|
||||||
|
|||||||
Reference in New Issue
Block a user