mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
*CTimerList: show warnings on overlapping recording only in single mode
NOTE: Only tested on single box by me, please send feedback
This commit is contained in:
@@ -66,6 +66,7 @@
|
||||
|
||||
#include <zapit/getservices.h>
|
||||
#include <zapit/bouquets.h>
|
||||
#include <zapit/femanager.h>
|
||||
|
||||
#include <eitd/sectionsd.h>
|
||||
|
||||
@@ -1210,51 +1211,55 @@ int CTimerList::newTimer()
|
||||
|
||||
bool askUserOnTimerConflict(time_t announceTime, time_t stopTime)
|
||||
{
|
||||
CTimerdClient Timer;
|
||||
CTimerd::TimerList overlappingTimers = Timer.getOverlappingTimers(announceTime,stopTime);
|
||||
//printf("[CTimerdClient] attention\n%d\t%d\t%d conflicts with:\n",timerNew.announceTime,timerNew.alarmTime,timerNew.stopTime);
|
||||
if (CFEManager::getInstance()->getMode() == CFEManager::FE_MODE_SINGLE){
|
||||
CTimerdClient Timer;
|
||||
CTimerd::TimerList overlappingTimers = Timer.getOverlappingTimers(announceTime,stopTime);
|
||||
//printf("[CTimerdClient] attention\n%d\t%d\t%d conflicts with:\n",timerNew.announceTime,timerNew.alarmTime,timerNew.stopTime);
|
||||
|
||||
std::string timerbuf = g_Locale->getText(LOCALE_TIMERLIST_OVERLAPPING_TIMER);
|
||||
timerbuf += "\n";
|
||||
for (CTimerd::TimerList::iterator it = overlappingTimers.begin();
|
||||
it != overlappingTimers.end(); ++it)
|
||||
{
|
||||
timerbuf += CTimerList::convertTimerType2String(it->eventType);
|
||||
timerbuf += " (";
|
||||
timerbuf += CTimerList::convertChannelId2String(it->channel_id); // UTF-8
|
||||
if (it->epgID != 0)
|
||||
{
|
||||
CEPGData epgdata;
|
||||
if (CEitManager::getInstance()->getEPGid(it->epgID, it->epg_starttime, &epgdata))
|
||||
{
|
||||
timerbuf += ":";
|
||||
timerbuf += epgdata.title;
|
||||
}
|
||||
else if (strlen(it->epgTitle)!=0)
|
||||
{
|
||||
timerbuf += ":";
|
||||
timerbuf += it->epgTitle;
|
||||
}
|
||||
}
|
||||
timerbuf += ")";
|
||||
|
||||
timerbuf += ":\n";
|
||||
char at[25] = {0};
|
||||
struct tm *annTime = localtime(&(it->announceTime));
|
||||
strftime(at,20,"%d.%m. %H:%M",annTime);
|
||||
timerbuf += at;
|
||||
timerbuf += " - ";
|
||||
|
||||
char st[25] = {0};
|
||||
struct tm *sTime = localtime(&(it->stopTime));
|
||||
strftime(st,20,"%d.%m. %H:%M",sTime);
|
||||
timerbuf += st;
|
||||
std::string timerbuf = g_Locale->getText(LOCALE_TIMERLIST_OVERLAPPING_TIMER);
|
||||
timerbuf += "\n";
|
||||
//printf("%d\t%d\t%d\n",it->announceTime,it->alarmTime,it->stopTime);
|
||||
}
|
||||
//printf("message:\n%s\n",timerbuf.c_str());
|
||||
// todo: localize message
|
||||
//g_Locale->getText(TIMERLIST_OVERLAPPING_MESSAGE);
|
||||
for (CTimerd::TimerList::iterator it = overlappingTimers.begin();
|
||||
it != overlappingTimers.end(); ++it)
|
||||
{
|
||||
timerbuf += CTimerList::convertTimerType2String(it->eventType);
|
||||
timerbuf += " (";
|
||||
timerbuf += CTimerList::convertChannelId2String(it->channel_id); // UTF-8
|
||||
if (it->epgID != 0)
|
||||
{
|
||||
CEPGData epgdata;
|
||||
if (CEitManager::getInstance()->getEPGid(it->epgID, it->epg_starttime, &epgdata))
|
||||
{
|
||||
timerbuf += ":";
|
||||
timerbuf += epgdata.title;
|
||||
}
|
||||
else if (strlen(it->epgTitle)!=0)
|
||||
{
|
||||
timerbuf += ":";
|
||||
timerbuf += it->epgTitle;
|
||||
}
|
||||
}
|
||||
timerbuf += ")";
|
||||
|
||||
return (ShowMsgUTF(LOCALE_MESSAGEBOX_INFO,timerbuf,CMessageBox::mbrNo,CMessageBox::mbNo|CMessageBox::mbYes) == CMessageBox::mbrYes);
|
||||
timerbuf += ":\n";
|
||||
char at[25] = {0};
|
||||
struct tm *annTime = localtime(&(it->announceTime));
|
||||
strftime(at,20,"%d.%m. %H:%M",annTime);
|
||||
timerbuf += at;
|
||||
timerbuf += " - ";
|
||||
|
||||
char st[25] = {0};
|
||||
struct tm *sTime = localtime(&(it->stopTime));
|
||||
strftime(st,20,"%d.%m. %H:%M",sTime);
|
||||
timerbuf += st;
|
||||
timerbuf += "\n";
|
||||
//printf("%d\t%d\t%d\n",it->announceTime,it->alarmTime,it->stopTime);
|
||||
}
|
||||
//printf("message:\n%s\n",timerbuf.c_str());
|
||||
// todo: localize message
|
||||
//g_Locale->getText(TIMERLIST_OVERLAPPING_MESSAGE);
|
||||
|
||||
return (ShowMsgUTF(LOCALE_MESSAGEBOX_INFO,timerbuf,CMessageBox::mbrNo,CMessageBox::mbNo|CMessageBox::mbYes) == CMessageBox::mbrYes);
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user