diff options
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 { |