summaryrefslogtreecommitdiffstats
path: root/perl-install/interactive/gtk.pm
blob: 473e3a22afc1fd0d097ef96f1e5d62ec0051203b (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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
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
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
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
package interactive::gtk; # $Id$

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

@ISA = qw(interactive);

use interactive;
use common;
use mygtk2;
use ugtk2 qw(:helpers :wrappers :create);
use Gtk2::Gdk::Keysyms;

my $forgetTime = 1000; #- in milli-seconds

sub new {
    my $w = &interactive::new;
    ($w->{windowwidth}, $w->{windowheight}) = gtkroot()->get_size if !$::isInstall;
    $w;
}
sub enter_console { my ($o) = @_; $o->{suspended} = common::setVirtual(1) }
sub leave_console { my ($o) = @_; common::setVirtual(delete $o->{suspended}) }
sub adapt_markup { 
    #- nothing needed, the default markup is gtk2's
    my ($_o, $s) = @_; return $s;
}

sub exit { ugtk2::exit(@_) }

sub ask_fileW {
    my ($in, $common) = @_;

    my $w = ugtk2::create_file_selector(%$common);

    my $file;
    $w->main(sub { 
	$file = $w->{chooser}->get_filename;
	my $err = ugtk2::file_selected_check($common->{save}, $common->{want_a_dir}, $file);
	$err and $in->ask_warn('', $err);
	!$err;
    }) && $file;
}

sub create_boxradio {
    my ($e, $onchange_f, $double_click) = @_;

    my $boxradio = gtkpack2__(Gtk2::VBox->new(0, 0),
			      my @radios = gtkradio('', @{$e->{formatted_list}}));
    my $tips = Gtk2::Tooltips->new;
    mapn {
	my ($txt, $w) = @_;
	$w->signal_connect(button_press_event => $double_click) if $double_click;

	$w->signal_connect(key_press_event => $e->{may_go_to_next});
	$w->signal_connect(clicked => sub { 
	    ${$e->{val}} ne $txt or return;
	    $onchange_f->(sub { $txt });
	});
	if ($e->{help}) {
	    gtkset_tip($tips, $w,
		       ref($e->{help}) eq 'HASH' ? $e->{help}{$txt} :
		       ref($e->{help}) eq 'CODE' ? $e->{help}($txt) : $e->{help});
	}
    } $e->{list}, \@radios;

    $boxradio, sub {
	my ($v, $full_struct) = @_;
	mapn { 
	    $_[0]->set_active($_[1] eq $v);
	    $full_struct->{focus_w} = $_[0] if $_[1] eq $v;
	} \@radios, $e->{list};
    }, $radios[0];
}

sub create_treeview_list {
    my ($e, $onchange_f, $double_click) = @_;
    my $curr;

    my $list = Gtk2::ListStore->new("Glib::String");
    my $list_tv = Gtk2::TreeView->new_with_model($list);
    $list_tv->set_headers_visible(0);
    $list_tv->get_selection->set_mode('browse');
    my $textcolumn = Gtk2::TreeViewColumn->new_with_attributes(undef, my $renderer = Gtk2::CellRendererText->new, 'text' => 0);
    $list_tv->append_column($textcolumn);
    $renderer->set_property('ellipsize', 'end');
    
    my $select = sub {
	my ($path) = @_;
	$list_tv->set_cursor($path, undef, 0);
	Glib::Timeout->add(100, sub { $list_tv->scroll_to_cell($path, undef, 1, 0.5, 0); 0 });
    };

    my ($starting_word, $start_reg) = ('', '^');
    my $timeout;
    $list_tv->set_enable_search(0);
    $list_tv->signal_connect(key_press_event => sub {
        my ($_w, $event) = @_;
	my $c = chr($event->keyval & 0xff);

	Glib::Source->remove($timeout) if $timeout; $timeout = '';
	
	if ($event->keyval >= 0x100) {
	    $e->{may_go_to_next}(), return 1 if member($event->keyval, ($Gtk2::Gdk::Keysyms{Return}, $Gtk2::Gdk::Keysyms{KP_Enter}));
	    $starting_word = '' if !member($event->keyval, ($Gtk2::Gdk::Keysyms{Control_L}, $Gtk2::Gdk::Keysyms{Control_R}));
	} else {
	    if (member('control-mask', @{$event->state})) {
		$c eq 's' or return 1;
		$start_reg and $start_reg = '', return 1;
		$curr++;
	    } else {
		$e->{may_go_to_next}(), return 1 if $c eq ' ';

		$curr++ if $starting_word eq '' || $starting_word eq $c;
		$starting_word .= $c unless $starting_word eq $c;
	    }
	    my @l = @{$e->{formatted_list}};
	    my $word = quotemeta $starting_word;
	    my $j; for ($j = 0; $j < @l; $j++) {
		 $l[($j + $curr) % @l] =~ /$start_reg$word/i and last;
	    }
	    if ($j == @l) {
		$starting_word = '';
	    } else {
		$select->(Gtk2::TreePath->new_from_string(($j + $curr) % @l));
	    }

	    $timeout = Glib::Timeout->add($forgetTime, sub { $timeout = $starting_word = ''; 0 });
	}
	0;
    });
    $list_tv->show;

    $list->append_set([ 0 => $_ ]) foreach @{$e->{formatted_list}};

    $list_tv->get_selection->signal_connect(changed => sub {
	my ($model, $iter) = $_[0]->get_selected;
	$model && $iter or return;
	$onchange_f->(sub {
	    my $row = $model->get_path_str($iter);
	    $e->{list}[$curr = $row];
	});
    });
    $list_tv->signal_connect(button_press_event => $double_click) if $double_click;

    $list_tv, sub {
	my ($v) = @_;
	eval {
	    my $nb = find_index { $_ eq $v } @{$e->{list}};
	    my ($old_path) = $list_tv->get_cursor;
	    if (!$old_path || $nb != $old_path->to_string) {
		$select->(Gtk2::TreePath->new_from_string($nb));
	    }
	    undef $old_path if $old_path;
	};
    };
}

sub __create_tree_model {
    my ($e) = @_;

    my $sep = quotemeta $e->{separator};
    my $tree_model = Gtk2::TreeStore->new("Glib::String", if_($e->{image2f}, "Gtk2::Gdk::Pixbuf"));

    my $build_value = sub {
	my ($v) = @_;
	my $type = 0;
	if ($e->{image2f}) {
	    my $image = $e->{image2f}->($_[0]);
	    ($type, $v) = (1, gtkcreate_pixbuf($image)) if $image; 
	}
	[ $type => $v ];
    };

    my (%wtree, $parent);
    $parent = sub {
	if (my $w = $wtree{"$_[0]$e->{separator}"}) { return $w }
	my $s = '';
	foreach (split $sep, $_[0]) {
	    $wtree{"$s$_$e->{separator}"} ||= 
	      $tree_model->append_set($s ? $parent->($s) : undef, $build_value->($_));
	    $s .= "$_$e->{separator}";
	}
	$wtree{$s};
    };

    $tree_model->{path_str_list} = [ map {
	my ($root, $leaf) = /(.*)$sep(.+)/ ? ($1, $2) : ('', $_);
	my $iter = $tree_model->append_set($parent->($root), $build_value->($leaf));

	$tree_model->get_path_str($iter);
    } @{$e->{formatted_list}} ];

    undef $_ foreach values %wtree;
    undef %wtree;

    $tree_model;
}

sub create_treeview_tree {
    my ($e, $onchange_f, $double_click) = @_;

    my $tree_model = __create_tree_model($e);
    my $tree = Gtk2::TreeView->new_with_model($tree_model);
    $tree->get_selection->set_mode('browse');
    {
	my $col = Gtk2::TreeViewColumn->new;
	$col->pack_start(my $texrender = Gtk2::CellRendererText->new, 0);
	$col->add_attribute($texrender, text => 0);
	if ($e->{image2f}) {
	    $col->pack_start(my $pixrender = Gtk2::CellRendererPixbuf->new, 0);
	    $col->add_attribute($pixrender, pixbuf => 1);
	}
	$tree->append_column($col);
    }
    $tree->set_headers_visible(0);

    my $select = sub {
	my ($path_str) = @_;
	my $path = Gtk2::TreePath->new_from_string($path_str);
	$tree->expand_to_path($path);
	$tree->set_cursor($path, undef, 0);
        gtkflush();  #- workaround gtk2 bug not honouring centering on the given row if node was closed
	$tree->scroll_to_cell($path, undef, 1, 0.5, 0);
    };

    my $curr = $tree_model->get_iter_first; #- default value
    $tree->expand_all if $e->{tree_expanded};

    my $selected_via_click;

    $tree->get_selection->signal_connect(changed => sub {
	my ($model, $iter) = $_[0]->get_selected;
	$model && $iter or return;
	undef $curr if ref $curr;
	my $path = $tree_model->get_path($curr = $iter);
	if (!$tree_model->iter_has_child($iter)) {
	    $onchange_f->(sub {
		my $path_str = $path->to_string;
		my $i = find_index { $path_str eq $_ } @{$tree_model->{path_str_list}};
		$e->{list}[$i];
	    });
	} else {
	    $tree->expand_row($path, 0) if $selected_via_click;
	}
    });
    my ($starting_word, $start_reg) = ('', "^");
    my $timeout;

    my $toggle = sub {
	if ($tree_model->iter_has_child($curr)) {
	    $tree->toggle_expansion($tree_model->get_path($curr), 0);

	} else {
	    &{$e->{may_go_to_next}};
	}
    };

    $tree->set_enable_search(0);
    $tree->signal_connect(key_press_event => sub {
        my ($_w, $event) = @_;
	$selected_via_click = 0;
	my $c = chr($event->keyval & 0xff);
	$curr or return 0;
	Glib::Source->remove($timeout) if $timeout; $timeout = '';

	if ($event->keyval >= 0x100) {
	    &$toggle and return 1 if member($event->keyval, ($Gtk2::Gdk::Keysyms{Return}, $Gtk2::Gdk::Keysyms{KP_Enter}));
	    $starting_word = '' if !member($event->keyval, ($Gtk2::Gdk::Keysyms{Control_L}, $Gtk2::Gdk::Keysyms{Control_R}));
	} else {
	    my $next;
	    if (member('control-mask', @{$event->state})) {
		$c eq "s" or return 1;
		$start_reg and $start_reg = '', return 0;
		$next = 1;
	    } else {
		&$toggle and return 1 if $c eq ' ';
		$next = 1 if $starting_word eq '' || $starting_word eq $c;
		$starting_word .= $c unless $starting_word eq $c;
	    }
	    my $word = quotemeta $starting_word;
	    my ($after, $best);

	    my $sep = quotemeta $e->{separator};
	    my $currpath = $tree_model->get_path_str($curr);
	    mapn {
		my ($path_str, $v) = @_;
		$next &&= !$after;
		$after ||= $path_str eq $currpath;
		$v =~ s/.*$sep//;
		if ($v =~ /$start_reg$word/i) {
		    if ($after && !$next) {
			($best, $after) = ($path_str, 0);
		    } else {
			$best ||= $path_str;
		    }
		}
	    } $tree_model->{path_str_list}, $e->{formatted_list};

	    if (defined $best) {
		$select->($best);
	    } else {
		$starting_word = '';
	    }

	    $timeout = Glib::Timeout->add($forgetTime, sub { $timeout = $starting_word = ''; 0 });
	}
	0;
    });
    $tree->signal_connect(button_press_event => sub {
	$selected_via_click = 1;
	&$double_click if $curr && !$tree_model->iter_has_child($curr) && $double_click;
    });

    $tree, sub {
        my $v = may_apply($e->{format}, $_[0]);
        eval {
            my $i = find_index { $v eq $_ } @{$e->{formatted_list}};

            my ($model, $iter) = $tree->get_selection->get_selected;

            my $new_path_str = $tree_model->{path_str_list}[$i];
            my $old_path_str = $model && $tree_model->get_path_str($iter);

            $select->($new_path_str) if $new_path_str ne $old_path_str;
            undef $iter if ref $iter;
        };
    };
}

#- $actions is a ref list of $action
#- $action is a { kind => $kind, action => sub { ... }, button => Gtk2::Button->new(...) }
#-   where $kind is one of '', 'modify', 'remove', 'add'
sub add_modify_remove_action {
    my ($button, $buttons, $e, $treelist) = @_;

    if (member($button->{kind}, 'modify', 'remove')) {
	@{$e->{list}} or return;
    }
    my $r = $button->{action}->(${$e->{val}});
    defined $r or return;
    
    if ($button->{kind} eq 'add') {
	${$e->{val}} = $r;
    } elsif ($button->{kind} eq 'remove') {
	${$e->{val}} = $e->{list}[0];
    }
    ugtk2::gtk_set_treelist($treelist, [ map { may_apply($e->{format}, $_) } @{$e->{list}} ]);

    add_modify_remove_sensitive($buttons, $e);
    1;
}

sub create_widget {
    my ($o, $e, $onchange_f, $update, $ignore_ref) = @_;

    my $onchange = sub {
	my ($f) = @_;
	sub { $onchange_f->($f, @_) };
    };

    my ($w, $real_w, $focus_w, $set);
    if ($e->{type} eq 'iconlist') {
	$w = Gtk2::Button->new;
	$set = sub {
	    gtkdestroy($e->{icon});
	    my $f = $e->{icon2f}->($_[0]);
	    $e->{icon} = -e $f ?
	      gtkcreate_img($f) :
		Gtk2::WrappedLabel->new(may_apply($e->{format}, $_[0]));
	    $w->add(gtkshow($e->{icon}));
	};
	$w->signal_connect(clicked => sub {
			       $onchange_f->(sub { next_val_in_array(${$e->{val}}, $e->{list}) });
			       $set->(${$e->{val}});
			   });
	$real_w = gtkpack_(Gtk2::HBox->new(0,10), 1, Gtk2::HBox->new(0,0), 0, $w, 1, Gtk2::HBox->new(0,0));
    } elsif ($e->{type} eq 'bool') {
	if ($e->{image}) {
	    $w = ugtk2::gtkadd(Gtk2::CheckButton->new, gtkshow(gtkcreate_img($e->{image})));
	} else {
	    #-		warn "\"text\" member should have been used instead of \"label\" one at:\n", common::backtrace(), "\n" if $e->{label} && !$e->{text};
	    $w = Gtk2::CheckButton->new_with_label($e->{text});
	}
	$w->signal_connect(clicked => $onchange->(sub { $w->get_active }));
	$set = sub { $w->set_active($_[0]) };
    } elsif ($e->{type} eq 'only_label') {
	$w = $e->{title} ? 
	         gtknew('Title2', label => escape_text_for_TextView_markup_format(${$e->{val}})) :
		 gtknew('Label_Left', line_wrap => 1, text_markup => ${$e->{val}});
    } elsif ($e->{type} eq 'label') {
	$w = gtknew('WrappedLabel', text_markup => ${$e->{val}});
	$set = sub { $w->set($_[0]) };
    } elsif ($e->{type} eq 'empty') {
	$w = gtknew('HBox', height => $e->{height});
    } elsif ($e->{type} eq 'button') {
	$w = Gtk2::Button->new_with_label('');
	$w->signal_connect(clicked => $e->{clicked_may_quit_cooked});
	$set = sub { $w->child->set_label(may_apply($e->{format}, $_[0])) };
    } elsif ($e->{type} eq 'range') {
	my $adj = Gtk2::Adjustment->new(${$e->{val}}, $e->{min}, $e->{max} + ($e->{SpinButton} ? 0 : 1), 1, ($e->{max} - $e->{min}) / 10, 1);
	$w = $e->{SpinButton} ? Gtk2::SpinButton->new($adj, 10, 0) : Gtk2::HScale->new($adj);
	$w->set_size_request($e->{SpinButton} ? 100 : 200, -1);
	$w->set_digits(0);
	$adj->signal_connect(value_changed => $onchange->(sub { $adj->get_value }));
	$w->signal_connect(key_press_event => $e->{may_go_to_next});
	$set = sub { $adj->set_value($_[0]) };
    } elsif ($e->{type} eq 'expander') {
	$e->{grow} = 'fill';
	my $children = [ if_($e->{message}, { type => 'only_label', no_indent => 1, val => \$e->{message} }), @{$e->{children}} ];
	my $box = create_widgets_block($o, $children, $update, $ignore_ref);
	$w = gtknew('Expander', text => $e->{text}, child => $box);
    } elsif ($e->{type} =~ /list/) {

	$e->{formatted_list} = [ map { may_apply($e->{format}, $_) } @{$e->{list}} ];

	if (my $actions = $e->{add_modify_remove}) {
	    my @buttons = map {
		{ kind => lc $_, action => $actions->{$_}, button => Gtk2::Button->new(translate($_)) };
	    } N_("Add"), N_("Modify"), N_("Remove");
	    my $modify = find { $_->{kind} eq 'modify' } @buttons;

	    my $do_action = sub {
		my ($button) = @_;
		add_modify_remove_action($button, \@buttons, $e, $w) and $update->();
	    };

	    ($w, $set, $focus_w) = create_treeview_list($e, $onchange_f, 
							sub { $do_action->($modify) if $_[1]->type =~ /^2/ });

	    foreach my $button (@buttons) {
		$button->{button}->signal_connect(clicked => sub { $do_action->($button) });
	    }
	    add_modify_remove_sensitive(\@buttons, $e);

	    $real_w = gtkpack_(Gtk2::HBox->new(0,0),
			       1, create_scrolled_window($w), 
			       0, gtkpack__(Gtk2::VBox->new(0,0), map { $_->{button} } @buttons));
	    $e->{grow} = 'expand';
	} else {
	    my $use_boxradio = exists $e->{gtk}{use_boxradio} ? $e->{gtk}{use_boxradio} : @{$e->{list}} <= 8;

	    if ($e->{help} || $use_boxradio && $e->{type} ne 'treelist') {
		#- used only when needed, as key bindings are dropped by List (ListStore does not seems to accepts Tooltips).
		($w, $set, $focus_w) = create_boxradio($e, $onchange_f, $e->{quit_if_double_click_cooked});
	    } elsif ($e->{type} eq 'treelist') {
		($w, $set) = create_treeview_tree($e, $onchange_f, $e->{quit_if_double_click_cooked});
	    } else {
		($w, $set, $focus_w) = create_treeview_list($e, $onchange_f, $e->{quit_if_double_click_cooked});
	    }
	    if (@{$e->{list}} > 10 || $e->{gtk}{use_scrolling}) {
		$real_w = create_scrolled_window($w);
		$e->{grow} = 'expand';
	    }
	}
    } else {
	if ($e->{type} eq "combo") {
	    my $model;

	    my @formatted_list = map { may_apply($e->{format}, $_) } @{$e->{list}};
	    $e->{formatted_list} = \@formatted_list;

	    my @l = sort { $b <=> $a } map { length } @formatted_list;
	    my $width = $l[@l / 16]; # take the third octile (think quartile)

	    if (!$e->{separator}) {
		if ($e->{not_edit} && $width < 160) { #- ComboBoxes do not have an horizontal scroll-bar. This can cause havoc for long strings (eg: diskdrake Create dialog box in expert mode)
		    $w = Gtk2::ComboBox->new_text;
		    $w->set_wrap_width($e->{gtk}{wrap_width}) if exists $e->{gtk}{wrap_width};
		} else {
		    $w = Gtk2::Combo->new;
		    $w->set_use_arrows_always(1);
		    $w->entry->set_editable(!$e->{not_edit});
		    $w->disable_activate;
		}
		$w->set_popdown_strings(@formatted_list);
		$w->set_text(ref($e->{val}) ? may_apply($e->{format}, ${$e->{val}}) : $formatted_list[0]) if $w->isa('Gtk2::ComboBox');
	    } else {
		$model = __create_tree_model($e);
		$w = Gtk2::ComboBox->new_with_model($model);

		$w->pack_start(my $texrender = Gtk2::CellRendererText->new, 0);
		$w->add_attribute($texrender, text => 0);
		if ($e->{image2f}) {
		    $w->pack_start(my $pixrender = Gtk2::CellRendererPixbuf->new, 0);
		    $w->add_attribute($pixrender, pixbuf => 1);
		}
	    }
	    ($real_w, $w) = ($w, $w->entry);

	    my $get = sub {
		my $i = $model ? do {
		    my $s = $model->get_string_from_iter($w->get_active_iter);
		    eval { find_index { $s eq $_ } @{$model->{path_str_list}} };
		} : do {
		    my $s = $w->get_text;
		    eval { find_index { $s eq $_ } @formatted_list };
		};
		defined $i ? $e->{list}[$i] : $w->get_text;
	    };
	    if ($real_w->isa('Gtk2::Combo')) {
		#- FIXME workaround gtk suckiness (set_text generates two 'change' signals, one when removing the whole, one for inserting the replacement..)
		my $idle;
		$w->signal_connect(changed => sub {
				       return if $$ignore_ref;
				       $idle ||= Glib::Idle->add(sub { undef $idle; $onchange_f->($get); 0 });
				   });
	    } else {
		$w->signal_connect(changed => $onchange->($get));
	    }

	    $set = sub {
		my $s = may_apply($e->{format}, $_[0]);
		if ($model) {
		    eval {
			my $i = find_index { $s eq $_ } @{$e->{formatted_list}};
			my $path_str = $model->{path_str_list}[$i];
			$w->set_active_iter($model->get_iter_from_string($path_str));
		    };
		} else {
		    $w->set_text($s) if $s ne $w->get_text && $_[0] ne $w->get_text;
		}
	    };
	} else {
	    $w = Gtk2::Entry->new;
	    $w->signal_connect(changed => $onchange->(sub { $w->get_text }));
	    $w->signal_connect(focus_in_event => sub { $w->select_region(0, -1) });
	    $w->signal_connect(focus_out_event => sub { $w->select_region(0, 0) });
	    $set = sub { $w->set_text($_[0]) if $_[0] ne $w->get_text };
	    if ($e->{type} eq 'file') {
		my $button = gtksignal_connect(Gtk2::Button->new_from_stock('gtk-open'), clicked => sub {
						   my $file = $o->ask_fileW({
                                                       title => $e->{label},
                                                       want_a_dir => to_bool($e->{want_a_dir}),
                                                   });
						   $set->($file) if $file;
					       });
		$real_w = gtkpack_(Gtk2::HBox->new(0,0), 1, $w, 0, $button);
	    }
	}
	$w->signal_connect(key_press_event => $e->{may_go_to_next});
	if ($e->{hidden}) {
	    $w->set_visibility(0);
	    $w->signal_connect(key_press_event => sub {
		my (undef, $event) = @_;
		if (!$o->{capslock_warned} && member('lock-mask', @{$event->state}) && !$w->get_text) {
		    $o->{capslock_warned} = 1;
		    $o->ask_warn('', N("Beware, Caps Lock is enabled"));
		}
		0;
	    });
	}
    }

    if (my $focus_out = $e->{focus_out}) {
	$w->signal_connect(focus_out_event => sub { $update->($focus_out) });
    }
    $real_w ||= $w;

    $e->{w} = $w;
    $e->{real_w} = $real_w;
    $e->{focus_w} = $focus_w || $w if $e->{type} ne 'empty';
    $e->{set} = $set || sub {};
}

sub all_entries {
    my ($l) = @_;
    map { $_, if_($_->{children}, @{$_->{children}}) } @$l;
}

sub all_focusable_entries {
    my ($l) = @_;
    map { $_->{type} eq 'expander' 
	    ? ($_->{w}->get_expanded ? all_focusable_entries($_->{children}) : ())
	    : $_;
      } grep { $_->{focus_w} } @$l;
}

sub create_widgets_block {
    my ($o, $l, $update, $ignore_ref) = @_;

    my $label_sizegrp = Gtk2::SizeGroup->new('horizontal');

    @$l = map_index {
	if ($::i && ($_->{type} eq 'expander' || $_->{title})) {
	    ({ type => 'empty', height => 4 }, $_);
	} else {
	    $_;
	}
    } @$l;

    foreach my $e (@$l) {
	my $onchange_f = sub {
	    my ($f, @para) = @_;
	    return if $$ignore_ref;
	    ${$e->{val}} = $f->(@para); 
	    $update->($e->{changed});
	};

	create_widget($o, $e, $onchange_f, $update, $ignore_ref);

	my $label_w;
	if ($e->{label} || !$e->{no_indent}) {
	    $label_w = gtknew('Label_Left', text_markup => $e->{label} || '',
			      size_group => $label_sizegrp, alignment => [ 0, 0.5 ]);
	}

	$e->{real_w} = gtkpack_(Gtk2::HBox->new,
				if_($e->{icon}, 0, eval { gtkcreate_img($e->{icon}) }),
				if_($label_w, 0, $label_w),
				(1, $e->{real_w}),
			    );
    }
    gtknew('VBox', children => [ map { $_->{grow} || 0, $_->{real_w} } @$l ]);
}

sub create_widgets {
    my ($o, $common, $mainw, $l) = @_;

    my $ignore = 0; #-to handle recursivity
    my $set_all = sub {
	$ignore = 1;
	my @all = all_entries($l);
	$_->{set}->(${$_->{val}}, $_) foreach @all; #- nb: the parameter "$_" is needed for create_boxradio
	$_->{disabled} and $_->{real_w}->set_sensitive(!$_->{disabled}()) foreach @all;
	$mainw->{ok}->set_sensitive(!$common->{ok_disabled}()) if $common->{ok_disabled};
	$ignore = 0;
    };
    my $update = sub {
	my ($f) = @_;
	return if $ignore;
	$f->() if $f;
	$set_all->();
    };

    my $ok_clicked = sub { 
	!$mainw->{ok} || $mainw->{ok}->get_property('sensitive') or return;
	$mainw->{retval} = 1;
	Gtk2->main_quit;
    };

    my @all = all_entries($l);
    foreach (@all) {
	my $e = $_; #- for closures

	if (@all == 1 || $e->{quit_if_double_click}) {
	    #- i'm the only one, double click means accepting
	    $e->{quit_if_double_click_cooked} = sub { $_[1]->type =~ /^2/ && $ok_clicked->() };
	}

	if ($e->{clicked_may_quit}) {
	    $e->{clicked_may_quit_cooked} = sub {
		$mainw->{rwindow}->hide;
		if (my $v = $e->{clicked_may_quit}()) {
		    $mainw->{retval} = $v;
		    Gtk2->main_quit;
		}
		$mainw->{rwindow}->show;
		$update->();
	    };
	}

	$e->{may_go_to_next} = sub {
	    my (undef, $event) = @_;
	    if (!$event || ($event->keyval & 0x7f) == 0xd) {
		my @current_all = all_focusable_entries($l);
		my $ind = eval { find_index { $_ == $e } @current_all };
		if (my $e_ = $current_all[$ind+1]) {
		    $e_->{focus_w}->grab_focus;
		} else {
		    @current_all == 1 ? $ok_clicked->() : $mainw->{ok}->grab_focus;
		}
		1; #- prevent an action on the just grabbed focus
	    } else {
		0;
	    }
	};
    }

    my $box = create_widgets_block($o, $l, $update, \$ignore);

    my $tooltips = Gtk2::Tooltips->new;
    foreach my $e (@all) {
	$tooltips->set_tip($e->{w}, $e->{help}) if $e->{help} && !ref($e->{help});
    }

    $box, $set_all;
}

sub add_modify_remove_sensitive {
    my ($buttons, $e) = @_;
    $_->{button}->set_sensitive(@{$e->{list}} != ()) foreach 
      grep { member($_->{kind}, 'modify', 'remove') } @$buttons;
}

sub filter_widgets {
    my ($l) = @_;

    foreach my $e (all_entries($l)) {
	$e->{no_indent} = 1 if member($e->{type}, 'list', 'treelist', 'expander', 'bool', 'only_label');
    }
}

my $help_path = "/usr/share/doc/installer-help";

sub load_from_uri {
    my ($document, $url) = @_;
    $url =~ s/#.*$//; # prevent segfaults on anchors
    $url = get_html_file($::o, $url);
    my $str = scalar(cat_($url));
    c::set_tagged_utf8($str);
    $document->clear;
    $document->open_stream("text/html");
    $document->write_stream($str);
}

sub get_html_file {
    my ($o, $url) = @_;
    find { -e $_ } map { "$help_path/${_}" }
      map {
          my $id = $_;
          require lang;
          map { ("$_/$id") } (split ':', lang::getLANGUAGE($o->{locale}{lang})), '';
      } $url;
}

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

    filter_widgets($l);

    my $mainw = ugtk2->new($common->{title}, %$o, modal => 1, if__($::main_window, transient => $::main_window, modal => 1),
                           if_($common->{icon}, icon => $common->{icon}), banner_title => $common->{banner_title},
		       );
 
    my ($box, $set_all) = create_widgets($o, $common, $mainw, $l);

    $mainw->{box_allow_grow} = 1;
    my $pack = create_box_with_title($mainw, @{$common->{messages}});
    mygtk2::set_main_window_size($mainw->{rwindow}) if $mainw->{pop_it} && !$common->{auto_window_size} && (@$l || $mainw->{box_size} == 200);

    my @more_buttons = (
			if_($common->{interactive_help}, 
			    [ N("Help"), sub { 
                         if (my $file = $common->{interactive_help_id}) {
                             require Gtk2::Html2;
                             my $view     = Gtk2::Html2::View->new;
                             my $document = Gtk2::Html2::Document->new;
                             $document->signal_connect(request_url => sub {
                                 my ($_document, $url, $stream) = @_;
                                 $stream->write(join('', cat_("$help_path/$url")));
                                 $stream->close;
                             });
                             $document->signal_connect('link-clicked' => \&load_from_uri);
                             $view->set_document($document);

                             load_from_uri($document, "$file.html");

                             my $w = ugtk2->new(N("Help"), transient => $mainw->{real_window}, modal => 1);
                             gtkadd($w->{rwindow},
                                    gtkpack_(Gtk2::VBox->new,
                                             1, create_scrolled_window(gtkset_border_width($view, 5),
                                                                       [ 'never', 'automatic' ],
                                                                   ),
                                             0, gtkpack(create_hbox('edge'),
                                                        gtknew('Button', text => N("Close"), clicked => sub { Gtk2->main_quit })
                                                    ),
                                         ),
                                 );
                             # make parent visible still visible:
                             local ($::real_windowwidth, $::real_windowheight) = ($::real_windowwidth - 50, $::real_windowheight - 50);
                             mygtk2::set_main_window_size($w->{rwindow});
                             $w->{real_window}->grab_focus;
                             $w->{real_window}->show_all;
                             $w->main;
                             return;
                         }
				  my $message = $common->{interactive_help}->() or return;
				  $o->ask_warn(N("Help"), $message);
			      }, 1 ]),
			if_($common->{more_buttons}, @{$common->{more_buttons}}),
		       );
    my $buttons_pack = ($common->{ok} || !exists $common->{ok}) && $mainw->create_okcancel($common->{ok}, $common->{cancel}, '', @more_buttons);

    gtkpack_($pack, 1, gtknew('ScrolledWindow', shadow_type => 'none', child => $box)) if @$l;
	    
    if ($buttons_pack) {
	$pack->pack_end(gtkshow($buttons_pack), 0, 0, 0);
    }
    ugtk2::gtkadd($mainw->{window}, $pack);
    $set_all->();

    my $entry_to_focus = find { $_->{focus} && $_->{focus}() } @$l;
    my $widget_to_focus = $entry_to_focus ? $entry_to_focus->{focus_w} :
                          $common->{focus_cancel} ? $mainw->{cancel} :
			    @$l && (!$mainw->{ok} || @$l == 1 && member(ref($l->[0]{focus_w}), "Gtk2::TreeView", "Gtk2::RadioButton")) ? 
			      $l->[0]{focus_w} : 
			      $mainw->{ok};
    $widget_to_focus->grab_focus if $widget_to_focus;

    my $validate = sub {
	my @all = all_entries($l);
	my $e = find { $_->{validate} && !$_->{validate}->() } @all;
	$e ||= $common->{validate} && !$common->{validate}() && $all[0];
	if ($e) {
	    $set_all->();
	    $e->{focus_w}->grab_focus;
	}
	!$e;
    };

    $mainw->main($validate);
}


