10 Commits

Author SHA1 Message Date
kamel5
2f497adf01 Version 1.3.4 2021-01-11 11:36:25 +01:00
kamel5
decfb2d39d Coemetic changes 2021-01-11 11:33:16 +01:00
kamel5
5f4ea6b30d gcc11fix 2021-01-11 11:19:01 +01:00
kamel5
435a74d9cf Version 1.3.3 2020-08-06 19:05:42 +02:00
kamel5
fc47c35bea Version 1.3.2 2020-08-06 12:47:03 +02:00
kamel5
4d80c6900d Optional deactivation of the timer confirmation messages 2020-08-06 12:47:03 +02:00
kamel5
78d6e980ee Wrap title in detailview header 2020-08-06 12:47:03 +02:00
kamel5
69356e9c43 Add "Timer On/Off" to recmenu 2020-08-06 12:46:59 +02:00
kamel5
bf3a8a430b Center some channel logos 2020-08-02 19:50:55 +02:00
kamel5
52c41ff5af Fixed display groupname in cChannelGroupGrid::DrawHorizontal 2020-07-25 13:35:03 +02:00
21 changed files with 224 additions and 99 deletions

16
HISTORY
View File

@@ -270,3 +270,19 @@ Version 1.3.1
- Fixes for <VDR-2.3.1 compatibility
- Fixed a segfault while starting tvguide
Version 1.3.2
- Fixed display groupname in cChannelGroupGrid::DrawHorizontal
- Center some channel logos
- Add "Timer On/Off" to recmenu
- Wrap title in detailview header
- Optional deactivation of the timer confirmation messages
Version 1.3.3
- Bugfix
Version 1.3.4
- Fix for gcc11

View File

