summaryrefslogtreecommitdiffstats
path: root/perl-install/interactive
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/interactive')
-rw-r--r--perl-install/interactive/curses.pm14
-rw-r--r--perl-install/interactive/gtk.pm8
-rw-r--r--perl-install/interactive/stdio.pm4
3 files changed, 12 insertions, 14 deletions
diff --git a/perl-install/interactive/curses.pm b/perl-install/interactive/curses.pm
index 9a50522aa..81e0f0459 100644
--- a/perl-install/interactive/curses.pm
+++ b/perl-install/interactive/curses.pm
@@ -34,9 +34,9 @@ sub new {
$cui ||= Curses::UI->new('-color_support' => 1);
# Set some default terminal size, for serial install
- unless ($cui->{-width}) {
- $cui->{-width} = $cui->{-w} = $cui->{-bw} = 80;
- $cui->{-height} = $cui->{-h} = $cui->{-bh} = 25;
+ unless ($cui->{'-width'}) {
+ $cui->{'-width'} = $cui->{'-w'} = $cui->{'-bw'} = 80;
+ $cui->{'-height'} = $cui->{'-h'} = $cui->{'-bh'} = 25;
}
bless { cui => $cui }, $class;
@@ -552,7 +552,7 @@ sub ask_fileW {
$dir = $opts->{directory} || $opts->{file} && dirname($opts->{file});
- if($opts->{save}) {
+ if ($opts->{save}) {
$file = $o->{cui}->savefilebrowser('-title' => $opts->{title}, '-path' => $dir, '-file' => basename($file));
} else {
$file = $o->{cui}->loadfilebrowser('-title' => $opts->{title}, '-path' => $dir, '-file' => basename($file));
@@ -561,13 +561,13 @@ sub ask_fileW {
my $err;
if (!$file) {
$err = N("No file chosen");
- } elsif(-f $file && $opts->{want_a_dir}) {
+ } elsif (-f $file && $opts->{want_a_dir}) {
$file = dirname($file);
- } elsif(-d $file && !$opts->{want_a_dir}) {
+ } elsif (-d $file && !$opts->{want_a_dir}) {
$err = N("You have chosen a directory, not a file");
} elsif (!-e $file && !$opts->{save}) {
$err = $opts->{want_a_dir} ? N("No such directory") : N("No such file");
- };
+ }
$err and $o->ask_warn('', $err) or $file;
}
diff --git a/perl-install/interactive/gtk.pm b/perl-install/interactive/gtk.pm
index 4648c2d6b..9ca5b3b72 100644
--- a/perl-install/interactive/gtk.pm
+++ b/perl-install/interactive/gtk.pm
@@ -452,9 +452,7 @@ sub create_widget {
if (my $actions = $e->{add_modify_remove}) {
my @buttons = (N_("Add"), N_("Modify"), N_("Remove"));
# Add Up/Down buttons if their actions are defined
- foreach (qw(Up Down)) {
- push @buttons, 'gtk-go-' . $_ if $actions->{$_};
- }
+ push @buttons, map { if_($actions->{$_}, 'gtk-go-' . $_) } qw(Up Down);
@buttons = map {
my $button = /^gtk-/ ? gtknew('Button', image => gtknew('Image', stock => lc($_)))
: Gtk2::Button->new(translate($_));
@@ -485,7 +483,7 @@ sub create_widget {
if_($images,
gtknew('HButtonBox',
layout => 'spread',
- children_loose => [ map { $_->{button} } @$images]
+ children_loose => [ map { $_->{button} } @$images ]
)
),
),
@@ -664,7 +662,7 @@ sub create_widgets_block {
]);
}
- my $eater = gtknew('Label') if $e->{alignment} eq 'right' && !$label_w;
+ my $eater = if_($e->{alignment} eq 'right' && !$label_w, gtknew('Label'));
$e->{real_w} = gtkpack_(Gtk2::HBox->new,
if_($e->{icon}, 0, eval { gtkcreate_img($e->{icon}) }),
diff --git a/perl-install/interactive/stdio.pm b/perl-install/interactive/stdio.pm
index 3d4370c2a..9c72f45db 100644
--- a/perl-install/interactive/stdio.pm
+++ b/perl-install/interactive/stdio.pm
@@ -63,7 +63,7 @@ ask_fromW_begin:
my @labels;
my $format_label = sub { my ($e) = @_; return sprintf("`%s' %s %s\n", ${$e->{val}}, $e->{label}, $e->{text}) };
my $do_widget = sub {
- my ($e, $ind) = @_;
+ my ($e, $_ind) = @_;
if ($e->{type} eq 'bool') {
print "$e->{text} $e->{label}\n";
@@ -170,7 +170,7 @@ sub wait_messageW {
print join "\n", $message, $message_modifiable;
}
sub wait_message_nextW {
- my $m = join "\n", $_[1];
+ my $m = $_[1];
print "\r$m", ' ' x (60 - length $m);
}
sub wait_message_endW { print "\nDone\n" }