From 13ab786661c401177a0bbd2cc614c98e2fd6da51 Mon Sep 17 00:00:00 2001 From: satbaby Date: Mon, 3 May 2010 11:32:03 +0000 Subject: [PATCH] -add on/off menu for infobar var & hdd git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@561 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- data/locale/deutsch.locale | 3 ++- data/locale/english.locale | 1 + src/gui/infoviewer.cpp | 55 +++++++++++++++++++------------------- src/neutrino.cpp | 4 ++- src/neutrino_menue.cpp | 1 + src/system/locals.h | 1 + src/system/locals_intern.h | 1 + src/system/settings.h | 2 +- 8 files changed, 38 insertions(+), 30 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index f8d035cbc..8982fcd6d 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -714,7 +714,8 @@ miscsettings.infobar_disp_1 Logo in der Nummernbox miscsettings.infobar_disp_2 Logo Infobar / Kanalnummer miscsettings.infobar_disp_3 Logo Infobar / Signalbalken miscsettings.infobar_disp_log Infobar Dis. -miscsettings.infobar_sat_display Infobar Kabel-/Satellitenanbieter +miscsettings.infobar_sat_display Kabel-/Satellitenanbieter +miscsettings.infobar_show_var_hdd Füllstandanzeige (var & hdd ) miscsettings.noaviawatchdog AVIA-Watchdog aktivieren miscsettings.noenxwatchdog eNX-Watchdog aktivieren miscsettings.pmtupdate PMT Aktualisierung verwenden diff --git a/data/locale/english.locale b/data/locale/english.locale index 06e1ce7cb..3a87184e2 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -516,6 +516,7 @@ miscsettings.infobar_disp_2 Logo 2 miscsettings.infobar_disp_3 Logo 3 miscsettings.infobar_disp_log Infoview Dis. miscsettings.infobar_sat_display Satellite display on infobar +miscsettings.infobar_show_var_hdd Fill level (var & hdd ) miscsettings.noaviawatchdog enable AVIA watchdog miscsettings.noenxwatchdog enable eNX watchdog miscsettings.pmtupdate enable pmt update diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index b4aea3391..baab7579c 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1162,40 +1162,41 @@ void CInfoViewer::showSNR () g_SignalFont->RenderString (posx, posy + height, sw, percent, COL_INFOBAR); } } - - struct statfs s; - int per = 0; - if (::statfs("/var", &s) == 0) { - per = (s.f_blocks - s.f_bfree) / (s.f_blocks/100); - } + if(g_settings.infobar_show_var_hdd){ + struct statfs s; + int per = 0; + if (::statfs("/var", &s) == 0) { + per = (s.f_blocks - s.f_bfree) / (s.f_blocks/100); + } /* center the scales in the button bar. BBarY + InfoHeightY_Info / 2 is middle, scales are 6 pixels high, icons are 16 pixels, so keep 4 pixels free between the scales */ - varscale->paintProgressBar(BoxEndX - (2*ICON_LARGE_WIDTH + 2*ICON_SMALL_WIDTH + 4*2) - 102, - BBarY + InfoHeightY_Info / 2 - 2 - 6, 100, 6, per, 100); - per = 0; + varscale->paintProgressBar(BoxEndX - (2*ICON_LARGE_WIDTH + 2*ICON_SMALL_WIDTH + 4*2) - 102, + BBarY + InfoHeightY_Info / 2 - 2 - 6, 100, 6, per, 100); + per = 0; //HD info - if (::statfs(g_settings.network_nfs_recordingdir, &s) == 0) { - switch (s.f_type) - { - case (int) 0xEF53: /*EXT2 & EXT3*/ - case (int) 0x6969: /*NFS*/ - case (int) 0xFF534D42: /*CIFS*/ - case (int) 0x517B: /*SMB*/ - case (int) 0x52654973: /*REISERFS*/ - case (int) 0x65735546: /*fuse for ntfs*/ - case (int) 0x58465342: /*xfs*/ - case (int) 0x4d44: /*msdos*/ - per = (s.f_blocks - s.f_bfree) / (s.f_blocks/100); - break; - default: - fprintf( stderr,"%s Unknow File system type: %i\n",g_settings.network_nfs_recordingdir ,s.f_type); + if (::statfs(g_settings.network_nfs_recordingdir, &s) == 0) { + switch (s.f_type) + { + case (int) 0xEF53: /*EXT2 & EXT3*/ + case (int) 0x6969: /*NFS*/ + case (int) 0xFF534D42: /*CIFS*/ + case (int) 0x517B: /*SMB*/ + case (int) 0x52654973: /*REISERFS*/ + case (int) 0x65735546: /*fuse for ntfs*/ + case (int) 0x58465342: /*xfs*/ + case (int) 0x4d44: /*msdos*/ + per = (s.f_blocks - s.f_bfree) / (s.f_blocks/100); + break; + default: + fprintf( stderr,"%s Unknow File system type: %i\n",g_settings.network_nfs_recordingdir ,s.f_type); break; + } } - } - hddscale->paintProgressBar(BoxEndX - (2*ICON_LARGE_WIDTH + 2*ICON_SMALL_WIDTH + 4*2) - 102, - BBarY + InfoHeightY_Info / 2 + 2, 100, 6, per, 100); + hddscale->paintProgressBar(BoxEndX - (2*ICON_LARGE_WIDTH + 2*ICON_SMALL_WIDTH + 4*2) - 102, + BBarY + InfoHeightY_Info / 2 + 2, 100, 6, per, 100); + } } void CInfoViewer::display_Info(const char *current, const char *next, diff --git a/src/neutrino.cpp b/src/neutrino.cpp index c039bcec2..9cb74c436 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -812,7 +812,8 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.casystem_display = configfile.getBool("casystem_display", false ); g_settings.scrambled_message = configfile.getBool("scrambled_message", true ); g_settings.volume_pos = configfile.getInt32("volume_pos", 0 ); - g_settings.menu_pos = configfile.getInt32("menu_pos", 0 ); + g_settings.menu_pos = configfile.getInt32("menu_pos", 0 ); + g_settings.infobar_show_var_hdd = configfile.getBool("infobar_show_var_hdd" , true ); //audio g_settings.audio_AnalogMode = configfile.getInt32( "audio_AnalogMode", 0 ); g_settings.audio_DolbyDigital = configfile.getBool("audio_DolbyDigital" , false); @@ -1342,6 +1343,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setBool("scrambled_message" , g_settings.scrambled_message ); configfile.setInt32("volume_pos" , g_settings.volume_pos ); configfile.setInt32("menu_pos" , g_settings.menu_pos); + configfile.setInt32("infobar_show_var_hdd" , g_settings.infobar_show_var_hdd ); //audio configfile.setInt32( "audio_AnalogMode", g_settings.audio_AnalogMode ); diff --git a/src/neutrino_menue.cpp b/src/neutrino_menue.cpp index def5bd224..75ffb19a8 100644 --- a/src/neutrino_menue.cpp +++ b/src/neutrino_menue.cpp @@ -2394,6 +2394,7 @@ void CNeutrinoApp::InitColorSettings(CMenuWidget &colorSettings, CMenuWidget &fo miscSettingsInfobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_DISP_LOG, &g_settings.infobar_show_channellogo, LOCALE_MISCSETTINGS_INFOBAR_DISP_OPTIONS, LOCALE_MISCSETTINGS_INFOBAR_DISP_OPTIONS_COUNT, true)); miscSettingsInfobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_VIRTUAL_ZAP_MODE, &g_settings.virtual_zap_mode, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); miscSettingsInfobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_SAT_DISPLAY, &g_settings.infobar_sat_display, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); + miscSettingsInfobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_SHOW_VAR_HDD, &g_settings.infobar_show_var_hdd, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); colorSettings.addItem(new CMenuForwarder(LOCALE_MISCSETTINGS_INFOBAR, true, NULL, miscSettingsInfobar, NULL, CRCInput::RC_2)); diff --git a/src/system/locals.h b/src/system/locals.h index 1eb51d9a5..b7665e719 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -550,6 +550,7 @@ typedef enum { LOCALE_MISCSETTINGS_INFOBAR_DISP_3, LOCALE_MISCSETTINGS_INFOBAR_DISP_LOG, LOCALE_MISCSETTINGS_INFOBAR_SAT_DISPLAY, + LOCALE_MISCSETTINGS_INFOBAR_SHOW_VAR_HDD, LOCALE_MISCSETTINGS_SHUTDOWN_COUNT, LOCALE_MISCSETTINGS_SHUTDOWN_COUNT_HINT1, LOCALE_MISCSETTINGS_SHUTDOWN_COUNT_HINT2, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 2d706971a..d164af67f 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -550,6 +550,7 @@ const char *locale_real_names[] = { "miscsettings.infobar_disp_3", "miscsettings.infobar_disp_log", "miscsettings.infobar_sat_display", + "miscsettings.infobar_show_var_hdd", "miscsettings.shutdown_count", "miscsettings.shutdown_count_hint1", "miscsettings.shutdown_count_hint2", diff --git a/src/system/settings.h b/src/system/settings.h index 3501f00bb..2544c4f4e 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -69,7 +69,7 @@ struct SNeutrinoSettings int scrambled_message; int volume_pos; int menu_pos; - + int infobar_show_var_hdd; //audio int audio_AnalogMode; int audio_DolbyDigital;