From d0793802f2e5ca9e6f52f8f9a4690dcb7c586384 Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Thu, 7 Aug 2003 12:24:29 +0000 Subject: when updating media, if url is too long, don't display it because it enlarges much the dialog; better display only the basename and the medium name (#4338) --- rpmdrake.pm | 30 +++++++++++++++++++----------- rpmdrake.spec | 3 +++ 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/rpmdrake.pm b/rpmdrake.pm index 6a87546e..b6694d8e 100644 --- a/rpmdrake.pm +++ b/rpmdrake.pm @@ -354,6 +354,7 @@ by Mandrake Linux Official Updates.")), return ''; sub show_urpm_progress { my ($label, $pb, $mode, $file, $percent, $total, $eta, $speed) = @_; $file =~ s|([^:]*://[^/:\@]*:)[^/:\@]*(\@.*)|$1xxxx$2|; #- if needed... + my $medium if 0; if ($mode eq 'copy') { $pb->set_fraction(0); $label->set_label(N("Copying file for medium `%s'...", $file)); @@ -363,23 +364,30 @@ sub show_urpm_progress { } elsif ($mode eq 'retrieve') { $pb->set_fraction(0); $label->set_label(N("Examining remote file of medium `%s'...", $file)); - } elsif ($mode eq 'start') { - $pb->set_fraction(0); - $label->set_label(N("Starting download of `%s'...", $file)); - } elsif ($mode eq 'progress') { - if (defined $total && defined $eta) { - $pb->set_fraction($percent/100); - $label->set_label(N("Download of `%s', time to go:%s, speed:%s", $file, $eta, $speed)); - } else { - $pb->set_fraction($percent/100); - $label->set_label(N("Download of `%s', speed:%s", $file, $speed)); - } + $medium = $file; } elsif ($mode eq 'done') { $pb->set_fraction(1.0); $label->set_label($label->get_label . N(" done.")); + $medium = undef; } elsif ($mode eq 'failed') { $pb->set_fraction(1.0); $label->set_label($label->get_label . N(" failed!")); + $medium = undef; + } else { + length($file) > 60 and $file = $medium ? N("%s from medium %s", basename($file), $medium) + : basename($file); + if ($mode eq 'start') { + $pb->set_fraction(0); + $label->set_label(N("Starting download of `%s'...", $file)); + } elsif ($mode eq 'progress') { + if (defined $total && defined $eta) { + $pb->set_fraction($percent/100); + $label->set_label(N("Download of `%s', time to go:%s, speed:%s", $file, $eta, $speed)); + } else { + $pb->set_fraction($percent/100); + $label->set_label(N("Download of `%s', speed:%s", $file, $speed)); + } + } } Gtk2->main_iteration while Gtk2->events_pending; } diff --git a/rpmdrake.spec b/rpmdrake.spec index 6e8be481..e05c7cde 100644 --- a/rpmdrake.spec +++ b/rpmdrake.spec @@ -110,6 +110,9 @@ rm -rf $RPM_BUILD_ROOT (such dialog is for example "more information on packages") - don't display a too high message when there are many packages with signatures problems (#4335) +- when updating media, if url is too long, don't display it because + it enlarges much the dialog; better display only the basename + and the medium name (#4338) * Mon Aug 4 2003 Guillaume Cottenceau 2.1-30mdk - revert "use checkboxes instead of icons" -- cgit v1.2.1