From 027d239803146b08081b2475131128e45f936cf8 Mon Sep 17 00:00:00 2001 From: Damien Chaumette Date: Sun, 7 Sep 2003 18:35:48 +0000 Subject: - $netcnx->{PROFILE} is current profile name (now scalar) - fix non working profiles loading/saving - perl_checker --- perl-install/network/netconnect.pm | 13 ++++++++----- perl-install/standalone/drakconnect | 8 +++++--- 2 files changed, 13 insertions(+), 8 deletions(-) (limited to 'perl-install') diff --git a/perl-install/network/netconnect.pm b/perl-install/network/netconnect.pm index 639e1ab6f..14f30a45f 100644 --- a/perl-install/network/netconnect.pm +++ b/perl-install/network/netconnect.pm @@ -277,16 +277,19 @@ fi sub save_conf { my ($netcnx) = @_; my $string = "# Connection type reminder -type=$netcnx->{type} +name=$netcnx->{PROFILE} "; output_with_perm("$prefix/etc/sysconfig/drakconnect", 0600, $string); } sub set_profile { - my ($netcnx, $profile) = @_; - $netcnx->{PROFILE} = $profile; + my ($netcnx) = @_; system("/sbin/set-netprofile $netcnx->{PROFILE}"); +} +sub save_profile { + my ($netcnx) = @_; + system("/sbin/save-netprofile $netcnx->{PROFILE}"); } sub del_profile { @@ -307,9 +310,9 @@ sub get_profiles() { sub load_conf { my ($netcnx, $netc, $intf) = @_; - my $type = { getVarsFromSh("$prefix/etc/sysconfig/drakconnect") }; + my $profile = { getVarsFromSh("$prefix/etc/sysconfig/drakconnect") }; - $type->{type} and $netcnx->{type} = $type->{type}; + $netcnx->{PROFILE} = $profile->{name}; network::read_all_conf($prefix, $netc, $intf); } diff --git a/perl-install/standalone/drakconnect b/perl-install/standalone/drakconnect index 582fb7528..2196a0483 100755 --- a/perl-install/standalone/drakconnect +++ b/perl-install/standalone/drakconnect @@ -91,6 +91,7 @@ my $profile_combo = gtksignal_connect(Gtk2::OptionMenu->new, changed => sub { my $selected_profile = $combo->get_text; return if $selected_profile eq $netcnx->{PROFILE}; set_profiles($selected_profile) if $combo->window; # is realized?; + $netcnx->{PROFILE} = $selected_profile; }); sub update_profiles { @@ -105,9 +106,8 @@ sub update_profiles { sub set_profiles { my ($new_profile) = @_; - network::netconnect::set_profile($netcnx, $new_profile); + network::netconnect::set_profile($netcnx); network::netconnect::load_conf($netcnx, $netc, $intf); - $netcnx->{$_} = $netc->{$_} foreach qw(NET_DEVICE NET_INTERFACE); update_profiles($new_profile); update(); $button_apply->set_sensitive(1); @@ -224,7 +224,7 @@ $window1->{window}->add( $button_apply->set_sensitive(1); update(); }; - if ($@ =~ /wizcancel/) { } + if ($@ =~ /wizcancel/) {} $::WizardWindow->destroy; undef $::WizardWindow; sensitive_buttons(1); @@ -376,6 +376,8 @@ sub apply() { network::configureNetwork2($in, $prefix, $netc, $intf); $netcnx->{type} =~ /adsl/ or system("/sbin/chkconfig --del adsl 2> /dev/null"); $netcnx->{type} !~ /adsl_p/ and system("$prefix/etc/rc.d/init.d/network restart"); + + network::netconnect::save_profile($netcnx); $button_apply->set_sensitive(0); } -- cgit v1.2.1