From d93c174387bc9379025dd19b161cd2db4e4f769a Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 7 Nov 2003 19:53:49 +0000 Subject: fix network interfaces list update: - really remove from the Gtk+ list lost interfaces - update the intf reference list --- perl-install/standalone/drakconnect | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'perl-install/standalone/drakconnect') diff --git a/perl-install/standalone/drakconnect b/perl-install/standalone/drakconnect index fa2325a63..0c5c26d43 100755 --- a/perl-install/standalone/drakconnect +++ b/perl-install/standalone/drakconnect @@ -338,14 +338,18 @@ sub get_intf_ip { my %intf; sub update_list() { + @all_cards = network::ethernet::conf_network_card_backend($netc, $intf); my %new_intf = map { @$_ } @all_cards; my @new_intf = sort keys %new_intf; + foreach my $interface (difference2(\@new_intf, [ keys %intf ])) { + $intf{$interface} = $tree_model->append(undef); + } foreach my $interface (@new_intf) { my ($ip, $state) = get_intf_ip($interface); - $intf{$interface}{iter} ||= $tree_model->append(undef); - $tree_model->set($intf{$interface}{iter}, map_index { $::i => $_ } (gtkcreate_pixbuf("eth_card_mini2.png"), $interface, $ip , $intf->{$interface}{BOOTPROTO}, $new_intf{$interface}, $state)); + $tree_model->set($intf{$interface}, map_index { $::i => $_ } (gtkcreate_pixbuf("eth_card_mini2.png"), $interface, $ip , $intf->{$interface}{BOOTPROTO}, $new_intf{$interface}, $state)); } foreach my $i (difference2([ keys %intf ], \@new_intf)) { + $tree_model->remove($intf{$i}); delete $intf{$i}; } } -- cgit v1.2.1