sub ask_browse_tree_info_refW {
    my ($o, $common) = @_;
    add2hash($common, { wait_message => sub { $o->wait_message(@_) } });
    ugtk2::ask_browse_tree_info($common);
}


sub ask_from__add_modify_removeW {
    my ($o, $title, $message, $l, %callback) = @_;

    my $e = $l->[0];
    my $chosen_element;
    put_in_hash($e, { allow_empty_list => 1, gtk => { use_boxradio => 0 }, sort => 0,
		      val => \$chosen_element, type => 'list', add_modify_remove => \%callback });

    $o->ask_from($title, $message, $l, %callback);
}

sub wait_messageW {
    my ($o, $title, $message, $message_modifiable) = @_;

    my $to_modify = Gtk2::Label->new(scalar warp_text(ref $message_modifiable ? '' : $message_modifiable));

    my $Window = gtknew('MagicWindow',
			title => $title,
			pop_it => !$::isInstall, 
			modal => 1, 
			$::isInstall ? (banner => Gtk2::Banner->new((get_default_step_items())[0], $message)) : (),
			no_Window_Manager => exists $o->{no_Window_Manager} ? $o->{no_Window_Manager} : !$::isStandalone,
			if__($::main_window, transient_for => $::main_window),
			child => gtknew('VBox', padding => 4, border_width => 10, children => [
			    1, $to_modify,
			    if_(ref($message_modifiable), 0, $message_modifiable),
			]),
		      );
    $Window->signal_connect(expose_event => sub { $Window->{displayed} = 1; 0 });
    $Window->{wait_messageW} = $to_modify;
    mygtk2::sync($Window) while !$Window->{displayed};
    $Window;
}
sub wait_message_nextW {
    my ($_o, $message, $Window) = @_;
    return if $message eq $Window->{wait_messageW}->get_text; #- needed otherwise no expose_event :(
    $Window->{displayed} = 0;
    $Window->{wait_messageW}->set($message);
    mygtk2::sync($Window) while !$Window->{displayed};
}
sub wait_message_endW {
    my ($_o, $Window) = @_;
    mygtk2::may_destroy($Window);
    mygtk2::flush();
}

