This forum has been archived. All content is frozen. Please use KDE Discuss instead.

System tray icon

Tags: None
(comma "," separated)
User avatar
blindvic
Registered Member
Posts
157
Karma
0
OS

System tray icon

Thu Mar 14, 2013 5:24 am
I need a system tray icon, which when clicked with left mouse button should stop the screen recorder i am developing in Python. Also the icon should have a menu show on right mouse click. And it should be able to show tooltips, preferably rich - for example with a button which clicked should trigger an action.

I found QtGui.QSystemTrayIcon and PyKDE4.kdeui.KStatusNotifierItem for system tray icons and kdialog (kdialog --title "Long process completed" --passivepopup "This popup will disappear in 5 seconds" 5) for showing messages.

Which combination of them or other tools is the best to get the interface i need?

Also, what is the PyKDE4 API way to show a passive popup like with kdialog --title "Long process completed" --passivepopup "This popup will disappear in 5 seconds" 5 ?
User avatar
blindvic
Registered Member
Posts
157
Karma
0
OS
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: System tray icon  Topic is solved

Thu Mar 14, 2013 9:00 am
I would recommend using KStatusNotifierItem, as it will integrate properly with the KDE system tray in a more native fashion compared to QSystemTrayIcon. Where KDE facilities are not available, KSNI will automatically fallback to using QSystemTrayIcon internally.

Both should have appropriate interfaces allowing you to trigger events (via slots) on left and right click respectively. I would suggest consulting their API documentation regarding that.

As for the notifications, you want to look at the KDialog and KNotification classes there.
API Documentation for KDE libraries can be found on api.kde.org.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: Bing [Bot], blue_bullet, Google [Bot], rockscient, Yahoo [Bot]