vdr-plugin-tvguide/setup.c

482 lines
28 KiB
C
Raw Normal View History

2013-01-17 13:16:44 +01:00
#include "setup.h"
cTvguideSetup::cTvguideSetup() {
2013-05-26 11:38:05 +02:00
tmpTvguideConfig = tvguideConfig;
Setup();
2013-01-17 13:16:44 +01:00
}
cTvguideSetup::~cTvguideSetup() {
2013-12-21 11:25:03 +01:00
geoManager.SetGeometry(cOsd::OsdWidth(), cOsd::OsdHeight(), true);
fontManager.DeleteFonts();
fontManager.SetFonts();
tvguideConfig.LoadTheme();
tvguideConfig.setDynamicValues();
imgCache.Clear();
imgCache.CreateCache();
2013-01-17 13:16:44 +01:00
}
void cTvguideSetup::Setup(void) {
2013-05-26 11:38:05 +02:00
int currentItem = Current();
Clear();
Add(new cOsdItem(tr("General Settings")));
Add(new cOsdItem(tr("Screen Presentation")));
Add(new cOsdItem(tr("Fonts and Fontsizes")));
Add(new cOsdItem(tr("Recording Menus and Favorites")));
2013-12-21 11:25:03 +01:00
Add(new cOsdItem(tr("Image Loading and Caching")));
2013-05-26 11:38:05 +02:00
SetCurrent(Get(currentItem));
Display();
2013-01-17 13:16:44 +01:00
}
eOSState cTvguideSetup::ProcessKey(eKeys Key) {
2013-05-26 11:38:05 +02:00
bool hadSubMenu = HasSubMenu();
eOSState state = cMenuSetupPage::ProcessKey(Key);
if (hadSubMenu && Key == kOk)
Store();
if (!hadSubMenu && (state == osUnknown || Key == kOk)) {
if ((Key == kOk && !hadSubMenu)) {
const char* ItemText = Get(Current())->Text();
if (strcmp(ItemText, tr("General Settings")) == 0)
state = AddSubMenu(new cMenuSetupGeneral(&tmpTvguideConfig));
if (strcmp(ItemText, tr("Screen Presentation")) == 0)
state = AddSubMenu(new cMenuSetupScreenLayout(&tmpTvguideConfig));
if (strcmp(ItemText, tr("Fonts and Fontsizes")) == 0)
2013-12-21 11:25:03 +01:00
state = AddSubMenu(new cMenuSetupFont(&tmpTvguideConfig));
if (strcmp(ItemText, tr("Recording Menus and Favorites")) == 0)
state = AddSubMenu(new cMenuSetupFavorites(&tmpTvguideConfig));
2013-12-21 11:25:03 +01:00
if (strcmp(ItemText, tr("Image Loading and Caching")) == 0)
state = AddSubMenu(new cMenuSetupImageCache(&tmpTvguideConfig));
2013-05-26 11:38:05 +02:00
}
}
return state;
2013-01-17 13:16:44 +01:00
}
void cTvguideSetup::Store(void) {
2013-05-26 11:38:05 +02:00
tvguideConfig = tmpTvguideConfig;
2013-12-21 11:25:03 +01:00
SetupStore("debugImageLoading", tvguideConfig.debugImageLoading);
SetupStore("useNopacityTheme", tvguideConfig.useNopacityTheme);
2013-05-26 11:38:05 +02:00
SetupStore("themeIndex", tvguideConfig.themeIndex);
SetupStore("showMainMenuEntry", tvguideConfig.showMainMenuEntry);
SetupStore("replaceOriginalSchedule", tvguideConfig.replaceOriginalSchedule);
2013-05-26 11:38:05 +02:00
SetupStore("displayMode", tvguideConfig.displayMode);
SetupStore("showTimeInGrid", tvguideConfig.showTimeInGrid);
SetupStore("displayStatusHeader", tvguideConfig.displayStatusHeader);
2013-05-31 13:58:22 +02:00
SetupStore("displayChannelGroups", tvguideConfig.displayChannelGroups);
2014-01-15 18:25:37 +01:00
SetupStore("displayTimeBase", tvguideConfig.displayTimeBase);
SetupStore("headerHeightPercent", tvguideConfig.headerHeightPercent);
2013-05-31 13:58:22 +02:00
SetupStore("channelGroupsPercent", tvguideConfig.channelGroupsPercent);
2013-12-21 11:25:03 +01:00
SetupStore("epgViewBorder", tvguideConfig.epgViewBorder);
2013-05-26 11:38:05 +02:00
SetupStore("scaleVideo", tvguideConfig.scaleVideo);
SetupStore("decorateVideo", tvguideConfig.decorateVideo);
SetupStore("roundedCorners", tvguideConfig.roundedCorners);
SetupStore("timeFormat", tvguideConfig.timeFormat);
SetupStore("channelCols", tvguideConfig.channelCols);
SetupStore("channelRows", tvguideConfig.channelRows);
SetupStore("displayTime", tvguideConfig.displayTime);
SetupStore("bigStepHours", tvguideConfig.bigStepHours);
SetupStore("hugeStepHours", tvguideConfig.hugeStepHours);
2013-05-31 13:58:22 +02:00
SetupStore("channelJumpMode", tvguideConfig.channelJumpMode);
SetupStore("blueKeyMode", tvguideConfig.blueKeyMode);
SetupStore("numkeyMode", tvguideConfig.numkeyMode);
2013-07-20 13:46:26 +02:00
SetupStore("useRemoteTimers", tvguideConfig.useRemoteTimers);
SetupStore("closeOnSwitch", tvguideConfig.closeOnSwitch);
2013-05-31 13:58:22 +02:00
SetupStore("hideLastGroup", tvguideConfig.hideLastGroup);
2013-05-26 11:38:05 +02:00
SetupStore("hideChannelLogos", tvguideConfig.hideChannelLogos);
SetupStore("logoExtension", tvguideConfig.logoExtension);
SetupStore("logoWidthRatio", tvguideConfig.logoWidthRatio);
SetupStore("logoHeightRatio", tvguideConfig.logoHeightRatio);
SetupStore("hideEpgImages", tvguideConfig.hideEpgImages);
SetupStore("epgImageWidth", tvguideConfig.epgImageWidth);
SetupStore("epgImageHeight", tvguideConfig.epgImageHeight);
SetupStore("numAdditionalEPGPictures", tvguideConfig.numAdditionalEPGPictures);
SetupStore("epgImageWidthLarge", tvguideConfig.epgImageWidthLarge);
SetupStore("epgImageHeightLarge", tvguideConfig.epgImageHeightLarge);
2014-05-11 09:00:21 +02:00
SetupStore("detailedViewScrollStep", tvguideConfig.detailedViewScrollStep);
2013-05-26 11:38:05 +02:00
SetupStore("timeLineWidthPercent", tvguideConfig.timeLineWidthPercent);
SetupStore("timeLineHeightPercent", tvguideConfig.timeLineHeightPercent);
2013-05-24 16:23:23 +02:00
SetupStore("displayChannelName", tvguideConfig.displayChannelName);
SetupStore("channelHeaderWidthPercent", tvguideConfig.channelHeaderWidthPercent);
SetupStore("channelHeaderHeightPercent", tvguideConfig.channelHeaderHeightPercent);
2013-12-21 11:25:03 +01:00
SetupStore("footerHeightPercent", tvguideConfig.footerHeightPercent);
SetupStore("instRecFolderMode", tvguideConfig.instRecFolderMode);
SetupStore("instRecFixedFolder", tvguideConfig.instRecFixedFolder.c_str());
SetupStore("favWhatsOnNow", tvguideConfig.favWhatsOnNow);
SetupStore("favWhatsOnNext", tvguideConfig.favWhatsOnNext);
SetupStore("favUseTime1", tvguideConfig.favUseTime1);
SetupStore("favUseTime2", tvguideConfig.favUseTime2);
SetupStore("favUseTime3", tvguideConfig.favUseTime3);
SetupStore("favUseTime4", tvguideConfig.favUseTime4);
SetupStore("favTime1", tvguideConfig.favTime1);
SetupStore("favTime2", tvguideConfig.favTime2);
SetupStore("favTime3", tvguideConfig.favTime3);
SetupStore("favTime4", tvguideConfig.favTime4);
SetupStore("descUser1", tvguideConfig.descUser1.c_str());
SetupStore("descUser2", tvguideConfig.descUser2.c_str());
SetupStore("descUser3", tvguideConfig.descUser3.c_str());
SetupStore("descUser4", tvguideConfig.descUser4.c_str());
SetupStore("favLimitChannels", tvguideConfig.favLimitChannels);
SetupStore("favStartChannel", tvguideConfig.favStartChannel);
SetupStore("favStopChannel", tvguideConfig.favStopChannel);
2019-03-22 13:52:26 +01:00
SetupStore("switchMinsBefore", tvguideConfig.switchMinsBefore);
2013-05-26 11:38:05 +02:00
SetupStore("fontIndex", tvguideConfig.fontIndex);
2013-05-24 16:23:23 +02:00
SetupStore("FontButtonDelta", tvguideConfig.FontButtonDelta);
SetupStore("FontDetailViewDelta", tvguideConfig.FontDetailViewDelta);
SetupStore("FontDetailHeaderDelta", tvguideConfig.FontDetailHeaderDelta);
2013-05-26 11:38:05 +02:00
SetupStore("FontMessageBoxDelta", tvguideConfig.FontMessageBoxDelta);
SetupStore("FontMessageBoxLargeDelta", tvguideConfig.FontMessageBoxLargeDelta);
SetupStore("FontStatusHeaderDelta", tvguideConfig.FontStatusHeaderDelta);
SetupStore("FontStatusHeaderLargeDelta", tvguideConfig.FontStatusHeaderLargeDelta);
SetupStore("FontChannelHeaderDelta", tvguideConfig.FontChannelHeaderDelta);
2013-05-31 13:58:22 +02:00
SetupStore("FontChannelGroupsDelta", tvguideConfig.FontChannelGroupsDelta);
2013-05-26 11:38:05 +02:00
SetupStore("FontGridDelta", tvguideConfig.FontGridDelta);
SetupStore("FontGridSmallDelta", tvguideConfig.FontGridSmallDelta);
SetupStore("FontTimeLineWeekdayDelta", tvguideConfig.FontTimeLineWeekdayDelta);
SetupStore("FontTimeLineDateDelta", tvguideConfig.FontTimeLineDateDelta);
SetupStore("FontTimeLineTimeDelta", tvguideConfig.FontTimeLineTimeDelta);
SetupStore("FontChannelHeaderHorizontalDelta", tvguideConfig.FontChannelHeaderHorizontalDelta);
2013-05-31 13:58:22 +02:00
SetupStore("FontChannelGroupsHorizontalDelta", tvguideConfig.FontChannelGroupsHorizontalDelta);
2013-05-26 11:38:05 +02:00
SetupStore("FontGridHorizontalDelta", tvguideConfig.FontGridHorizontalDelta);
SetupStore("FontGridHorizontalSmallDelta", tvguideConfig.FontGridHorizontalSmallDelta);
SetupStore("FontTimeLineDateHorizontalDelta", tvguideConfig.FontTimeLineDateHorizontalDelta);
SetupStore("FontTimeLineTimeHorizontalDelta", tvguideConfig.FontTimeLineTimeHorizontalDelta);
2013-07-09 00:17:42 +02:00
SetupStore("FontRecMenuItemDelta", tvguideConfig.FontRecMenuItemDelta);
SetupStore("FontRecMenuItemSmallDelta", tvguideConfig.FontRecMenuItemSmallDelta);
SetupStore("FontRecMenuItemLargeDelta", tvguideConfig.FontRecMenuItemLargeDelta);
2013-05-26 17:44:04 +02:00
SetupStore("displayRerunsDetailEPGView", tvguideConfig.displayRerunsDetailEPGView);
SetupStore("numReruns", tvguideConfig.numReruns);
SetupStore("useSubtitleRerun", tvguideConfig.useSubtitleRerun);
2013-12-21 11:25:03 +01:00
SetupStore("numLogosInitial", tvguideConfig.numLogosInitial);
SetupStore("numLogosMax", tvguideConfig.numLogosMax);
SetupStore("limitLogoCache", tvguideConfig.limitLogoCache);
2013-01-17 13:16:44 +01:00
}
cMenuSetupSubMenu::cMenuSetupSubMenu(const char* Title, cTvguideConfig* data) : cOsdMenu(Title, 30) {
2013-05-26 11:38:05 +02:00
tmpTvguideConfig = data;
2013-12-21 11:25:03 +01:00
indent = " ";
2013-01-17 13:16:44 +01:00
}
cOsdItem *cMenuSetupSubMenu::InfoItem(const char *label, const char *value) {
cOsdItem *item;
item = new cOsdItem(cString::sprintf("%s: %s", label, value));
item->SetSelectable(false);
return item;
}
eOSState cMenuSetupSubMenu::ProcessKey(eKeys Key) {
eOSState state = cOsdMenu::ProcessKey(Key);
if (state == osUnknown) {
switch (Key) {
case kOk:
return osBack;
default:
break;
}
}
return state;
}
//----- General Settings -------------------------------------------------------------------------------------------------------------
2013-01-17 13:16:44 +01:00
cMenuSetupGeneral::cMenuSetupGeneral(cTvguideConfig* data) : cMenuSetupSubMenu(tr("General Settings"), data) {
2013-05-26 11:38:05 +02:00
themes.Load(*cString("tvguide"));
2013-05-24 16:23:23 +02:00
timeFormatItems[0] = "12h";
2013-05-26 11:38:05 +02:00
timeFormatItems[1] = "24h";
2013-05-31 13:58:22 +02:00
jumpMode[0] = tr("x channels back / forward");
jumpMode[1] = tr("previous / next channel group");
blueMode[0] = tr("Blue: Channel Switch, Ok: Detailed EPG");
blueMode[1] = tr("Blue: Detailed EPG, Ok: Channel Switch");
blueMode[2] = tr("Blue: Favorites / Switch, Ok: Detailed EPG");
numMode[0] = tr("Timely Jump");
numMode[1] = tr("Jump to specific channel");
2013-05-26 17:44:04 +02:00
useSubtitleRerunTexts[0] = tr("never");
useSubtitleRerunTexts[1] = tr("if exists");
useSubtitleRerunTexts[2] = tr("always");
2013-05-26 11:38:05 +02:00
Set();
2013-01-17 13:16:44 +01:00
}
void cMenuSetupGeneral::Set(void) {
2013-05-26 11:38:05 +02:00
int currentItem = Current();
Clear();
Add(new cMenuEditBoolItem(tr("Show Main Menu Entry"), &tmpTvguideConfig->showMainMenuEntry));
Add(new cMenuEditBoolItem(tr("Replace VDR Schedules Menu"), &tmpTvguideConfig->replaceOriginalSchedule));
2013-12-21 11:25:03 +01:00
Add(new cMenuEditBoolItem(tr("Use appropriate nOpacity Theme"), &tmpTvguideConfig->useNopacityTheme));
if (!tmpTvguideConfig->useNopacityTheme) {
if (themes.NumThemes())
Add(new cMenuEditStraItem(cString::sprintf("%s%s", *indent, tr("Theme")), &tmpTvguideConfig->themeIndex, themes.NumThemes(), themes.Descriptions()));
}
Add(new cMenuEditIntItem(tr("Time to display in minutes"), &tmpTvguideConfig->displayTime, 60, 320));
2013-05-26 11:38:05 +02:00
Add(new cMenuEditBoolItem(tr("Rounded Corners"), &tmpTvguideConfig->roundedCorners));
2013-05-31 13:58:22 +02:00
Add(new cMenuEditStraItem(tr("Channel Jump Mode (Keys Green / Yellow)"), &tmpTvguideConfig->channelJumpMode, 2, jumpMode));
Add(new cMenuEditStraItem(tr("Keys Blue and OK"), &tmpTvguideConfig->blueKeyMode, 3, blueMode));
2013-07-20 13:46:26 +02:00
Add(new cMenuEditBoolItem(tr("Close TVGuide after channel switch"), &tmpTvguideConfig->closeOnSwitch));
Add(new cMenuEditStraItem(tr("Functionality of numeric Keys"), &tmpTvguideConfig->numkeyMode, 2, numMode));
2013-05-31 13:58:22 +02:00
Add(new cMenuEditBoolItem(tr("Hide last Channel Group"), &tmpTvguideConfig->hideLastGroup));
2013-05-26 11:38:05 +02:00
Add(new cMenuEditIntItem(tr("Big Step (Keys 1 / 3) in hours"), &tmpTvguideConfig->bigStepHours, 1, 12));
Add(new cMenuEditIntItem(tr("Huge Step (Keys 4 / 6) in hours"), &tmpTvguideConfig->hugeStepHours, 13, 48));
Add(new cMenuEditStraItem(tr("Time Format (12h/24h)"), &tmpTvguideConfig->timeFormat, 2, timeFormatItems));
2014-05-11 09:00:21 +02:00
Add(new cMenuEditIntItem(tr("EPG Window Text Scrolling Speed"), &tmpTvguideConfig->detailedViewScrollStep, 1, 30));
2013-05-26 17:44:04 +02:00
Add(new cMenuEditBoolItem(tr("Display Reruns in detailed EPG View"), &tmpTvguideConfig->displayRerunsDetailEPGView));
if (tmpTvguideConfig->displayRerunsDetailEPGView) {
2013-12-21 11:25:03 +01:00
Add(new cMenuEditIntItem(cString::sprintf("%s%s", *indent, tr("Number of reruns to display")), &tmpTvguideConfig->numReruns, 1, 10));
Add(new cMenuEditStraItem(cString::sprintf("%s%s", *indent, tr("Use Subtitle for reruns")), &tmpTvguideConfig->useSubtitleRerun, 3, useSubtitleRerunTexts));
2013-05-26 17:44:04 +02:00
}
2013-05-26 11:38:05 +02:00
SetCurrent(Get(currentItem));
Display();
2013-01-17 13:16:44 +01:00
}
2013-05-26 17:44:04 +02:00
eOSState cMenuSetupGeneral::ProcessKey(eKeys Key) {
eOSState state = cOsdMenu::ProcessKey(Key);
if (Key == kOk) {
state = osBack;
} else if (Key != kNone) {
Set();
}
return state;
}
//----- Screen Presentation -------------------------------------------------------------------------------------------------------------
2013-01-17 13:16:44 +01:00
cMenuSetupScreenLayout::cMenuSetupScreenLayout(cTvguideConfig* data) : cMenuSetupSubMenu(tr("Screen Presentation"), data) {
2013-05-26 11:38:05 +02:00
displayModeItems[0] = "vertical";
2013-05-24 16:23:23 +02:00
displayModeItems[1] = "horizontal";
2013-05-26 11:38:05 +02:00
hideChannelLogosItems[0] = trVDR("yes");
hideChannelLogosItems[1] = trVDR("no");
logoExtensionItems[0] = "png";
logoExtensionItems[1] = "jpg";
Set();
2013-01-17 13:16:44 +01:00
}
void cMenuSetupScreenLayout::Set(void) {
2013-05-26 11:38:05 +02:00
int currentItem = Current();
Clear();
2013-05-24 16:23:23 +02:00
Add(new cMenuEditStraItem(tr("Display Mode"), &tmpTvguideConfig->displayMode, 2, displayModeItems));
if (tmpTvguideConfig->displayMode == eVertical) {
2013-12-21 11:25:03 +01:00
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Height of Channel Header (Perc. of osd height)")), &tmpTvguideConfig->channelHeaderHeightPercent, 5, 30));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Width of Timeline (Perc. of osd width)")), &tmpTvguideConfig->timeLineWidthPercent, 5, 30));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Number of Channels to display")), &tmpTvguideConfig->channelCols, 3, 12));
2013-05-24 16:23:23 +02:00
} else if (tmpTvguideConfig->displayMode == eHorizontal) {
2013-12-21 11:25:03 +01:00
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Width of Channel Header (Perc. of osd width)")), &tmpTvguideConfig->channelHeaderWidthPercent, 5, 30));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Height of Timeline (Perc. of osd height)")), &tmpTvguideConfig->timeLineHeightPercent, 5, 30));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Number of Channels to display")), &tmpTvguideConfig->channelRows, 3, 12));
Add(new cMenuEditBoolItem(*cString::sprintf("%s%s", *indent, tr("Display time in EPG Grids")), &tmpTvguideConfig->showTimeInGrid));
2013-05-24 16:23:23 +02:00
}
Add(new cMenuEditIntItem(tr("Height of Headers (Status Header and EPG View, Perc. of osd height)"), &tmpTvguideConfig->headerHeightPercent, 10, 50));
2013-12-21 11:25:03 +01:00
Add(new cMenuEditIntItem(tr("Height of Footer (Perc. of osd height)"), &tmpTvguideConfig->footerHeightPercent, 3, 20));
2013-05-24 16:23:23 +02:00
Add(new cMenuEditBoolItem(tr("Display status header"), &tmpTvguideConfig->displayStatusHeader));
if (tmpTvguideConfig->displayStatusHeader) {
2013-12-21 11:25:03 +01:00
Add(new cMenuEditBoolItem(*cString::sprintf("%s%s", *indent, tr("Scale video to upper right corner")), &tmpTvguideConfig->scaleVideo));
Add(new cMenuEditBoolItem(*cString::sprintf("%s%s", *indent, tr("Rounded corners around video frame")), &tmpTvguideConfig->decorateVideo));
}
2013-05-26 11:38:05 +02:00
Add(new cMenuEditBoolItem(tr("Display Channel Names in Header"), &tmpTvguideConfig->displayChannelName));
2013-05-31 13:58:22 +02:00
Add(new cMenuEditBoolItem(tr("Display channel groups"), &tmpTvguideConfig->displayChannelGroups));
if (tmpTvguideConfig->displayChannelGroups) {
if (tmpTvguideConfig->displayMode == eVertical) {
2013-12-21 11:25:03 +01:00
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Height of channel groups (Perc. of osd height)")), &tmpTvguideConfig->channelGroupsPercent, 3, 30));
2013-05-31 13:58:22 +02:00
} else if (tmpTvguideConfig->displayMode == eHorizontal) {
2013-12-21 11:25:03 +01:00
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Width of channel groups (Perc. of osd width)")), &tmpTvguideConfig->channelGroupsPercent, 3, 30));
2013-05-31 13:58:22 +02:00
}
}
2014-01-15 18:25:37 +01:00
Add(new cMenuEditBoolItem(tr("Display current time baseline"), &tmpTvguideConfig->displayTimeBase));
2013-05-26 11:38:05 +02:00
Add(new cMenuEditStraItem(tr("Show Channel Logos"), &tmpTvguideConfig->hideChannelLogos, 2, hideChannelLogosItems));
if (!tmpTvguideConfig->hideChannelLogos) {
Add(InfoItem(tr("Logo Path used"), *tvguideConfig.logoPath));
2013-12-21 11:25:03 +01:00
Add(new cMenuEditStraItem(*cString::sprintf("%s%s", *indent, tr("Logo Extension")), &tmpTvguideConfig->logoExtension, 2, logoExtensionItems));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Logo width ratio")), &tmpTvguideConfig->logoWidthRatio, 1, 1000));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Logo height ratio")), &tmpTvguideConfig->logoHeightRatio, 1, 1000));
2013-05-26 11:38:05 +02:00
}
2013-12-21 11:25:03 +01:00
Add(new cMenuEditIntItem(tr("Text Border in Detailed View (pixel)"), &tmpTvguideConfig->epgViewBorder, 0, 300));
2013-05-26 11:38:05 +02:00
Add(new cMenuEditStraItem(tr("Show EPG Images"), &tmpTvguideConfig->hideEpgImages, 2, hideChannelLogosItems));
if (!tmpTvguideConfig->hideEpgImages) {
Add(InfoItem(tr("EPG Images Path used"), *tvguideConfig.epgImagePath));
2013-12-21 11:25:03 +01:00
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("EPG Image width")), &tmpTvguideConfig->epgImageWidth, 0, 800));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("EPG Image height")), &tmpTvguideConfig->epgImageHeight, 0, 800));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Number of additional EPG Images")), &tmpTvguideConfig->numAdditionalEPGPictures, 0, 20));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Additional EPG Image width")), &tmpTvguideConfig->epgImageWidthLarge, 1, 800));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Additional EPG Image height")), &tmpTvguideConfig->epgImageHeightLarge, 0, 800));
2013-05-26 11:38:05 +02:00
}
SetCurrent(Get(currentItem));
Display();
2013-01-17 13:16:44 +01:00
}
eOSState cMenuSetupScreenLayout::ProcessKey(eKeys Key) {
2013-05-26 11:38:05 +02:00
eOSState state = cOsdMenu::ProcessKey(Key);
if (Key == kOk) {
state = osBack;
} else if (Key != kNone) {
Set();
}
return state;
2013-01-17 13:16:44 +01:00
}
//-----Fonts and Fontsizes -------------------------------------------------------------------------------------------------------
2013-01-17 13:16:44 +01:00
cMenuSetupFont::cMenuSetupFont(cTvguideConfig* data) : cMenuSetupSubMenu(tr("Fonts and Fontsizes"), data) {
2013-05-26 11:38:05 +02:00
cFont::GetAvailableFontNames(&fontNames);
fontNames.Insert(strdup(tvguideConfig.fontNameDefault));
Set();
2013-01-17 13:16:44 +01:00
}
void cMenuSetupFont::Set(void) {
2013-05-26 11:38:05 +02:00
int currentItem = Current();
Clear();
2013-05-24 16:23:23 +02:00
Add(new cMenuEditStraItem(tr("Font"), &tmpTvguideConfig->fontIndex, fontNames.Size(), &fontNames[0]));
Add(new cMenuEditIntItem(tr("Status Header Font Size"), &tmpTvguideConfig->FontStatusHeaderDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Status Header Large Font Size"), &tmpTvguideConfig->FontStatusHeaderLargeDelta, -30, 30));
2013-05-26 11:38:05 +02:00
Add(new cMenuEditIntItem(tr("Detail EPG View Font Size"), &tmpTvguideConfig->FontDetailViewDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Detail EPG View Header Font Size"), &tmpTvguideConfig->FontDetailHeaderDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Message Font Size"), &tmpTvguideConfig->FontMessageBoxDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Message Large Font Size"), &tmpTvguideConfig->FontMessageBoxLargeDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Button Font Size"), &tmpTvguideConfig->FontButtonDelta, -30, 30));
2013-05-24 16:23:23 +02:00
if (tmpTvguideConfig->displayMode == eVertical) {
Add(new cMenuEditIntItem(tr("Channel Header Font Size"), &tmpTvguideConfig->FontChannelHeaderDelta, -30, 30));
2013-05-31 13:58:22 +02:00
Add(new cMenuEditIntItem(tr("Channel Groups Font Size"), &tmpTvguideConfig->FontChannelGroupsDelta, -30, 30));
2013-05-24 16:23:23 +02:00
Add(new cMenuEditIntItem(tr("Grid Font Size"), &tmpTvguideConfig->FontGridDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Grid Font Small Size"), &tmpTvguideConfig->FontGridSmallDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Timeline Weekday Font Size"), &tmpTvguideConfig->FontTimeLineWeekdayDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Timeline Date Font Size"), &tmpTvguideConfig->FontTimeLineDateDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Timeline Time Font Size"), &tmpTvguideConfig->FontTimeLineTimeDelta, -30, 30));
} else if (tmpTvguideConfig->displayMode == eHorizontal) {
Add(new cMenuEditIntItem(tr("Channel Header Font Size"), &tmpTvguideConfig->FontChannelHeaderHorizontalDelta, -30, 30));
2013-05-31 13:58:22 +02:00
Add(new cMenuEditIntItem(tr("Channel Groups Font Size"), &tmpTvguideConfig->FontChannelGroupsHorizontalDelta, -30, 30));
2013-05-24 16:23:23 +02:00
Add(new cMenuEditIntItem(tr("Grid Font Size"), &tmpTvguideConfig->FontGridHorizontalDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Grid Font Small Size"), &tmpTvguideConfig->FontGridHorizontalSmallDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Timeline Date Font Size"), &tmpTvguideConfig->FontTimeLineDateHorizontalDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Timeline Time Font Size"), &tmpTvguideConfig->FontTimeLineTimeHorizontalDelta, -30, 30));
}
2013-07-09 00:17:42 +02:00
Add(new cMenuEditIntItem(tr("Search & Recording Menu Font Size"), &tmpTvguideConfig->FontRecMenuItemDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Search & Recording Menu Small Font Size"), &tmpTvguideConfig->FontRecMenuItemSmallDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Search & Recording Menu Header Font Size"), &tmpTvguideConfig->FontRecMenuItemLargeDelta, -30, 30));
2013-05-24 16:23:23 +02:00
2013-05-26 11:38:05 +02:00
SetCurrent(Get(currentItem));
Display();
2013-12-21 11:25:03 +01:00
}
//----- Recording Menus and Favorites -------------------------------------------------------------------------------------------------------
cMenuSetupFavorites::cMenuSetupFavorites(cTvguideConfig* data) : cMenuSetupSubMenu(tr("Recording Menus and Favorites"), data) {
strn0cpy(description1, data->descUser1.c_str(), sizeof(description1));
strn0cpy(description2, data->descUser2.c_str(), sizeof(description2));
strn0cpy(description3, data->descUser3.c_str(), sizeof(description3));
strn0cpy(description4, data->descUser4.c_str(), sizeof(description4));
recFolderMode[0] = tr("Always use root video folder");
recFolderMode[1] = tr("Select from folder list");
recFolderMode[2] = tr("Use fixed folder");
strn0cpy(fixedFolder, data->instRecFixedFolder.c_str(), sizeof(fixedFolder));
Set();
}
void cMenuSetupFavorites::Set(void) {
int currentItem = Current();
Clear();
Add(new cMenuEditStraItem(tr("Folder for instant Recordings"), &tmpTvguideConfig->instRecFolderMode, 3, recFolderMode));
if (tmpTvguideConfig->instRecFolderMode == eFolderFixed) {
Add(new cMenuEditStrItem(cString::sprintf("%s%s", *indent, tr("Folder")), fixedFolder, sizeof(fixedFolder), trVDR(FileNameChars)));
}
if (pRemoteTimers)
Add(new cMenuEditBoolItem(tr("Use Remotetimers"), &tmpTvguideConfig->useRemoteTimers));
Add(new cMenuEditBoolItem(tr("Use \"What's on now\" in favorites"), &tmpTvguideConfig->favWhatsOnNow));
Add(new cMenuEditBoolItem(tr("Use \"What's on next\" in favorites"), &tmpTvguideConfig->favWhatsOnNext));
Add(new cMenuEditBoolItem(tr("Use user defined time 1 in favorites"), &tmpTvguideConfig->favUseTime1));
if (tmpTvguideConfig->favUseTime1) {
Add(new cMenuEditStrItem(cString::sprintf("%s%s", *indent, tr("Description")), description1, sizeof(description1), trVDR(FileNameChars)));
Add(new cMenuEditTimeItem(cString::sprintf("%s%s", *indent, tr("Time")), &tmpTvguideConfig->favTime1));
}
Add(new cMenuEditBoolItem(tr("Use user defined time 2 in favorites"), &tmpTvguideConfig->favUseTime2));
if (tmpTvguideConfig->favUseTime2) {
Add(new cMenuEditStrItem(cString::sprintf("%s%s", *indent, tr("Description")), description2, sizeof(description2), trVDR(FileNameChars)));
Add(new cMenuEditTimeItem(cString::sprintf("%s%s", *indent, tr("Time")), &tmpTvguideConfig->favTime2));
}
Add(new cMenuEditBoolItem(tr("Use user defined time 3 in favorites"), &tmpTvguideConfig->favUseTime3));
if (tmpTvguideConfig->favUseTime3) {
Add(new cMenuEditStrItem(cString::sprintf("%s%s", *indent, tr("Description")), description3, sizeof(description3), trVDR(FileNameChars)));
Add(new cMenuEditTimeItem(cString::sprintf("%s%s", *indent, tr("Time")), &tmpTvguideConfig->favTime3));
}
Add(new cMenuEditBoolItem(tr("Use user defined time 4 in favorites"), &tmpTvguideConfig->favUseTime4));
if (tmpTvguideConfig->favUseTime4) {
Add(new cMenuEditStrItem(cString::sprintf("%s%s", *indent, tr("Description")), description4, sizeof(description4), trVDR(FileNameChars)));
Add(new cMenuEditTimeItem(cString::sprintf("%s%s", *indent, tr("Time")), &tmpTvguideConfig->favTime4));
}
Add(new cMenuEditBoolItem(tr("Limit channels in favorites"), &tmpTvguideConfig->favLimitChannels));
if (tmpTvguideConfig->favLimitChannels) {
Add(new cMenuEditChanItem(tr("Start Channel"), &tmpTvguideConfig->favStartChannel));
Add(new cMenuEditChanItem(tr("Stop Channel"), &tmpTvguideConfig->favStopChannel));
}
2019-03-22 13:52:26 +01:00
Add(new cMenuEditIntItem(tr("Minutes a switchtimer switches before start of a show"), &tmpTvguideConfig->switchMinsBefore, 0, 10));
SetCurrent(Get(currentItem));
Display();
}
eOSState cMenuSetupFavorites::ProcessKey(eKeys Key) {
int tmpFavUseTime1 = tmpTvguideConfig->favUseTime1;
int tmpFavUseTime2 = tmpTvguideConfig->favUseTime2;
int tmpFavUseTime3 = tmpTvguideConfig->favUseTime3;
int tmpFavUseTime4 = tmpTvguideConfig->favUseTime4;
int tmpFavLimitChannels = tmpTvguideConfig->favLimitChannels;
int tmpFolderMode = tmpTvguideConfig->instRecFolderMode;
eOSState state = cOsdMenu::ProcessKey(Key);
if (Key == kOk) {
tmpTvguideConfig->descUser1 = description1;
tmpTvguideConfig->descUser2 = description2;
tmpTvguideConfig->descUser3 = description3;
tmpTvguideConfig->descUser4 = description4;
tmpTvguideConfig->instRecFixedFolder = fixedFolder;
} else if ((Key == kLeft)||(Key == kRight)) {
if ((tmpFavUseTime1 != tmpTvguideConfig->favUseTime1) ||
(tmpFavUseTime2 != tmpTvguideConfig->favUseTime2) ||
(tmpFavUseTime3 != tmpTvguideConfig->favUseTime3) ||
(tmpFavUseTime4 != tmpTvguideConfig->favUseTime4) ||
(tmpFavLimitChannels != tmpTvguideConfig->favLimitChannels) ||
(tmpFolderMode != tmpTvguideConfig->instRecFolderMode) )
Set();
}
return state;
}
2013-12-21 11:25:03 +01:00
//-----Image Caching-------------------------------------------------------------------------------------------------------------
cMenuSetupImageCache::cMenuSetupImageCache(cTvguideConfig* data) : cMenuSetupSubMenu(tr("Image Loading and Caching"), data) {
Set();
}
void cMenuSetupImageCache::Set(void) {
int currentItem = Current();
Clear();
Add(new cMenuEditBoolItem(tr("Create Log Messages for image loading"), &tmpTvguideConfig->debugImageLoading));
Add(new cMenuEditBoolItem(tr("Limit Logo Cache"), &tmpTvguideConfig->limitLogoCache));
if (&tmpTvguideConfig->limitLogoCache) {
Add(new cMenuEditIntItem(cString::sprintf("%s%s", *indent, tr("Maximal number of logos to cache")), &tmpTvguideConfig->numLogosMax, 1, 9999));
}
Add(new cMenuEditIntItem(tr("Number of logos to cache at start"), &tmpTvguideConfig->numLogosInitial, 0, 9999));
Add(InfoItem(tr("Cache Sizes"), ""));
Add(InfoItem(tr("OSD Element Cache"), (imgCache.GetCacheSize(ctOsdElement)).c_str()));
Add(InfoItem(tr("Logo cache"), (imgCache.GetCacheSize(ctLogo)).c_str()));
Add(InfoItem(tr("EPG Grid Cache"), (imgCache.GetCacheSize(ctGrid)).c_str()));
Add(InfoItem(tr("Channel Groups Cache"), (imgCache.GetCacheSize(ctChannelGroup)).c_str()));
Add(InfoItem(tr("Recording Menus Icon Cache"), (imgCache.GetCacheSize(ctIcon)).c_str()));
2013-12-21 11:25:03 +01:00
SetCurrent(Get(currentItem));
Display();
}