40 matchCount(0), recCount(0),
41 last_record(QDateTime()),
50 recType(other.recType),
51 matchCount(other.matchCount),
52 recCount(other.recCount),
53 last_record(other.last_record),
54 avg_delay(other.avg_delay),
64 if (!ignore_non_serialized_data)
80 if (!ignore_non_serialized_data)
92 const ProgramInfo &other,
bool ignore_non_serialized_data)
96 if (!ignore_non_serialized_data)
120 bool showrerecord,
uint star_range)
const
123 progMap[
"title"] = (
title ==
"Default (Template)") ?
124 QObject::tr(
"Default (Template)") :
title;;
125 progMap[
"category"] = (
category ==
"Default") ?
148 if (finalA != finalB)
151 return finalA < finalB;
153 return finalA > finalB;
162 return typeA > typeB;
164 return typeA < typeB;
190 if (finalA != finalB)
193 return finalA < finalB;
195 return finalA > finalB;
204 return typeA > typeB;
206 return typeA < typeB;
235 return (typeA > typeB);
237 return (typeA < typeB);
243 if (finalA != finalB)
246 return finalA < finalB;
248 return finalA > finalB;
276 if (countA != countB)
279 return countA < countB;
281 return countA > countB;
284 if (recCountA != recCountB)
287 return recCountA < recCountB;
289 return recCountA > recCountB;
315 if (recCountA != recCountB)
318 return recCountA < recCountB;
320 return recCountA > recCountB;
323 if (countA != countB)
326 return countA < countB;
328 return countA > countB;
352 if (lastRecA != lastRecB)
355 return lastRecA < lastRecB;
357 return lastRecA > lastRecB;
404 m_programList(NULL), m_schedInfoText(NULL),
405 m_recPriorityText(NULL),
406 m_recPriorityBText(NULL), m_finalPriorityText(NULL),
407 m_lastRecordedText(NULL), m_lastRecordedDateText(NULL),
408 m_lastRecordedTimeText(NULL), m_channameText(NULL),
409 m_channumText(NULL), m_callsignText(NULL),
410 m_recProfileText(NULL), m_currentItem(NULL)
442 LOG(VB_GENERAL, LOG_ERR,
"Theme is missing critical theme elements.");
452 "rec_type|titlesubtitle|progpriority");
476 bool handled =
false;
480 for (
int i = 0; i < actions.size() && !handled; i++)
482 QString
action = actions[i];
485 if (action ==
"RANKINC")
487 else if (action ==
"RANKDEC")
489 else if (action ==
"ESCAPE")
498 else if (action ==
"1")
509 else if (action ==
"2")
520 else if (action ==
"4")
531 else if (action ==
"5")
544 else if (action ==
"6")
555 else if (action ==
"7")
566 else if (action ==
"8")
577 else if (action ==
"PREVVIEW" || action ==
"NEXTVIEW")
588 else if (action ==
"SELECT" || action ==
"EDIT")
593 else if (action ==
"MENU")
597 else if (action ==
"CUSTOMEDIT")
602 else if (action ==
"DELETE")
607 else if (action ==
"UPCOMING")
612 else if (action ==
"INFO" || action ==
"DETAILS")
626 QString label = tr(
"Options");
635 menuPopup->
AddButton(tr(
"Increase Priority"));
636 menuPopup->
AddButton(tr(
"Decrease Priority"));
637 menuPopup->
AddButton(tr(
"Sort"), NULL,
true);
638 menuPopup->
AddButton(tr(
"Program Details"));
642 menuPopup->
AddButton(tr(
"New Template"));
654 QString label = tr(
"Sort Options");
663 menuPopup->
AddButton(tr(
"Reverse Sort Order"));
664 menuPopup->
AddButton(tr(
"Sort By Title"));
665 menuPopup->
AddButton(tr(
"Sort By Priority"));
666 menuPopup->
AddButton(tr(
"Sort By Type"));
667 menuPopup->
AddButton(tr(
"Sort By Count"));
668 menuPopup->
AddButton(tr(
"Sort By Record Count"));
669 menuPopup->
AddButton(tr(
"Sort By Last Recorded"));
670 menuPopup->
AddButton(tr(
"Sort By Average Delay"));
686 QString resultid = dce->
GetId();
690 if (resultid ==
"menu")
692 if (resulttext == tr(
"Increase Priority"))
696 else if (resulttext == tr(
"Decrease Priority"))
700 else if (resulttext == tr(
"Sort"))
704 else if (resulttext == tr(
"Program Details"))
708 else if (resulttext == tr(
"Upcoming"))
713 else if (resulttext == tr(
"Custom Edit"))
718 else if (resulttext == tr(
"Delete Rule"))
723 else if (resulttext == tr(
"New Template"))
729 tr(
"Template Name"));
737 else if (resultid ==
"sortmenu")
739 if (resulttext == tr(
"Reverse Sort Order"))
744 else if (resulttext == tr(
"Sort By Title"))
755 else if (resulttext == tr(
"Sort By Priority"))
766 else if (resulttext == tr(
"Sort By Type"))
777 else if (resulttext == tr(
"Sort By Count"))
790 else if (resulttext == tr(
"Sort By Record Count"))
801 else if (resulttext == tr(
"Sort By Last Recorded"))
812 else if (resulttext == tr(
"Sort By Average Delay"))
824 else if (resultid ==
"deleterule")
827 qVariantValue<RecordingRule *>(dce->
GetData());
835 if (record->
Delete() && item)
838 LOG(VB_GENERAL, LOG_ERR,
839 "Failed to delete recording rule");
844 else if (resultid ==
"templatecat")
859 qVariantValue<ProgramRecPriorityInfo*>(item->
GetData());
874 connect(schededit, SIGNAL(ruleSaved(
int)), SLOT(
scheduleChanged(
int)));
875 connect(schededit, SIGNAL(ruleDeleted(
int)), SLOT(
scheduleChanged(
int)));
883 category = category.trimmed();
884 if (category.isEmpty())
888 QMap<int, ProgramRecPriorityInfo>::Iterator it;
894 Qt::CaseInsensitive) == 0)
912 connect(schededit, SIGNAL(ruleSaved(
int)), SLOT(
scheduleChanged(
int)));
913 connect(schededit, SIGNAL(ruleDeleted(
int)), SLOT(
scheduleChanged(
int)));
925 pgRecInfo = qVariantValue<ProgramRecPriorityInfo*>(item->
GetData());
929 if (!pgRecInfo || recid != pgRecInfo->
getRecordID())
961 query.
prepare(
"SELECT recpriority, type, inactive "
963 "WHERE recordid = :RECORDID");
969 else if (query.
next())
971 int recPriority = query.
value(0).toInt();
972 int rectype = query.
value(1).toInt();
973 int inactive = query.
value(2).toInt();
1002 qVariantValue<ProgramRecPriorityInfo*>(item->
GetData());
1014 qVariantValue<ProgramRecPriorityInfo*>(item->
GetData());
1019 .compare(
"Default", Qt::CaseInsensitive) == 0))
1026 if (!record->
Load())
1032 QString message = tr(
"Delete '%1' %2 rule?").arg(record->
m_title)
1041 okPopup->
SetData(qVariantFromValue(record));
1056 qVariantValue<ProgramRecPriorityInfo*>(item->
GetData());
1062 query.
prepare(
"SELECT inactive "
1064 "WHERE recordid = :RECID");
1072 else if (query.
next())
1074 int inactive = query.
value(0).toInt();
1080 query.
prepare(
"UPDATE record "
1081 "SET inactive = :INACTIVE "
1082 "WHERE recordid = :RECID");
1089 "Update recording schedule inactive query", query);
1094 QString(
"DeactivateRule %1 %2")
1111 qVariantValue<ProgramRecPriorityInfo*>(item->
GetData());
1131 QString trimTitle = pgRecInfo->
title;
1132 trimTitle.remove(QRegExp(
" \\(.*\\)$"));
1162 qVariantValue<ProgramRecPriorityInfo*>(item->
GetData());
1167 int tempRecPriority;
1170 if (tempRecPriority > -100 && tempRecPriority < 100)
1182 item->
SetText(QString::number(progRecPriority),
"progpriority");
1183 item->
SetText(QString::number(progRecPriority),
"recpriority");
1187 item->
SetText(QString::number(progRecPriority),
"recpriorityB");
1191 item->
SetText(QString::number(progRecPriority),
"finalpriority");
1200 QMap<int, ProgramRecPriorityInfo>::Iterator it;
1217 vector<ProgramInfo *> recordinglist;
1223 vector<ProgramInfo *>::iterator pgiter = recordinglist.begin();
1225 for (; pgiter != recordinglist.end(); ++pgiter)
1234 (*pgiter)->GetRecordingPriority();
1244 result.
prepare(
"SELECT recordid, title, chanid, starttime, startdate, "
1245 "type, inactive, last_record, avg_delay, profile "
1252 else if (result.
next())
1256 uint recordid = result.
value(0).toUInt();
1257 QString title = result.
value(1).toString();
1258 QString chanid = result.
value(2).toString();
1259 QString tempTime = result.
value(3).toString();
1260 QString tempDate = result.
value(4).toString();
1262 int inactive = result.
value(6).toInt();
1264 int avgd = result.
value(8).toInt();
1269 QMap<int, ProgramRecPriorityInfo>::Iterator it;
1276 progInfo->
sortTitle.remove(QRegExp(tr(
"^(The |A |An )")));
1298 }
while (result.
next());
1313 for (; it != schedList.
end(); ++it)
1315 const RecStatusType recstatus = (**it).GetRecordingStatus();
1316 const uint recordid = (**it).GetRecordingRuleID();
1317 if ((**it).GetRecordingEndTime() > now && recstatus !=
rsNotListed)
1342 qVariantValue<ProgramRecPriorityInfo*>(item->
GetData());
1345 QMap<int, ProgramRecPriorityInfo>::Iterator pit;
1346 vector<ProgramRecPriorityInfo *>::iterator sit;
1400 vector<ProgramRecPriorityInfo*>::iterator it;
1407 qVariantFromValue(progInfo));
1439 progInfo->
ToMap(infoMap);
1443 if (progInfo->
subtitle !=
"(null)" &&
1454 matchInfo = QString(
"%1 %2")
1460 matchInfo = tr(
"Recording %1 of %2")
1464 subtitle = QString(
"(%1) %2").arg(matchInfo).arg(subtitle);
1465 item->
SetText(subtitle,
"scheduleinfo", state);
1467 item->
SetText(QString::number(progRecPriority),
"progpriority", state);
1468 item->
SetText(QString::number(progRecPriority),
"finalpriority", state);
1470 item->
SetText(QString::number(progRecPriority),
"recpriority", state);
1471 item->
SetText(QString::number(progRecPriority),
"recpriorityB", state);
1476 item->
SetText(tempDateTime,
"lastrecorded", state);
1480 item->
SetText(tempDate,
"lastrecordeddate", state);
1483 item->
SetText(tempTime,
"lastrecordedtime", state);
1485 QString channame = progInfo->
channame;
1490 channame = tr(
"Any");
1491 item->
SetText(channame,
"channel", state);
1492 QString channum = progInfo->
chanstr;
1497 channum = tr(
"Any");
1498 item->
SetText(channum,
"channum", state);
1499 QString callsign = progInfo->
chansign;
1504 callsign = tr(
"Any");
1505 item->
SetText(callsign,
"callsign", state);
1508 if ((profile ==
"Default") || (profile ==
"Live TV") ||
1509 (profile ==
"High Quality") || (profile ==
"Low Quality"))
1510 profile = tr(profile.toUtf8().constData());
1511 item->
SetText(profile,
"recordingprofile", state);
1523 if (norecordingText)
1541 if (pgRecInfo->
subtitle !=
"(null)" &&
1552 matchInfo = QString(
"%1 %2")
1558 matchInfo = tr(
"Recording %1 of %2")
1562 subtitle = QString(
"(%1) %2").arg(matchInfo).arg(subtitle);
1565 pgRecInfo->
ToMap(infoMap);
1605 QString channame = pgRecInfo->
channame;
1610 channame = tr(
"Any");
1616 QString channum = pgRecInfo->
chanstr;
1621 channum = tr(
"Any");
1627 QString callsign = pgRecInfo->
chansign;
1632 callsign = tr(
"Any");
1639 if ((profile ==
"Default") || (profile ==
"Live TV") ||
1640 (profile ==
"High Quality") || (profile ==
"Low Quality"))
1641 profile = tr(profile.toUtf8().constData());
1658 QMap<int, ProgramRecPriorityInfo>::iterator it;