@@ -68,29 +68,28 @@ void cChannelGroupGrid::Draw(void) {
void cChannelGroupGrid::DrawVertical(tColor colorText, tColor colorTextBack) {
int textY = (Height() - fontManager.FontChannelGroups->Height()) / 2;
cString text = CutText(name, Width() - 4, fontManager.FontChannelGroups).c_str();
cString text = cString::sprintf("%s", CutText(name, Width() - 4, fontManager.FontChannelGroups).c_str());
int textWidth = fontManager.FontChannelGroups->Width(*text);
int x = (Width() - textWidth) / 2;
pixmap->DrawText(cPoint(x, textY), *text, colorText, colorTextBack, fontManager.FontChannelGroups);
}
void cChannelGroupGrid::DrawHorizontal(tColor colorText, tColor colorTextBack) {
std::string nameUpper = name;
std::transform(nameUpper.begin(), nameUpper.end(),nameUpper.begin(), ::toupper);
int numChars = nameUpper.length();
std::string groupName = name;
int numChars = groupName.length();
int charHeight = fontManager.FontChannelGroupsHorizontal->Height();
int textHeight = numChars * charHeight;
int y = 5;
if ((textHeight +5) < Height()) {
if ((textHeight + 5) < Height()) {
y = (Height() - textHeight) / 2;
}
for (int i=0; i < numChars; i++) {
if (((y + 2*charHeight) > Height()) && ((i+1)<numChars)) {
for (int i = 0; i < numChars; i++) {
if (((y + 2 * charHeight) > Height()) && ((i + 1) < numChars)) {
int x = (Width() - fontManager.FontChannelGroupsHorizontal->Width("...")) / 2;
pixmap->DrawText(cPoint(x, y), "...", colorText, colorTextBack, fontManager.FontChannelGroupsHorizontal);
break;
}
cString currentChar = cString::sprintf("%c", nameUpper.at(i));
cString currentChar = cString::sprintf("%s", utf8_substr(groupName.c_str(), i, 1).c_str());
int x = (Width() - fontManager.FontChannelGroupsHorizontal->Width(*currentChar)) / 2;
pixmap->DrawText(cPoint(x, y), *currentChar, colorText, colorTextBack, fontManager.FontChannelGroupsHorizontal);
y += fontManager.FontChannelGroupsHorizontal->Height();

View File

@@ -35,6 +35,7 @@ cTVGuideConfig::cTVGuideConfig() {
jumpChannels = 0;
blueKeyMode = 2;
addSubtitleToTimer = 1;
timerMessage = 1;
closeOnSwitch = 1;
numkeyMode = 0;
useRemoteTimers = 0;
@@ -297,6 +298,7 @@ bool cTVGuideConfig::SetupParse(const char *Name, const char *Value) {
else if (strcmp(Name, "instRecFolderMode") == 0) instRecFolderMode = atoi(Value);
else if (strcmp(Name, "instRecFixedFolder") == 0) instRecFixedFolder = Value;
else if (strcmp(Name, "addSubtitleToTimer") == 0) addSubtitleToTimer = atoi(Value);
else if (strcmp(Name, "timerMessage") == 0) timerMessage = atoi(Value);
else if (strcmp(Name, "favWhatsOnNow") == 0) favWhatsOnNow = atoi(Value);
else if (strcmp(Name, "favWhatsOnNext") == 0) favWhatsOnNext = atoi(Value);
else if (strcmp(Name, "favUseTime1") == 0) favUseTime1 = atoi(Value);

View File

@@ -88,6 +88,7 @@ class cTVGuideConfig {
int channelJumpMode;
int jumpChannels;
int blueKeyMode;
int timerMessage;
int addSubtitleToTimer;
int closeOnSwitch;
int numkeyMode;

View File

@@ -20,9 +20,9 @@ cEpgGrid::~cEpgGrid(void) {
void cEpgGrid::SetViewportHeight() {
int viewportHeightOld = viewportHeight;
if ( column->Start() > StartTime() ) {
viewportHeight = (min((int)EndTime(), column->Stop()) - column->Start()) /60;
viewportHeight = (std::min((int)EndTime(), column->Stop()) - column->Start()) / 60;
} else if ( column->Stop() < EndTime() ) {
viewportHeight = (column->Stop() - StartTime()) /60;
viewportHeight = (column->Stop() - StartTime()) / 60;
if (viewportHeight < 0) viewportHeight = 0;
} else {
viewportHeight = Duration() / 60;
@@ -37,11 +37,11 @@ void cEpgGrid::PositionPixmap() {
int x0 = column->getX();
int y0 = geoManager.statusHeaderHeight + geoManager.channelHeaderHeight + geoManager.channelGroupsHeight;
if ( column->Start() < StartTime() ) {
y0 += (StartTime() - column->Start())/60*geoManager.minutePixel;
y0 += (StartTime() - column->Start()) / 60 * geoManager.minutePixel;
}
if (!pixmap) {
pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, geoManager.colWidth, viewportHeight),
cRect(0, 0, geoManager.colWidth, Duration()/60*geoManager.minutePixel));
cRect(0, 0, geoManager.colWidth, Duration() / 60 * geoManager.minutePixel));
} else {
pixmap->SetViewPort(cRect(x0, y0, geoManager.colWidth, viewportHeight));
}
@@ -49,11 +49,11 @@ void cEpgGrid::PositionPixmap() {
int x0 = geoManager.channelHeaderWidth + geoManager.channelGroupsWidth;
int y0 = column->getY();
if ( column->Start() < StartTime() ) {
x0 += (StartTime() - column->Start())/60*geoManager.minutePixel;
x0 += (StartTime() - column->Start()) / 60 * geoManager.minutePixel;
}
if (!pixmap) {
pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, viewportHeight, geoManager.rowHeight),
cRect(0, 0, Duration()/60*geoManager.minutePixel, geoManager.rowHeight));
cRect(0, 0, Duration() / 60 * geoManager.minutePixel, geoManager.rowHeight));
} else {
pixmap->SetViewPort(cRect(x0, y0, viewportHeight, geoManager.rowHeight ));
}

View File

@@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-tvguide 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2020-02-17 14:30+0100\n"
"POT-Creation-Date: 2020-08-04 14:15+0200\n"
"PO-Revision-Date: 2013-09-21 17:49+0200\n"
"Last-Translator: My friend <Sampep> Thanks David <Gabychan> <gbonich@gmail.com>\n"
"Language-Team: \n"
@@ -25,7 +25,7 @@ msgid "min"
msgstr "min"
msgid "Reruns of "
msgstr ""
msgstr "Reemissions "
msgid "No reruns found"
msgstr ""
@@ -105,12 +105,15 @@ msgstr ""
msgid "Instant Record"
msgstr "Enregistra a l'instant"
msgid "Delete Timer"
msgstr "Esborra temporitzador"
msgid "Timer On/Off"
msgstr "Temporitzador On/Off"
msgid "Edit Timer"
msgstr "Edita temporitzador"
msgid "Delete Timer"
msgstr "Esborra temporitzador"
msgid "Timer Timeline"
msgstr ""
@@ -760,7 +763,7 @@ msgid "Display time in EPG Grids"
msgstr "Mostra el temps a l'EPG"
msgid "Height of Headers (Status Header and EPG View, Perc. of osd height)"
msgstr ""
msgstr "Alçada capçalera d'estat (% alçada OSD)"
msgid "Height of Footer (Perc. of osd height)"
msgstr ""
@@ -898,7 +901,7 @@ msgid "Instant recording:"
msgstr ""
msgid "Folder for instant Recordings"
msgstr ""
msgstr "Utilitza carpetes per gravacions a l'instant"
msgid "Folder"
msgstr ""
@@ -909,6 +912,9 @@ msgstr ""
msgid "Use Remotetimers"
msgstr "Utilitza temporitzadors remots"
msgid "Show timer confirmation messages"
msgstr ""
msgid "Favorites:"
msgstr ""
@@ -997,7 +1003,7 @@ msgid "EPG Info"
msgstr ""
msgid "Reruns"
msgstr ""
msgstr "Reemissions"
msgid "Recording Information"
msgstr ""

View File

@@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-tvguide 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2020-02-17 14:30+0100\n"
"POT-Creation-Date: 2020-08-04 14:15+0200\n"
"PO-Revision-Date: 2012-08-25 17:49+0200\n"
"Last-Translator: Horst\n"
"Language-Team: \n"
@@ -102,12 +102,15 @@ msgstr "erledigte Aufnahmen"
msgid "Instant Record"
msgstr "Aufnahme"
msgid "Delete Timer"
msgstr "Timer löschen"
msgid "Timer On/Off"
msgstr "Timer Ein/Aus"
msgid "Edit Timer"
msgstr "Timer bearbeiten"
msgid "Delete Timer"
msgstr "Timer löschen"
msgid "Timer Timeline"
msgstr "Timer Tagesübersicht"
@@ -906,6 +909,9 @@ msgstr "Untertitel in manuellen Timern"
msgid "Use Remotetimers"
msgstr "RemoteTimers benutzen"
msgid "Show timer confirmation messages"
msgstr "Timer Bestätigungsmeldungen anzeigen"
msgid "Favorites:"
msgstr "Favoriten:"
@@ -997,7 +1003,7 @@ msgid "Reruns"
msgstr "Wiederholungen"
msgid "Recording Information"
msgstr ""
msgstr "Aufnahme Information"
msgid "Image Galery"
msgstr "Bildergalerie"

View File

@@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-tvguide 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2020-02-17 14:30+0100\n"
"POT-Creation-Date: 2020-08-04 14:15+0200\n"
"PO-Revision-Date: 2012-08-25 17:49+0200\n"
"Last-Translator: fiveten_59\n"
"Language-Team: \n"
@@ -102,12 +102,15 @@ msgstr "registrazione eseguita"
msgid "Instant Record"
msgstr "Registrazione immediata"
msgid "Delete Timer"
msgstr "Cancella il Timer"
msgid "Timer On/Off"
msgstr "Timer On/Off"
msgid "Edit Timer"
msgstr "Edita il Timer"
msgid "Delete Timer"
msgstr "Cancella il Timer"
msgid "Timer Timeline"
msgstr "Scadenza del Timer"
@@ -906,6 +909,9 @@ msgstr "Aggiungi episodi ai timer manuali"
msgid "Use Remotetimers"
msgstr "Usa Remotetimers"
msgid "Show timer confirmation messages"
msgstr ""
msgid "Favorites:"
msgstr ""

View File

@@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-tvguide 1.0.0\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2020-02-17 14:30+0100\n"
"POT-Creation-Date: 2020-08-04 14:15+0200\n"
"PO-Revision-Date: 2013-09-25 17:49+0400\n"
"Last-Translator: AmiD, ilya\n"
"Language-Team: Russia-Cherepovets(wm.amid@gmail.com)\n"
@@ -22,7 +22,7 @@ msgid "min"
msgstr "мин"
msgid "Reruns of "
msgstr ""
msgstr "ПОВТОРЫ ЭТОЙ "
msgid "No reruns found"
msgstr ""
@@ -102,12 +102,15 @@ msgstr ""
msgid "Instant Record"
msgstr "Записать"
msgid "Delete Timer"
msgstr "Удалить таймер"
msgid "Timer On/Off"
msgstr "таймер Вкл/Выкл"
msgid "Edit Timer"
msgstr "Редактировать таймер"
msgid "Delete Timer"
msgstr "Удалить таймер"
msgid "Timer Timeline"
msgstr ""
@@ -295,7 +298,7 @@ msgid "No Search Timers Configured"
msgstr ""
msgid "Configure Search Timer Options"
msgstr ""
msgstr "Настроить параметры таймера"
msgid "Save Search Timer"
msgstr ""
@@ -757,7 +760,7 @@ msgid "Display time in EPG Grids"
msgstr "Показывать время в сетке EPG"
msgid "Height of Headers (Status Header and EPG View, Perc. of osd height)"
msgstr ""
msgstr "Высота верхней панели (% от высоты OSD)"
msgid "Height of Footer (Perc. of osd height)"
msgstr ""
@@ -895,7 +898,7 @@ msgid "Instant recording:"
msgstr ""
msgid "Folder for instant Recordings"
msgstr ""
msgstr "Использовать директории для быстрой записи"
msgid "Folder"
msgstr ""
@@ -906,6 +909,9 @@ msgstr ""
msgid "Use Remotetimers"
msgstr "RemoteTimers benutzen"
msgid "Show timer confirmation messages"
msgstr ""
msgid "Favorites:"
msgstr ""
@@ -994,7 +1000,7 @@ msgid "EPG Info"
msgstr ""
msgid "Reruns"
msgstr ""
msgstr "ПОВТОРЫ"
msgid "Recording Information"
msgstr ""

View File

@@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-tvguide 1.1.0\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2020-02-17 14:30+0100\n"
"POT-Creation-Date: 2020-08-04 14:15+0200\n"
"PO-Revision-Date: 2013-09-15 00:12+0100\n"
"Last-Translator: Milan Hrala <hrala.milan@gmail.com>\n"
"Language-Team: \n"
@@ -22,7 +22,7 @@ msgid "min"
msgstr "min"
msgid "Reruns of "
msgstr ""
msgstr "Repr<EFBFBD>za tohto "
msgid "No reruns found"
msgstr ""
@@ -102,12 +102,15 @@ msgstr ""
msgid "Instant Record"
msgstr "Okam<61>ite nahra<72>"
msgid "Delete Timer"
msgstr "Vymaza<EFBFBD> pl<70>n nahr<68>vania"
msgid "Timer On/Off"
msgstr "Zap./Vyp. pl<70>n nahr<68>vania"
msgid "Edit Timer"
msgstr "Upravi<76> pl<70>n nahr<68>vania"
msgid "Delete Timer"
msgstr "Vymaza<7A> pl<70>n nahr<68>vania"
msgid "Timer Timeline"
msgstr ""
@@ -757,7 +760,7 @@ msgid "Display time in EPG Grids"
msgstr "Zobrazi<7A> <20>as v EPG mrie<69>ke"
msgid "Height of Headers (Status Header and EPG View, Perc. of osd height)"
msgstr ""
msgstr "V<EFBFBD><EFBFBD>ka stavovej hlavi<76>ky (% z OSD v<><76>ky)"
msgid "Height of Footer (Perc. of osd height)"
msgstr ""
@@ -895,7 +898,7 @@ msgid "Instant recording:"
msgstr ""
msgid "Folder for instant Recordings"
msgstr ""
msgstr "Pou<EFBFBD>i<EFBFBD> adres<65>re pre okam<61>it<69> nahr<68>vky"
msgid "Folder"
msgstr ""
@@ -906,6 +909,9 @@ msgstr "Prida
msgid "Use Remotetimers"
msgstr "Pou<6F>i<EFBFBD> vzdialen<65> pl<70>nova<76>"
msgid "Show timer confirmation messages"
msgstr ""
msgid "Favorites:"
msgstr ""
@@ -994,7 +1000,7 @@ msgid "EPG Info"
msgstr ""
msgid "Reruns"
msgstr ""
msgstr "Repr<EFBFBD>za"
msgid "Recording Information"
msgstr ""

View File

@@ -267,6 +267,21 @@ void cRecManager::DeleteRemoteTimer(const cEvent *event) {
}
}
void cRecManager::OnOffTimer(const cEvent *event) {
const cTimer *t;
#if VDRVERSNUM >= 20301
{
LOCK_TIMERS_READ;
t = Timers->GetMatch(event);
}
#else
t = Timers.GetMatch(event);
#endif
if (!t)
return;
SaveTimer(t);
}
void cRecManager::SaveTimer(const cTimer *t, cTimer *newTimerSettings) {
if (!t)
return;
@@ -288,20 +303,26 @@ void cRecManager::SaveTimer(const cTimer *t, cTimer *newTimerSettings) {
if (!timer) {
return;
}
bool active = newTimerSettings->HasFlags(tfActive);
int prio = newTimerSettings->Priority();
int lifetime = newTimerSettings->Lifetime();
time_t day = newTimerSettings->Day();
int start = newTimerSettings->Start();
int stop = newTimerSettings->Stop();
std::string fileName = newTimerSettings->File();
timer->SetDay(day);
timer->SetStart(start);
timer->SetStop(stop);
timer->SetPriority(prio);
timer->SetLifetime(lifetime);
timer->SetFile(fileName.c_str());
bool active = true;
if (newTimerSettings) {
int prio = newTimerSettings->Priority();
int lifetime = newTimerSettings->Lifetime();
time_t day = newTimerSettings->Day();
int start = newTimerSettings->Start();
int stop = newTimerSettings->Stop();
std::string fileName = newTimerSettings->File();
timer->SetDay(day);
timer->SetStart(start);
timer->SetStop(stop);
timer->SetPriority(prio);
timer->SetLifetime(lifetime);
timer->SetFile(fileName.c_str());
active = newTimerSettings->HasFlags(tfActive);
} else
active = !timer->HasFlags(tfActive);
if (active)
timer->SetFlags(tfActive);

View File

@@ -33,11 +33,12 @@ public:
cTimer *createLocalTimer(const cEvent *event, std::string path);
cTimer *createRemoteTimer(const cEvent *event, std::string path);
void SetTimerPath(cTimer *timer, const cEvent *event, std::string path);
void OnOffTimer(const cEvent *event);
void DeleteTimer(const cTimer *timer);
void DeleteTimer(const cEvent *event);
void DeleteLocalTimer(const cEvent *event);
void DeleteRemoteTimer(const cEvent *event);
void SaveTimer(const cTimer *timer, cTimer *newTimerSettings);
void SaveTimer(const cTimer *timer, cTimer *newTimerSettings = NULL);
bool IsRecorded(const cEvent *event);
cTVGuideTimerConflicts *CheckTimerConflict(void);
void CreateSeriesTimer(cTimer *seriesTimer);

View File

@@ -557,7 +557,7 @@ void cRecMenuItemSelect::Draw(void) {
void cRecMenuItemSelect::DrawValue(void) {
pixmapVal->Fill(clrTransparent);
std::string textVal = strings[currentVal];
int iconSize = min(128, height);
int iconSize = std::min(128, height);
int textX = width - font->Width(textVal.c_str()) - iconSize;
int textY = (height - font->Height()) / 2;
pixmapVal->DrawText(cPoint(textX, textY), textVal.c_str(), colorText, clrTransparent, font);
@@ -664,7 +664,7 @@ void cRecMenuItemSelectDirectory::Draw(void) {
void cRecMenuItemSelectDirectory::DrawValue(void) {
pixmapVal->Fill(clrTransparent);
int iconSize = min(128, height);
int iconSize = std::min(128, height);
int textX = std::max(width - font->Width(folders[currentVal].c_str()) - iconSize, 10 + font->Width(*text) + 2 * iconSize);
int textY = (height - font->Height()) / 2;
pixmapVal->DrawText(cPoint(textX, textY), folders[currentVal].c_str(), colorText, clrTransparent, font, width - textX - iconSize, font->Height(), taTop | taRight);
@@ -967,7 +967,7 @@ char *cRecMenuItemText::GetSMSKeys(int num) {
if (specialChar)
addition = 1;
Utf8FromArray(startCharUtf8, p, numChars+addition);
int maxChars = min(numChars+1+addition, 8);
int maxChars = std::min(numChars+1+addition, 8);
char *smskey = new char[maxChars];
Utf8Strn0Cpy(smskey, p, maxChars);
return smskey;
@@ -1601,7 +1601,7 @@ void cRecMenuItemTimer::Draw(void) {
if (!config.hideChannelLogos) {
if (imgLoader.LoadLogo(channel, logoWidth, height)) {
cImage logo = imgLoader.GetImage();
pixmapIcons->DrawImage(cPoint(logoX, 0), logo);
pixmapIcons->DrawImage(cPoint(logoX, (height - logo.Height()) / 2), logo);
logoX += logoWidth + 5;
}
}
@@ -2013,7 +2013,7 @@ void cRecMenuItemChannelChooser::DrawValue(void) {
cImageLoader imgLoader;
if (imgLoader.LoadLogo(channel, logoWidth, height - 10)) {
cImage logo = imgLoader.GetImage();
pixmapChannel->DrawImage(cPoint(logoX, 5), logo);
pixmapChannel->DrawImage(cPoint(logoX, (height - logo.Height()) / 2), logo);
}
} else {
cString textVal = tr("all Channels");
@@ -2163,7 +2163,7 @@ void cRecMenuItemDayChooser::SetSizes(void) {
if (charWidth > maxWidth)
maxWidth = charWidth;
}
daysSize = min(maxWidth + 15, height - 4);
daysSize = std::min(maxWidth + 15, height - 4);
daysX = width - 10 - 7 * daysSize;
daysY = (height - daysSize) / 2;
}
@@ -2393,7 +2393,7 @@ void cRecMenuItemTimelineHeader::DrawCurrentTimer(void) {
if (!config.hideChannelLogos) {
if (imgLoader.LoadLogo(channel, logoWidth, infoHeight)) {
cImage logo = imgLoader.GetImage();
pixmapTimerInfo->DrawImage(cPoint(0, 0), logo);
pixmapTimerInfo->DrawImage(cPoint(0, (infoHeight - logo.Height()) / 2), logo);
x += logoWidth + 10;
logoDrawn = true;
}

View File

@@ -25,6 +25,7 @@ enum eRecMenuState {
rmsSearchRerunsTimerConflictMenu,
rmsSaveTimerConflictMenu,
rmsTimerConflictShowInfo,
rmsOnOffTimer,
rmsDeleteTimer,
rmsDeleteTimerConfirmation,
rmsEditTimer,

View File

@@ -11,8 +11,9 @@ cRecMenuMain::cRecMenuMain(bool epgSearchAvailable, bool timerActive, bool switc
action = rmsInstantRecordFolder;
AddMenuItem(new cRecMenuItemButton(tr("Instant Record"), action, true, false, false, true));
} else {
AddMenuItem(new cRecMenuItemButton(tr("Delete Timer"), rmsDeleteTimer, true, false, false, true));
AddMenuItem(new cRecMenuItemButton(tr("Timer On/Off"), rmsOnOffTimer, true, false, false, true));
AddMenuItem(new cRecMenuItemButton(tr("Edit Timer"), rmsEditTimer, false, false, false, true));
AddMenuItem(new cRecMenuItemButton(tr("Delete Timer"), rmsDeleteTimer, false, false, false, true));
}
AddMenuItem(new cRecMenuItemButton(tr("Timer Timeline"), rmsTimeline, false, false, false, true));

View File

@@ -121,6 +121,7 @@ bool cRecMenuView::DisplayTimerConflict(int timerID) {
cTVGuideTimerConflict *conflict = timerConflicts->GetCurrentConflict();
if (!conflict)
return false;
delete activeMenu;
activeMenu = new cRecMenuTimerConflict(conflict, rmsIgnoreTimerConflict);
activeMenu->Display();
return true;
@@ -163,11 +164,16 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) {
if (cRecMenuAskFolder *menu = dynamic_cast<cRecMenuAskFolder*>(activeMenu)) {
recFolder = menu->GetFolder();
}
delete activeMenu;
cTimer *timer = recManager->createTimer(event, recFolder);
if (!DisplayTimerConflict(timer)) {
activeMenu = new cRecMenuConfirmTimer(event);
activeMenu->Display();
if (config.timerMessage) {
delete activeMenu;
activeMenu = new cRecMenuConfirmTimer(event);
activeMenu->Display();
} else {
Close();
state = osEnd;
}
}
break; }
case rmsInstantRecordFolder:
@@ -177,24 +183,49 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) {
activeMenu = new cRecMenuAskFolder(event, rmsInstantRecord);
activeMenu->Display();
break;
case rmsOnOffTimer: {
//caller: main menu
//De/Activate timer for active event
recManager->OnOffTimer(event);
if (config.timerMessage) {
delete activeMenu;
activeMenu = new cRecMenuConfirmTimer(event, true);
activeMenu->Display();
} else {
Close();
state = osEnd;
}
break; }
case rmsDeleteTimer: {
//caller: main menu
//delete timer for active event
delete activeMenu;
if (recManager->IsRecorded(event)) {
delete activeMenu;
activeMenu = new cRecMenuAskDeleteTimer(event);
activeMenu->Display();
} else {
recManager->DeleteTimer(event);
activeMenu = new cRecMenuConfirmDeleteTimer(event);
if (config.timerMessage) {
delete activeMenu;
activeMenu = new cRecMenuConfirmDeleteTimer(event);
activeMenu->Display();
} else {
Close();
state = osEnd;
}
}
activeMenu->Display();
break; }
case rmsDeleteTimerConfirmation: {
//delete running timer for active event
recManager->DeleteTimer(event);
delete activeMenu;
activeMenu = new cRecMenuConfirmDeleteTimer(event);
activeMenu->Display();
if (config.timerMessage) {
delete activeMenu;
activeMenu = new cRecMenuConfirmDeleteTimer(event);
activeMenu->Display();
} else {
Close();
state = osEnd;
}
break; }
case rmsEditTimer: {
//edit timer for active event
@@ -221,9 +252,14 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) {
case rmsIgnoreTimerConflict:
//caller: cRecMenuTimerConflict
//Confirming created Timer
delete activeMenu;
activeMenu = new cRecMenuConfirmTimer(event);
activeMenu->Display();
if (config.timerMessage) {
delete activeMenu;
activeMenu = new cRecMenuConfirmTimer(event);
activeMenu->Display();
} else {
Close();
state = osEnd;
}
break;
case rmsTimerConflictShowInfo: {
//caller: cRecMenuTimerConflict
@@ -273,10 +309,15 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) {
event = timers->Get(timerID)->Event();
#endif
recManager->DeleteTimer(event);
delete activeMenu;
if (!DisplayTimerConflict(timerID)) {
activeMenu = new cRecMenuConfirmDeleteTimer(event);
activeMenu->Display();
if (config.timerMessage) {
delete activeMenu;
activeMenu = new cRecMenuConfirmDeleteTimer(event);
activeMenu->Display();
} else {
Close();
state = osEnd;
}
}
break; }
case rmsEditTimerConflictMenu: {
@@ -315,10 +356,15 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) {
originalTimer = menu->GetOriginalTimer();
} else break;
recManager->SaveTimer(originalTimer, timerModified);
delete activeMenu;
if (!DisplayTimerConflict(originalTimer)) {
activeMenu = new cRecMenuConfirmTimer(originalTimer->Event(), true);
activeMenu->Display();
if (config.timerMessage) {
delete activeMenu;
activeMenu = new cRecMenuConfirmTimer(originalTimer->Event(), true);
activeMenu->Display();
} else {
Close();
state = osEnd;
}
}
break; }
/***************************************************************************************

View File

@@ -108,7 +108,8 @@ void cTvguideSetup::Store(void) {
SetupStore("footerHeightPercent", config.footerHeightPercent);
SetupStore("instRecFolderMode", config.instRecFolderMode);
SetupStore("instRecFixedFolder", config.instRecFixedFolder.c_str());
SetupStore("AddSubtitleToTimerMode", config.addSubtitleToTimer);
SetupStore("addSubtitleToTimer", config.addSubtitleToTimer);
SetupStore("timerMessage", config.timerMessage);
SetupStore("favWhatsOnNow", config.favWhatsOnNow);
SetupStore("favWhatsOnNext", config.favWhatsOnNext);
SetupStore("favUseTime1", config.favUseTime1);
@@ -432,6 +433,7 @@ void cMenuSetupFavorites::Set(void) {
Add(new cMenuEditStraItem(tr("Add episode to manual timers"), &tmpConfig->addSubtitleToTimer, 3, addSubtitleMode));
if (pRemoteTimers)
Add(new cMenuEditBoolItem(tr("Use Remotetimers"), &tmpConfig->useRemoteTimers));
Add(new cMenuEditBoolItem(tr("Show timer confirmation messages"), &tmpConfig->timerMessage));
Add(new cOsdItem(tr("Favorites:"), osUnknown, false));
Add(new cMenuEditBoolItem(tr("Limit channels in favorites"), &tmpConfig->favLimitChannels));
if (tmpConfig->favLimitChannels) {

View File

@@ -10,7 +10,6 @@
#include <vdr/plugin.h>
#include <vdr/skins.h>
#include "services/epgsearch.h"
#include "tools.h"
cPlugin *GetScraperPlugin(void) {
@@ -42,7 +41,7 @@ std::string utf8_substr(const std::string& str, unsigned int start, long unsigne
}
if (q<=start+leng || leng==std::string::npos){ max=i; }
if (min==std::string::npos || max==std::string::npos) { return ""; }
return str.substr(min,max);
return str.substr(min,max-min);
}
std::string CutText(std::string text, int width, const cFont *font) {

View File

@@ -27,7 +27,7 @@
#error "VDR-2.0.0 API version or greater is required!"
#endif
static const char *VERSION = "1.3.1";
static const char *VERSION = "1.3.4";
static const char *DESCRIPTION = tr("A fancy 2d EPG Viewer");
static const char *MAINMENUENTRY = "Tvguide";

29
view.c
View File

@@ -113,12 +113,18 @@ void cView::DrawHeader(void) {
}
}
//Date and Time, Title, Subtitle
int yDateTime = border / 2;
int yTitle = (headerHeight - fontHeaderLarge->Height()) / 2;
int ySubtitle = headerHeight - fontHeader->Height() - border / 3;
int textWidthMax = headerWidth - xText - border / 2;
wrapper.Set(title.c_str(), fontHeaderLarge, textWidthMax);
int lineHeight = fontHeaderLarge->Height();
int textLines = wrapper.Lines();
int yDateTime = border / 2;
int yTitle = (headerHeight - textLines * lineHeight) / 2;
int ySubtitle = headerHeight - fontHeader->Height() - border / 3;
pixmapHeader->DrawText(cPoint(xText, yDateTime), CutText(dateTime, textWidthMax, fontHeader).c_str(), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeader);
pixmapHeader->DrawText(cPoint(xText, yTitle), CutText(title, textWidthMax, fontHeaderLarge).c_str(), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeaderLarge);
for (int i = 0; i < textLines; i++) {
pixmapHeader->DrawText(cPoint(xText, yTitle + i * lineHeight), wrapper.GetLine(i), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeaderLarge);
}
pixmapHeader->DrawText(cPoint(xText, ySubtitle), CutText(subTitle, textWidthMax, fontHeader).c_str(), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeader);
//REC Icon
eTimerMatch timerMatch = tmNone;
@@ -216,7 +222,7 @@ void cView::DrawContent(std::string *text) {
wText.Set(text->c_str(), font, width - 2 * border);
int lineHeight = font->Height();
int textLines = wText.Lines();
int textHeight = lineHeight * textLines + 2*border;
int textHeight = lineHeight * textLines + 2 * border;
int yText = border;
CreateContent(textHeight);
for (int i=0; i < textLines; i++) {
@@ -246,14 +252,14 @@ void cView::DrawFloatingContent(std::string *infoText, cTvMedia *img, cTvMedia *
int lineHeight = font->Height();
int textLinesTall = wTextTall.Lines();
int textLinesFull = wTextFull.Lines();
int textHeight = lineHeight * (textLinesTall + textLinesFull) + 2*border;
int textHeight = lineHeight * (textLinesTall + textLinesFull) + 2 * border;
int yText = border;
CreateContent(max(textHeight, imgHeight + 2*border));
for (int i=0; i < textLinesTall; i++) {
CreateContent(std::max(textHeight, imgHeight + 2 * border));
for (int i = 0; i < textLinesTall; i++) {
pixmapContent->DrawText(cPoint(border, yText), wTextTall.GetLine(i), theme.Color(clrFont), clrTransparent, font);
yText += lineHeight;
}
for (int i=0; i < textLinesFull; i++) {
for (int i = 0; i < textLinesFull; i++) {
pixmapContent->DrawText(cPoint(border, yText), wTextFull.GetLine(i), theme.Color(clrFont), clrTransparent, font);
yText += lineHeight;
}
@@ -268,13 +274,13 @@ void cView::DrawFloatingContent(std::string *infoText, cTvMedia *img, cTvMedia *
osdManager.flush();
if (imgLoader.LoadPoster(img2->path.c_str(), imgWidth2, imgHeight2)) {
if (Running() && pixmapContent)
pixmapContent->DrawImage(cPoint(width - imgWidth2 - border, imgHeight + 2*border), imgLoader.GetImage());
pixmapContent->DrawImage(cPoint(width - imgWidth2 - border, imgHeight + 2 * border), imgLoader.GetImage());
}
}
void cView::CreateFloatingTextWrapper(cTextWrapper *twNarrow, cTextWrapper *twFull, std::string *text, int widthImg, int heightImg) {
int lineHeight = font->Height();
int linesNarrow = (heightImg + 2*border)/ lineHeight;
int linesNarrow = (heightImg + 2 * border)/ lineHeight;
int linesDrawn = 0;
int y = 0;
int widthNarrow = width - 3 * border - widthImg;
@@ -481,7 +487,6 @@ bool cView::KeyUp(void) {
if (!scrollable)
return false;
int aktHeight = pixmapContent->DrawPort().Point().Y();
// int lineHeight = font->Height();
if (aktHeight >= 0) {
return false;
}

1
view.h
View File

@@ -51,6 +51,7 @@ protected:
int contentHeight;
int tabHeight;
int scrollbarWidth;
cTextWrapper wrapper;
std::vector<std::string> tabs;
std::string title;
std::string subTitle;