X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=curs_lib.c;h=3e03810b76900f83760ffebb7320de467234bc27;hp=b9c4557925122ad453670db5f91508854c200aee;hb=8889846011afe0d33ff155acce9afef5af306ae0;hpb=ba5e3af4ea19e1d20c80941c077039871ec84258;ds=sidebyside diff --git a/curs_lib.c b/curs_lib.c index b9c4557..3e03810 100644 --- a/curs_lib.c +++ b/curs_lib.c @@ -16,6 +16,7 @@ #endif #include "mutt.h" +#include "enter.h" #include "mutt_menu.h" #include "mutt_curses.h" #include "pager.h" @@ -275,7 +276,7 @@ void mutt_query_exit (void) if (Timeout) timeout (-1); /* restore blocking operation */ if (mutt_yesorno (_("Exit Mutt-ng?"), M_YES) == M_YES) { - endwin (); + mutt_endwin (NULL); exit (1); } mutt_clear_error (); @@ -309,6 +310,30 @@ void mutt_curses_error (const char *fmt, ...) set_option (OPTMSGERR); } +void mutt_progress_bar (progress_t* progress, long pos) { + char posstr[SHORT_STRING]; + + if (!pos) { + if (!NetInc) + mutt_message (progress->msg); + else { + mutt_pretty_size (progress->sizestr, sizeof (progress->sizestr), + progress->size); + progress->pos = 0; + } + } + + if (!NetInc) + return; + + if (pos > progress->pos + (NetInc << 10)) { + progress->pos = pos; + pos = pos / (NetInc << 10) * (NetInc << 10); + mutt_pretty_size (posstr, sizeof (posstr), pos); + mutt_message ("%s %s/%s", progress->msg, posstr, progress->sizestr); + } +} + void mutt_curses_message (const char *fmt, ...) { char TmpErrorbuf[STRING];