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

Disabled systray icon on OSX (close #70)

This commit is contained in:
Paweł Jastrzębski
2013-11-12 13:18:27 +01:00
parent 86a9dde1eb
commit 8b33331929
7 changed files with 15 additions and 29 deletions

View File

@@ -27,9 +27,6 @@
<pointsize>9</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="windowTitle">
<string>Kindle Comic Converter</string>
</property>

View File

@@ -27,9 +27,6 @@
<pointsize>9</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="windowTitle">
<string>Kindle Comic Converter</string>
</property>

3
KCC.ui
View File

@@ -27,9 +27,6 @@
<pointsize>9</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="windowTitle">
<string>Kindle Comic Converter</string>
</property>

View File

@@ -528,6 +528,7 @@ class WorkerThread(QtCore.QThread):
class SystemTrayIcon(QtGui.QSystemTrayIcon):
def __init__(self, parent=None):
if not sys.platform.startswith('darwin') and self.isSystemTrayAvailable():
QtGui.QSystemTrayIcon.__init__(self, parent)
self.setIcon(GUIMain.icons.programIcon)
self.activated.connect(self.catchClicks)
@@ -537,16 +538,11 @@ class SystemTrayIcon(QtGui.QSystemTrayIcon):
MainWindow.activateWindow()
def addTrayMessage(self, message, icon):
if not sys.platform.startswith('darwin'):
icon = eval('QtGui.QSystemTrayIcon.' + icon)
if self.supportsMessages() and not MainWindow.isActiveWindow():
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):
def selectDir(self):
@@ -868,6 +864,8 @@ class Ui_KCC(object):
event.ignore()
if not GUI.ConvertButton.isEnabled():
event.ignore()
if not sys.platform.startswith('darwin'):
self.tray.hide()
self.contentServer.stop()
self.settings.setValue('settingsVersion', __version__)
self.settings.setValue('lastPath', self.lastPath)
@@ -952,8 +950,10 @@ class Ui_KCC(object):
self.listFontSize = 11
elif sys.platform.startswith('linux'):
self.listFontSize = 8
self.tray.show()
else:
self.listFontSize = 9
self.tray.show()
self.addMessage('<b>Welcome!</b>', '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>!'
' 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)
GUI.BasicModeButton.clicked.connect(self.modeBasic)
GUI.AdvModeButton.clicked.connect(self.modeAdvanced)

View File

@@ -2,7 +2,7 @@
# 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
#
# WARNING! All changes made in this file will be lost!
@@ -32,7 +32,6 @@ class Ui_KCC(object):
font = QtGui.QFont()
font.setPointSize(9)
KCC.setFont(font)
KCC.setFocusPolicy(QtCore.Qt.StrongFocus)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/Icon/icons/comic2ebook.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
KCC.setWindowIcon(icon)

View File

@@ -2,7 +2,7 @@
# 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
#
# WARNING! All changes made in this file will be lost!
@@ -32,7 +32,6 @@ class Ui_KCC(object):
font = QtGui.QFont()
font.setPointSize(9)
KCC.setFont(font)
KCC.setFocusPolicy(QtCore.Qt.StrongFocus)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/Icon/icons/comic2ebook.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
KCC.setWindowIcon(icon)

View File

@@ -2,7 +2,7 @@
# 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
#
# WARNING! All changes made in this file will be lost!
@@ -32,7 +32,6 @@ class Ui_KCC(object):
font = QtGui.QFont()
font.setPointSize(9)
KCC.setFont(font)
KCC.setFocusPolicy(QtCore.Qt.StrongFocus)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/Icon/icons/comic2ebook.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
KCC.setWindowIcon(icon)