Merge branch 'dvbsi++' of coolstreamtech.de:cst-public-gui-neutrino into dvbsi++

Origin commit data
------------------
Branch: ni/coolstream
Commit: 59430be85f
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2012-10-02 (Tue, 02 Oct 2012)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
[CST] Focus
2012-10-02 14:10:29 +04:00
7 changed files with 34 additions and 27 deletions

View File

@@ -94,7 +94,7 @@ CInfoViewerBB::CInfoViewerBB()
void CInfoViewerBB::Init()
{
hddscale = NULL;
varscale = NULL;
sysscale = NULL;
hddwidth = 0;
bbIconMaxH = 0;
bbButtonMaxH = 0;
@@ -597,9 +597,11 @@ void CInfoViewerBB::showSysfsHdd()
{
if (g_settings.infobar_show_sysfs_hdd) {
//sysFS info
int sysper = 0;
sysper = get_fs_usage("/");
showBarSys(sysper);
int percent = 0;
long t, u;
if (get_fs_usage("/", t, u))
percent = (u * 100ULL) / t;
showBarSys(percent);
#if 0
//HDD info in a seperate thread
@@ -610,8 +612,9 @@ void CInfoViewerBB::showSysfsHdd()
}
#else
if (!check_dir(g_settings.network_nfs_recordingdir)) {
sysper = get_fs_usage(g_settings.network_nfs_recordingdir);
showBarHdd(sysper);
if (get_fs_usage(g_settings.network_nfs_recordingdir, t, u))
percent = (u * 100ULL) / t;
showBarHdd(percent);
}
#endif
}
@@ -621,9 +624,11 @@ void* CInfoViewerBB::hddperThread(void *arg)
{
CInfoViewerBB *infoViewerBB = (CInfoViewerBB*) arg;
int hddper = 0;
hddper = get_fs_usage(g_settings.network_nfs_recordingdir);
infoViewerBB->showBarHdd(hddper);
int percent = 0;
long t, u;
if (get_fs_usage(g_settings.network_nfs_recordingdir, t, u))
percent = (u * 100ULL) / t;
infoViewerBB->showBarHdd(percent);
infoViewerBB->hddperTflag=false;
pthread_exit(NULL);
@@ -632,13 +637,11 @@ void* CInfoViewerBB::hddperThread(void *arg)
void CInfoViewerBB::showBarSys(int percent)
{
if (is_visible)
varscale->paintProgressBar(bbIconMinX, BBarY + InfoHeightY_Info / 2 - 2 - 6, hddwidth, 6, percent, 100);
sysscale->paintProgressBar(bbIconMinX, BBarY + InfoHeightY_Info / 2 - 2 - 6, hddwidth, 6, percent, 100);
}
void CInfoViewerBB::showBarHdd(int percent)
{
if (percent < 0)
percent = 0;
if (is_visible)
hddscale->paintProgressBar(bbIconMinX, BBarY + InfoHeightY_Info / 2 + 2 + 0, hddwidth, 6, percent, 100);
}
@@ -791,16 +794,16 @@ void CInfoViewerBB::changePB()
if (hddscale != NULL)
delete hddscale;
hddscale = new CProgressBar(true, hddwidth, 6, 50, 100, 75, true);
if (varscale != NULL)
delete varscale;
varscale = new CProgressBar(true, hddwidth, 6, 50, 100, 75, true);
if (sysscale != NULL)
delete sysscale;
sysscale = new CProgressBar(true, hddwidth, 6, 50, 100, 75, true);
}
void CInfoViewerBB::reset_allScala()
{
hddscale->reset();
varscale->reset();
lasthdd = lastvar = -1;
sysscale->reset();
//lasthdd = lastsys = -1;
}
void CInfoViewerBB::setBBOffset()

View File

@@ -98,7 +98,7 @@ class CInfoViewerBB
int BBarY, BBarFontY;
int hddwidth;
int lasthdd, lastvar;
//int lasthdd, lastsys;
bool fta;
int minX;
@@ -106,7 +106,7 @@ class CInfoViewerBB
bool scrambledNoSig, scrambledNoSigSave;
pthread_t scrambledT;
CProgressBar *hddscale, *varscale;
CProgressBar *hddscale, *sysscale;
void showBBIcons(const int modus, const std::string & icon);
void getBBIconInfo(void);

View File

@@ -73,6 +73,7 @@ COsdSetup::COsdSetup(bool wizard_mode)
is_wizard = wizard_mode;
width = w_max (40, 10); //%
show_tuner_icon = 0;
}
COsdSetup::~COsdSetup()
@@ -763,7 +764,7 @@ void COsdSetup::showOsdInfobarSetup(CMenuWidget *menu_infobar)
// tuner icon
bool mc_active = false;
int show_tuner_icon = 0;
show_tuner_icon = 0;
// show possible option if we in single box mode, but don't touch the real settings
int *p_show_tuner_icon = &show_tuner_icon;
if (CFEManager::getInstance()->getMode() != CFEManager::FE_MODE_SINGLE){

View File

@@ -49,6 +49,7 @@ class COsdSetup : public CMenuTarget, public CChangeObserver
int width;
bool is_wizard;
int show_tuner_icon;
int showOsdSetup();
void showOsdMenueColorSetup(CMenuWidget *menu_colors);

View File

@@ -40,6 +40,7 @@
#include <cs_api.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <arpa/inet.h>

View File

@@ -191,17 +191,18 @@ int check_dir(const char * dir)
return ret;
}
int get_fs_usage(const char * dir)
bool get_fs_usage(const char * dir, long &btotal, long &bused)
{
int ret = 0;
long blocks_used;
btotal = bused = 0;
struct statfs s;
if (::statfs(dir, &s) == 0 && s.f_blocks) {
blocks_used = s.f_blocks - s.f_bfree;
ret = (blocks_used * 100ULL) / s.f_blocks;
btotal = s.f_blocks;
bused = s.f_blocks - s.f_bfree;
//printf("fs (%s): total %ld used %ld\n", dir, btotal, bused);
return true;
}
return ret;
return false;
}
bool get_mem_usage(unsigned long &kbtotal, unsigned long &kbfree)

View File

@@ -31,7 +31,7 @@ int safe_mkdir(char * path);
bool file_exists(const char *filename);
void wakeup_hdd(const char *hdd_dir);
int check_dir(const char * dir);
int get_fs_usage(const char * dir);
bool get_fs_usage(const char * dir, long &total, long &used);
bool get_mem_usage(unsigned long &total, unsigned long &free);
#endif