aboutsummaryrefslogtreecommitdiffstats
path: root/rpmdrake.pm
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2002-08-26 17:28:30 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2002-08-26 17:28:30 +0000
commitcb244fc25be74af11c644abf371286781c0d25ac (patch)
tree1e158c64ed4ae089b65b2798fe86763b68b09c39 /rpmdrake.pm
parent78b7770f28140484b03497c843587c9b32f6e82a (diff)
downloadrpmdrake-cb244fc25be74af11c644abf371286781c0d25ac.tar
rpmdrake-cb244fc25be74af11c644abf371286781c0d25ac.tar.gz
rpmdrake-cb244fc25be74af11c644abf371286781c0d25ac.tar.bz2
rpmdrake-cb244fc25be74af11c644abf371286781c0d25ac.tar.xz
rpmdrake-cb244fc25be74af11c644abf371286781c0d25ac.zip
when choosing between packages, add the ability to have
information about each package choice (one button per package)
Diffstat (limited to 'rpmdrake.pm')
-rw-r--r--rpmdrake.pm28
1 files changed, 18 insertions, 10 deletions
diff --git a/rpmdrake.pm b/rpmdrake.pm
index c7e36ce6..982026b0 100644
--- a/rpmdrake.pm
+++ b/rpmdrake.pm
@@ -63,29 +63,37 @@ sub writeconf {
}
sub interactive_msg {
- my ($title, $contents, $options) = @_;
+ my ($title, $contents, %options) = @_;
my $d = my_gtk->new($title);
gtkadd($d->{window},
gtkpack_(new Gtk::VBox(0,5),
- 1, new Gtk::Label($contents),
+ 1, $options{scroll} ? gtkset_usize(createScrolledWindow(gtktext_insert(new Gtk::Text, $contents)), $typical_width*2, 300)
+ : new Gtk::Label($contents),
0, gtkpack(create_hbox(),
- $options->{yesno} ? (gtksignal_connect(new Gtk::Button($options->{text}{yes} || _("Yes")),
- clicked => sub { $d->{retval} = 1; Gtk->main_quit }),
- gtksignal_connect(new Gtk::Button($options->{text}{no} || _("No")),
- clicked => sub { $d->{retval} = 0; Gtk->main_quit }))
+ $options{yesno} ? (gtksignal_connect(new Gtk::Button($options{text}{yes} || _("Yes")),
+ clicked => sub { $d->{retval} = 1; Gtk->main_quit }),
+ gtksignal_connect(new Gtk::Button($options{text}{no} || _("No")),
+ clicked => sub { $d->{retval} = 0; Gtk->main_quit }))
: gtksignal_connect(new Gtk::Button(_("Ok")), clicked => sub { Gtk->main_quit })
)));
$d->main;
}
sub interactive_list {
- my ($title, $contents, @list) = @_;
+ my ($title, $contents, $list, $callback) = @_;
my $d = my_gtk->new($title);
- my $vbradios = gtkpack__(new Gtk::VBox(0, 0), my @radios = gtkradio('', @list));
+ my @radios = gtkradio('', @$list);
+ my $vbradios = $callback ? create_packtable({},
+ mapn { my $n = $_[1];
+ [ $_[0],
+ gtksignal_connect(new Gtk::Button(_("Info...")),
+ clicked => sub { $callback->($n) }) ]
+ } \@radios, $list)
+ : gtkpack__(new Gtk::VBox(0, 0), @radios);
gtkadd($d->{window},
gtkpack__(new Gtk::VBox(0,5),
new Gtk::Label($contents),
- int(@list) > 8 ? gtkset_usize(createScrolledWindow($vbradios), 250, 320) : $vbradios,
+ int(@$list) > 8 ? gtkset_usize(createScrolledWindow($vbradios), 250, 320) : $vbradios,
gtkpack__(create_hbox(), gtksignal_connect(new Gtk::Button(_("Ok")), clicked => sub { Gtk->main_quit }))));
$d->main;
my $tmp;
@@ -221,7 +229,7 @@ sub choose_mirror {
_("I need to contact MandrakeSoft website to get the mirrors list.
Please check that your network is currently running.
-Is it ok to continue?"), { yesno => 1 }) or return '';
+Is it ok to continue?"), yesno => 1) or return '';
my $wait = wait_msg(_("Please wait, downloading mirrors addresses from MandrakeSoft website."));
my @mirrors;
eval { @mirrors = mirrors('/var/cache/urpmi', 'updates') };