summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2003-09-08 16:46:47 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2003-09-08 16:46:47 +0000
commitd554f081d32d36428ac4a080707204ba4c25ea06 (patch)
tree7b3086a546630b818bb9b6d9c3c21bd1aafb1834 /perl-install/standalone
parent49897f4672cd9ff8c53702a3a6816182eb925f18 (diff)
downloaddrakx-d554f081d32d36428ac4a080707204ba4c25ea06.tar
drakx-d554f081d32d36428ac4a080707204ba4c25ea06.tar.gz
drakx-d554f081d32d36428ac4a080707204ba4c25ea06.tar.bz2
drakx-d554f081d32d36428ac4a080707204ba4c25ea06.tar.xz
drakx-d554f081d32d36428ac4a080707204ba4c25ea06.zip
increase drakconnect robustness regarding profiles managment
- fix set_profiles() call on profiles menu user change - (set_profiles) consolidate netcnx->{PROFILE} setting where we call set_profile - (update_profiles) rely on netcnx->{PROFILE} - fix profiles list update when wizard exits
Diffstat (limited to 'perl-install/standalone')
-rwxr-xr-xperl-install/standalone/drakconnect21
1 files changed, 10 insertions, 11 deletions
diff --git a/perl-install/standalone/drakconnect b/perl-install/standalone/drakconnect
index a8088fcf3..137dd32cc 100755
--- a/perl-install/standalone/drakconnect
+++ b/perl-install/standalone/drakconnect
@@ -90,25 +90,25 @@ my $profile_combo = gtksignal_connect(Gtk2::OptionMenu->new, changed => sub {
return if $::ignore_profile_change;
my $selected_profile = $combo->get_text;
return if $selected_profile eq $netcnx->{PROFILE};
- $netcnx->{PROFILE} = $selected_profile;
- set_profiles($netcnx) if $combo->window; # is realized?;
+ set_profiles($selected_profile) if $combo->window; # is realized?;
});
-sub update_profiles {
- my ($new_profile) = @_;
- $new_profile ||= $netcnx->{PROFILE} || "default";
+# update combo profiles
+sub update_profiles() {
@profiles = network::netconnect::get_profiles();
$button_del->set_sensitive(@profiles > 1);
local $::ignore_profile_change = 1;
$profile_combo->set_popdown_strings(@profiles);
- $profile_combo->set_text($new_profile);
+ $profile_combo->set_text($netcnx->{PROFILE});
}
+# Change current profile
sub set_profiles {
my ($new_profile) = @_;
+ $netcnx->{PROFILE} = $new_profile;
network::netconnect::set_profile($netcnx);
network::netconnect::load_conf($netcnx, $netc, $intf);
- update_profiles($new_profile);
+ update_profiles();
update();
$button_apply->set_sensitive(1);
}
@@ -196,11 +196,10 @@ $window1->{window}->add(
gtksignal_connect(Gtk2::Button->new(N("Cancel")),
clicked => sub { $dialog->destroy }),
gtksignal_connect(Gtk2::Button->new(N("Ok")), clicked => sub {
- my $curr_prof = $profile_combo->get_text;
#warn if already existing
network::netconnect::add_profile($netcnx, $entry_dialog->get_text);
- update_profiles($curr_prof);
+ update_profiles();
$dialog->destroy;
}),
);
@@ -301,17 +300,17 @@ sub sensitive_buttons {
$SIG{CHLD} = sub {
my $child = waitpid(-1, POSIX::WNOHANG);
+ # when the wizard has exiter, reload everything to catch its changes
return if !($wizard_pid && $child eq $wizard_pid);
undef $wizard_pid;
sensitive_buttons(1);
- #- reload everything...
$netcnx = {}; $netc = {}; $intf = {};
network::netconnect::read_net_conf('', $netcnx, $netc);
modules::load_category('net');
@all_cards = network::ethernet::conf_network_card_backend($netc, $intf);
network::netconnect::load_conf($netcnx, $netc, $intf);
network::network::probe_netcnx_type('', $netc, $intf, $netcnx);
- $profile_combo->set_text(-e "/etc/sysconfig/network-scripts/drakconnect_conf." . ($profile_combo->entry->get_text || "default"));
+ update_profiles();
update();
};