mirror of
https://github.com/ciromattia/kcc
synced 2025-12-15 02:36:44 +00:00
Disabled systray icon on OSX (close #70)
This commit is contained in:
@@ -27,9 +27,6 @@
|
|||||||
<pointsize>9</pointsize>
|
<pointsize>9</pointsize>
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="focusPolicy">
|
|
||||||
<enum>Qt::StrongFocus</enum>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Kindle Comic Converter</string>
|
<string>Kindle Comic Converter</string>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
@@ -27,9 +27,6 @@
|
|||||||
<pointsize>9</pointsize>
|
<pointsize>9</pointsize>
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="focusPolicy">
|
|
||||||
<enum>Qt::StrongFocus</enum>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Kindle Comic Converter</string>
|
<string>Kindle Comic Converter</string>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
3
KCC.ui
3
KCC.ui
@@ -27,9 +27,6 @@
|
|||||||
<pointsize>9</pointsize>
|
<pointsize>9</pointsize>
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="focusPolicy">
|
|
||||||
<enum>Qt::StrongFocus</enum>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Kindle Comic Converter</string>
|
<string>Kindle Comic Converter</string>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
@@ -528,6 +528,7 @@ class WorkerThread(QtCore.QThread):
|
|||||||
|
|
||||||
class SystemTrayIcon(QtGui.QSystemTrayIcon):
|
class SystemTrayIcon(QtGui.QSystemTrayIcon):
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
|
if not sys.platform.startswith('darwin') and self.isSystemTrayAvailable():
|
||||||
QtGui.QSystemTrayIcon.__init__(self, parent)
|
QtGui.QSystemTrayIcon.__init__(self, parent)
|
||||||
self.setIcon(GUIMain.icons.programIcon)
|
self.setIcon(GUIMain.icons.programIcon)
|
||||||
self.activated.connect(self.catchClicks)
|
self.activated.connect(self.catchClicks)
|
||||||
@@ -537,16 +538,11 @@ class SystemTrayIcon(QtGui.QSystemTrayIcon):
|
|||||||
MainWindow.activateWindow()
|
MainWindow.activateWindow()
|
||||||
|
|
||||||
def addTrayMessage(self, message, icon):
|
def addTrayMessage(self, message, icon):
|
||||||
|
if not sys.platform.startswith('darwin'):
|
||||||
icon = eval('QtGui.QSystemTrayIcon.' + icon)
|
icon = eval('QtGui.QSystemTrayIcon.' + icon)
|
||||||
if self.supportsMessages() and not MainWindow.isActiveWindow():
|
if self.supportsMessages() and not MainWindow.isActiveWindow():
|
||||||
self.showMessage('Kindle Comic Converter', message, icon)
|
self.showMessage('Kindle Comic Converter', message, icon)
|
||||||
|
|
||||||
def focusChange(self, _):
|
|
||||||
if self.isSystemTrayAvailable() and not MainWindow.isActiveWindow():
|
|
||||||
self.show()
|
|
||||||
else:
|
|
||||||
self.hide()
|
|
||||||
|
|
||||||
|
|
||||||
class Ui_KCC(object):
|
class Ui_KCC(object):
|
||||||
def selectDir(self):
|
def selectDir(self):
|
||||||
@@ -868,6 +864,8 @@ class Ui_KCC(object):
|
|||||||
event.ignore()
|
event.ignore()
|
||||||
if not GUI.ConvertButton.isEnabled():
|
if not GUI.ConvertButton.isEnabled():
|
||||||
event.ignore()
|
event.ignore()
|
||||||
|
if not sys.platform.startswith('darwin'):
|
||||||
|
self.tray.hide()
|
||||||
self.contentServer.stop()
|
self.contentServer.stop()
|
||||||
self.settings.setValue('settingsVersion', __version__)
|
self.settings.setValue('settingsVersion', __version__)
|
||||||
self.settings.setValue('lastPath', self.lastPath)
|
self.settings.setValue('lastPath', self.lastPath)
|
||||||
@@ -952,8 +950,10 @@ class Ui_KCC(object):
|
|||||||
self.listFontSize = 11
|
self.listFontSize = 11
|
||||||
elif sys.platform.startswith('linux'):
|
elif sys.platform.startswith('linux'):
|
||||||
self.listFontSize = 8
|
self.listFontSize = 8
|
||||||
|
self.tray.show()
|
||||||
else:
|
else:
|
||||||
self.listFontSize = 9
|
self.listFontSize = 9
|
||||||
|
self.tray.show()
|
||||||
|
|
||||||
self.addMessage('<b>Welcome!</b>', 'info')
|
self.addMessage('<b>Welcome!</b>', 'info')
|
||||||
self.addMessage('<b>Remember:</b> All options have additional informations in tooltips.', 'info')
|
self.addMessage('<b>Remember:</b> All options have additional informations in tooltips.', 'info')
|
||||||
@@ -996,8 +996,6 @@ class Ui_KCC(object):
|
|||||||
self.addMessage('Cannot find <a href="http://www.7-zip.org/download.html">7za</a>!'
|
self.addMessage('Cannot find <a href="http://www.7-zip.org/download.html">7za</a>!'
|
||||||
' Processing of CB7/7Z files will be disabled.', 'warning')
|
' Processing of CB7/7Z files will be disabled.', 'warning')
|
||||||
|
|
||||||
KCC.focusInEvent = self.tray.focusChange
|
|
||||||
KCC.focusOutEvent = self.tray.focusChange
|
|
||||||
APP.connect(APP, QtCore.SIGNAL('messageFromOtherInstance'), self.handleMessage)
|
APP.connect(APP, QtCore.SIGNAL('messageFromOtherInstance'), self.handleMessage)
|
||||||
GUI.BasicModeButton.clicked.connect(self.modeBasic)
|
GUI.BasicModeButton.clicked.connect(self.modeBasic)
|
||||||
GUI.AdvModeButton.clicked.connect(self.modeAdvanced)
|
GUI.AdvModeButton.clicked.connect(self.modeAdvanced)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# Form implementation generated from reading ui file 'KCC.ui'
|
# Form implementation generated from reading ui file 'KCC.ui'
|
||||||
#
|
#
|
||||||
# Created: Tue Nov 12 11:51:07 2013
|
# Created: Tue Nov 12 13:11:03 2013
|
||||||
# by: PyQt4 UI code generator 4.10.3
|
# by: PyQt4 UI code generator 4.10.3
|
||||||
#
|
#
|
||||||
# WARNING! All changes made in this file will be lost!
|
# WARNING! All changes made in this file will be lost!
|
||||||
@@ -32,7 +32,6 @@ class Ui_KCC(object):
|
|||||||
font = QtGui.QFont()
|
font = QtGui.QFont()
|
||||||
font.setPointSize(9)
|
font.setPointSize(9)
|
||||||
KCC.setFont(font)
|
KCC.setFont(font)
|
||||||
KCC.setFocusPolicy(QtCore.Qt.StrongFocus)
|
|
||||||
icon = QtGui.QIcon()
|
icon = QtGui.QIcon()
|
||||||
icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/Icon/icons/comic2ebook.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/Icon/icons/comic2ebook.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
KCC.setWindowIcon(icon)
|
KCC.setWindowIcon(icon)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# Form implementation generated from reading ui file 'KCC-Linux.ui'
|
# Form implementation generated from reading ui file 'KCC-Linux.ui'
|
||||||
#
|
#
|
||||||
# Created: Tue Nov 12 11:51:18 2013
|
# Created: Tue Nov 12 13:11:16 2013
|
||||||
# by: PyQt4 UI code generator 4.10.3
|
# by: PyQt4 UI code generator 4.10.3
|
||||||
#
|
#
|
||||||
# WARNING! All changes made in this file will be lost!
|
# WARNING! All changes made in this file will be lost!
|
||||||
@@ -32,7 +32,6 @@ class Ui_KCC(object):
|
|||||||
font = QtGui.QFont()
|
font = QtGui.QFont()
|
||||||
font.setPointSize(9)
|
font.setPointSize(9)
|
||||||
KCC.setFont(font)
|
KCC.setFont(font)
|
||||||
KCC.setFocusPolicy(QtCore.Qt.StrongFocus)
|
|
||||||
icon = QtGui.QIcon()
|
icon = QtGui.QIcon()
|
||||||
icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/Icon/icons/comic2ebook.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/Icon/icons/comic2ebook.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
KCC.setWindowIcon(icon)
|
KCC.setWindowIcon(icon)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# Form implementation generated from reading ui file 'KCC-OSX.ui'
|
# Form implementation generated from reading ui file 'KCC-OSX.ui'
|
||||||
#
|
#
|
||||||
# Created: Tue Nov 12 11:51:32 2013
|
# Created: Tue Nov 12 13:11:25 2013
|
||||||
# by: PyQt4 UI code generator 4.10.3
|
# by: PyQt4 UI code generator 4.10.3
|
||||||
#
|
#
|
||||||
# WARNING! All changes made in this file will be lost!
|
# WARNING! All changes made in this file will be lost!
|
||||||
@@ -32,7 +32,6 @@ class Ui_KCC(object):
|
|||||||
font = QtGui.QFont()
|
font = QtGui.QFont()
|
||||||
font.setPointSize(9)
|
font.setPointSize(9)
|
||||||
KCC.setFont(font)
|
KCC.setFont(font)
|
||||||
KCC.setFocusPolicy(QtCore.Qt.StrongFocus)
|
|
||||||
icon = QtGui.QIcon()
|
icon = QtGui.QIcon()
|
||||||
icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/Icon/icons/comic2ebook.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/Icon/icons/comic2ebook.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
KCC.setWindowIcon(icon)
|
KCC.setWindowIcon(icon)
|
||||||
|
|||||||
Reference in New Issue
Block a user