diff options
author | Damien Chaumette <dchaumette@mandriva.com> | 2003-09-07 18:35:48 +0000 |
---|---|---|
committer | Damien Chaumette <dchaumette@mandriva.com> | 2003-09-07 18:35:48 +0000 |
commit | 027d239803146b08081b2475131128e45f936cf8 (patch) | |
tree | 1772897bf316b8b19db9cc8e81c575c078529b6c /perl-install | |
parent | d27a5e643e178914febb11d1dd25569a32fd698c (diff) | |
download | drakx-backup-do-not-use-027d239803146b08081b2475131128e45f936cf8.tar drakx-backup-do-not-use-027d239803146b08081b2475131128e45f936cf8.tar.gz drakx-backup-do-not-use-027d239803146b08081b2475131128e45f936cf8.tar.bz2 drakx-backup-do-not-use-027d239803146b08081b2475131128e45f936cf8.tar.xz drakx-backup-do-not-use-027d239803146b08081b2475131128e45f936cf8.zip |
- $netcnx->{PROFILE} is current profile name (now scalar)
- fix non working profiles loading/saving
- perl_checker
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/network/netconnect.pm | 13 | ||||
-rwxr-xr-x | perl-install/standalone/drakconnect | 8 |
2 files changed, 13 insertions, 8 deletions
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); } |