Anonymous avatar Anonymous committed 9e017f6

first try at adding a 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)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.