From a8f5e4fe17ebb3310457c07cd50ec90bf9f0d486 Mon Sep 17 00:00:00 2001 From: Darshit Shah Date: Thu, 1 May 2014 19:37:39 +0200 Subject: [PATCH] Aesthetic changes to progress bar --- src/ChangeLog | 9 +++++++++ src/progress.c | 7 +++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 96723dd..467cc00 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2014-05-01 Darshit Shah (tiny change) + + * progress.c (dot_finish): Do not print extra newlines when not in verbose + mode. (Purely aesthetic change) + (get_eta): Add extra space when eta is printed. + (create_image): Remove erroneous space from being added to progress bar when + filename > MAX_FILENAME_LEN + (create_image): Remove extra space before printed download speeds + 2014-04-19 Darshit Shah * log.h (log_options): Add new logging options, LOG_PROGRESS. All progress diff --git a/src/progress.c b/src/progress.c index b1d5095..4530feb 100644 --- a/src/progress.c +++ b/src/progress.c @@ -407,7 +407,7 @@ dot_finish (void *progress, double dltime) } print_row_stats (dp, dltime, true); - logputs (LOG_PROGRESS, "\n\n"); + logputs (LOG_VERBOSE, "\n\n"); log_set_flush (false); xfree (dp); @@ -823,7 +823,7 @@ get_eta (int *bcd) { /* TRANSLATORS: "ETA" is English-centric, but this must be short, ideally 3 chars. Abbreviate if necessary. */ - static const char eta_str[] = N_(" eta %s"); + static const char eta_str[] = N_(" eta %s"); static const char *eta_trans; static int bytes_cols_diff; if (eta_trans == NULL) @@ -931,7 +931,6 @@ create_image (struct bar_progress *bp, double dl_total_time, bool done) offset = ((int) bp->tick) % (orig_filename_len - MAX_FILENAME_LEN); else offset = 0; - *p++ = ' '; memcpy (p, bp->f_download + offset, MAX_FILENAME_LEN); p += MAX_FILENAME_LEN; *p++ = ' '; @@ -1037,7 +1036,7 @@ create_image (struct bar_progress *bp, double dl_total_time, bool done) wgint dlquant = hist->total_bytes + bp->recent_bytes; double dltime = hist->total_time + (dl_total_time - bp->recent_start); double dlspeed = calc_rate (dlquant, dltime, &units); - sprintf (p, " %4.*f%s", dlspeed >= 99.95 ? 0 : dlspeed >= 9.995 ? 1 : 2, + sprintf (p, "%4.*f%s", dlspeed >= 99.95 ? 0 : dlspeed >= 9.995 ? 1 : 2, dlspeed, !opt.report_bps ? short_units[units] : short_units_bits[units]); move_to_end (p); } -- 1.9.2