sshfs-mapper qasim: Use freedesktop notifications.
git-svn-id: https://websvn.glenux.net/svn/Upoc/sshfs-mapper/trunk@1694 eaee96b3-f302-0410-b096-c6cfd47f7835
This commit is contained in:
parent
f37bdc6e6b
commit
cd3981db1a
1 changed files with 18 additions and 2 deletions
|
@ -25,8 +25,24 @@ module Qasim
|
||||||
si.icon = std_icon
|
si.icon = std_icon
|
||||||
si.show
|
si.show
|
||||||
|
|
||||||
si.showMessage("Qasim",
|
bus = Qt::DBusConnection.sessionBus
|
||||||
"funky funky notification", 2, 5000)
|
if !bus.connected?
|
||||||
|
$stderr.puts("Cannot connect to the D-BUS session bus.\n" \
|
||||||
|
"To start it, run:\n" \
|
||||||
|
"\teval `dbus-launch --auto-syntax`\n")
|
||||||
|
exit 1
|
||||||
|
end
|
||||||
|
msg = Qt::DBusMessage.create_method_call( 'org.freedesktop.Notifications',
|
||||||
|
'/org/freedesktop/Notifications',
|
||||||
|
'org.freedesktop.Notifications',
|
||||||
|
'Notify' )
|
||||||
|
msg.arguments = [ 'Coucou', Qt::Variant.from_value( 0, "unsigned int" ),
|
||||||
|
'dialog-information', 'Title', 'blah', [], {}, -1 ]
|
||||||
|
rep = bus.call( msg )
|
||||||
|
# if rep.type == Qt::DBusMessage
|
||||||
|
|
||||||
|
# si.showMessage("Qasim",
|
||||||
|
# "Sorry dude", 2, 5000 )
|
||||||
|
|
||||||
si.setToolTip("Qasim %s" % VERSION);
|
si.setToolTip("Qasim %s" % VERSION);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue