diff options
author | Olivier Blin <oblin@mandriva.org> | 2005-07-18 10:36:30 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.org> | 2005-07-18 10:36:30 +0000 |
commit | e8a0e25299051673ac73fa0396efeb345e5f2a55 (patch) | |
tree | 82b975b2406e07e20d34580a3e086462db6d8716 /perl-install/standalone/net_applet | |
parent | 69f58f3727f1c024eb0a1aaa4859d57f6093c071 (diff) | |
download | drakx-backup-do-not-use-e8a0e25299051673ac73fa0396efeb345e5f2a55.tar drakx-backup-do-not-use-e8a0e25299051673ac73fa0396efeb345e5f2a55.tar.gz drakx-backup-do-not-use-e8a0e25299051673ac73fa0396efeb345e5f2a55.tar.bz2 drakx-backup-do-not-use-e8a0e25299051673ac73fa0396efeb345e5f2a55.tar.xz drakx-backup-do-not-use-e8a0e25299051673ac73fa0396efeb345e5f2a55.zip |
check for new version every minute instead of every 2 seconds
Diffstat (limited to 'perl-install/standalone/net_applet')
-rw-r--r-- | perl-install/standalone/net_applet | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/perl-install/standalone/net_applet b/perl-install/standalone/net_applet index 7f9f03867..eb4bcea68 100644 --- a/perl-install/standalone/net_applet +++ b/perl-install/standalone/net_applet @@ -5,7 +5,6 @@ use lib qw(/usr/lib/libDrakX); use c; use common; use standalone; -use Digest::MD5; use network::network; use network::tools; @@ -21,13 +20,12 @@ use ugtk2 qw(:create :helpers :wrappers); my $enable_activefw; my ($eventbox, $img); -my ($current_state, $menu, $timeout); +my ($current_state, $menu, $timeout, $update_timeout); my $onstartupfile = "$ENV{HOME}/.net_applet"; add_icon_path("/usr/share/libDrakX/pixmaps/"); # Allow multiple instances, but only one per user: is_running('net_applet') and die "net_applet already running\n"; my $prog_name = "/usr/bin/net_applet"; -my $current_md5 = common::md5file($prog_name); my $net = {}; my $watched_interface; @@ -170,9 +168,6 @@ sub checkNetwork() { ($watched_interface, network::tools::get_interface_status($watched_interface)) : network::tools::get_internet_connection($net); go2State($gw_address ? 'connected' : $gw_intf ? 'disconnected' : 'notconfigured', $gw_intf); - - my $new_md5 = common::md5file($prog_name); - if ($new_md5 ne $current_md5) { exec($prog_name) } } sub checkNetworkForce() { $net = {}; @@ -186,6 +181,13 @@ sub cronNetwork() { 1; }); } +sub cronUpdate() { + my $current_md5 = common::md5file($prog_name); + $update_timeout = Glib::Timeout->add(60000, sub { + my $new_md5 = common::md5file($prog_name); + $new_md5 ne $current_md5 and exec($prog_name); + }); +} sub go2State { my ($state_type, $interface) = @_; if ($current_state ne $state_type) { @@ -271,6 +273,7 @@ sub generate_menu { } sub mainQuit() { Glib::Source->remove($timeout) if $timeout; + Glib::Source->remove($update_timeout) if $update_timeout; Gtk2->main_quit; } sub getAutoStart() { |