summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-08-12 18:29:18 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-08-12 18:29:18 +0000
commitd0491365909800f8010c393eb3a0b99aaceb3b8d (patch)
tree9e37ce860d4dd6700f1791fce9c333ffcbca10fe
parent76e1db70d4cffe9833f23855b7301bec68bcefdb (diff)
downloaddrakx-backup-do-not-use-d0491365909800f8010c393eb3a0b99aaceb3b8d.tar
drakx-backup-do-not-use-d0491365909800f8010c393eb3a0b99aaceb3b8d.tar.gz
drakx-backup-do-not-use-d0491365909800f8010c393eb3a0b99aaceb3b8d.tar.bz2
drakx-backup-do-not-use-d0491365909800f8010c393eb3a0b99aaceb3b8d.tar.xz
drakx-backup-do-not-use-d0491365909800f8010c393eb3a0b99aaceb3b8d.zip
don't switch to 2 buttons dialog box if the labels are too long in ask_from_list
(otherwise it's ugly (reported for XFdrake multi-head choice with 67 & 58 chars strings) (fix bug #62)
-rw-r--r--perl-install/interactive.pm22
1 files changed, 12 insertions, 10 deletions
diff --git a/perl-install/interactive.pm b/perl-install/interactive.pm
index 619eeb3ab..3db0085f4 100644
--- a/perl-install/interactive.pm
+++ b/perl-install/interactive.pm
@@ -177,17 +177,19 @@ sub ask_from_listf_no_check {
my ($o, $title, $message, $f, $l, $def, $help) = @_;
if (@$l <= 2 && !$::isWizard) {
- my $ret = eval {
- ask_from_no_check($o,
- { title => $title, messages => $message, ok => $l->[0] && may_apply($f, $l->[0]),
- if_($l->[1], cancel => may_apply($f, $l->[1]), focus_cancel => $def eq $l->[1]) }, []
- ) ? $l->[0] : $l->[1];
- };
- die if $@ && $@ !~ /^wizcancel/;
- $@ ? undef : $ret;
- } else {
- ask_from($o, $title, $message, [ { val => \$def, type => 'list', list => $l, help => $help, format => $f } ]) && $def;
+ my ($ok, $cancel) = map { $_ && may_apply($f, $_) } @$l;
+ if (length "$ok$cancel" < 70) {
+ my $ret = eval {
+ ask_from_no_check($o,
+ { title => $title, messages => $message, ok => $ok,
+ if_($cancel, cancel => $cancel, focus_cancel => $def eq $l->[1]) }, []
+ ) ? $l->[0] : $l->[1];
+ };
+ die if $@ && $@ !~ /^wizcancel/;
+ return $@ ? undef : $ret;
+ }
}
+ ask_from($o, $title, $message, [ { val => \$def, type => 'list', list => $l, help => $help, format => $f } ]) && $def;
}
sub ask_from_treelist {