diff options
author | Guillaume Cottenceau <gc@mandriva.com> | 2003-08-07 12:24:29 +0000 |
---|---|---|
committer | Guillaume Cottenceau <gc@mandriva.com> | 2003-08-07 12:24:29 +0000 |
commit | d0793802f2e5ca9e6f52f8f9a4690dcb7c586384 (patch) | |
tree | 94a6526fdfe28bd89ad5ad867d92a8782517754e /rpmdrake.pm | |
parent | b084a03928c68929eae319b5950f111c0b5cb68c (diff) | |
download | rpmdrake-d0793802f2e5ca9e6f52f8f9a4690dcb7c586384.tar rpmdrake-d0793802f2e5ca9e6f52f8f9a4690dcb7c586384.tar.gz rpmdrake-d0793802f2e5ca9e6f52f8f9a4690dcb7c586384.tar.bz2 rpmdrake-d0793802f2e5ca9e6f52f8f9a4690dcb7c586384.tar.xz rpmdrake-d0793802f2e5ca9e6f52f8f9a4690dcb7c586384.zip |
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)
Diffstat (limited to 'rpmdrake.pm')
-rw-r--r-- | rpmdrake.pm | 30 |
1 files changed, 19 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; } |