![]() Registered Member ![]()
|
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 ? |
![]() Registered Member ![]()
|
I found something: http://api.kde.org/4.10-api/kdelibs-api ... ation.html
|
![]() Administrator ![]()
|
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] |
Registered users: Bing [Bot], blue_bullet, Google [Bot], rockscient, Yahoo [Bot]