From 42a633a091611f9058e26187b0cf2b5ce37832b0 Mon Sep 17 00:00:00 2001 From: damien Date: Sun, 12 Aug 2001 18:22:01 +0000 Subject: corrected connected call --- perl-install/network/tools.pm | 2 +- perl-install/standalone/draknet | 14 +++++++------- perl-install/standalone/net_monitor | 11 ++++++----- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/perl-install/network/tools.pm b/perl-install/network/tools.pm index 60f57e225..4c164f2ad 100644 --- a/perl-install/network/tools.pm +++ b/perl-install/network/tools.pm @@ -37,7 +37,7 @@ sub ask_connect_now { connect_backend(); sleep 5; my $netc = {}; - $up=connected($netc); + $up=connected(); } my $m = $up ? (_("The system is now connected to Internet.") . if_($::isInstall, _("For Security reason, it will be disconnected now.")) ) : diff --git a/perl-install/standalone/draknet b/perl-install/standalone/draknet index 7ff216ced..a5379a7d0 100755 --- a/perl-install/standalone/draknet +++ b/perl-install/standalone/draknet @@ -181,7 +181,7 @@ my $label5 = new Gtk::Label($netcnx->{type} eq 'lan' ? _("Gateway:") : _("Interf $table1->attach($label5, 0, 1, 1, 2, 'fill', 'fill',0,0); my $label6 = new Gtk::Label($netcnx->{type} eq 'lan' ? $netc->{GATEWAY} : $netc->{NET_INTERFACE}); $table1->attach($label6, 1, 2, 1, 2, 'fill', 'fill',0,0); -my $c=network::tools::connected(); +my $c=connected(); my $label7 = new Gtk::Label(_("Status:")); $table1->attach($label7, 0, 1, 2, 3, 'fill', 'fill',0,0); my $label8 = new Gtk::Label($c ? _("Connected") : _("Not connected")); @@ -204,20 +204,20 @@ $button2->signal_connect (clicked => sub { $bbox_dialog->add($button_ok ); $dialog->show_all; $dialog->set_modal(1); - if (!network::tools::connected()) { + if (!connected()) { $l->set(_("Starting your connection...")); Gtk->main_iteration while Gtk->events_pending; - network::tools::connect_backend(); + connect_backend(); foreach (1..10) { Gtk->main_iteration while Gtk->events_pending; sleep 1; } - my $up=network::tools::connected($netc); + my $up=connected(); $l->set($up ? _("The system is now connected to Internet.") : _("The system doesn't seem to be connected to internet. Try to reconfigure your connection.")); } else { $l->set(_("Closing your connection...")); Gtk->main_iteration while Gtk->events_pending; - network::tools::disconnect_backend(); + disconnect_backend(); foreach (1..10) { Gtk->main_iteration while Gtk->events_pending; sleep 1; } - my $up=network::tools::connected(); + my $up=connected(); $l->set($up ? _("The connection is not closed. Try to do it manually by running /etc/sysconfig/network-scripts/net_cnx_down @@ -387,7 +387,7 @@ sub update { $label4->set($netcnx->{type}); $label5->set($netcnx->{type} eq 'lan' ? _("Gateway:") : _("Interface:")); $label6->set($netcnx->{type} eq 'lan' ? $netc->{GATEWAY} : $netc->{NET_INTERFACE}); - my $c = network::tools::connected(); + my $c = connected(); $label8->set($c ? _("Connected") : _("Not connected")); $button2->child->set($c ? _("Disconnect...") : _("Connect...")); $clist1->freeze(); diff --git a/perl-install/standalone/net_monitor b/perl-install/standalone/net_monitor index 2f58c073f..e3283bf52 100755 --- a/perl-install/standalone/net_monitor +++ b/perl-install/standalone/net_monitor @@ -27,6 +27,7 @@ use my_gtk qw(:helpers :wrappers); use common; use strict; use network::netconnect; +use network::tools; use MDK::Common::Globals "network", qw($in $prefix $connect_file $disconnect_file $connect_prog); my ($connect, $default_intf); @@ -153,16 +154,16 @@ sub connection { my $tag2 = Gtk->timeout_add(10000, sub { Gtk->timeout_remove($tag); $statusbar->pop(1); - $statusbar->push(1, $isconnected2 ? ( network::netconnect::connected('', $netc) ? + $statusbar->push(1, $isconnected2 ? ( connected() ? _("Disconnection from Internet failed.") : _("Disconnection from Internet complete.")) : - ( network::netconnect::connected('', $netc) ? + ( connected() ? _("Connection complete.") : _("Connection failed.\nVerify your configuration in the Mandrake Control Center.")) ); my $tag3 = Gtk->timeout_add(10000, sub { $statusbar->pop(1); - $statusbar->push(1, network::netconnect::connected('', $netc) ? _("Connected") : _("Not connected")); + $statusbar->push(1, connected() ? _("Connected") : _("Not connected")); 0; }); $button_connect->set_sensitive(1); @@ -331,11 +332,11 @@ sub update { } @interfaces = @intfs; my $netc={}; - if(network::netconnect::connected('', $netc) == !$isconnected) { + if(connected() == !$isconnected) { $isconnected = $isconnected ? 0 : 1; $label_c->set($isconnected ? _("Disconnect") : _("Connect")); $statusbar->pop(1); - $statusbar->push(1, network::netconnect::connected('', $netc) ? _("Connected") : _("Not connected")); + $statusbar->push(1, connected() ? _("Connected") : _("Not connected")); $isconnected ? $pix_c->set($pix_c_map, $pix_c_mask) : $pix_c->set($pix_d_map, $pix_d_mask); } $time_tag2 = Gtk->timeout_add(5000, \&update); -- cgit v1.2.1