diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-06-07 05:51:29 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-06-07 05:51:29 +0000 |
commit | 86ce86bba775eb45c9d186cc04c5d1ae32cc1c6f (patch) | |
tree | 4eb19e078b723c2b69ccab74882749d69d499351 /gurpmi2 | |
parent | 780af97af0c276c628a3605e5c7e28aa146c32c1 (diff) | |
download | urpmi-86ce86bba775eb45c9d186cc04c5d1ae32cc1c6f.tar urpmi-86ce86bba775eb45c9d186cc04c5d1ae32cc1c6f.tar.gz urpmi-86ce86bba775eb45c9d186cc04c5d1ae32cc1c6f.tar.bz2 urpmi-86ce86bba775eb45c9d186cc04c5d1ae32cc1c6f.tar.xz urpmi-86ce86bba775eb45c9d186cc04c5d1ae32cc1c6f.zip |
Choice window wasn't working (bug #16104)
Diffstat (limited to 'gurpmi2')
-rwxr-xr-x | gurpmi2 | 27 |
1 files changed, 14 insertions, 13 deletions
@@ -111,27 +111,28 @@ sub ask_choice { my @radios = map { $radio = Gtk2::RadioButton->new_with_label( $radio ? $radio->get_group : undef, - (scalar $_->fullname) . "\n" . $_->summary + (scalar $_->fullname) . " : " . $_->summary . ($_->flag_installed ? N(" (to upgrade)") : '') . ($_->flag_upgrade ? N(" (to install)") : '') ); } @$choices; - my $vbox = Gtk2::VBox->new(0, 5); + my $d = Gtk2::Dialog->new(N("Package choice"), $mainw, [], N("_Cancel") => 0, N("_Ok") => 1); my $label = Gtk2::Label->new(N("One of the following packages is needed:")); $label->set_alignment(0.5, 0.5); - $vbox->pack_start($label, 1, 1, 0); - $vbox->pack_start($_, 1, 1, 0) foreach @radios; - my $cancel_button = Gtk2::Button->new(but(N("_Cancel"))); - my $choice_button = Gtk2::Button->new(but(N("_Ok"))); - $cancel_button->signal_connect(clicked => \&quit); - $choice_button->signal_connect(clicked => sub { - my $n = 0; - foreach (@radios) { last if $_->get_active; ++$n } - $choices->[$n]; + $d->vbox->pack_start($label, 1, 1, 0); + $d->vbox->pack_start($_, 1, 1, 0) foreach @radios; + my $n = 0; + $d->signal_connect(response => sub { + if ($_[1] == 1) { #- "ok" + foreach (@radios) { last if $_->get_active; ++$n } + } + $d->destroy; + exit 0 if $_[1] == 0; #- "cancel" }); - add_button_box($vbox, $cancel_button, $choice_button); - change_mainw($vbox); $radios[0]->set_active(1); + $d->show_all; + $d->run; + $choices->[$n]; } sub ask_continue { |