about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--KCC-Linux.ui3
-rw-r--r--KCC-OSX.ui3
-rw-r--r--KCC.ui3
-rw-r--r--kcc/KCC_gui.py26
-rw-r--r--kcc/KCC_ui.py3
-rw-r--r--kcc/KCC_ui_linux.py3
-rw-r--r--kcc/KCC_ui_osx.py3
7 files changed, 15 insertions, 29 deletions
diff --git a/KCC-Linux.ui b/KCC-Linux.ui
index 04328ed..9d2d26d 100644
--- a/KCC-Linux.ui
+++ b/KCC-Linux.ui
@@ -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>
diff --git a/KCC-OSX.ui b/KCC-OSX.ui
index 32d6f6a..ff91bec 100644
--- a/KCC-OSX.ui
+++ b/KCC-OSX.ui
@@ -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>
diff --git a/KCC.ui b/KCC.ui
index acb0305..cbe9f73 100644
--- a/KCC.ui
+++ b/KCC.ui
@@ -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>
diff --git a/kcc/KCC_gui.py b/kcc/KCC_gui.py
index f85e2c6..f5ed630 100644
--- a/kcc/KCC_gui.py
+++ b/kcc/KCC_gui.py
@@ -528,24 +528,20 @@ class WorkerThread(QtCore.QThread):
 
 class SystemTrayIcon(QtGui.QSystemTrayIcon):
     def __init__(self, parent=None):
-        QtGui.QSystemTrayIcon.__init__(self, parent)
-        self.setIcon(GUIMain.icons.programIcon)
-        self.activated.connect(self.catchClicks)
+        if not sys.platform.startswith('darwin') and self.isSystemTrayAvailable():
+            QtGui.QSystemTrayIcon.__init__(self, parent)
+            self.setIcon(GUIMain.icons.programIcon)
+            self.activated.connect(self.catchClicks)
 
     def catchClicks(self):
         MainWindow.raise_()
         MainWindow.activateWindow()
 
     def addTrayMessage(self, message, icon):
-        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()
+        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)
 
 
 class Ui_KCC(object):
@@ -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)
diff --git a/kcc/KCC_ui.py b/kcc/KCC_ui.py
index 70e2a8c..eea0045 100644
--- a/kcc/KCC_ui.py
+++ b/kcc/KCC_ui.py
@@ -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)
diff --git a/kcc/KCC_ui_linux.py b/kcc/KCC_ui_linux.py
index e1087fd..3cef0de 100644
--- a/kcc/KCC_ui_linux.py
+++ b/kcc/KCC_ui_linux.py
@@ -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)
diff --git a/kcc/KCC_ui_osx.py b/kcc/KCC_ui_osx.py
index 28937a7..de1ba5e 100644
--- a/kcc/KCC_ui_osx.py
+++ b/kcc/KCC_ui_osx.py
@@ -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)