summaryrefslogtreecommitdiffstats
path: root/docs/HACKING
diff options
context:
space:
mode:
authorTill Kamppeter <tkamppeter@mandriva.com>2003-12-15 02:29:22 +0000
committerTill Kamppeter <tkamppeter@mandriva.com>2003-12-15 02:29:22 +0000
commita27a5246797ea85e9474dae5eb0af1f2a86036a2 (patch)
treecca0a721a638dab7bb4c28096e64e325f2314fac /docs/HACKING
parent02082cc6c31e10468f6fd4a26f605976c48e5502 (diff)
downloaddrakx-backup-do-not-use-a27a5246797ea85e9474dae5eb0af1f2a86036a2.tar
drakx-backup-do-not-use-a27a5246797ea85e9474dae5eb0af1f2a86036a2.tar.gz
drakx-backup-do-not-use-a27a5246797ea85e9474dae5eb0af1f2a86036a2.tar.bz2
drakx-backup-do-not-use-a27a5246797ea85e9474dae5eb0af1f2a86036a2.tar.xz
drakx-backup-do-not-use-a27a5246797ea85e9474dae5eb0af1f2a86036a2.zip
Added facility to install scanner firmware.
Diffstat (limited to 'docs/HACKING')
0 files changed, 0 insertions, 0 deletions
='#n123'>123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
package interactive::stdio; # $Id$

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

@ISA = qw(interactive);

use interactive;
use common;

$| = 1;

sub readln() {
    my $l = <STDIN>;
    chomp $l;
    $l;
}

sub check_it {
    my ($i, $n) = @_;
    $i =~ /^\s*\d+\s*$/ && 1 <= $i && $i <= $n;
}

sub good_choice {
    my ($def_s, $max) = @_;
    my $i;
    do {
	defined $i and print N("Bad choice, try again\n");
	print N("Your choice? (default %s) ", $def_s);
	$i = readln();
    } until !$i || check_it($i, $max);
    $i;
}

sub ask_fromW {
    my ($_o, $common, $l, $_l2) = @_;

    add2hash_($common, { ok => N("Ok"), cancel => N("Cancel") }) if !exists $common->{ok};

ask_fromW_begin:

    my $already_entries = 0;
    my $predo_widget = sub {
	my ($e) = @_;

	$e->{type} = 'list' if $e->{type} =~ /(icon|tree)list/;
	#- combo does not exist, fallback to a sensible default
	$e->{type} = $e->{not_edit} ? 'list' : 'entry' if $e->{type} eq 'combo';

	if ($e->{type} eq 'entry') {
	    my $t = "\t$e->{label} $e->{text}\n";
	    if ($already_entries) {