summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-01-22 23:34:59 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-01-22 23:34:59 +0000
commitd4b8566f7d690b25c3aec5dab2c42886b309d4bc (patch)
treeea1382ddf19aa4b46602d90792339e470c755bc4
parentf274ed163f035102a4460a815582b8f5a2e1236a (diff)
downloaddrakx-backup-do-not-use-d4b8566f7d690b25c3aec5dab2c42886b309d4bc.tar
drakx-backup-do-not-use-d4b8566f7d690b25c3aec5dab2c42886b309d4bc.tar.gz
drakx-backup-do-not-use-d4b8566f7d690b25c3aec5dab2c42886b309d4bc.tar.bz2
drakx-backup-do-not-use-d4b8566f7d690b25c3aec5dab2c42886b309d4bc.tar.xz
drakx-backup-do-not-use-d4b8566f7d690b25c3aec5dab2c42886b309d4bc.zip
add "quit_if_double_click" and "tree_expanded" flags (request from till)
-rw-r--r--perl-install/interactive.pm2
-rw-r--r--perl-install/interactive_gtk.pm8
2 files changed, 6 insertions, 4 deletions
diff --git a/perl-install/interactive.pm b/perl-install/interactive.pm
index ed6b0184d..809281ea7 100644
--- a/perl-install/interactive.pm
+++ b/perl-install/interactive.pm
@@ -27,6 +27,8 @@ use common;
#- combo (with list, not_edit)
#- list (with list, icon2f (aka icon), separator (aka tree), format (aka pre_format function),
#- help can be a hash or a function,
+#- tree_expanded boolean telling wether the tree should be wide open by default
+#- quit_if_double_click boolean
#- allow_empty_list disables the special cases for 0 and 1 element lists)
#- entry (the default) (with hidden)
#
diff --git a/perl-install/interactive_gtk.pm b/perl-install/interactive_gtk.pm
index eb39348c6..e42833f80 100644
--- a/perl-install/interactive_gtk.pm
+++ b/perl-install/interactive_gtk.pm
@@ -147,7 +147,7 @@ sub create_clist {
}
sub create_ctree {
- my ($e, $may_go_to_next, $changed, $double_click) = @_;
+ my ($e, $may_go_to_next, $changed, $double_click, $tree_expanded) = @_;
my @l = map { may_apply($e->{format}, $_) } @{$e->{list}};
my $sep = quotemeta $e->{separator};
@@ -159,7 +159,7 @@ sub create_ctree {
my $s;
foreach (split $sep, $_[0]) {
$wtree{"$s$_$e->{separator}"} ||=
- $tree->insert_node($s ? $parent->($s) : undef, undef, [$_], 5, (undef) x 4, 0, 0);
+ $tree->insert_node($s ? $parent->($s) : undef, undef, [$_], 5, (undef) x 4, 0, $tree_expanded);
$size++ if !$s;
$s .= "$_$e->{separator}";
}
@@ -435,7 +435,7 @@ sub ask_fromW {
my $quit_if_double_click =
#- i'm the only one, double click means accepting
- @$l == 1 ?
+ @$l == 1 || $e->{quit_if_double_click} ?
sub { if ($_[1]{type} =~ /^2/) { $mainw->{retval} = 1; Gtk->main_quit } } : '';
my @para = ($e, $may_go_to_next, $changed, $quit_if_double_click);
@@ -445,7 +445,7 @@ sub ask_fromW {
#- used only when needed, as key bindings are dropped by List (CList does not seems to accepts Tooltips).
($w, $set, $focus_w) = $use_boxradio ? create_boxradio(@para) : create_list(@para);
} elsif ($e->{type} eq 'treelist') {
- ($w, $set, $size) = create_ctree(@para);
+ ($w, $set, $size) = create_ctree(@para, $e->{tree_expanded});
} else {
($w, $set, $focus_w) = $use_boxradio ? create_boxradio(@para) : create_clist(@para);
}