summaryrefslogtreecommitdiffstats
path: root/gurpmi2
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2006-04-06 13:02:08 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2006-04-06 13:02:08 +0000
commit2bba4f75e0826dcae162452153500ebb2707f65b (patch)
treee7cb9fb864bc3fa5ebe3bfaf4d77ba083b39e80d /gurpmi2
parent3f19cc726c3f123fd457943508e53c5ba4a3a964 (diff)
downloadurpmi-2bba4f75e0826dcae162452153500ebb2707f65b.tar
urpmi-2bba4f75e0826dcae162452153500ebb2707f65b.tar.gz
urpmi-2bba4f75e0826dcae162452153500ebb2707f65b.tar.bz2
urpmi-2bba4f75e0826dcae162452153500ebb2707f65b.tar.xz
urpmi-2bba4f75e0826dcae162452153500ebb2707f65b.zip
(configure_urpm) if the text is very big (eg: more than 160 lines with
"gurpmi apache"), just use a scrolled text
Diffstat (limited to 'gurpmi2')
-rwxr-xr-xgurpmi223
1 files changed, 22 insertions, 1 deletions
diff --git a/gurpmi2 b/gurpmi2
index b7c0bd57..8fc75dc9 100755
--- a/gurpmi2
+++ b/gurpmi2
@@ -95,7 +95,28 @@ sub configure_urpm {
exit $_[0];
};
$urpm->{error} = sub {
- my $w = Gtk2::MessageDialog->new($mainw, [qw(modal destroy-with-parent)], 'warning', 'ok', Locale::gettext::iconv($_[0], undef, 'UTF-8'));
+ my ($message) = @_;
+ my $nb_lines = split("\n", $message);
+ $message = Locale::gettext::iconv($message, undef, 'UTF-8');
+
+
+ my $w;
+ if ($nb_lines > 30) {
+ $w = Gtk2::Dialog->new(N("Warning"), $mainw, [qw(modal destroy-with-parent)], N("Ok"), 'ok');
+ $w->vbox->add(my $f = Gtk2::Frame->new);
+ my $sw = Gtk2::ScrolledWindow->new(undef, undef);
+ $f->add($sw);
+ $f->set_shadow_type('in');
+ $sw->set_policy('automatic', 'automatic');
+ my $text = Gtk2::TextView->new;
+ $sw->add($text);
+ $text->get_buffer->set_text($message);
+ $sw->set_border_width(2);
+ $_->show foreach $f, $sw, $text;
+ $w->set_size_request(400,400);
+ } else {
+ $w = Gtk2::MessageDialog->new($mainw, [qw(modal destroy-with-parent)], 'warning', 'ok', $message);
+ }
$w->run;
$w->destroy;
};