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