summaryrefslogtreecommitdiffstats
path: root/perl-install/ChangeLog
diff options
context:
space:
mode:
authorFunda Wang <fwang@mandriva.org>2005-01-03 01:14:05 +0000
committerFunda Wang <fwang@mandriva.org>2005-01-03 01:14:05 +0000
commit28263349a63896ca9b540b14922e46bc053cd552 (patch)
tree0708e492a451978653c480b0a58fef00b640e78f /perl-install/ChangeLog
parentbc7f26f382552f46f101e8796a691b7e1b360249 (diff)
downloaddrakx-backup-do-not-use-28263349a63896ca9b540b14922e46bc053cd552.tar
drakx-backup-do-not-use-28263349a63896ca9b540b14922e46bc053cd552.tar.gz
drakx-backup-do-not-use-28263349a63896ca9b540b14922e46bc053cd552.tar.bz2
drakx-backup-do-not-use-28263349a63896ca9b540b14922e46bc053cd552.tar.xz
drakx-backup-do-not-use-28263349a63896ca9b540b14922e46bc053cd552.zip
s/jp/ja. Corrected spelling of locale ja
Diffstat (limited to 'perl-install/ChangeLog')
0 files changed, 0 insertions, 0 deletions
> 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 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304
package interactive; # $Id$

use diagnostics;
use strict;

#-######################################################################################
#- misc imports
#-######################################################################################
use common qw(:common :functional);

#- ask_from_entries takes:
#-  val      => reference to the value
#-  label    => description
#-  icon     => icon to put before the description
#-  help     => tooltip
#-  advanced => wether it is shown in by default or only in advanced mode
#-  disabled => function returning wether it should be disabled (grayed)
#-  type     => 
#-     button => (with clicked) (type defaults to button if clicked is there) (val need not be a reference)
#-     label => (val need not be a reference) (type defaults to label if val is not a reference) 
#-     bool (with text)
#-     range (with min, max)
#-     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)
#-     entry (the default) (with hidden)
#
#- heritate from this class and you'll get all made interactivity for same steps.
#- for this you need to provide
#- - ask_from_listW(o, title, messages, arrayref, default) returns one string of arrayref
#-
#- where
#- - o is the object
#- - title is a string
#- - messages is an refarray of strings
#- - default is an optional string (default is in arrayref)
#- - arrayref is an arrayref of strings
#- - arrayref2 contains booleans telling the default state,
#-
#- ask_from_list and ask_from_list_ are wrappers around ask_from_biglist and ask_from_smalllist
#-
#- ask_from_list_ just translate arrayref before calling ask_from_list and untranslate the result
#-
#- ask_from_listW should handle differently small lists and big ones.
#-


#-######################################################################################
#- OO Stuff
#-######################################################################################
sub new($) {
    my ($type) = @_;

    bless {}, ref $type || $type;
}

sub vnew {
    my ($type, $su, $icon) = @_;
    $su = $su eq "su";
    require c;
    if ($ENV{DISPLAY} && system('/usr/X11R6/bin/xtest') == 0) {
	if ($su) {
	    $ENV{PATH} = "/sbin:/usr/sbin:$ENV{PATH}";
	    if ($>) {
		exec("kdesu", "-c", "$0 @ARGV") or die _("kdesu missing");
	    }
	}
	eval { require interactive_gtk };
	if (!$@) {
	    my $o = interactive_gtk->new;
	    $icon && !$::isWizard and $o->{icon} = $icon;
	    return $o;
	}
    }

    if ($su && $>) {
	die "you must be root to run this program";
    }
    require 'log.pm';
    undef *log::l;
    *log::l = sub {}; # otherwise, it will bother us :(
    require interactive_newt;
    interactive_newt->new;
}

sub enter_console {}
sub leave_console {}
sub suspend {}
sub resume {}
sub end {}
sub exit { exit($_[0]) }

#-######################################################################################
#- Interactive functions
#-######################################################################################
sub ask_warn {
    my ($o, $title, $message) = @_;
    local $::isWizard=0;
    ask_from_listf_no_check($o, $title, $message, undef, [ _("Ok") ]);
}

sub ask_yesorno {
    my ($o, $title, $message, $def, $help) = @_;