diff --git a/HISTORY b/HISTORY index 98e63f4..ccea680 100644 --- a/HISTORY +++ b/HISTORY @@ -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 diff --git a/skinskeleton/xmlfiles/displaymenudefault.xml b/skinskeleton/xmlfiles/displaymenudefault.xml index 64036ff..64718c2 100644 --- a/skinskeleton/xmlfiles/displaymenudefault.xml +++ b/skinskeleton/xmlfiles/displaymenudefault.xml @@ -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 diff --git a/views/displaymenuitemview.c b/views/displaymenuitemview.c index 1ce4066..acfee64 100644 --- a/views/displaymenuitemview.c +++ b/views/displaymenuitemview.c @@ -135,6 +135,18 @@ void cDisplayMenuItemDefaultView::SetTokens(void) { intTokens.insert(pair(nameUsed.str(), (tabTexts[i].size() > 0) ? 1 : 0 )); intTokens.insert(pair(nameX.str(), tabs[i])); intTokens.insert(pair(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(nameProgressBar.str(), 1)); + intTokens.insert(pair(namePbTotal.str(), tabTexts[i].size() - 2)); + intTokens.insert(pair(namePbSize.str(), std::count(tabTexts[i].begin(), tabTexts[i].end(), '|'))); + } } intTokens.insert(pair("current", current)); intTokens.insert(pair("separator", !selectable));