summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2020-07-10 17:34:07 +0100
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2020-07-10 17:34:07 +0100
commit5a1a9a51a205726e2abb43f14a85d289ec9694f5 (patch)
tree9cf007f486fdab90eddc644e693526f268d09783
parentc46f1d05459a6b37b4079115eaa412cf2ced07c9 (diff)
downloadurpmi-5a1a9a51a205726e2abb43f14a85d289ec9694f5.tar
urpmi-5a1a9a51a205726e2abb43f14a85d289ec9694f5.tar.gz
urpmi-5a1a9a51a205726e2abb43f14a85d289ec9694f5.tar.bz2
urpmi-5a1a9a51a205726e2abb43f14a85d289ec9694f5.tar.xz
urpmi-5a1a9a51a205726e2abb43f14a85d289ec9694f5.zip
gurpmi2: ensure download error report fits on screen.
With a batch size of 50, the number of failed downloads can be large. That causes the message dialogue to exceed the screen height, making the retry Yes/No buttons invisible and inaccessible.
-rw-r--r--Changes2
-rwxr-xr-xgurpmi219
2 files changed, 19 insertions, 2 deletions
diff --git a/Changes b/Changes
index 24e26237..5e294ce3 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,5 @@
+- gurpmi2:
+ o ensure download error report fits on screen
- Make it work with no feature qw(indirect) (aka perl7)
- small Kwalitee cleanups
- stop truncating disk names when prompting for a CD/USB key
diff --git a/gurpmi2 b/gurpmi2
index d69b6a52..0c874800 100755
--- a/gurpmi2
+++ b/gurpmi2
@@ -380,8 +380,23 @@ return_with_exit_code:
sub ask_yes_or_no {
my ($_title, $msg) = @_;
- # MessageDialogs have no titles unless using 'secondary-text'
- my $w = Gtk3::MessageDialog->new($mainw, [qw(modal destroy-with-parent)], 'warning', 'yes-no', $msg);
+ my $w;
+ my $nb_lines = $msg =~ tr/\n/\n/;
+ if ($nb_lines > 20) {
+ $w = Gtk3::Dialog->new(N("Warning"), $mainw, [qw(modal destroy-with-parent)], N("No"), 'no', N("Yes"), 'yes');
+ my @lines = split("\n", $msg);
+ my $vbox = Gtk3::VBox->new(0, 5);
+ $vbox->pack_start(new_label($lines[0]), 1, 1, 0);
+ $vbox->pack_start(new_label(join("\n", @lines[1 .. $nb_lines - 1])), 1, 1, 0);
+ $vbox->pack_start(new_label($lines[$nb_lines]), 1, 1, 0);
+ $vbox->set_size_request(400, 320);
+ $w->get_child->add($vbox);
+ $vbox->show_all;
+ $w->set_default_response('yes');
+ } else {
+ # MessageDialogs have no titles unless using 'secondary-text'
+ $w = Gtk3::MessageDialog->new($mainw, [qw(modal destroy-with-parent)], 'warning', 'yes-no', $msg);
+ }
my $response = $w->run;
$w->destroy;
$response eq 'yes';