1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-13 17:56:30 +00:00

Various multi-os tweaks

This commit is contained in:
Paweł Jastrzębski
2014-01-17 19:37:35 +01:00
parent b46ada9596
commit 66b867c1ca
4 changed files with 32 additions and 25 deletions

View File

@@ -43,12 +43,16 @@ try:
except ImportError: except ImportError:
missing.append('Pillow 2.3.0+') missing.append('Pillow 2.3.0+')
if len(missing) > 0: if len(missing) > 0:
print('ERROR: ' + ', '.join(missing) + ' is not installed!') try:
import tkinter # noinspection PyUnresolvedReferences
import tkinter.messagebox import tkinter
importRoot = tkinter.Tk() # noinspection PyUnresolvedReferences
importRoot.withdraw() import tkinter.messagebox
tkinter.messagebox.showerror('KCC - Error', 'ERROR: ' + ', '.join(missing) + ' is not installed!') importRoot = tkinter.Tk()
importRoot.withdraw()
tkinter.messagebox.showerror('KCC - Error', 'ERROR: ' + ', '.join(missing) + ' is not installed!')
except ImportError:
print('ERROR: ' + ', '.join(missing) + ' is not installed!')
exit(1) exit(1)
import sys import sys

View File

@@ -33,12 +33,16 @@ try:
except ImportError: except ImportError:
missing.append('Pillow 2.3.0+') missing.append('Pillow 2.3.0+')
if len(missing) > 0: if len(missing) > 0:
print('ERROR: ' + ', '.join(missing) + ' is not installed!') try:
import tkinter # noinspection PyUnresolvedReferences
import tkinter.messagebox import tkinter
importRoot = tkinter.Tk() # noinspection PyUnresolvedReferences
importRoot.withdraw() import tkinter.messagebox
tkinter.messagebox.showerror('KCC - Error', 'ERROR: ' + ', '.join(missing) + ' is not installed!') importRoot = tkinter.Tk()
importRoot.withdraw()
tkinter.messagebox.showerror('KCC - Error', 'ERROR: ' + ', '.join(missing) + ' is not installed!')
except ImportError:
print('ERROR: ' + ', '.join(missing) + ' is not installed!')
exit(1) exit(1)
import sys import sys

20
kcc.py
View File

@@ -48,12 +48,16 @@ try:
except ImportError: except ImportError:
missing.append('Pillow 2.3.0+') missing.append('Pillow 2.3.0+')
if len(missing) > 0: if len(missing) > 0:
print('ERROR: ' + ', '.join(missing) + ' is not installed!') try:
import tkinter # noinspection PyUnresolvedReferences
import tkinter.messagebox import tkinter
importRoot = tkinter.Tk() # noinspection PyUnresolvedReferences
importRoot.withdraw() import tkinter.messagebox
tkinter.messagebox.showerror('KCC - Error', 'ERROR: ' + ', '.join(missing) + ' is not installed!') importRoot = tkinter.Tk()
importRoot.withdraw()
tkinter.messagebox.showerror('KCC - Error', 'ERROR: ' + ', '.join(missing) + ' is not installed!')
except ImportError:
print('ERROR: ' + ', '.join(missing) + ' is not installed!')
exit(1) exit(1)
import sys import sys
@@ -95,10 +99,6 @@ 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()
def isRunning(self): def isRunning(self):
return self._running return self._running

View File

@@ -1021,13 +1021,11 @@ class KCCGUI(KCC_ui.Ui_KCC):
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:5px;padding-bottom:3px;border-top:2px solid #C2C7CB}' self.statusBarStyle = 'QLabel{padding-top:2px;padding-bottom:3px;border-top:2px solid #C2C7CB}'
self.tray.show()
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;border-top:2px solid #C2C7CB}'
self.tray.show()
self.profiles = { self.profiles = {
"Kindle Paperwhite": {'Quality': True, 'ForceExpert': False, 'DefaultFormat': 0, "Kindle Paperwhite": {'Quality': True, 'ForceExpert': False, 'DefaultFormat': 0,
@@ -1212,3 +1210,4 @@ class KCCGUI(KCC_ui.Ui_KCC):
MW.setWindowTitle("Kindle Comic Converter " + __version__) MW.setWindowTitle("Kindle Comic Converter " + __version__)
MW.show() MW.show()
MW.raise_() MW.raise_()
self.tray.show()