summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2006-04-06 15:29:42 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2006-04-06 15:29:42 +0000
commit2f834fb9c80e08a570c6d20273a0881b4a7d956a (patch)
treecdc12bfd0367c6011fa84e9f4f648e847dd57e16
parent2bba4f75e0826dcae162452153500ebb2707f65b (diff)
downloadurpmi-2f834fb9c80e08a570c6d20273a0881b4a7d956a.tar
urpmi-2f834fb9c80e08a570c6d20273a0881b4a7d956a.tar.gz
urpmi-2f834fb9c80e08a570c6d20273a0881b4a7d956a.tar.bz2
urpmi-2f834fb9c80e08a570c6d20273a0881b4a7d956a.tar.xz
urpmi-2f834fb9c80e08a570c6d20273a0881b4a7d956a.zip
Minor style nits.
-rwxr-xr-xgurpmi243
1 files changed, 20 insertions, 23 deletions
diff --git a/gurpmi2 b/gurpmi2
index 8fc75dc9..621d68b0 100755
--- a/gurpmi2
+++ b/gurpmi2
@@ -82,7 +82,6 @@ my @ask_unselect = $urpm->unselected_packages($state);
), \&do_install)
: do_install();
-
$mainw->show_all;
Gtk2->main;
@@ -95,28 +94,26 @@ sub configure_urpm {
exit $_[0];
};
$urpm->{error} = sub {
- 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);
- }
+ my ($message) = @_;
+ my $nb_lines = $message =~ tr/\n/\n/;
+ $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;
};