Change cTvguideConfig to cTVGuideConfig

This commit is contained in:
kamel5 2019-07-11 11:37:01 +02:00
parent 0766d67980
commit 81759f95cb
4 changed files with 31 additions and 31 deletions

View File

@ -1,7 +1,7 @@
#include <string> #include <string>
#include "config.h" #include "config.h"
cTvguideConfig::cTvguideConfig() { cTVGuideConfig::cTVGuideConfig() {
debugImageLoading = 0; debugImageLoading = 0;
showMainMenuEntry = 1; showMainMenuEntry = 1;
replaceOriginalSchedule = 0; replaceOriginalSchedule = 0;
@ -112,15 +112,15 @@ cTvguideConfig::cTvguideConfig() {
iconsPathSet = false; iconsPathSet = false;
} }
cTvguideConfig::~cTvguideConfig() { cTVGuideConfig::~cTVGuideConfig() {
} }
void cTvguideConfig::setDynamicValues() { void cTVGuideConfig::setDynamicValues() {
numGrids = (displayMode == eVertical)?channelCols:channelRows; numGrids = (displayMode == eVertical)?channelCols:channelRows;
jumpChannels = numGrids; jumpChannels = numGrids;
} }
bool cTvguideConfig::LoadTheme() { bool cTVGuideConfig::LoadTheme() {
//is correct theme already loaded? //is correct theme already loaded?
if (nOpacityTheme.size() == 0) if (nOpacityTheme.size() == 0)
nOpacityTheme = Setup.OSDTheme; nOpacityTheme = Setup.OSDTheme;
@ -178,7 +178,7 @@ bool cTvguideConfig::LoadTheme() {
} }
void cTvguideConfig::SetStyle(void) { void cTVGuideConfig::SetStyle(void) {
if (theme.Color(clrStyle) == CLR_STYLE_FLAT) { if (theme.Color(clrStyle) == CLR_STYLE_FLAT) {
style = eStyleFlat; style = eStyleFlat;
esyslog("tvguide: set flat style"); esyslog("tvguide: set flat style");
@ -195,25 +195,25 @@ void cTvguideConfig::SetStyle(void) {
} }
void cTvguideConfig::SetLogoPath(cString path) { void cTVGuideConfig::SetLogoPath(cString path) {
logoPath = checkSlashAtEnd(*path); logoPath = checkSlashAtEnd(*path);
logoPathSet = true; logoPathSet = true;
esyslog("tvguide: Logo Path set to %s", *logoPath); esyslog("tvguide: Logo Path set to %s", *logoPath);
} }
void cTvguideConfig::SetImagesPath(cString path) { void cTVGuideConfig::SetImagesPath(cString path) {
epgImagePath = checkSlashAtEnd(*path); epgImagePath = checkSlashAtEnd(*path);
imagesPathSet = true; imagesPathSet = true;
esyslog("tvguide: EPG Image Path set to %s", *epgImagePath); esyslog("tvguide: EPG Image Path set to %s", *epgImagePath);
} }
void cTvguideConfig::SetIconsPath(cString path) { void cTVGuideConfig::SetIconsPath(cString path) {
iconPath = checkSlashAtEnd(*path); iconPath = checkSlashAtEnd(*path);
iconsPathSet = true; iconsPathSet = true;
esyslog("tvguide: Icon Path set to %s", *iconPath); esyslog("tvguide: Icon Path set to %s", *iconPath);
} }
void cTvguideConfig::SetDefaultPathes(void) { void cTVGuideConfig::SetDefaultPathes(void) {
logoPathDefault = cString::sprintf("%s/logos/", cPlugin::ResourceDirectory(PLUGIN_NAME_I18N)); logoPathDefault = cString::sprintf("%s/logos/", cPlugin::ResourceDirectory(PLUGIN_NAME_I18N));
iconPathDefault = cString::sprintf("%s/icons/", cPlugin::ResourceDirectory(PLUGIN_NAME_I18N)); iconPathDefault = cString::sprintf("%s/icons/", cPlugin::ResourceDirectory(PLUGIN_NAME_I18N));
epgImagePathDefault = cString::sprintf("%s/epgimages/", cPlugin::CacheDirectory(PLUGIN_NAME_I18N)); epgImagePathDefault = cString::sprintf("%s/epgimages/", cPlugin::CacheDirectory(PLUGIN_NAME_I18N));
@ -229,7 +229,7 @@ void cTvguideConfig::SetDefaultPathes(void) {
} }
} }
cString cTvguideConfig::checkSlashAtEnd(std::string path) { cString cTVGuideConfig::checkSlashAtEnd(std::string path) {
try { try {
if (!(path.at(path.size()-1) == '/')) if (!(path.at(path.size()-1) == '/'))
return cString::sprintf("%s/", path.c_str()); return cString::sprintf("%s/", path.c_str());
@ -237,7 +237,7 @@ cString cTvguideConfig::checkSlashAtEnd(std::string path) {
return path.c_str(); return path.c_str();
} }
bool cTvguideConfig::SetupParse(const char *Name, const char *Value) { bool cTVGuideConfig::SetupParse(const char *Name, const char *Value) {
if (strcmp(Name, "timeFormat") == 0) timeFormat = atoi(Value); if (strcmp(Name, "timeFormat") == 0) timeFormat = atoi(Value);
else if (strcmp(Name, "debugImageLoading") == 0) debugImageLoading = atoi(Value); else if (strcmp(Name, "debugImageLoading") == 0) debugImageLoading = atoi(Value);
else if (strcmp(Name, "showMainMenuEntry") == 0) showMainMenuEntry = atoi(Value); else if (strcmp(Name, "showMainMenuEntry") == 0) showMainMenuEntry = atoi(Value);

View File

@ -43,12 +43,12 @@ enum eInstRecFolderMode {
eFolderFixed eFolderFixed
}; };
class cTvguideConfig { class cTVGuideConfig {
private: private:
cString checkSlashAtEnd(std::string path); cString checkSlashAtEnd(std::string path);
public: public:
cTvguideConfig(); cTVGuideConfig();
~cTvguideConfig(); ~cTVGuideConfig();
int debugImageLoading; int debugImageLoading;
int showMainMenuEntry; int showMainMenuEntry;
int replaceOriginalSchedule; int replaceOriginalSchedule;
@ -175,7 +175,7 @@ class cTvguideConfig {
}; };
#ifdef DEFINE_CONFIG #ifdef DEFINE_CONFIG
cTvguideConfig config; cTVGuideConfig config;
cOsdManager osdManager; cOsdManager osdManager;
cGeometryManager geoManager; cGeometryManager geoManager;
cFontManager fontManager; cFontManager fontManager;
@ -183,7 +183,7 @@ class cTvguideConfig {
cTheme theme; cTheme theme;
cPlugin* pRemoteTimers = NULL; cPlugin* pRemoteTimers = NULL;
#else #else
extern cTvguideConfig config; extern cTVGuideConfig config;
extern cOsdManager osdManager; extern cOsdManager osdManager;
extern cGeometryManager geoManager; extern cGeometryManager geoManager;
extern cFontManager fontManager; extern cFontManager fontManager;

12
setup.c
View File

@ -156,7 +156,7 @@ void cTvguideSetup::Store(void) {
SetupStore("limitLogoCache", config.limitLogoCache); SetupStore("limitLogoCache", config.limitLogoCache);
} }
cMenuSetupSubMenu::cMenuSetupSubMenu(const char* Title, cTvguideConfig* data) : cOsdMenu(Title, 40) { cMenuSetupSubMenu::cMenuSetupSubMenu(const char* Title, cTVGuideConfig* data) : cOsdMenu(Title, 40) {
tmpConfig = data; tmpConfig = data;
indent = " "; indent = " ";
} }
@ -183,7 +183,7 @@ eOSState cMenuSetupSubMenu::ProcessKey(eKeys Key) {
//----- General Settings ------------------------------------------------------------------------------------------------------------- //----- General Settings -------------------------------------------------------------------------------------------------------------
cMenuSetupGeneral::cMenuSetupGeneral(cTvguideConfig* data) : cMenuSetupSubMenu(tr("General Settings"), data) { cMenuSetupGeneral::cMenuSetupGeneral(cTVGuideConfig* data) : cMenuSetupSubMenu(tr("General Settings"), data) {
themes.Load(*cString("tvguide")); themes.Load(*cString("tvguide"));
timeFormatItems[0] = "12h"; timeFormatItems[0] = "12h";
timeFormatItems[1] = "24h"; timeFormatItems[1] = "24h";
@ -252,7 +252,7 @@ eOSState cMenuSetupGeneral::ProcessKey(eKeys Key) {
//----- Screen Presentation ------------------------------------------------------------------------------------------------------------- //----- Screen Presentation -------------------------------------------------------------------------------------------------------------
cMenuSetupScreenLayout::cMenuSetupScreenLayout(cTvguideConfig* data) : cMenuSetupSubMenu(tr("Screen Presentation"), data) { cMenuSetupScreenLayout::cMenuSetupScreenLayout(cTVGuideConfig* data) : cMenuSetupSubMenu(tr("Screen Presentation"), data) {
displayModeItems[0] = "vertical"; displayModeItems[0] = "vertical";
displayModeItems[1] = "horizontal"; displayModeItems[1] = "horizontal";
hideChannelLogosItems[0] = trVDR("yes"); hideChannelLogosItems[0] = trVDR("yes");
@ -344,7 +344,7 @@ eOSState cMenuSetupScreenLayout::ProcessKey(eKeys Key) {
//-----Fonts and Fontsizes ------------------------------------------------------------------------------------------------------- //-----Fonts and Fontsizes -------------------------------------------------------------------------------------------------------
cMenuSetupFont::cMenuSetupFont(cTvguideConfig* data) : cMenuSetupSubMenu(tr("Fonts and Fontsizes"), data) { cMenuSetupFont::cMenuSetupFont(cTVGuideConfig* data) : cMenuSetupSubMenu(tr("Fonts and Fontsizes"), data) {
cFont::GetAvailableFontNames(&fontNames); cFont::GetAvailableFontNames(&fontNames);
fontNames.Insert(strdup(config.fontNameDefault)); fontNames.Insert(strdup(config.fontNameDefault));
Set(); Set();
@ -392,7 +392,7 @@ void cMenuSetupFont::Set(void) {
//----- Recording Menus and Favorites ------------------------------------------------------------------------------------------------------- //----- Recording Menus and Favorites -------------------------------------------------------------------------------------------------------
cMenuSetupFavorites::cMenuSetupFavorites(cTvguideConfig* data) : cMenuSetupSubMenu(tr("Recording Menus and Favorites"), data) { cMenuSetupFavorites::cMenuSetupFavorites(cTVGuideConfig* data) : cMenuSetupSubMenu(tr("Recording Menus and Favorites"), data) {
strn0cpy(description1, data->descUser1.c_str(), sizeof(description1)); strn0cpy(description1, data->descUser1.c_str(), sizeof(description1));
strn0cpy(description2, data->descUser2.c_str(), sizeof(description2)); strn0cpy(description2, data->descUser2.c_str(), sizeof(description2));
strn0cpy(description3, data->descUser3.c_str(), sizeof(description3)); strn0cpy(description3, data->descUser3.c_str(), sizeof(description3));
@ -493,7 +493,7 @@ eOSState cMenuSetupFavorites::ProcessKey(eKeys Key) {
} }
//-----Image Caching------------------------------------------------------------------------------------------------------------- //-----Image Caching-------------------------------------------------------------------------------------------------------------
cMenuSetupImageCache::cMenuSetupImageCache(cTvguideConfig* data) : cMenuSetupSubMenu(tr("Image Loading and Caching"), data) { cMenuSetupImageCache::cMenuSetupImageCache(cTVGuideConfig* data) : cMenuSetupSubMenu(tr("Image Loading and Caching"), data) {
Set(); Set();
} }

18
setup.h
View File

@ -4,14 +4,14 @@
#include <vdr/menuitems.h> #include <vdr/menuitems.h>
#include "config.h" #include "config.h"
extern cTvguideConfig config; extern cTVGuideConfig config;
class cTvguideSetup : public cMenuSetupPage { class cTvguideSetup : public cMenuSetupPage {
public: public:
cTvguideSetup(void); cTvguideSetup(void);
virtual ~cTvguideSetup(); virtual ~cTvguideSetup();
private: private:
cTvguideConfig tmpConfig; cTVGuideConfig tmpConfig;
void Setup(void); void Setup(void);
protected: protected:
virtual eOSState ProcessKey(eKeys Key); virtual eOSState ProcessKey(eKeys Key);
@ -21,13 +21,13 @@ class cTvguideSetup : public cMenuSetupPage {
class cMenuSetupSubMenu : public cOsdMenu { class cMenuSetupSubMenu : public cOsdMenu {
protected: protected:
cTvguideConfig *tmpConfig; cTVGuideConfig *tmpConfig;
virtual eOSState ProcessKey(eKeys Key); virtual eOSState ProcessKey(eKeys Key);
virtual void Set(void) = 0; virtual void Set(void) = 0;
cOsdItem *InfoItem(const char *label, const char *value); cOsdItem *InfoItem(const char *label, const char *value);
cString indent; cString indent;
public: public:
cMenuSetupSubMenu(const char *Title, cTvguideConfig *data); cMenuSetupSubMenu(const char *Title, cTVGuideConfig *data);
}; };
class cMenuSetupGeneral : public cMenuSetupSubMenu { class cMenuSetupGeneral : public cMenuSetupSubMenu {
@ -41,7 +41,7 @@ class cMenuSetupGeneral : public cMenuSetupSubMenu {
const char *useSubtitleRerunTexts[3]; const char *useSubtitleRerunTexts[3];
void Set(void); void Set(void);
public: public:
cMenuSetupGeneral(cTvguideConfig *data); cMenuSetupGeneral(cTVGuideConfig *data);
}; };
class cMenuSetupScreenLayout : public cMenuSetupSubMenu { class cMenuSetupScreenLayout : public cMenuSetupSubMenu {
@ -52,7 +52,7 @@ class cMenuSetupScreenLayout : public cMenuSetupSubMenu {
const char * logoExtensionItems[2]; const char * logoExtensionItems[2];
void Set(void); void Set(void);
public: public:
cMenuSetupScreenLayout(cTvguideConfig *data); cMenuSetupScreenLayout(cTVGuideConfig *data);
}; };
class cMenuSetupFont : public cMenuSetupSubMenu { class cMenuSetupFont : public cMenuSetupSubMenu {
@ -60,7 +60,7 @@ class cMenuSetupFont : public cMenuSetupSubMenu {
cStringList fontNames; cStringList fontNames;
void Set(void); void Set(void);
public: public:
cMenuSetupFont(cTvguideConfig *data); cMenuSetupFont(cTVGuideConfig *data);
}; };
class cMenuSetupFavorites : public cMenuSetupSubMenu { class cMenuSetupFavorites : public cMenuSetupSubMenu {
@ -75,14 +75,14 @@ class cMenuSetupFavorites : public cMenuSetupSubMenu {
void Set(void); void Set(void);
virtual eOSState ProcessKey(eKeys Key); virtual eOSState ProcessKey(eKeys Key);
public: public:
cMenuSetupFavorites(cTvguideConfig *data); cMenuSetupFavorites(cTVGuideConfig *data);
}; };
class cMenuSetupImageCache : public cMenuSetupSubMenu { class cMenuSetupImageCache : public cMenuSetupSubMenu {
protected: protected:
void Set(void); void Set(void);
public: public:
cMenuSetupImageCache(cTvguideConfig *data); cMenuSetupImageCache(cTVGuideConfig *data);
}; };
#endif //__TVGUIDE_SETUP_H #endif //__TVGUIDE_SETUP_H