Commits

Anonymous committed aed583e Merge

merge tray icon.

  • Participants
  • Parent commits 6289803, 404f924

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, KStatusNotifierItem #, KSessionManager # for handling sessions by hand, should quit not work.
 
 # SIGNALs and SLOTs for a clean shutdown. 
 from PyQt4.QtCore import SIGNAL, SLOT
         # And get and show the GUI
         Rad = importRad()
         self.rad = Rad()
+        # and a tray icon
+        self.statusnotifier = KStatusNotifierItem(self.rad)
+        self.statusnotifier.setCategory(0) # 0 = ApplicationStatus
+        self.statusnotifier.setIconByName(programIcon())
+        
         self.connect(self, SIGNAL("shutDown()"), self.close)
         self.connect(self, SIGNAL("shutDown()"), self.quit)
         self.connect(self.rad, SIGNAL("queryClose()"), self.close)