Commits

Arne Babenhauserheide  committed 9e017f6

first try at adding a tray icon.

  • Participants
  • Parent commits 6289803
  • Branches tray-icon

Comments (0)

Files changed (1)

     from rad import Rad
     return Rad
 
+def programIcon():
+    from rad import PROGRAM_ICON
+    return PROGRAM_ICON
+
 # We also do the other imports in functions to facilitate profiling. 
 # Then commandline arguments and handling
 from PyKDE4.kdecore import KCmdLineArgs, KCmdLineOptions
 from PyKDE4.kdecore import ki18n, KAboutData
 
 # KApplication for basics
-from PyKDE4.kdeui import KUniqueApplication #, KSessionManager # for handling sessions by hand, should quit not work.
+from PyKDE4.kdeui import KUniqueApplication, KSystemTrayIcon #, KSessionManager # for handling sessions by hand, should quit not work.
 
 # SIGNALs and SLOTs for a clean shutdown. 
 from PyQt4.QtCore import SIGNAL, SLOT
 
+# and the QIcon for the tray icon
+from PyQt4.QtGui import QIcon
+
 # and exiting.
 from sys import exit as exit_
 
         # And get and show the GUI
         Rad = importRad()
         self.rad = Rad()
+        # and a tray icon
+        trayicon = KSystemTrayIcon(QIcon(self.rad.iconloader.loadIcon(programIcon(), 0)))
+        trayicon.show()
+        
         self.connect(self, SIGNAL("shutDown()"), self.close)
         self.connect(self, SIGNAL("shutDown()"), self.quit)
         self.connect(self.rad, SIGNAL("queryClose()"), self.close)