added tokens for progressbars in displamenudefault

This commit is contained in:
louis 2015-04-19 16:55:20 +02:00
parent eb3f8f074d
commit 4fb0b9de22
3 changed files with 22 additions and 0 deletions

View File

@ -299,4 +299,5 @@ Version 0.4.3
- added strequal, strnotequal, strcontains, strnotcontains functions
to compare strings in conditions
- fixed sort order in lastrecordings viewelement
- added tokens for progressbars in displamenudefault

View File

@ -27,6 +27,15 @@
{column4width} proposed width of column4
{column5width} proposed width of column5
{column6width} proposed width of column6
{column1pb} true if column 1 is a progressbar
...
{column6pb} true if column 6 is a progressbar
{column1pbtotalsize} total size of progressbar
...
{column6pbtotalsize} total size of progressbar
{column1pbsize} current size of progressbar
...
{column6pbsize} current size of progressbar
{current} true if column is currently selected
{separator} true if column is a list separator

View File

@ -135,6 +135,18 @@ void cDisplayMenuItemDefaultView::SetTokens(void) {
intTokens.insert(pair<string,int>(nameUsed.str(), (tabTexts[i].size() > 0) ? 1 : 0 ));
intTokens.insert(pair<string,int>(nameX.str(), tabs[i]));
intTokens.insert(pair<string,int>(nameWidth.str(), tabWidths[i]));
//Progress Bar
if (tabTexts[i].find("[") != string::npos & tabTexts[i].find("]") != string::npos) {
stringstream nameProgressBar;
nameProgressBar << name.str() << "pb";
stringstream namePbTotal;
namePbTotal << name.str() << "pbtotalsize";
stringstream namePbSize;
namePbSize << name.str() << "pbsize";
intTokens.insert(pair<string,int>(nameProgressBar.str(), 1));
intTokens.insert(pair<string,int>(namePbTotal.str(), tabTexts[i].size() - 2));
intTokens.insert(pair<string,int>(namePbSize.str(), std::count(tabTexts[i].begin(), tabTexts[i].end(), '|')));
}
}
intTokens.insert(pair<string,int>("current", current));
intTokens.insert(pair<string,int>("separator", !selectable));