Results 1 to 7 of 7

Thread: Tray notification popup with buttons(like accept, reject)

  1. #1
    Join Date
    Sep 2008
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Tray notification popup with buttons(like accept, reject)

    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:



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

    Any ideas how to implent something like that?
    Attached Images Attached Images

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Tray notification popup with buttons(like accept, reject)

    You have to create your own popup widget from scratch and probably use QWidget::setMask to obtain the shape you want.

  3. #3
    Join Date
    Sep 2008
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Tray notification popup with buttons(like accept, reject)

    Thanks for the tip, but i found an easy way to do it. I've used dbus notification and it just work



    The code can be looked here:

    http://svn.pardus.org.tr/uludag/trun...eleri/sinerji/
    Attached Images Attached Images

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Tray notification popup with buttons(like accept, reject)

    So long portability Try running your application on WindowMaker or Windows

  5. #5
    Join Date
    Sep 2008
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Tray notification popup with buttons(like accept, reject)

    That's right, i didn't think in this way. But it uses avahi too, and aim to be work only on Linux.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Tray notification popup with buttons(like accept, reject)

    What about Linux running a window manager not supporting dbus notifications?

  7. #7
    Join Date
    Sep 2008
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Tray notification popup with buttons(like accept, reject)

    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.