diff options
27 files changed, 58 insertions, 43 deletions
@@ -12,6 +12,7 @@ VDR Plugin 'skinflatplus' Revision History - [update] timer widget new options to select which timer to show (recording, active) - [update] add 15:11 aspect in displaychannel and replay +- [update] disk usage icons with 16 sections instead of 8 2014-12-04: Version 0.5.0 - [fix] femon receiver - do not get data from previous channel diff --git a/baserender.c b/baserender.c index fa0ff10a..c7c027c5 100644 --- a/baserender.c +++ b/baserender.c @@ -212,59 +212,65 @@ void cFlatBaseRender::TopBarEnableDiskUsage(void) { double AllMinutes = FreeMinutes / (double)((100 - DiskUsage) / 100.0); double OccupiedGB = AllGB - FreeGB; int OccupiedMinutes = AllMinutes - FreeMinutes; + int ChartDiskUsage = DiskUsage; + cString iconName("chart1"); cString extra1; cString extra2; - // show in free mode - if( Config.DiskUsageFree == 1 ) { - if( Config.DiskUsageShort == false ) { - extra1 = cString::sprintf("%s: %d%% %s", tr("Disk"), 100 - DiskUsage, tr("free") ); + + if( Config.DiskUsageFree == 1 ) { // Show in free mode + ChartDiskUsage = 100 - DiskUsage; // DiskFreePrecent + if( Config.DiskUsageShort == false ) { // Long format + extra1 = cString::sprintf("%s: %d%% %s", tr("Disk"), ChartDiskUsage, tr("free") ); extra2 = cString::sprintf("%.1f GB ~ %02d:%02d", FreeGB, FreeMinutes / 60, FreeMinutes % 60); - } else { - extra1 = cString::sprintf("%d%% %s", 100 - DiskUsage, tr("free") ); + } else { // Short format + extra1 = cString::sprintf("%d%% %s", ChartDiskUsage, tr("free") ); extra2 = cString::sprintf("~ %02d:%02d", FreeMinutes / 60, FreeMinutes % 60); } - } else { - if( Config.DiskUsageShort == false ) { + switch(ChartDiskUsage) { // Show free space + case 0 ... 3: iconName = "chart0b"; break; // Symbol free < 4% (chart1b in red) + case 4 ... 7: iconName = "chart1b"; break; // 6,25 + case 8 ... 13: iconName = "chart2b"; break; // 12,5 + case 14 ... 19: iconName = "chart3b"; break; // 18,75 + case 20 ... 25: iconName = "chart4b"; break; // 25 + case 26 ... 32: iconName = "chart5b"; break; // 31,25 + case 33 ... 38: iconName = "chart6b"; break; // 37,5 + case 39 ... 44: iconName = "chart7b"; break; // 43,75 + case 45 ... 50: iconName = "chart8b"; break; // 50 + case 51 ... 57: iconName = "chart9b"; break; // 56,25 + case 58 ... 63: iconName = "chart10b"; break; // 62,5 + case 64 ... 69: iconName = "chart11b"; break; // 68,75 + case 70 ... 75: iconName = "chart12b"; break; // 75 + case 76 ... 82: iconName = "chart13b"; break; // 81,25 + case 83 ... 88: iconName = "chart14b"; break; // 87,5 + case 89 ... 100: iconName = "chart15b"; break; // 93,75+ + } + } else { // Show in occupied mode + if( Config.DiskUsageShort == false ) { // Long format extra1 = cString::sprintf("%s: %d%% %s", tr("Disk"), DiskUsage, tr("occupied") ); extra2 = cString::sprintf("%.1f GB ~ %02d:%02d", OccupiedGB, OccupiedMinutes / 60, OccupiedMinutes % 60); - } else { - extra1 = cString::sprintf("%d%% %s", 100 - DiskUsage, tr("occupied") ); + } else { // Short format + extra1 = cString::sprintf("%d%% %s", DiskUsage, tr("occupied") ); extra2 = cString::sprintf("~ %02d:%02d", OccupiedMinutes / 60, OccupiedMinutes % 60); } - } - - int ChartDiskUsage = DiskUsage; - cString iconName("chart1"); - if( Config.DiskUsageFree == 1 ) { - ChartDiskUsage = 100 - DiskUsage; - - iconName = "chart1b"; - if( ChartDiskUsage > 14 ) - iconName = "chart2b"; - if( ChartDiskUsage > 28 ) - iconName = "chart3b"; - if( ChartDiskUsage > 42 ) - iconName = "chart4b"; - if( ChartDiskUsage > 56 ) - iconName = "chart5b"; - if( ChartDiskUsage > 70 ) - iconName = "chart6b"; - if( ChartDiskUsage > 84 ) - iconName = "chart7b"; - } else { - if( ChartDiskUsage > 14 ) - iconName = "chart2"; - if( ChartDiskUsage > 28 ) - iconName = "chart3"; - if( ChartDiskUsage > 42 ) - iconName = "chart4"; - if( ChartDiskUsage > 56 ) - iconName = "chart5"; - if( ChartDiskUsage > 70 ) - iconName = "chart6"; - if( ChartDiskUsage > 84 ) - iconName = "chart7"; + switch(ChartDiskUsage) { // show used space + case 0 ... 7: iconName = "chart1"; break; // 6,25 + case 8 ... 13: iconName = "chart2"; break; // 12,5 + case 14 ... 19: iconName = "chart3"; break; // 18,75 + case 20 ... 25: iconName = "chart4"; break; // 25 + case 26 ... 32: iconName = "chart5"; break; // 31,25 + case 33 ... 38: iconName = "chart6"; break; // 37,5 + case 39 ... 44: iconName = "chart7"; break; // 43,75 + case 45 ... 50: iconName = "chart8"; break; // 50 + case 51 ... 57: iconName = "chart9"; break; // 56,25 + case 58 ... 63: iconName = "chart10"; break; // 62,5 + case 64 ... 69: iconName = "chart11"; break; // 68,75 + case 70 ... 75: iconName = "chart12"; break; // 75 + case 76 ... 82: iconName = "chart13"; break; // 81,25 + case 83 ... 88: iconName = "chart14"; break; // 87,5 + case 89 ... 95: iconName = "chart15"; break; // 93,75 (95) + case 96 ... 100: iconName = "chart16"; break; // symbol usage > 96% (chart15 in red) + } } TopBarSetTitleExtra(extra1, extra2); TopBarSetExtraIcon(iconName); diff --git a/icons/default/chart0b.png b/icons/default/chart0b.png Binary files differnew file mode 100644 index 00000000..3197ea53 --- /dev/null +++ b/icons/default/chart0b.png diff --git a/icons/default/chart1.png b/icons/default/chart1.png Binary files differindex 48d5d311..85c8ab48 100644 --- a/icons/default/chart1.png +++ b/icons/default/chart1.png diff --git a/icons/default/chart10.png b/icons/default/chart10.png Binary files differnew file mode 100644 index 00000000..013a1f4f --- /dev/null +++ b/icons/default/chart10.png diff --git a/icons/default/chart10b.png b/icons/default/chart10b.png new file mode 120000 index 00000000..90d275de --- /dev/null +++ b/icons/default/chart10b.png @@ -0,0 +1 @@ +chart10.png
\ No newline at end of file diff --git a/icons/default/chart11.png b/icons/default/chart11.png Binary files differnew file mode 100644 index 00000000..e578d642 --- /dev/null +++ b/icons/default/chart11.png diff --git a/icons/default/chart11b.png b/icons/default/chart11b.png new file mode 120000 index 00000000..eca67398 --- /dev/null +++ b/icons/default/chart11b.png @@ -0,0 +1 @@ +chart11.png
\ No newline at end of file diff --git a/icons/default/chart12.png b/icons/default/chart12.png Binary files differnew file mode 100644 index 00000000..30ed6016 --- /dev/null +++ b/icons/default/chart12.png diff --git a/icons/default/chart12b.png b/icons/default/chart12b.png new file mode 120000 index 00000000..afb049f6 --- /dev/null +++ b/icons/default/chart12b.png @@ -0,0 +1 @@ +chart12.png
\ No newline at end of file diff --git a/icons/default/chart13.png b/icons/default/chart13.png Binary files differnew file mode 100644 index 00000000..c6dfccb0 --- /dev/null +++ b/icons/default/chart13.png diff --git a/icons/default/chart13b.png b/icons/default/chart13b.png new file mode 120000 index 00000000..c119389c --- /dev/null +++ b/icons/default/chart13b.png @@ -0,0 +1 @@ +chart13.png
\ No newline at end of file diff --git a/icons/default/chart14.png b/icons/default/chart14.png Binary files differnew file mode 100644 index 00000000..165b85b6 --- /dev/null +++ b/icons/default/chart14.png diff --git a/icons/default/chart14b.png b/icons/default/chart14b.png new file mode 120000 index 00000000..d45f9c07 --- /dev/null +++ b/icons/default/chart14b.png @@ -0,0 +1 @@ +chart14.png
\ No newline at end of file diff --git a/icons/default/chart15.png b/icons/default/chart15.png Binary files differnew file mode 100644 index 00000000..41809f0f --- /dev/null +++ b/icons/default/chart15.png diff --git a/icons/default/chart15b.png b/icons/default/chart15b.png new file mode 120000 index 00000000..a5db2d59 --- /dev/null +++ b/icons/default/chart15b.png @@ -0,0 +1 @@ +chart7.png
\ No newline at end of file diff --git a/icons/default/chart16.png b/icons/default/chart16.png Binary files differnew file mode 100644 index 00000000..43cac07b --- /dev/null +++ b/icons/default/chart16.png diff --git a/icons/default/chart2.png b/icons/default/chart2.png Binary files differindex b5182b0f..af6384a7 100644 --- a/icons/default/chart2.png +++ b/icons/default/chart2.png diff --git a/icons/default/chart3.png b/icons/default/chart3.png Binary files differindex 9f31d644..f845f92d 100644 --- a/icons/default/chart3.png +++ b/icons/default/chart3.png diff --git a/icons/default/chart4.png b/icons/default/chart4.png Binary files differindex 93dd1302..c386d728 100644 --- a/icons/default/chart4.png +++ b/icons/default/chart4.png diff --git a/icons/default/chart5.png b/icons/default/chart5.png Binary files differindex 3c6cce8d..34bf78ea 100644 --- a/icons/default/chart5.png +++ b/icons/default/chart5.png diff --git a/icons/default/chart6.png b/icons/default/chart6.png Binary files differindex b0407778..8b28084d 100644 --- a/icons/default/chart6.png +++ b/icons/default/chart6.png diff --git a/icons/default/chart7.png b/icons/default/chart7.png Binary files differindex d1882dc8..252d1c53 100644 --- a/icons/default/chart7.png +++ b/icons/default/chart7.png diff --git a/icons/default/chart8.png b/icons/default/chart8.png Binary files differnew file mode 100644 index 00000000..d73df381 --- /dev/null +++ b/icons/default/chart8.png diff --git a/icons/default/chart8b.png b/icons/default/chart8b.png new file mode 120000 index 00000000..404a9d54 --- /dev/null +++ b/icons/default/chart8b.png @@ -0,0 +1 @@ +chart8.png
\ No newline at end of file diff --git a/icons/default/chart9.png b/icons/default/chart9.png Binary files differnew file mode 100644 index 00000000..4ef7c934 --- /dev/null +++ b/icons/default/chart9.png diff --git a/icons/default/chart9b.png b/icons/default/chart9b.png new file mode 120000 index 00000000..274e12b9 --- /dev/null +++ b/icons/default/chart9b.png @@ -0,0 +1 @@ +chart9.png
\ No newline at end of file |