Commits

Anonymous committed 404f924

statusnotifier as tray icon.

  • Participants
  • Parent commits 40b7745
  • Branches tray-icon

Comments (0)

Files changed (1)

 from PyKDE4.kdecore import ki18n, KAboutData
 
 # KApplication for basics
-from PyKDE4.kdeui import KUniqueApplication, KSystemTrayIcon #, 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 the QIcon for the tray icon
-from PyQt4.QtGui import QIcon
-
 # and exiting.
 from sys import exit as exit_
 
         Rad = importRad()
         self.rad = Rad()
         # and a tray icon
-        self.trayicon = KSystemTrayIcon(QIcon(self.rad.iconloader.loadIcon(programIcon(), 0)))
-        self.trayicon.show()
+        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)