mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 17:58:31 +02:00
added discusage icons to menu header view element
This commit is contained in:
parent
797e33441e
commit
82f2bbd5c4
1
HISTORY
1
HISTORY
@ -14,3 +14,4 @@ Version 0.0.2
|
|||||||
- added Theme support, each skin can now have various themes
|
- added Theme support, each skin can now have various themes
|
||||||
- fixed a crash if no skindesigner skins are found and plugin setup menu is called from another skin
|
- fixed a crash if no skindesigner skins are found and plugin setup menu is called from another skin
|
||||||
- added {durationhours} and {durationminutes} tokens in several view elements
|
- added {durationhours} and {durationminutes} tokens in several view elements
|
||||||
|
- added discusage icons to menu header view element so that it discusage can be displayed in every menu view
|
||||||
|
@ -33,6 +33,12 @@
|
|||||||
{vdrversion} running VDR Version
|
{vdrversion} running VDR Version
|
||||||
{hasicon} true if a menu icon is available
|
{hasicon} true if a menu icon is available
|
||||||
{icon} path of menu icon
|
{icon} path of menu icon
|
||||||
|
{freetime} available disc capacity in hh:mm
|
||||||
|
{freepercent} available disc capacity in percent
|
||||||
|
{usedpercent} used disc capacity in percent
|
||||||
|
{freegb} available disc capacity in gigabytes
|
||||||
|
{discalert} true if disc usage is > 95%
|
||||||
|
{vdrusagestring} localized VDR internal usage string
|
||||||
-->
|
-->
|
||||||
<header>
|
<header>
|
||||||
<area x="0" y="0" width="41%" height="10%" layer="2">
|
<area x="0" y="0" width="41%" height="10%" layer="2">
|
||||||
|
@ -25,6 +25,12 @@
|
|||||||
{vdrversion} running VDR Version
|
{vdrversion} running VDR Version
|
||||||
{hasicon} true if a menu icon is available
|
{hasicon} true if a menu icon is available
|
||||||
{icon} path of menu icon
|
{icon} path of menu icon
|
||||||
|
{freetime} available disc capacity in hh:mm
|
||||||
|
{freepercent} available disc capacity in percent
|
||||||
|
{usedpercent} used disc capacity in percent
|
||||||
|
{freegb} available disc capacity in gigabytes
|
||||||
|
{discalert} true if disc usage is > 95%
|
||||||
|
{vdrusagestring} localized VDR internal usage string
|
||||||
-->
|
-->
|
||||||
<header>
|
<header>
|
||||||
</header>
|
</header>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#define __STL_CONFIG_H
|
#define __STL_CONFIG_H
|
||||||
#include <vdr/menu.h>
|
#include <vdr/menu.h>
|
||||||
|
#include <vdr/videodir.h>
|
||||||
#include "displaymenurootview.h"
|
#include "displaymenurootview.h"
|
||||||
#include "../config.h"
|
#include "../config.h"
|
||||||
#include "../libcore/helpers.h"
|
#include "../libcore/helpers.h"
|
||||||
@ -380,6 +381,20 @@ void cDisplayMenuRootView::DrawHeader(void) {
|
|||||||
stringTokens.insert(pair<string,string>("icon", icon));
|
stringTokens.insert(pair<string,string>("icon", icon));
|
||||||
intTokens.insert(pair<string,int>("hasicon", hasIcon));
|
intTokens.insert(pair<string,int>("hasicon", hasIcon));
|
||||||
|
|
||||||
|
//Disc Usage
|
||||||
|
string vdrUsageString = *cVideoDiskUsage::String();
|
||||||
|
int discUsage = cVideoDiskUsage::UsedPercent();
|
||||||
|
bool discAlert = (discUsage > 95) ? true : false;
|
||||||
|
string freeTime = *cString::sprintf("%02d:%02d", cVideoDiskUsage::FreeMinutes() / 60, cVideoDiskUsage::FreeMinutes() % 60);
|
||||||
|
int freeGB = cVideoDiskUsage::FreeMB() / 1024;
|
||||||
|
|
||||||
|
intTokens.insert(pair<string, int>("usedpercent", discUsage));
|
||||||
|
intTokens.insert(pair<string, int>("freepercent", 100-discUsage));
|
||||||
|
intTokens.insert(pair<string, int>("discalert", discAlert));
|
||||||
|
intTokens.insert(pair<string, int>("freegb", freeGB));
|
||||||
|
stringTokens.insert(pair<string,string>("freetime", freeTime));
|
||||||
|
stringTokens.insert(pair<string,string>("vdrusagestring", vdrUsageString));
|
||||||
|
|
||||||
ClearViewElement(veHeader);
|
ClearViewElement(veHeader);
|
||||||
DrawViewElement(veHeader, &stringTokens, &intTokens);
|
DrawViewElement(veHeader, &stringTokens, &intTokens);
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,20 @@ bool cDisplayMenuView::DrawHeader(void) {
|
|||||||
stringTokens.insert(pair<string,string>("icon", icon));
|
stringTokens.insert(pair<string,string>("icon", icon));
|
||||||
intTokens.insert(pair<string,int>("hasicon", hasIcon));
|
intTokens.insert(pair<string,int>("hasicon", hasIcon));
|
||||||
|
|
||||||
|
//Disc Usage
|
||||||
|
string vdrUsageString = *cVideoDiskUsage::String();
|
||||||
|
int discUsage = cVideoDiskUsage::UsedPercent();
|
||||||
|
bool discAlert = (discUsage > 95) ? true : false;
|
||||||
|
string freeTime = *cString::sprintf("%02d:%02d", cVideoDiskUsage::FreeMinutes() / 60, cVideoDiskUsage::FreeMinutes() % 60);
|
||||||
|
int freeGB = cVideoDiskUsage::FreeMB() / 1024;
|
||||||
|
|
||||||
|
intTokens.insert(pair<string, int>("usedpercent", discUsage));
|
||||||
|
intTokens.insert(pair<string, int>("freepercent", 100-discUsage));
|
||||||
|
intTokens.insert(pair<string, int>("discalert", discAlert));
|
||||||
|
intTokens.insert(pair<string, int>("freegb", freeGB));
|
||||||
|
stringTokens.insert(pair<string,string>("freetime", freeTime));
|
||||||
|
stringTokens.insert(pair<string,string>("vdrusagestring", vdrUsageString));
|
||||||
|
|
||||||
ClearViewElement(veHeader);
|
ClearViewElement(veHeader);
|
||||||
DrawViewElement(veHeader, &stringTokens, &intTokens);
|
DrawViewElement(veHeader, &stringTokens, &intTokens);
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user