Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 427334 | Differences between
and this patch

Collapse All | Expand All

(-)a/PATCHES (+1 lines)
Line 0 Link Here
1
patch-1.5.20hg.pdmef.progress.vl.2
(-)a/color.c (+1 lines)
Lines 96-101 static const struct mapping_t Fields[] = Link Here
96
  { "sidebar_new",	MT_COLOR_NEW },
96
  { "sidebar_new",	MT_COLOR_NEW },
97
  { "sidebar_flagged",	MT_COLOR_FLAGGED },
97
  { "sidebar_flagged",	MT_COLOR_FLAGGED },
98
  { "sidebar",		MT_COLOR_SIDEBAR },
98
  { "sidebar",		MT_COLOR_SIDEBAR },
99
  { "progress",		MT_COLOR_PROGRESS },
99
  { NULL,		0 }
100
  { NULL,		0 }
100
};
101
};
101
102
(-)a/curs_lib.c (-5 / +51 lines)
Lines 390-395 void mutt_progress_init (progress_t* progress, const char *msg, Link Here
390
  mutt_progress_update (progress, 0, 0);
390
  mutt_progress_update (progress, 0, 0);
391
}
391
}
392
392
393
static void message_bar (int percent, const char *fmt, ...)
394
{
395
  va_list ap;
396
  char buf[STRING], buf2[STRING];
397
  int w = percent * COLS / 100;
398
  size_t l;
399
400
  va_start (ap, fmt);
401
  vsnprintf (buf, sizeof (buf), fmt, ap);
402
  l = mutt_strwidth (buf);
403
  va_end (ap);
404
405
  mutt_format_string(buf2, sizeof (buf2),
406
    0, COLS-2, FMT_LEFT, 0, buf, sizeof (buf), 0);
407
408
  move (LINES - 1, 0);
409
410
  if (l < w)
411
  {
412
    SETCOLOR(MT_COLOR_PROGRESS);
413
    addstr (buf2);
414
    w -= l;
415
    while (w--)
416
      addch(' ');
417
    SETCOLOR(MT_COLOR_NORMAL);
418
    clrtoeol ();
419
    mutt_refresh();
420
  }
421
  else
422
  {
423
    size_t bw;
424
    char ch;
425
    int off = mutt_wstr_trunc (buf2, sizeof (buf2), w, &bw);
426
427
    ch = buf2[off];
428
    buf2[off] = 0;
429
    SETCOLOR(MT_COLOR_PROGRESS);
430
    addstr (buf2);
431
    buf2[off] = ch;
432
    SETCOLOR(MT_COLOR_NORMAL);
433
    addstr (&buf2[off]);
434
    clrtoeol ();
435
    mutt_refresh();
436
  }
437
}
438
393
void mutt_progress_update (progress_t* progress, long pos, int percent)
439
void mutt_progress_update (progress_t* progress, long pos, int percent)
394
{
440
{
395
  char posstr[SHORT_STRING];
441
  char posstr[SHORT_STRING];
Lines 440-455 void mutt_progress_update (progress_t* progress, long pos, int percent) Link Here
440
486
441
    if (progress->size > 0)
487
    if (progress->size > 0)
442
    {
488
    {
443
      mutt_message ("%s %s/%s (%d%%)", progress->msg, posstr, progress->sizestr,
489
      message_bar (percent > 0 ? percent : (int) (100.0 * (double) progress->pos / progress->size),
444
		    percent > 0 ? percent :
490
        "%s %s/%s (%d%%)", progress->msg, posstr, progress->sizestr,
445
		   	(int) (100.0 * (double) progress->pos / progress->size));
491
        percent > 0 ? percent : (int) (100.0 * (double) progress->pos / progress->size));
446
    }
492
    }
447
    else
493
    else
448
    {
494
    {
449
      if (percent > 0)
495
      if (percent > 0)
450
	mutt_message ("%s %s (%d%%)", progress->msg, posstr, percent);
496
        message_bar (percent, "%s %s (%d%%)", progress->msg, posstr, percent);
451
      else
497
      else
452
	mutt_message ("%s %s", progress->msg, posstr);
498
        mutt_message ("%s %s", progress->msg, posstr);
453
    }
499
    }
454
  }
500
  }
455
501
(-)a/doc/manual.xml.head (+1 lines)
Lines 2641-2646 specify one or the other). Link Here
2641
<listitem><para>markers (the <quote>+</quote> markers at the beginning of wrapped lines in the pager)</para></listitem>
2641
<listitem><para>markers (the <quote>+</quote> markers at the beginning of wrapped lines in the pager)</para></listitem>
2642
<listitem><para>message (informational messages)</para></listitem>
2642
<listitem><para>message (informational messages)</para></listitem>
2643
<listitem><para>normal</para></listitem>
2643
<listitem><para>normal</para></listitem>
2644
<listitem><para>progress (visual progress bar)</para></listitem>
2644
<listitem><para>quoted (text matching <link linkend="quote-regexp">$quote_regexp</link> in the body of a message)</para></listitem>
2645
<listitem><para>quoted (text matching <link linkend="quote-regexp">$quote_regexp</link> in the body of a message)</para></listitem>
2645
<listitem><para>quoted1, quoted2, ..., quoted<emphasis>N</emphasis> (higher levels of quoting)</para></listitem>
2646
<listitem><para>quoted1, quoted2, ..., quoted<emphasis>N</emphasis> (higher levels of quoting)</para></listitem>
2646
<listitem><para>search (highlighting of words in the pager)</para></listitem>
2647
<listitem><para>search (highlighting of words in the pager)</para></listitem>
(-)a/mutt_curses.h (+1 lines)
Lines 128-133 enum Link Here
128
  MT_COLOR_SIDEBAR,
128
  MT_COLOR_SIDEBAR,
129
  MT_COLOR_UNDERLINE,
129
  MT_COLOR_UNDERLINE,
130
  MT_COLOR_INDEX,
130
  MT_COLOR_INDEX,
131
  MT_COLOR_PROGRESS,
131
  MT_COLOR_NEW,
132
  MT_COLOR_NEW,
132
  MT_COLOR_FLAGGED,
133
  MT_COLOR_FLAGGED,
133
  MT_COLOR_MAX
134
  MT_COLOR_MAX

Return to bug 427334