diff options
author | tv <tv@99302b65-d5f7-0310-b3dd-f8cd6f4e3d94> | 2008-03-28 15:50:44 +0000 |
---|---|---|
committer | tv <tv@99302b65-d5f7-0310-b3dd-f8cd6f4e3d94> | 2008-03-28 15:50:44 +0000 |
commit | 1c96f0253a3548a8f56b66687b50760ba5f05670 (patch) | |
tree | 6b35dd569f3914d54032f03037c224db03479454 /draksnapshot-applet | |
parent | 45a4dd2db9afd428e5ab25644e05b2b25adc660f (diff) | |
download | draksnapshot-1c96f0253a3548a8f56b66687b50760ba5f05670.tar draksnapshot-1c96f0253a3548a8f56b66687b50760ba5f05670.tar.gz draksnapshot-1c96f0253a3548a8f56b66687b50760ba5f05670.tar.bz2 draksnapshot-1c96f0253a3548a8f56b66687b50760ba5f05670.tar.xz draksnapshot-1c96f0253a3548a8f56b66687b50760ba5f05670.zip |
(silentCheck) rename as firstCheck() and simplify since we're now
called only once at startup
git-svn-id: http://svn.mandriva.com/svn/soft/draksnapshot/trunk@241088 99302b65-d5f7-0310-b3dd-f8cd6f4e3d94
Diffstat (limited to 'draksnapshot-applet')
-rwxr-xr-x | draksnapshot-applet | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/draksnapshot-applet b/draksnapshot-applet index 43876a4..d1d1a09 100755 --- a/draksnapshot-applet +++ b/draksnapshot-applet @@ -42,7 +42,7 @@ use Gtk2::Notify '-init', 'draksnapshot'; ugtk2::add_icon_path("/usr/share/draksnapshot/pixmaps/"); -my ($menu, @discs, $state_global); +my ($menu, $state_global); my $localfile = "$ENV{HOME}/.draksnapshot"; @@ -83,7 +83,7 @@ shouldStart() or die "$localfile should be set to TRUE: please use --force or -f go2State('okay'); gtkflush(); -silentCheck(); +firstCheck(); $SIG{USR1} = 'IGNORE'; @@ -135,24 +135,9 @@ sub configure() { go2State('config_in_progress'); } -sub silentCheck() { - state @old_discs; - return if $config_pid; - my $w = $::main_window ? $::main_window->window : undef; - gtkset_mousecursor_wait($w); - - # force refreshing cache: - detect_devices::probeall_update_cache(); - @discs = grep { $_->{usb_bus} && detect_devices::may_be_a_hd($_) } detect_devices::getSCSI(); - go2State('okay') if !@discs; - - # are there any updates ? - my @a = difference2(\@discs, \@old_discs); - if (@a && $state_global ne 'disk_found') { - go2State('disk_found'); - } - @old_discs = @discs; - gtkset_mousecursor_normal($w) if !$insensitive_while_running_a_child; +sub firstCheck() { + my @discs = grep { $_->{usb_bus} && detect_devices::may_be_a_hd($_) } detect_devices::getSCSI(); + go2State(@discs ? 'disk_found' : 'okay'); } sub go2State { |