diff options
author | tv <tv@99302b65-d5f7-0310-b3dd-f8cd6f4e3d94> | 2008-03-28 15:59:03 +0000 |
---|---|---|
committer | tv <tv@99302b65-d5f7-0310-b3dd-f8cd6f4e3d94> | 2008-03-28 15:59:03 +0000 |
commit | d570a338e80b2f2d2fa8b4e1b96021390d0be4af (patch) | |
tree | 29f063f7bdea7fa90b01d02ac6b2473512512267 /draksnapshot-applet | |
parent | f23b08c38364009eed695305eaf38caa115dc817 (diff) | |
download | draksnapshot-d570a338e80b2f2d2fa8b4e1b96021390d0be4af.tar draksnapshot-d570a338e80b2f2d2fa8b4e1b96021390d0be4af.tar.gz draksnapshot-d570a338e80b2f2d2fa8b4e1b96021390d0be4af.tar.bz2 draksnapshot-d570a338e80b2f2d2fa8b4e1b96021390d0be4af.tar.xz draksnapshot-d570a338e80b2f2d2fa8b4e1b96021390d0be4af.zip |
do not display multiple bubbles if more than one device is plugged in
less than 5 seconds
git-svn-id: http://svn.mandriva.com/svn/soft/draksnapshot/trunk@241092 99302b65-d5f7-0310-b3dd-f8cd6f4e3d94
Diffstat (limited to 'draksnapshot-applet')
-rwxr-xr-x | draksnapshot-applet | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/draksnapshot-applet b/draksnapshot-applet index 27b5dc1..54eaa19 100755 --- a/draksnapshot-applet +++ b/draksnapshot-applet @@ -80,6 +80,7 @@ my $dbus = dbus_object::system_bus(); my $do = dbus_object->new($dbus, $hal_dn, $manager_path, $hal_manager); my $con = $dbus->{connection}; +my $old_time; $con->add_filter(sub { my ($_bus, $msg) = @_; return if $msg->get_member ne 'DeviceAdded'; @@ -90,7 +91,9 @@ $con->add_filter(sub { $bool = $device->QueryCapability('block') && $device->GetProperty('block.is_volume'); }; if ($bool) { - go2State('disk_found'); + my $time = time(); + go2State('disk_found') if 5 < abs($time - $old_time); + $old_time = $time; } 0; }); |