sub wait_message_with_progress_bar {
    my ($in, $o_title) = @_;

    my $progress = Gtk2::ProgressBar->new;
    my $w = $in->wait_message($o_title, $progress);
    my $displayed;
    $progress->signal_connect(expose_event => sub { $displayed = 1; 0 });
    $w, sub {
	my ($msg, $current, $total) = @_;
	if ($msg) {
	    $w->set($msg);
	}

	if ($total) {
	    $progress or internal_error('You must first give some text to display');
	    my $fraction = min(1, $current / $total);
	    if ($fraction != $progress->get_fraction) {
		$progress->set_fraction($fraction);
		$progress->show;
		$displayed = 0;
		mygtk2::flush() while !$displayed;
	    }
	} else {
	    $progress->hide;
	    mygtk2::flush();
	}
    };
}

sub kill {
    my ($_o) = @_;
    $_->destroy foreach $::WizardTable ? $::WizardTable->get_children : (), @tempory::objects;
    @tempory::objects = ();
}

1;
"" " --proxy-user - specify user and password to use for proxy\n" " authentication (format is <user:password>).\n" msgstr "" " --proxy-user - spécifier l'utilisateur et le mot de passe pour \n" " l'authentification proxy (format <utilisateur:" "motdepasse>).\n" #: ../urpmi:112 #, c-format msgid "" " --bug - output a bug report in directory indicated by\n" " next arg.\n" msgstr "" " --bug - délivrer un rapport de bogue dans le répertoire\n" " indiqué en second argument.\n" #: ../urpmi:116 #, c-format msgid " --X - use X interface.\n" msgstr " --X - utiliser l'interface graphique (X11)\n" #: ../urpmi:117 #, c-format msgid "" " --best-output - choose best interface according to the environment:\n" " X or text mode.\n" msgstr "" " --best-output - choisir la meilleure interface en fonction de\n" " l'environnement : mode graphique ou textuel.\n" #: ../urpmi:119 #, c-format msgid "" " --verify-rpm - verify rpm signature before installation\n" " (--no-verify-rpm disable it, default is enabled).\n" msgstr "" " --verify-rpm - vérifier la signature du rpm avant l'installation.\n" " (--no-verify-rpm désactive la vérification).\n" #: ../urpmi:122 #, c-format msgid " --excludepath - exclude path separated by comma.\n" msgstr "" " --excludepath - exclure les chemins indiqués, séparés par des virgules.\n" #: ../urpmi:123 #, c-format msgid " --excludedocs - exclude docs files.\n" msgstr " --excludedocs - exclut les fichiers de documentation.\n" #: ../urpmi:124 #, c-format msgid " --skip - packages which installation should be skipped\n" msgstr " --skip - paquetages dont l'installation doit être ignorée\n" #: ../urpmi:125 #, c-format msgid "" " --more-choices - when several packages are found, propose more choices\n" " than the default.\n" msgstr "" " --more-choices - lorsque beaucoup de paquetages sont trouvés, propose plus " "de choix que par defaut.\n" #: ../urpmi:127 ../urpmq:79 #, c-format msgid " -a - select all matches on command line.\n" msgstr "" " -a - sélectionne toutes les correspondances de la ligne de\n" " commande.\n" #: ../urpmi:128 #, c-format msgid " -p - allow search in provides to find package.\n" msgstr "" " -p - cherche dans les apports pour trouver le paquetage.\n" #: ../urpmi:129 #, c-format msgid " -P - do not search in provides to find package.\n" msgstr "" " -P - ne pas chercher dans les apports pour trouver un " "paquetage.\n" #: ../urpmi:130 ../urpmq:84 #, c-format msgid " -y - impose fuzzy search (same as --fuzzy).\n" msgstr " -y - imposer la recherche floue (identique à --fuzzy).\n" #: ../urpmi:131 ../urpmq:86 #, c-format msgid " -s - next package is a source package (same as --src).\n" msgstr "" " -s - le prochain paquetage est un paquetage source\n" " (identique --src).\n" #: ../urpmi:132 ../urpmi.addmedia:77 ../urpmi.removemedia:45 #: ../urpmi.update:44 #, c-format msgid " -q - quiet mode.\n" msgstr " -q - mode peu verbeux.\n" #: ../urpmi:134 #, c-format msgid " names or rpm files given on command line will be installed.\n" msgstr "" " les noms ou les fichiers rpm donnés en ligne de commande seront " "installés.\n" #: ../urpmi:141 #, c-format msgid "Choose location to save file" msgstr "Choisissez un emplacement pour enregistrer le fichier." #: ../urpmi:197 #, c-format msgid "What can be done with binary rpm files when using --install-src" msgstr "" "Ce qui peut être fait avec les fichiers binaires rpm avec l'option --install-" "src" #: ../urpmi:204 #, c-format msgid "" "You have selected a source package:\n" "\n" "%s\n" "\n" "You probably didn't want to install it on your computer (installing it\n" "would allow you to make modifications to its sourcecode then compile it).\n" "\n" "What would you like to do?" msgstr "" "Vous avez choisi un paquetage de sources :\n" "\n" "%s\n" "\n" "Vous ne désirez probablement l'installer sur votre ordinateur. (L'installer\n" "vous permettra de modifier le code source, puis de le recompiler.)\n" "\n" "Que voulez vous faire ?" #: ../urpmi:212 #, c-format msgid "Do nothing" msgstr "Ne rien faire" #: ../urpmi:213 #, c-format msgid "Yes, really install it" msgstr "Oui, l'installer vraiment." #: ../urpmi:214 ../urpmi:231 #, c-format msgid "Save file" msgstr "Enregistrer le fichier" #: ../urpmi:225 #, c-format msgid "" "You are about to install the following software package on your computer:\n" "\n" "%s\n" "\n" "You may prefer to just save it. What is your choice?" msgstr "" "Vous êtes sur le point d'installer les paquetages suivant sur votre " "ordinateur :\n" "\n" "%s\n" "\n" "Peut-être préférez-vous simplement les enregistrer. Quel est votre choix ?" #: ../urpmi:230 #, c-format msgid "Install it" msgstr "L'installer" #: ../urpmi:239 #, c-format msgid "" "Directory [%s] already exists, please use another directory for bug report " "or delete it" msgstr "" "Le répertoire [%s] existe déjà, merci d'en utiliser un autre pour le rapport " "de bogue, ou de l'effacer." #: ../urpmi:240 #, c-format msgid "Unable to create directory [%s] for bug report" msgstr "Impossible de créer le répertoire [%s] pour le rapport de bogue" #: ../urpmi:243 ../urpmi:365 #, c-format msgid "Copying failed" msgstr "Copie impossible" #: ../urpmi:260 #, c-format msgid "Only superuser is allowed to install packages" msgstr "Seul l'administrateur système (root) peut installer des paquetages" #: ../urpmi:401 #, c-format msgid "One of the following packages is needed:" msgstr "Un des paquetages suivants est nécessaire :" #: ../urpmi:414 #, c-format msgid "What is your choice? (1-%d) " msgstr "Que choisissez-vous ? (1-%d)" #: ../urpmi:423 ../urpmi:550 #, c-format msgid "Package installation..." msgstr "Installation du paquetage..." #: ../urpmi:423 ../urpmi:550 #, c-format msgid "Initializing..." msgstr "Initialisation..." #: ../urpmi:446 #, c-format msgid "" "Some package requested cannot be installed:\n" "%s" msgstr "" "Certains paquetages demandés ne peuvent pas être installés :\n" "%s" #: ../urpmi:451 ../urpmi:482 #, c-format msgid "do you agree ?" msgstr "Êtes-vous d'accord ?" #: ../urpmi:457 #, c-format msgid "" "\n" "Continue?" msgstr "" "\n" "continuer?" #: ../urpmi:471 #, c-format msgid "" "The installation cannot continue because the following packages\n" "have to be removed for others to be upgraded:\n" "%s\n" msgstr "" "La mise à jour ne peut pas continuer car les paquetages suivants\n" "doivent être désinstallés :\n" "%s\n" #: ../urpmi:477 #, c-format msgid "" "The following packages have to be removed for others to be upgraded:\n" "%s" msgstr "" "Afin de poursuivre la mise à jour, les paquetages suivants doivent être " "désinstallés :\n" "%s" #: ../urpmi:516 ../urpmi:527 #, c-format msgid "" "To satisfy dependencies, the following %d packages are going to be installed " "(%d MB)" msgstr "" "Pour satisfaire les dépendances, les %d paquetages suivants vont être " "installés (%d Mo)" #: ../urpmi:517 ../urpmi:528 #, c-format msgid "" "To satisfy dependencies, the following package is going to be installed (%d " "MB)" msgstr "" "Pour satisfaire les dépendances, le paquetage suivant va être installé (%d " "Mo)" #: ../urpmi:523 #, c-format msgid "" "You need to be root to install the following dependencies:\n" "%s\n" msgstr "" "Vous devez être root pour installer les dépendances suivantes :\n" "%s\n" #: ../urpmi:546 ../urpmq:300 #, c-format msgid "unable to get source packages, aborting" msgstr "impossible de récupérer les paquetages sources, abandon" #: ../urpmi:560 #, c-format msgid "Please insert the medium named \"%s\" on device [%s]" msgstr "Veuillez insérer le média nommé « %s » dans le périphérique [%s]" #: ../urpmi:561 #, c-format msgid "Press Enter when ready..." msgstr "Appuyez sur la touche Entrée quand vous êtes prêt..." #: ../urpmi:605 #, c-format msgid "Downloading package `%s'..." msgstr "téléchargement du paquetage %s" #: ../urpmi:617 #, c-format msgid " %s%% of %s completed, ETA = %s, speed = %s" msgstr " %s%% sur %s, temps total = %s, vitesse = %s" #: ../urpmi:620 #, c-format msgid " %s%% completed, speed = %s" msgstr " %s%% complèté, vitesse = %s" #: ../urpmi:639 #, c-format msgid "The following packages have bad signatures" msgstr "Les paquetages suivants ont des signatures non valides" #: ../urpmi:640 #, c-format msgid "Do you want to continue installation ?" msgstr "Voulez-vous continuer l'installation ?" #: ../urpmi:660 ../urpmi:787 #, c-format msgid "" "Installation failed, some files are missing:\n" "%s\n" "You may want to update your urpmi database" msgstr "" "L'installation a échoué, il manque des fichiers :\n" "%s\n" "Vous devriez mettre à jour votre base de données urpmi" #: ../urpmi:670 ../urpmi:725 ../urpmi:746 ../urpmi:766 #, c-format msgid "Installation failed" msgstr "L'installation a échoué" #: ../urpmi:685 #, c-format msgid "distributing %s" msgstr "distribution de %s" #: ../urpmi:693 #, c-format msgid "installing %s" msgstr "installation de %s" #: ../urpmi:708 #, c-format msgid "Installing package `%s' (%s/%s)..." msgstr "Installation du paquetage « %s » (%s/%s)..." #: ../urpmi:732 #, c-format msgid "Try installation without checking dependencies? (y/N) " msgstr "Essayer d'installer sans vérifier les dépendances ? (o/N) " #: ../urpmi:751 #, c-format msgid "Try installation even more strongly (--force)? (y/N) " msgstr "Essayer de forcer l'installation (--force) ? (o/N) " #: ../urpmi:792 #, c-format msgid "%d installation transactions failed" msgstr "%d transactions d'installation ont échoué" #: ../urpmi:800 #, c-format msgid "Installation is possible" msgstr "L'installation est possible" #: ../urpmi:803 #, c-format msgid "Everything already installed" msgstr "Tout est déjà installé" #: ../urpmi:817 #, c-format msgid "restarting urpmi" msgstr "Redémarrage de urpmi" #: ../urpmi.addmedia:38 #, c-format msgid "" "usage: urpmi.addmedia [options] <name> <url> [with <relative_path>]\n" "where <url> is one of\n" " [file:/]/<path> with <relative filename of hdlist>\n" " ftp://<login>:<password>@<host>/<path> with <relative filename of " "hdlist>\n" " ftp://<host>/<path> with <relative filename of hdlist>\n" " http://<host>/<path> with <relative filename of hdlist>\n" " removable://<path>\n" "\n" "and [options] are from\n" msgstr "" "Utilisation : urpmi.addmedia [options] <nom> <url> [with <chemin relatif>]\n" "où <url> est l'un de :\n" " [file:/]/<chemin> with <nom de fichier relatif de hdlist>\n" " ftp://<utilisateur>:<mot de passe>@<hôte>/<chemin> with <nom de " "fichier relatif de hdlist>\n" " ftp://<hôte>/<chemin> with <nom de fichier relatif de hdlist>\n" " http://<host>/<path> with <nom de fichier relatif de hdlist>\n" " removable://<chemin>\n" "\n" "et [options] sont issues de\n" #: ../urpmi.addmedia:55 #, c-format msgid " --update - create an update medium.\n" msgstr " --update - créer un média de mise à jour.\n" #: ../urpmi.addmedia:56 #, c-format msgid " --probe-synthesis - try to find and use synthesis file.\n" msgstr "" " --probe-synthesis - essayer de trouver et d'utiliser un fichier de " "synthèse.\n" #: ../urpmi.addmedia:57 #, c-format msgid " --probe-hdlist - try to find and use hdlist file.\n" msgstr "" " --probe-hdlist - essayer de trouver et d'utiliser un fichier hdlist.\n" #: ../urpmi.addmedia:58 #, c-format msgid "" " --no-probe - do not try to find any synthesis or\n" " hdlist file.\n" msgstr "" " --no-probe - ne pas essayer de trouver un fichier hdlist\n" " ou de synthèse.\n" #: ../urpmi.addmedia:60 #, c-format msgid "" " --distrib - automatically create all media from an installation\n" " medium.\n" msgstr "" " --distrib - créer automatiquement tous les médias à partir\n" " d'un média d'installation.\n" #: ../urpmi.addmedia:62 #, c-format msgid "" " --distrib-XXX - automatically create a medium for XXX part of a\n" " distribution, XXX may be main, contrib, updates or\n" " anything else that has been configured ;-)\n" msgstr "" " --distrib-XXX - créer automatiquement un média pour XXX appartenant à\n" " une distribution, XXX peut être main (principal),\n" " contrib (contributions), updates (mises à jour)\n" " ou n'importe quoi d'autre qui a été configuré ;-)\n" #: ../urpmi.addmedia:65 #, c-format msgid "" " --from - use specified url for list of mirrors, the default is\n" " %s\n" msgstr "" " --env - utiliser l'url spécifiée pour une liste de miroirs, par " "défaut\n" " %s\n" #: ../urpmi.addmedia:67 #, c-format msgid "" " --version - use specified distribution version, the default is taken\n" " from the version of the distribution told by the\n" " installed mandrakelinux-release package.\n" msgstr "" " --version - spécifier une version de distribution. Celle par défaut " "est\n" " donnée par le paquetage « mandrakelinux-release ».\n" #: ../urpmi.addmedia:70 #, c-format msgid "" " --arch - use specified architecture, the default is arch of\n" " mandrakelinux-release package installed.\n" msgstr "" " --arch - spécifier l'architecture. Celle par défaut est donnée " "par\n" " le paquetage mandrakelinux-release.\n" #: ../urpmi.addmedia:72 #, c-format msgid "" " --virtual - create virtual media wich are always up-to-date,\n" " only file:// protocol is allowed.\n" msgstr "" " --virtual - créer un média virtuel qui est toujours à jour,\n" " seul le protocole « file:// » est autorisé.\n" #: ../urpmi.addmedia:74 ../urpmi.update:39 #, c-format msgid " --no-md5sum - disable MD5SUM file checking.\n" msgstr "" " --no-md5sum - Supprime la vérification de la somme de contrôle " "(MD5SUM).\n" #: ../urpmi.addmedia:75 ../urpmi.removemedia:43 ../urpmi.update:42 #, c-format msgid " -c - clean headers cache directory.\n" msgstr " -c - purger le répertoire cache des en-têtes.\n" #: ../urpmi.addmedia:76 ../urpmi.update:43 #, c-format msgid " -f - force generation of hdlist files.\n" msgstr " -f - forcer la génération des fichiers hdlist.\n" #: ../urpmi.addmedia:115 #, c-format msgid "Only superuser is allowed to add media" msgstr "Seul l'administrateur système (root) peut ajouter un média" #: ../urpmi.addmedia:144 #, c-format msgid "found version %s and arch %d ..." msgstr "trouvé version %s et architecture %d ..." #: ../urpmi.addmedia:148 #, c-format msgid "cannot add updates of a cooker distribution\n" msgstr "" "Ne peut ajouter des mises à jour sur une distribution " "« cooker » (« betas »)\n" #: ../urpmi.addmedia:153 #, c-format msgid "retrieving mirrors at %s ..." msgstr "récupération des miroirs depuis %s ..." #: ../urpmi.addmedia:206 #, c-format msgid "no need to give <relative path of hdlist> with --distrib" msgstr "inutile de spécifier le <chemin relatif de hdlist> avec --distrib" #: ../urpmi.addmedia:213 ../urpmi.addmedia:236 #, c-format msgid "unable to update medium \"%s\"\n" msgstr "impossible de mettre à jour le média « %s »\n" #: ../urpmi.addmedia:224 #, c-format msgid "<relative path of hdlist> missing\n" msgstr "<chemin relatif de hdlist> manquant\n" #: ../urpmi.addmedia:226 #, c-format msgid "`with' missing for network media\n" msgstr "directive « with » manquante pour les médias en réseau\n" #: ../urpmi.addmedia:234 #, c-format msgid "unable to create medium \"%s\"\n" msgstr "impossible de créer le média « %s »\n" #: ../urpmi.removemedia:39 #, c-format msgid "" "usage: urpmi.removemedia [-a] <name> ...\n" "where <name> is a medium name to remove.\n" msgstr "" "Utilisation : urpmi.removemedia [-a] <nom> ...\n" "où <nom> est le nom du média à retirer.\n" #: ../urpmi.removemedia:42 #, c-format msgid " -a - select all media.\n" msgstr " -a - sélectionne toutes les medias\n" #: ../urpmi.removemedia:44 #, c-format msgid " -y - fuzzy match on media names.\n" msgstr " -y - imposer la recherche floue sur les noms de média.\n" #: ../urpmi.removemedia:47 #, c-format msgid "" "\n" "unknown options '%s'\n" msgstr "" "\n" "option inconnue '%s'\n" #: ../urpmi.removemedia:53 #, c-format msgid "Only superuser is allowed to remove media" msgstr "Seul l'administrateur système (root) peut enlever un média" #: ../urpmi.removemedia:63 #, c-format msgid "nothing to remove (use urpmi.addmedia to add a media)\n" msgstr "rien à retirer (utiliser urpmi.addmedia pour ajouter un média)\n" #: ../urpmi.removemedia:65 #, c-format msgid "" "the entry to remove is missing\n" "(one of %s)\n" msgstr "" "L'entrée à retirer est manquante\n" " (l'une parmi %s)\n" #: ../urpmi.update:28 #, c-format msgid "" "usage: urpmi.update [options] <name> ...\n" "where <name> is a medium name to update.\n" msgstr "" "Utillisation : urpmi.update [options] <nom> ...\n" "où <nom> est un nom de média à mettre à jour.\n" #: ../urpmi.update:38 #, c-format msgid " --update - update only update media.\n" msgstr " --update - ne rafraîchir que les médias de mise à jour.\n" #: ../urpmi.update:40 #, c-format msgid " --force-key - force update of gpg key.\n" msgstr " --force-key - force la mise à jour de la clef gpg.\n" #: ../urpmi.update:41 #, c-format msgid " -a - select all non-removable media.\n" msgstr " -a - sélectionne tous les médias non amovibles\n" #: ../urpmi.update:62 #, c-format msgid "Only superuser is allowed to update media" msgstr "Seul l'administrateur système (root) peut mettre à jour un média" #: ../urpmi.update:70 #, c-format msgid "nothing to update (use urpmi.addmedia to add a media)\n" msgstr "rien à mettre à jour (utiliser urpmi.addmedia pour ajouter un média)\n" #: ../urpmi.update:82 #, c-format msgid "" "the entry to update is missing\n" "(one of %s)\n" msgstr "" "l'entrée à mettre à jour est manquante\n" "(un parmi de %s)\n" #: ../urpmq:38 #, c-format msgid "" "urpmq version %s\n" "Copyright (C) 2000-2004 Mandrakesoft.\n" "This is free software and may be redistributed under the terms of the GNU " "GPL.\n" "\n" "usage:\n" msgstr "" "urpmf version %s\n" "Copyright (C) 2000-2004 Mandrakesoft.\n" "Ceci est un logiciel libre pouvant être redistribué selon les termes de la " "licence GNU GPL.\n" "\n" "usage :\n" #: ../urpmq:53 #, c-format msgid " --list - list available packages.\n" msgstr " --list - montrer tous les paquetages disponibles.\n" #: ../urpmq:54 #, c-format msgid " --list-media - list available media.\n" msgstr " --list-media - montrer tous les médias disponibles.\n" #: ../urpmq:55 #, c-format msgid " --list-url - list available media and their url.\n" msgstr " --list-url - montrer tous les médias disponibles et leurs URL.\n" #: ../urpmq:56 #, c-format msgid "" " --dump-config - dump the config in form of urpmi.addmedia argument.\n" msgstr "" " --dump-config - renvoie la configuration sous forme d'un argument\n" " pour urpmi.addmedia.\n" #: ../urpmq:57 #, c-format msgid " --list-nodes - list available nodes when using --parallel.\n" msgstr "" " --list-nodes - montrer tous les noeuds disponibles en.\n" " utilisant --parallel.\n" #: ../urpmq:58 #, c-format msgid " --list-aliases - list available parallel aliases.\n" msgstr " --list-aliases - lister les alias parallèles disponibles.\n" #: ../urpmq:60 #, c-format msgid "" " --headers - extract headers for package listed from urpmi db to\n" " stdout (root only).\n" msgstr "" " --headers - extraire les en-têtes des paquetages listés de la base " "urpmi\n" " vers la sortie standard (root seulement).\n" #: ../urpmq:62 #, c-format msgid "" " --sources - give all source packages before downloading (root only).\n" msgstr "" " --sources - donner tous les paquetages sources avant de télécharger.\n" " (root seulement).\n" #: ../urpmq:65 #, c-format msgid "" " --use-distrib - configure urpmi on the fly from a distrib tree.\n" " This permit to querying a distro.\n" msgstr "" " --use-distrib - configure urpmi à la volée d'après l'arbre d'une\n" " distribution, permettant d'interroger une distribution.\n" #: ../urpmq:75 #, c-format msgid " --changelog - print changelog.\n" msgstr " --changelog - imprime le changelog.\n" #: ../urpmq:77 #, c-format msgid " -d - extend query to package dependencies.\n" msgstr " -d - étend la requête aux dépendances du paquetage.\n" #: ../urpmq:78 #, c-format msgid "" " -u - remove package if a more recent version is already " "installed.\n" msgstr "" " -u - enlève le paquetage si une version plus récente est déjà\n" " installée.\n" #: ../urpmq:80 #, c-format msgid " -c - complete output with package to be removed.\n" msgstr "" " -c - sortie sur la ligne de commande avec les\n" " noms des paquetages à désinstaller.\n" #: ../urpmq:81 #, c-format msgid " -p - search in provides to find package.\n" msgstr "" " -p - cherche dans les apports pour trouver le paquetage.\n" #: ../urpmq:82 #, c-format msgid "" " -P - do not search in provides to find package (default).\n" msgstr "" " -P - ne pas chercher dans les apports pour trouver un " "paquetage (par défaut).\n" #: ../urpmq:83 #, c-format msgid " -R - reverse search to what requires package.\n" msgstr "" " -R - recherche inversée des items nécessitant ce paquetage.\n" #: ../urpmq:85 #, c-format msgid " -Y - like -y, but forces to match case-insensitively.\n" msgstr " -Y - comme -y mais n'est pas sensible à la casse \n" #: ../urpmq:87 #, c-format msgid " -i - print useful information in human readable form.\n" msgstr "" " -i - affiche des informations utiles dans une forme " "compréhensible.\n" #: ../urpmq:88 #, c-format msgid " -g - print groups with name also.\n" msgstr " -g - afficher les groupes ainsi que les noms\n" #: ../urpmq:89 #, c-format msgid " -r - print version and release with name also.\n" msgstr " -r - affiche la version détaillée ainsi que le nom.\n" #: ../urpmq:91 #, c-format msgid " -l - list files in package.\n" msgstr " -l - liste les fichiers d'un paquetage.\n" #: ../urpmq:92 #, c-format msgid " names or rpm files given on command line are queried.\n" msgstr "" " les noms ou fichiers rpm indiqués sur la ligne de commandes sont " "intérrogés.\n" #: ../urpmq:152 #, c-format msgid "--list-nodes can only be used with --parallel" msgstr "--list-nodes peut seulement être utilisé avec --parallel" #: ../urpmq:331 #, c-format msgid "skipping media %s: no hdlist\n" msgstr "média %s ignoré : aucun hdlist\n" #: ../urpmq:392 #, c-format msgid "No filelist found\n" msgstr "aucune liste de sources complète n'a pu être trouvée\n" #: ../urpmq:402 #, c-format msgid "No changelog found\n" msgstr "Aucun Changelog trouvé\n"