aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2003-08-07 12:24:29 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2003-08-07 12:24:29 +0000
commitd0793802f2e5ca9e6f52f8f9a4690dcb7c586384 (patch)
tree94a6526fdfe28bd89ad5ad867d92a8782517754e
parentb084a03928c68929eae319b5950f111c0b5cb68c (diff)
downloadrpmdrake-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)
-rw-r--r--rpmdrake.pm30
-rw-r--r--rpmdrake.spec3
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 <gc@mandrakesoft.com> 2.1-30mdk
- revert "use checkboxes instead of icons"