diff options
author | damien <damien@mandriva.com> | 2001-03-09 02:40:49 +0000 |
---|---|---|
committer | damien <damien@mandriva.com> | 2001-03-09 02:40:49 +0000 |
commit | 2af607580dd3e1568f0eb5c50f6db77bed314f5b (patch) | |
tree | 8708884d76f4d717aa778f3e78ae0e2c177101a2 | |
parent | d6f963e89a8485f20fc561e5bce5e58c322d668a (diff) | |
download | drakx-backup-do-not-use-2af607580dd3e1568f0eb5c50f6db77bed314f5b.tar drakx-backup-do-not-use-2af607580dd3e1568f0eb5c50f6db77bed314f5b.tar.gz drakx-backup-do-not-use-2af607580dd3e1568f0eb5c50f6db77bed314f5b.tar.bz2 drakx-backup-do-not-use-2af607580dd3e1568f0eb5c50f6db77bed314f5b.tar.xz drakx-backup-do-not-use-2af607580dd3e1568f0eb5c50f6db77bed314f5b.zip |
applied gtkradio
created create_boxradio
in wizard mode : list -> radio buttons
-rw-r--r-- | perl-install/install_steps_gtk.pm | 5 | ||||
-rw-r--r-- | perl-install/interactive_gtk.pm | 28 | ||||
-rw-r--r-- | perl-install/my_gtk.pm | 2 |
3 files changed, 29 insertions, 6 deletions
diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm index 79012db54..b9f43a150 100644 --- a/perl-install/install_steps_gtk.pm +++ b/perl-install/install_steps_gtk.pm @@ -151,11 +151,10 @@ sub selectInstallClass1 { $::live || @$l == 1 and return $o->SUPER::selectInstallClass1($verif, $l, $def, $l2, $def2); my $w = my_gtk->new(''); - my ($radio, $focused); + my $focused; gtkadd($w->{window}, gtkpack($o->create_box_with_title(_("Please, choose one of the following classes of installation:")), - (my @radios = map { $radio = new Gtk::RadioButton($_, $radio ? $radio : ()); - $radio->set_active($_ eq $def); $radio } @$l), + (my @radios = gtkradio(@$l, $def)), gtkadd(create_hbox(), map { my $v = $_; my $b = new Gtk::Button(translate($_)); diff --git a/perl-install/interactive_gtk.pm b/perl-install/interactive_gtk.pm index 39f4d0b71..b967f6aa3 100644 --- a/perl-install/interactive_gtk.pm +++ b/perl-install/interactive_gtk.pm @@ -32,9 +32,31 @@ sub ask_warn { local $my_gtk::pop_it = 1; &interactive::ask_warn; } + +sub create_boxradio { + my ($e, $may_go_to_next, $changed) = @_; + my @l = map { may_apply($e->{format}, $_) } @{$e->{list}}; + + my $boxradio = gtkpack2__(new Gtk::VBox(0, 0), + my @radios = gtkradio(@l, '')); + $boxradio->show; + mapn { + my ($txt, $w) = @_; + $w->signal_connect(clicked => sub { + ${$e->{val}} = $txt; + &$changed; + }); + } $e->{list}, \@radios; + + $boxradio, sub { + my ($v) = @_; + mapn { $_[0]->set_active($_[1] eq $v) } \@radios, $e->{list}; + } +} + sub create_clist { my ($e, $may_go_to_next, $changed) = @_; - my (@widgets, $curr); + my $curr; my @l = map { may_apply($e->{format}, $_) } @{$e->{list}}; my $list = new Gtk::CList(1); @@ -358,7 +380,9 @@ sub ask_from_entries_refW { } elsif ($e->{type} eq 'treelist') { ($w, $set) = create_ctree($e, $may_go_to_next, $changed); } else { - ($w, $set) = create_clist($e, $may_go_to_next, $changed); + ($w, $set) = $::isWizard ? + create_boxradio($e, $may_go_to_next, $changed) : + create_clist($e, $may_go_to_next, $changed); } if (@$l == 1) { #- i'm the only one, double click means accepting diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm index 065ed2a59..01853f83e 100644 --- a/perl-install/my_gtk.pm +++ b/perl-install/my_gtk.pm @@ -10,7 +10,7 @@ use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK $border); @ISA = qw(Exporter); %EXPORT_TAGS = ( helpers => [ qw(create_okcancel createScrolledWindow create_menu create_notebook create_packtable create_hbox create_vbox create_adjustment create_box_with_title create_treeitem) ], - wrappers => [ qw(gtksignal_connect gtkpack gtkpack_ gtkpack__ gtkpack2 gtkpack3 gtkpack2_ gtkpack2__ gtksetstyle gtkappend gtkset_shadow_type gtkadd gtkput gtktext_insert gtkset_usize gtkset_justify gtkset_active gtkshow gtkdestroy gtkset_mousecursor gtkset_mousecursor_normal gtkset_mousecursor_wait gtkset_background gtkset_default_fontset gtkctree_children gtkxpm gtkpng gtkcreate_xpm gtkcreate_png) ], + wrappers => [ qw(gtksignal_connect gtkradio gtkpack gtkpack_ gtkpack__ gtkpack2 gtkpack3 gtkpack2_ gtkpack2__ gtksetstyle gtkappend gtkset_shadow_type gtkadd gtkput gtktext_insert gtkset_usize gtkset_justify gtkset_active gtkshow gtkdestroy gtkset_mousecursor gtkset_mousecursor_normal gtkset_mousecursor_wait gtkset_background gtkset_default_fontset gtkctree_children gtkxpm gtkpng gtkcreate_xpm gtkcreate_png) ], ask => [ qw(ask_warn ask_okcancel ask_yesorno ask_from_entry ask_file) ], ); $EXPORT_TAGS{all} = [ map { @$_ } values %EXPORT_TAGS ]; |