summaryrefslogtreecommitdiffstats
path: root/perl-install/install/steps_curses.pm
blob: 6f8f73579369689e1d6188876c8c7f90539d23f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package install::steps_curses; # $Id: steps_curses.pm 247958 2008-10-08 15:19:32Z tv $

use diagnostics;
use strict;
use vars qw(@ISA);

@ISA = qw(install::steps_interactive interactive::curses);

#-######################################################################################
#- misc imports
#-######################################################################################
use install::steps_interactive;
use interactive::curses;
use install::any;
use devices;
use lang;
use common;

my $banner;
sub banner {
    my ($cui, $step) = @_;
    my $text = N("%s Installation %s", "Mageia", "| $step");
    $banner ||= do {
	my $win = $cui->add(undef, 'Window', '-x' => 1, '-y' => 0, '-height' => 1);
	$win->add(undef, 'Label');
    };
    $banner->text($text);
}

sub help_line {
    my ($cui) = @_;
    my $text = N("<Tab>/<Alt-Tab> between elements");
    my $win = $cui->add(undef, 'Window', '-x' => 1, '-y' => -1, '-height' => 1);
    $win->add(undef, 'Label', '-text' => $text);
}

sub new {
    my ($type, $o) = @_;

    add2hash($o, interactive::curses->new);

    #- unset DISPLAY so that code testing wether DISPLAY is set can know we don't have or use X
    delete $ENV{DISPLAY};

    banner($o->{cui}, '');
    help_line($o->{cui});

    (bless {}, ref($type) || $type)->SUPER::new($o);
}

sub charsetChanged {
    my ($o) = @_;
    lang::load_console_font($o->{locale});
}

sub enteringStep {
    my ($o, $step) = @_;
    $o->SUPER::enteringStep($step);
    banner($o->{cui}, translate($o->{steps}{$step}{text}));
}

sub exitInstall { 
    &install::steps_interactive::exitInstall;
    interactive::curses::end();
}

1;