From d570a338e80b2f2d2fa8b4e1b96021390d0be4af Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 28 Mar 2008 15:59:03 +0000 Subject: 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 --- draksnapshot-applet | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; }); -- cgit v1.2.1