diff options
author | Thierry Vignaud <tv@mandriva.org> | 2007-12-05 12:22:53 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2007-12-05 12:22:53 +0000 |
commit | 46fea0d25d44a6fc2a7de3fc84c65150892a5898 (patch) | |
tree | 9a6cf7fe3fb44ae5508c1e9c0265214a3bb66df9 | |
parent | 6227fd431806d3319d3c2d070ee671e296d9f3eb (diff) | |
download | mgaonline-46fea0d25d44a6fc2a7de3fc84c65150892a5898.tar mgaonline-46fea0d25d44a6fc2a7de3fc84c65150892a5898.tar.gz mgaonline-46fea0d25d44a6fc2a7de3fc84c65150892a5898.tar.bz2 mgaonline-46fea0d25d44a6fc2a7de3fc84c65150892a5898.tar.xz mgaonline-46fea0d25d44a6fc2a7de3fc84c65150892a5898.zip |
kill disconnect state (thus make mdkapplet works again w/o network)
-rwxr-xr-x | mdkapplet | 44 |
1 files changed, 10 insertions, 34 deletions
@@ -80,7 +80,7 @@ mkdir_p($localdir) if !-d $localdir; my %state = ( delayed => { colour => [ 'busy' ], - changes => [ 'busy', 'critical', 'disconnected' ], + changes => [ 'busy', 'critical' ], menu => [ 'check' ], tt => [ #-PO: here %s will be replaced by the local time (eg: "Will check updates at 14:03:50" @@ -91,19 +91,19 @@ my %state = ( okay => { colour => [ 'okay' ], - changes => [ 'busy', 'critical', 'disconnected' ], + changes => [ 'busy', 'critical' ], menu => [ 'check' ], tt => [ N_("Your system is up-to-date") ] }, critical => { colour => [ 'noconf' ], - changes => [ 'okay', 'busy', 'critical', 'disconnected' ], + changes => [ 'okay', 'busy', 'critical' ], menu => [ 'check' ], tt => [ N_("Service configuration problem. Please check logs and send mail to support\@mandrivaonline.com") ] }, busy => { colour => [ 'busy' ], - changes => [ 'okay', 'critical', 'error', 'disconnected' ], + changes => [ 'okay', 'critical', 'error' ], menu => [], tt => [ N_("Please wait, finding available packages...") ] }, @@ -119,12 +119,6 @@ my %state = ( menu => [ 'update', 'check' ], tt => [ N_("New bundles are available for your system") ] }, - disconnected => { - colour => [ 'disconnect' ], - changes => [ 'okay', 'busy', 'critical', 'error' ], - menu => [ 'confNetwork' ], - tt => [ N_("Network is down. Please configure your network") ] - }, disabled => { colour => [ 'disabled' ], changes => [ 'okay', 'busy', 'critical', 'error' ], @@ -133,7 +127,7 @@ my %state = ( }, locked => { colour => [ 'noconf' ], - changes => [ 'okay', 'busy', 'critical', 'disconnected' ], + changes => [ 'okay', 'busy', 'critical' ], menu => [ 'check' ], tt => [ N_("urpmi database locked") ], }, @@ -145,13 +139,13 @@ my %state = ( }, no_update_medium => { colour => [ 'noconf' ], - changes => [ 'okay', 'busy', 'critical', 'disconnected' ], + changes => [ 'okay', 'busy', 'critical' ], menu => [ 'check' ], tt => [ N_("No medium found. You must add some media through 'Software Media Manager'.") ], }, no_enabled_medium => { colour => [ 'noconf' ], - changes => [ 'okay', 'busy', 'critical', 'disconnected' ], + changes => [ 'okay', 'busy', 'critical' ], menu => [ 'check' ], tt => [ N("You already have at least one update medium configured, but all of them are currently disabled. You should run the Software @@ -202,7 +196,7 @@ my %comm_codes = ( my %actions = ( 'update' => { name => N("Install updates"), launch => sub { installUpdates() } }, - 'check' => { name => N("Check Updates"), launch => \&checkUpdates }, + 'check' => { name => N("Check Updates"), launch => \&silentCheck }, 'confNetwork' => { name => N("Configure Network"), launch => sub { configNetwork() } }, ); @@ -232,8 +226,7 @@ shouldStart() or die "$localfile should be set to TRUE: please use --force or -f $icon->show_all; go2State('delayed'); gtkflush(); -checkConfig(); -Glib::Timeout->add($config{FIRST_CHECK_DELAY}, sub { checkUpdates(); 0 }); +Glib::Timeout->add($config{FIRST_CHECK_DELAY}, sub { silentCheck(); 0 }); setup_cyclic_check(); @@ -388,10 +381,6 @@ sub okState() { logIt(N_("System is up-to-date\n")); go2State('okay') } sub setup_cyclic_check() { - Glib::Timeout->add(10*1000, sub { - checkConfig(); - 1; - }); $timeout = Glib::Timeout->add($config{UPDATE_FREQUENCY}*1000, sub { my $first_run if 0; if (!$first_run) { @@ -399,7 +388,7 @@ sub setup_cyclic_check() { return 1; } - checkUpdates(); + silentCheck(); 1; }); } @@ -415,19 +404,6 @@ sub setLastTime() { setVar($localfile, 'LASTCHECK', $date); } -sub checkConfig() { - if (!isNetwork()) { - logIt(N_("Checking Network: seems disabled\n")); - go2State('disconnected'); - } elsif (member($state_global, qw(disconnected))) { - silentCheck(); #- state has changed, update - } -} - -sub checkUpdates() { - member($state_global, qw(disconnected)) or silentCheck(); -} - sub go2State { my $state = shift; $menu->destroy if $menu; |