summaryrefslogtreecommitdiffstats
path: root/perl-install/harddrake/ui.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2002-09-05 15:19:26 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2002-09-05 15:19:26 +0000
commita54c3784b15abf55c8e35fc55761b65d6c060671 (patch)
tree1a6d28ac502048484620c1b90ead4cea9f50b8a3 /perl-install/harddrake/ui.pm
parentc21e20134660ccb5855bac3f9287d7bd9073ebf9 (diff)
downloaddrakx-a54c3784b15abf55c8e35fc55761b65d6c060671.tar
drakx-a54c3784b15abf55c8e35fc55761b65d6c060671.tar.gz
drakx-a54c3784b15abf55c8e35fc55761b65d6c060671.tar.bz2
drakx-a54c3784b15abf55c8e35fc55761b65d6c060671.tar.xz
drakx-a54c3784b15abf55c8e35fc55761b65d6c060671.zip
don't rely on ctree row number
Diffstat (limited to 'perl-install/harddrake/ui.pm')
-rw-r--r--perl-install/harddrake/ui.pm21
1 files changed, 12 insertions, 9 deletions
diff --git a/perl-install/harddrake/ui.pm b/perl-install/harddrake/ui.pm
index fd6be1217..99f4a7341 100644
--- a/perl-install/harddrake/ui.pm
+++ b/perl-install/harddrake/ui.pm
@@ -114,10 +114,13 @@ sub new {
my $wcolor = { 'red' => 0xFFFF, 'green' => 0x6400, 'blue' => 0x6400 };
$cmap->color_alloc($wcolor);
$tree->set_column_auto_resize(0, 1);
+ my $curr = $tree->node_nth(0); #- default value
$tree->signal_connect( 'select_row', sub {
my ( $ctree, $row, $column, $event ) = @_;
my $node = $ctree->node_nth( $row );
- my $data = $tree->{data}{$row};
+ my ($name, undef) = $tree->node_get_pixtext($node,0);
+ my $data = $tree->{data}{$name};
+
if ($data) {
$text->hide;
$text->backward_delete($text->get_point);
@@ -152,7 +155,7 @@ sub new {
}
disconnect($config_button, 'tool');
$text->show;
- my $configurator = $tree->{configurator}{$row};
+ my $configurator = $tree->{configurator}{$name};
return unless -x $configurator;
$IDs{tool} = $config_button->signal_connect(clicked => sub {
@@ -169,7 +172,6 @@ sub new {
}
});
- my $row = 0;
foreach (@harddrake::data::tree) {
my ($Ident, $title, $icon, $configurator, $detector) = @$_;
next if (ref($detector) ne "CODE"); #skip class witouth detector
@@ -178,8 +180,7 @@ sub new {
my @devices = &$detector;
next if (!listlength(@devices)); # Skip empty class (no devices)
my $hw_class_tree = $tree->insert_node(undef, undef, [$title], 5, (gtkcreate_png($icon)) x 2, 0, ($title =~ /Unknown/ ? 0 : 1));
- $row++;
-
+ my $prev_item;
foreach (@devices) {
if (exists $_->{bus} && $_->{bus} eq "PCI") {
my $i = $_;
@@ -208,12 +209,14 @@ sub new {
}
foreach my $i (qw(vendor id subvendor subid pci_bus pci_device pci_function MOUSETYPE XMOUSETYPE unsafe val devfs_prefix wacom auxmouse)) { delete $_->{$i} }
$_->{device} = '/dev/'.$_->{device} if exists $_->{device};
- my $hw_item = $tree->insert_node($hw_class_tree, undef, [defined($_->{device}) ? $_->{device} : (defined($_->{description}) ? $_->{description} : $title) ], 5, (undef) x 4, 1, 0);
- $tree->{data}{$row} = $_;
- $tree->{configurator}{$row++} = $configurator;
+ my $custom_id = defined($_->{device}) ? $_->{device} : (defined($_->{description}) ? $_->{description} : $title);
+ my $hw_item = $tree->insert_node($hw_class_tree, $prev_item, [$custom_id ], 5, (undef) x 4, 1, 0);
+ $tree->set_row_data($hw_item, [data => $_, configurator => $configurator ]);
+ $tree->{data}{$custom_id} = $_;
+ $tree->{configurator}{$custom_id} = $configurator;
+ $prev_item = $hw_item;
}
}
-
$SIG{CHLD} = sub { undef $pid; $statusbar->pop($sig_id) };
$w->{rwindow}->signal_connect (delete_event => \&quit_global);
undef $wait;