diff options
author | Olivier Blin <oblin@mandriva.com> | 2008-03-14 12:25:34 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2008-03-14 12:25:34 +0000 |
commit | 2dd11815b455f1bb9510b5c9cf90e4f08f7bfa21 (patch) | |
tree | c1a18d9282ca460850d12dfe66239969887a340a | |
parent | a2849d2425633eabb21fec8c5903f92b32b7fd79 (diff) | |
download | drakx-net-2dd11815b455f1bb9510b5c9cf90e4f08f7bfa21.tar drakx-net-2dd11815b455f1bb9510b5c9cf90e4f08f7bfa21.tar.gz drakx-net-2dd11815b455f1bb9510b5c9cf90e4f08f7bfa21.tar.bz2 drakx-net-2dd11815b455f1bb9510b5c9cf90e4f08f7bfa21.tar.xz drakx-net-2dd11815b455f1bb9510b5c9cf90e4f08f7bfa21.zip |
pass some missing variables
-rwxr-xr-x | bin/drakconnect | 2 | ||||
-rw-r--r-- | lib/network/drakconnect.pm | 5 | ||||
-rw-r--r-- | lib/network/drakconnect/edit.pm | 10 | ||||
-rw-r--r-- | lib/network/drakconnect/global.pm | 4 |
4 files changed, 11 insertions, 10 deletions
diff --git a/bin/drakconnect b/bin/drakconnect index fa30628..45ac58e 100755 --- a/bin/drakconnect +++ b/bin/drakconnect @@ -70,7 +70,7 @@ if (/--del/) { } if (/--internet/) { require network::drakconnect::global; - network::drakconnect::global::configure_net($in, $net); + network::drakconnect::global::configure_net($in, $net, $modules_conf); } # default is to run wizard diff --git a/lib/network/drakconnect.pm b/lib/network/drakconnect.pm index dbe2693..ec784cb 100644 --- a/lib/network/drakconnect.pm +++ b/lib/network/drakconnect.pm @@ -2,12 +2,13 @@ package network::drakconnect; use common; -sub apply() { +sub apply { + my ($in, $net, $modules_conf) = @_; network::network::configure_network($net, $in, $modules_conf); } sub get_intf_ip { - my ($interface) = @_; + my ($net, $interface) = @_; my ($ip, $state, $mask); if (-x "/sbin/ifconfig") { local $_ = `LC_ALL=C LANGUAGE=C /sbin/ifconfig $interface`; diff --git a/lib/network/drakconnect/edit.pm b/lib/network/drakconnect/edit.pm index 667958e..e71ddd8 100644 --- a/lib/network/drakconnect/edit.pm +++ b/lib/network/drakconnect/edit.pm @@ -58,7 +58,7 @@ sub manage { cancel_clicked => sub { $window->destroy; Gtk2->main_quit }, ok_clicked => sub { if ($apply_button->get_property('sensitive')) { - save($in, $net, $p, $apply_button); + save($in, $net, $modules_conf, $p, $apply_button); } $window->destroy; Gtk2->main_quit; @@ -66,7 +66,7 @@ sub manage { }, undef, undef, '', [ N("Help"), sub { run_program::raw({ detach => 1 }, 'drakhelp', '--id', 'internet-connection') } ], - [ N("Apply"), sub { save($in, $net, $p, $apply_button) }, 0, 1 ], + [ N("Apply"), sub { save($in, $net, $modules_conf, $p, $apply_button) }, 0, 1 ], ), ), ); @@ -186,7 +186,7 @@ sub build_notebook { $_->set_sensitive(0) foreach $gui->{intf}{IPADDR}, $gui->{intf}{NETMASK}, $gui->{network}{GATEWAY}; delete $gui->{intf}{BOOTPROTO}; } - !$intf->{IPADDR} and ($intf->{IPADDR}, $gui->{active}, $intf->{NETMASK}) = network::drakconnect::get_intf_ip($interface_name); + !$intf->{IPADDR} and ($intf->{IPADDR}, $gui->{active}, $intf->{NETMASK}) = network::drakconnect::get_intf_ip($net, $interface_name); $gui->{network}{$_}->set_text($net->{network}{$_}) foreach keys %{$gui->{network}}; } @@ -459,7 +459,7 @@ sub populate_notebook { } sub save { - my ($in, $net, $p, $apply_button) = @_; + my ($in, $net, $modules_conf, $p, $apply_button) = @_; my $dialog = _create_dialog(N("Please wait")); gtkpack($dialog->vbox, @@ -474,7 +474,7 @@ sub save { save_notebook($in, $net, $p->{$_}{intf}, $p->{$_}{gui}) or return; $p->{$_}{intf}{save} and $p->{$_}{intf}{save}->(); } - network::drakconnect::apply(); + network::drakconnect::apply($in, $net, $modules_conf); system("/etc/rc.d/init.d/network restart"); $dialog->response(0); }); diff --git a/lib/network/drakconnect/global.pm b/lib/network/drakconnect/global.pm index 746f717..84881b2 100644 --- a/lib/network/drakconnect/global.pm +++ b/lib/network/drakconnect/global.pm @@ -22,7 +22,7 @@ sub update_network_status { } sub configure_net { - my ($in, $net) = @_; + my ($in, $net, $modules_conf) = @_; my $int_state; my $int_label = Gtk2::WrappedLabel->new($net->{type} eq 'lan' ? N("Gateway:") : N("Interface:")); my $int_name = Gtk2::Label->new($net->{type} eq 'lan' ? $net->{network}{GATEWAY} : $net->{net_interface}); @@ -90,7 +90,7 @@ Run the \"%s\" assistant from the Mandriva Linux Control Center", N("Set up a ne foreach my $i (0..$#conf_data) { ${$conf_data[$i][1]} = $infos[2*$i+1]->get_text; } - network::drakconnect::apply(); + network::drakconnect::apply($in, $net, $modules_conf); $exit_dialogsub->(); }), ), |