summaryrefslogtreecommitdiffstats
path: root/lib/network/connection_manager.pm
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-02-26 17:34:44 +0000
committerOlivier Blin <oblin@mandriva.com>2008-02-26 17:34:44 +0000
commit0962b3b8025c988b8141f84a91d3ac9ffe5672f7 (patch)
tree04a0f159c8f20cb0a457a5ad5863d2047096444d /lib/network/connection_manager.pm
parente1df22b070059f5d8c7d4ebcf816356047099552 (diff)
downloaddrakx-net-0962b3b8025c988b8141f84a91d3ac9ffe5672f7.tar
drakx-net-0962b3b8025c988b8141f84a91d3ac9ffe5672f7.tar.gz
drakx-net-0962b3b8025c988b8141f84a91d3ac9ffe5672f7.tar.bz2
drakx-net-0962b3b8025c988b8141f84a91d3ac9ffe5672f7.tar.xz
drakx-net-0962b3b8025c988b8141f84a91d3ac9ffe5672f7.zip
factorize settings write in write_settings() (adds additional modules_conf write in some cases)
Diffstat (limited to 'lib/network/connection_manager.pm')
-rw-r--r--lib/network/connection_manager.pm14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/network/connection_manager.pm b/lib/network/connection_manager.pm
index 00a2383..a6cf643 100644
--- a/lib/network/connection_manager.pm
+++ b/lib/network/connection_manager.pm
@@ -88,6 +88,14 @@ sub load_settings {
$cmanager->{connection}->guess_control_settings;
}
+sub write_settings {
+ my ($cmanager) = @_;
+
+ my $modules_conf = modules::any_conf->read;
+ $cmanager->{connection}->write_settings($cmanager->{net}, $modules_conf);
+ $modules_conf->write;
+}
+
sub configure_connection {
my ($cmanager) = @_;
@@ -142,9 +150,7 @@ sub configure_connection {
$cmanager->{connection}->install_packages($cmanager->{in}) if $cmanager->{connection}->can('install_packages');
$cmanager->{connection}->unload_connection if $cmanager->{connection}->can('unload_connection');
- my $modules_conf = modules::any_conf->read;
- $cmanager->{connection}->write_settings($cmanager->{net}, $modules_conf);
- $modules_conf->write;
+ write_settings($cmanager);
1;
}
@@ -165,7 +171,7 @@ sub start_connection {
#- settings have to be rewritten only if they are impacted by choices from the main window
if ($cmanager->{connection}->can('get_networks')) {
load_settings($cmanager);
- $cmanager->{connection}->write_settings($cmanager->{net});
+ write_settings($cmanager);
}
$cmanager->{connection}->prepare_connection if $cmanager->{connection}->can('prepare_connection');
$cmanager->{connection}->disconnect;