summaryrefslogtreecommitdiffstats
path: root/gurpmi2
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-06-07 05:51:29 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-06-07 05:51:29 +0000
commit86ce86bba775eb45c9d186cc04c5d1ae32cc1c6f (patch)
tree4eb19e078b723c2b69ccab74882749d69d499351 /gurpmi2
parent780af97af0c276c628a3605e5c7e28aa146c32c1 (diff)
downloadurpmi-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-xgurpmi227
1 files changed, 14 insertions, 13 deletions
diff --git a/gurpmi2 b/gurpmi2
index aa7f64f4..f781e832 100755
--- a/gurpmi2
+++ b/gurpmi2
@@ -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 {