statusbar: use boost::format instead of c-style printf

This commit is contained in:
Andrzej Rybczak
2014-08-27 05:25:53 +02:00
parent 8d1b10fb3e
commit 59430f640b
23 changed files with 283 additions and 219 deletions

View File

@@ -37,25 +37,6 @@ bool statusbarBlockUpdate = false;
bool progressbarBlockUpdate = false;
bool statusbarAllowUnlock = true;
void showMessage(int time, const char *format, va_list list)
{
if (statusbarAllowUnlock)
{
statusbarLockTime = Global::Timer;
statusbarLockDelay = time;
if (Config.statusbar_visibility)
statusbarBlockUpdate = true;
else
progressbarBlockUpdate = true;
wFooter->goToXY(0, Config.statusbar_visibility);
*wFooter << NC::Format::NoBold;
wmove(wFooter->raw(), Config.statusbar_visibility, 0);
vw_printw(wFooter->raw(), format, list);
wclrtoeol(wFooter->raw());
wFooter->refresh();
}
}
}
void Progressbar::lock()
@@ -168,20 +149,20 @@ NC::Window &Statusbar::put()
return *wFooter;
}
void Statusbar::msg(const char *format, ...)
void Statusbar::print(int time, const std::string &message)
{
va_list list;
va_start(list, format);
showMessage(Config.message_delay_time, format, list);
va_end(list);
}
void Statusbar::msg(int time, const char *format, ...)
{
va_list list;
va_start(list, format);
showMessage(time, format, list);
va_end(list);
if (statusbarAllowUnlock)
{
statusbarLockTime = Global::Timer;
statusbarLockDelay = time;
if (Config.statusbar_visibility)
statusbarBlockUpdate = true;
else
progressbarBlockUpdate = true;
wFooter->goToXY(0, Config.statusbar_visibility);
*wFooter << message << wclrtoeol;
wFooter->refresh();
}
}
void Statusbar::Helpers::mpd()