Reply
Thread Tools
noobmonkey's Avatar
Posts: 3,203 | Thanked: 1,391 times | Joined on Nov 2009 @ Worthing, England
#11
Originally Posted by attila77 View Post
You could cheat, too... Here's a snippet (in C++, but I'd say your a pro enough by now to convert it to Python without any problems ). Ugly, but works in Qt4.5, too.

Code:
void MyClass::notify(QString text)
{
    QDBusMessage msg = QDBusMessage::createMethodCall("org.freedesktop.Notifications",
       "/org/freedesktop/Notifications",
       "org.freedesktop.Notifications",
       "SystemNoteDialog");

    QList<QVariant> args;
    args.append(text);
    args.append(static_cast<quint32>(0));
    args.append("ok");

    msg.setArguments(args);

    QDBusConnection::systemBus().call(msg);
}
ahhhh thats the way - nothing wrong with a good bit of cheating

Thank you very much Attila
__________________
----------- Follow me on Twitter here
----------- My Photography Website and Blog is here
----------- Author of the N900 Health Check Application ----------- New Version in Extras Devel (Dec 2010 - 2.9.10)
----------- Are you on the N900 World Map? - http://pininthemap.com/maemo - masterpin: shotgun
----------- What apps do you want to see on the n900 or in MeeGo in the future? -
 

The Following User Says Thank You to noobmonkey For This Useful Post:
noobmonkey's Avatar
Posts: 3,203 | Thanked: 1,391 times | Joined on Nov 2009 @ Worthing, England
#12
Originally Posted by attila77 View Post
You could cheat, too... Here's a snippet (in C++, but I'd say your a pro enough by now to convert it to Python without any problems ).

Well, it's not quite a function yet, but it is quite sexy i'd say...

Code:
 bus = dbus.SessionBus()
        proxy = bus.get_object('org.freedesktop.Notifications', '/org/freedesktop/Notifications')
        interface = dbus.Interface(proxy,dbus_interface='org.freedesktop.Notifications')


        interface.Notify('Healthcheck', 0, '', 'W0000p', 'I R Sexy', [], {}, 2000)
__________________
----------- Follow me on Twitter here
----------- My Photography Website and Blog is here
----------- Author of the N900 Health Check Application ----------- New Version in Extras Devel (Dec 2010 - 2.9.10)
----------- Are you on the N900 World Map? - http://pininthemap.com/maemo - masterpin: shotgun
----------- What apps do you want to see on the n900 or in MeeGo in the future? -
 
noobmonkey's Avatar
Posts: 3,203 | Thanked: 1,391 times | Joined on Nov 2009 @ Worthing, England
#13
Working fine, apart from an odd icon picture, think i need to get the application title part correct to fix that, not sure - but does what i wanted it too!

Yay with cherries on top!!!
__________________
----------- Follow me on Twitter here
----------- My Photography Website and Blog is here
----------- Author of the N900 Health Check Application ----------- New Version in Extras Devel (Dec 2010 - 2.9.10)
----------- Are you on the N900 World Map? - http://pininthemap.com/maemo - masterpin: shotgun
----------- What apps do you want to see on the n900 or in MeeGo in the future? -
 
Posts: 108 | Thanked: 119 times | Joined on Aug 2010 @ Dresden - Germany
#14
Hildon Banner is also available for PyQt. You have to:

Code:
from QtMaemo5 import QMaemo5InformationBox
and than for showing them, for example:

Code:
QMaemo5InformationBox.information(None, QString(warning), 2500)
2500 - how long to show it (in milliseconds). If it's 0 you have to click.

Hope it will help you!
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 04:31.