PDA

View Full Version : Tray notification popup with buttons(like accept, reject)



Fatih
11th September 2008, 07:40
Hi,

I'm writing a fronted for Synergy. There will be some code that will execute in defined interval. After that, it will search and popup a message near to tray. The user will be asked for accepting or rejecting.

Now theoritik it's possible, but QSystemTrayIcon's showMessage() only support plain text. It shows and you have to click on this message or not.

But i would like that it has buttons, and the user clicked on that. Like that:

http://www.qtcentre.org/forum/attachment.php?attachmentid=2549&stc=1&d=1221115302

This popup is implented in qt3. But i'm using Qt4 and PyQt4

Any ideas how to implent something like that?

wysota
11th September 2008, 11:07
You have to create your own popup widget from scratch and probably use QWidget::setMask to obtain the shape you want.

Fatih
12th September 2008, 06:57
Thanks for the tip, but i found an easy way to do it. I've used dbus notification and it just work

http://www.qtcentre.org/forum/attachment.php?attachmentid=2551&stc=1&d=1221199114

The code can be looked here:

http://svn.pardus.org.tr/uludag/trunk/staj-projeleri/sinerji/

wysota
12th September 2008, 10:35
So long portability :) Try running your application on WindowMaker or Windows ;)

Fatih
12th September 2008, 11:56
That's right, i didn't think in this way. But it uses avahi too, and aim to be work only on Linux.

wysota
12th September 2008, 12:03
What about Linux running a window manager not supporting dbus notifications?

Fatih
12th September 2008, 12:11
Well dbus has to be installed because of avahi. Avahi do not has an api for Python, only bindings which communicate trough dbus. But you're right, in the future i've have to rewrite some parts of the code.