diff options
author | Olivier Blin <oblin@mandriva.com> | 2008-02-20 17:16:00 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2008-02-20 17:16:00 +0000 |
commit | fdd57f52cc1beda869eb5488a53b8cbb0a93bed6 (patch) | |
tree | 61785bdcd2b4412b15a0a2e8055ca9c0cbe393c3 /lib/network | |
parent | df618fc367737a3b07cfcae7465a4600b5a0c063 (diff) | |
download | drakx-net-fdd57f52cc1beda869eb5488a53b8cbb0a93bed6.tar drakx-net-fdd57f52cc1beda869eb5488a53b8cbb0a93bed6.tar.gz drakx-net-fdd57f52cc1beda869eb5488a53b8cbb0a93bed6.tar.bz2 drakx-net-fdd57f52cc1beda869eb5488a53b8cbb0a93bed6.tar.xz drakx-net-fdd57f52cc1beda869eb5488a53b8cbb0a93bed6.zip |
allow to configure device if not installed (#33531)
Diffstat (limited to 'lib/network')
-rw-r--r-- | lib/network/connection_manager.pm | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/lib/network/connection_manager.pm b/lib/network/connection_manager.pm index 89a831f..c8e8b74 100644 --- a/lib/network/connection_manager.pm +++ b/lib/network/connection_manager.pm @@ -61,6 +61,7 @@ sub setup_connection { return; } } + $cmanager->{connection}{passed_setup} = 1; } sub load_settings { @@ -79,6 +80,12 @@ sub load_settings { sub configure_connection { my ($cmanager) = @_; + if (!$cmanager->{connection}{passed_setup}) { + setup_connection($cmanager); + update_on_status_change($cmanager); + return; + } + load_settings($cmanager); my $error; @@ -294,9 +301,18 @@ sub update_on_status_change { $cmanager->{gui}{buttons}{connect_stop}->set_sensitive($cmanager->{connection} && $cmanager->{connection}->get_status) if $cmanager->{gui}{buttons}{connect_stop}; - my $may_have_network = $cmanager->{connection} && - (!$cmanager->{connection}->can('get_networks') || $cmanager->{connection}{network}); - $cmanager->{gui}{buttons}{configure}->set_sensitive($may_have_network) + my $allow_configure; + if ($cmanager->{connection}) { + my $may_have_network = + !$cmanager->{connection}->can('get_networks') || + $cmanager->{connection}{network}; + $cmanager->{connection}{passed_setup} = + !$cmanager->{connection}->can("check_device") || + $cmanager->{connection}->check_device; + $allow_configure = $may_have_network || !$cmanager->{connection}{passed_setup}; + } + + $cmanager->{gui}{buttons}{configure}->set_sensitive($allow_configure) if $cmanager->{gui}{buttons}{configure}; my $has_interface = to_bool($cmanager->{connection} && $cmanager->{connection}->get_interface); |