MythTV master
prevreclist.cpp
Go to the documentation of this file.
1/*
2 * Copyright (c) 2017 Peter G Bennett <pbennett@mythtv.org>
3 *
4 * This file is part of MythTV.
5 *
6 * MythTV is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Public License as
8 * published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * MythTV is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with MythTV. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20// C/C++
21#include <algorithm>
22#include <deque> // for _Deque_iterator, operator-, etc
23#include <iterator> // for reverse_iterator
24
25// QT
26#include <QChar> // Fix Qt6 GCC SFINAE warning
27#include <QDateTime>
28#include <QString>
29
30//MythTV
32#include "libmythbase/mythdb.h"
44#include "libmythui/mythuiutils.h" // for UIUtilE, UIUtilW
46
47// MythFrontend
48#include "prevreclist.h"
49
50#define LOC QString("PrevRecordedList: ")
51
52// flags for PrevRecSortFlags setting
53static const int fTitleGroup = 1;
54static const int fReverseSort = 2;
55static const int fDefault = fReverseSort;
56
58 QString title) :
59 ScheduleCommon(parent,"PrevRecordedList"),
60 m_recid(recid),
61 m_title(std::move(title))
62{
63
64 if (m_recid && !m_title.isEmpty())
65 {
66 m_where = QString(" AND ( recordid = %1 OR title = :MTITLE )")
67 .arg(m_recid);
68 }
69 else if (!m_title.isEmpty())
70 {
71 m_where = QString("AND title = :MTITLE ");
72 }
73 else if (m_recid)
74 {
75 m_where = QString("AND recordid = %1 ").arg(m_recid);
76 }
77 else
78 {
79 // Get sort options if this is not a filtered list
80 int flags = gCoreContext->GetNumSetting("PrevRecSortFlags",fDefault);
81 m_titleGroup = ((flags & fTitleGroup) != 0);
82 m_reverseSort = ((flags & fReverseSort) != 0);
83
84 }
85}
86
88{
89 if (m_where.isEmpty())
90 {
91 // Save sort setting if this is not a filtered list
92 int flags = 0;
93 if (m_titleGroup)
94 flags |= fTitleGroup;
95 if (m_reverseSort)
96 flags |= fReverseSort;
97 gCoreContext->SaveSetting("PrevRecSortFlags", flags);
98 }
102}
103
105{
106 if (!LoadWindowFromXML("schedule-ui.xml", "prevreclist", this))
107 return false;
108
109 bool err = false;
110 UIUtilE::Assign(this, m_titleList, "titles", &err);
111 UIUtilE::Assign(this, m_showList, "shows", &err);
112 UIUtilW::Assign(this, m_help1Text, "help1text");
113 UIUtilW::Assign(this, m_help2Text, "help2text");
114 UIUtilW::Assign(this, m_curviewText, "curview");
115
116 if (err)
117 {
118 LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'prevreclist'");
119 return false;
120 }
121
122 m_titleList->SetLCDTitles(tr("Programs"), "title");
123 m_showList->SetLCDTitles(tr("Episodes"), "startdate|parttitle");
124
127 m_loadShows = false;
129
130 return true;
131}
132
134{
144
146 updateInfo();
147}
148
149// When m_loadShows is false we are loading the left hand
150// button list, when it is true the right hand.
152{
153 if (m_loadShows)
154 {
155 if (m_titleGroup)
157 else
159 }
160 else
161 {
162 if (m_titleGroup)
163 LoadTitles();
164 else
165 LoadDates();
166 }
167 auto *slce = new ScreenLoadCompletionEvent(objectName());
168 QCoreApplication::postEvent(this, slce);
169}
170
171static bool comp_sorttitle_lt(const ProgramInfo *a, const ProgramInfo *b)
172{
174}
175
176static bool comp_sorttitle_lt_rev(const ProgramInfo *a, const ProgramInfo *b)
177{
179}
180
182 const ProgramInfo *a, const ProgramInfo *b)
183{
185}
186
188 const ProgramInfo *a, const ProgramInfo *b)
189{
191}
192
193// Load a list of titles without subtitle or other info.
194// each title can represent multiple recordings.
196{
197 QString querystr = "SELECT DISTINCT title FROM oldrecorded "
198 "WHERE oldrecorded.future = 0 " + m_where;
199
201
203 query.prepare(querystr);
204
205 if (!m_title.isEmpty())
206 query.bindValue(":MTITLE", m_title);
207
208 if (!query.exec())
209 {
210 MythDB::DBError("PrevRecordedList::LoadTitles", query);
211 return false;
212 }
213
214 while (query.next())
215 {
216 QString title(query.value(0).toString());
217 auto *program = new ProgramInfo();
218 program->SetTitle(title);
219 m_titleData.push_back(program);
220 }
221 if (m_reverseSort)
222 std::ranges::stable_sort(m_titleData, comp_sorttitle_lt_rev);
223 else
224 std::ranges::stable_sort(m_titleData, comp_sorttitle_lt);
225 return true;
226}
227
229{
230 QString querystr = "SELECT DISTINCT "
231 "YEAR(CONVERT_TZ(starttime,'UTC','SYSTEM')), "
232 "MONTH(CONVERT_TZ(starttime,'UTC','SYSTEM')) "
233 "FROM oldrecorded "
234 "WHERE oldrecorded.future = 0 " + m_where;
235
237
239 query.prepare(querystr);
240
241 if (!m_title.isEmpty())
242 query.bindValue(":MTITLE", m_title);
243
244 if (!query.exec())
245 {
246 MythDB::DBError("PrevRecordedList::LoadDates", query);
247 return false;
248 }
249
250 // Create "Last two weeks" entry
251 // It is identified by bogus date of 0000/00
252
253 auto *program = new ProgramInfo();
254 program->SetRecordingStartTime(QDateTime::currentDateTime());
255 program->SetTitle(tr("Last two weeks"), "0000/00");
256 m_titleData.push_back(program);
257
258 while (query.next())
259 {
260 int year(query.value(0).toInt());
261 int month(query.value(1).toInt());
262 program = new ProgramInfo();
263 QDate startdate(year,month,1);
264 QDateTime starttime = startdate.startOfDay();
265 program->SetRecordingStartTime(starttime);
266 QString date = QString("%1/%2")
267 .arg(year,4,10,QChar('0')).arg(month,2,10,QChar('0'));
268 QLocale locale = gCoreContext->GetLocale()->ToQLocale();
269 QString title = QString("%1 %2").
270 arg(locale.monthName(month)).arg(year);
271 program->SetTitle(title, date);
272 m_titleData.push_back(program);
273 }
274 if (m_reverseSort)
275 std::ranges::stable_sort(m_titleData, comp_sortdate_lt_rev);
276 else
277 std::ranges::stable_sort(m_titleData, comp_sortdate_lt);
278 return true;
279}
280
282{
284}
285
287{
289}
290
292 ProgramList *progData, bool isShows) const
293{
294 bnList->Reset();
295 for (auto *pg : *progData)
296 {
297 auto *item = new MythUIButtonListItem(bnList, "",
298 QVariant::fromValue(pg));
299 InfoMap infoMap;
300 pg->ToMap(infoMap,true);
301 QString state;
302 if (isShows)
303 {
304 QString partTitle;
305 if (m_titleGroup)
306 partTitle = infoMap["subtitle"];
307 else
308 partTitle = infoMap["titlesubtitle"];
309 infoMap["parttitle"] = partTitle;
310 state = RecStatus::toUIState(pg->GetRecordingStatus());
311 if ((state == "warning"))
312 state = "disabled";
313 }
314 else
315 {
316 infoMap["buttontext"] = infoMap["title"];
317 }
318
319 item->SetTextFromMap(infoMap, state);
320 }
321}
322
324{
325 if (m_help1Text)
327 if (m_help2Text)
329
330 if (!m_showData.empty())
331 {
332 InfoMap infoMap;
333 m_showData[m_showList->GetCurrentPos()]->ToMap(infoMap,true);
334 SetTextFromMap(infoMap);
335 m_infoMap = infoMap;
336 }
337 else
338 {
340
341 if (m_titleGroup)
342 {
343 m_titleList->SetLCDTitles(tr("Programs"), "title");
344 m_showList->SetLCDTitles(tr("Episodes"), "startdate|parttitle");
345 if (m_help1Text)
346 m_help1Text->SetText(tr("Select a program..."));
347 if (m_help2Text)
348 {
350 "Select the title of the program you wish to find. "
351 "When finished return with the left arrow key. "
352 "To search by date press 1."));
353 }
354 if (m_curviewText)
355 {
356 if (m_reverseSort)
357 m_curviewText->SetText(tr("Reverse Title","Sort sequence"));
358 else
359 m_curviewText->SetText(tr("Title","Sort sequence"));
360 }
361 }
362 else
363 {
364 m_titleList->SetLCDTitles(tr("Dates"), "title");
365 m_showList->SetLCDTitles(tr("Programs"), "startdate|parttitle");
366 if (m_help1Text)
367 m_help1Text->SetText(tr("Select a month ..."));
368 if (m_help2Text)
369 {
371 "Select a month to search. "
372 "When finished return with the left arrow key. "
373 "To search by title press 2."));
374 }
375 if (m_curviewText)
376 {
377 if (m_reverseSort)
378 m_curviewText->SetText(tr("Reverse Time","Sort sequence"));
379 else
380 m_curviewText->SetText(tr("Time","Sort sequence"));
381 }
382 }
383 }
384}
385
387{
389 m_showList->Reset();
390 updateInfo();
391}
392
394{
395 m_loadShows = true;
397}
398
400{
401 MSqlBindings bindings;
402 QString sql = " AND oldrecorded.title = :TITLE " + m_where;
403 uint selected = m_titleList->GetCurrentPos();
404 if (selected < m_titleData.size() && (m_titleData[selected] != nullptr))
405 bindings[":TITLE"] = m_titleData[selected]->GetTitle();
406 else
407 bindings[":TITLE"] = "";
408 if (!m_title.isEmpty())
409 bindings[":MTITLE"] = m_title;
411 LoadFromOldRecorded(m_showData, sql, bindings);
412}
413
415{
416 MSqlBindings bindings;
417 int selected = m_titleList->GetCurrentPos();
418 if (m_titleData[selected] == nullptr)
419 {
420 LOG(VB_GENERAL, LOG_ERR, LOC +
421 QString("Invalid selection in title data: %1").arg(selected));
422 return;
423 }
424 QString sortTitle = m_titleData[selected]->GetSortTitle();
425 QStringList dateParts = sortTitle.split('/');
426 if (dateParts.size() != 2)
427 {
428 LOG(VB_GENERAL, LOG_ERR, LOC +
429 QString("Invalid sort Date: %1").arg(sortTitle));
430 return;
431 }
432 QString sortorder;
433 if (m_reverseSort)
434 sortorder = "DESC";
435 QString sql;
436 if (dateParts[0] == "0000")
437 {
438 sql = "AND TIMESTAMPDIFF(DAY, starttime, NOW()) < 14 ";
439 }
440 else
441 {
442 sql =
443 " AND YEAR(CONVERT_TZ(starttime,'UTC','SYSTEM')) = :YEAR "
444 " AND MONTH(CONVERT_TZ(starttime,'UTC','SYSTEM')) = :MONTH ";
445 bindings[":YEAR"] = dateParts[0];
446 bindings[":MONTH"] = dateParts[1];
447 }
448 sql = sql + m_where + QString(" ORDER BY starttime %1 ").arg(sortorder);
449 if (!m_title.isEmpty())
450 bindings[":MTITLE"] = m_title;
452 LoadFromOldRecorded(m_showData, sql, bindings);
453}
454
456{
457 if (!m_allowEvents)
458 return true;
459
461 {
462 m_allowEvents = true;
463 return true;
464 }
465
466 m_allowEvents = false;
467
468 QStringList actions;
469 bool handled = GetMythMainWindow()->TranslateKeyPress(
470 "TV Frontend", e, actions);
471
472 bool needUpdate = false;
473 for (uint i = 0; i < uint(actions.size()) && !handled; ++i)
474 {
475 const QString& action = actions[i];
476 handled = true;
477
478 if (action == "CUSTOMEDIT") {
479 EditCustom();
480 } else if (action == "EDIT") {
482 } else if (action == "DELETE") {
484 } else if (action == "DETAILS" || action == "INFO") {
485 ShowDetails();
486 } else if (action == "GUIDE") {
487 ShowGuide();
488 } else if (action == "UPCOMING") {
489 ShowUpcoming();
490 } else if (action == "1") {
491 if (m_titleGroup)
492 {
493 m_titleGroup = false;
494 m_reverseSort = true;
495 }
496 else
497 {
499 }
500 needUpdate = true;
501 } else if (action == "2") {
502 if (!m_titleGroup)
503 {
504 m_titleGroup = true;
505 m_reverseSort = false;
506 }
507 else
508 {
510 }
511 needUpdate = true;
512 } else {
513 handled = false;
514 }
515 }
516
517 if (!handled && MythScreenType::keyPressEvent(e))
518 handled = true;
519
520 if (needUpdate)
521 {
522 m_loadShows = false;
524 }
525
526 m_allowEvents = true;
527
528 return handled;
529}
530
532{
533 auto *sortMenu = new MythMenu(tr("Sort Options"), this, "sortmenu");
534 sortMenu->AddItem(tr("Reverse Sort Order"));
535 sortMenu->AddItem(tr("Sort By Title"));
536 sortMenu->AddItem(tr("Sort By Time"));
537
538 auto *menu = new MythMenu(tr("List Options"), this, "menu");
539
540 menu->AddItem(tr("Sort"), nullptr, sortMenu);
541
543 if (pi)
544 {
545 menu->AddItem(tr("Edit Schedule"), qOverload<>(&PrevRecordedList::EditScheduled));
546 menu->AddItem(tr("Custom Edit"), &PrevRecordedList::EditCustom);
547 menu->AddItem(tr("Program Details"), &PrevRecordedList::ShowDetails);
548 menu->AddItem(tr("Upcoming"), qOverload<>(&PrevRecordedList::ShowUpcoming));
549 menu->AddItem(tr("Channel Search"), &PrevRecordedList::ShowChannelSearch);
550 }
551 menu->AddItem(tr("Program Guide"), &PrevRecordedList::ShowGuide);
552 MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
553 auto *menuPopup = new MythDialogBox(menu, popupStack, "menuPopup");
554
555 if (!menuPopup->Create())
556 {
557 delete menuPopup;
558 return;
559 }
560
561 popupStack->AddScreen(menuPopup);
562}
563
565{
566 auto *menu = new MythMenu(tr("Recording Options"), this, "menu");
567
569 if (pi)
570 {
571 if (pi->IsDuplicate())
572 menu->AddItem(tr("Allow this episode to re-record"), &PrevRecordedList::AllowRecord);
573 else
574 menu->AddItem(tr("Never record this episode"), &PrevRecordedList::PreventRecord);
575 menu->AddItem(tr("Remove this episode from the list"),
577 menu->AddItem(tr("Remove all episodes for this title"),
579 }
580 MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
581 auto *menuPopup = new MythDialogBox(menu, popupStack, "menuPopup");
582
583 if (!menuPopup->Create())
584 {
585 delete menuPopup;
586 return;
587 }
588
589 popupStack->AddScreen(menuPopup);
590}
591
593{
594 bool needUpdate = false;
595
596 if (event->type() == DialogCompletionEvent::kEventType)
597 {
598 auto *dce = (DialogCompletionEvent*)event;
599
600 QString resultid = dce->GetId();
601// QString resulttext = dce->GetResultText();
602 int buttonnum = dce->GetResult();
603
604 if (resultid == "sortmenu")
605 {
606 switch (buttonnum)
607 {
608 case 0:
610 needUpdate = true;
611 break;
612 case 1:
613 m_titleGroup = true;
614 m_reverseSort = false;
615 needUpdate = true;
616 break;
617 case 2:
618 m_titleGroup = false;
619 m_reverseSort = true;
620 needUpdate = true;
621 break;
622 }
623 }
624 else if (resultid == "deleterule")
625 {
626 auto *record = dce->GetData().value<RecordingRule *>();
627 if (record && buttonnum > 0 && !record->Delete())
628 {
629 LOG(VB_GENERAL, LOG_ERR, LOC +
630 "Failed to delete recording rule");
631 }
632 delete record;
633 }
634 else
635 {
637 }
638 }
639 else if (event->type() == ScreenLoadCompletionEvent::kEventType)
640 {
641 auto *slce = (ScreenLoadCompletionEvent*)event;
642 QString id = slce->GetId();
643
644 if (id == objectName())
645 {
646 // CloseBusyPopup(); // opened by LoadInBackground()
647 if (m_loadShows)
648 {
650 CloseBusyPopup(); // opened by LoadInBackground()
651 }
652 else
653 {
656 m_showList->Reset();
657 updateInfo();
658 CloseBusyPopup(); // opened by LoadInBackground()
660 }
661 }
662 }
663
664 if (needUpdate)
665 {
666 m_loadShows = false;
668 }
669}
670
672{
674 if (pi)
675 {
676 int pos = m_showList->GetCurrentPos();
677 RecordingInfo ri(*pi);
678 ri.ForgetHistory();
680 updateInfo();
682 }
683}
684
686{
688 if (pi)
689 {
690 int pos = m_showList->GetCurrentPos();
691 RecordingInfo ri(*pi);
692 ri.SetDupHistory();
694 updateInfo();
696 }
697}
698
699
701{
702 int pos = m_showList->GetCurrentPos();
703 if (pos >= 0 && pos < (int) m_showData.size())
704 return m_showData[pos];
705 return nullptr;
706}
707
709{
711
712 if (!pi)
713 return;
714
715 QString message = tr("Delete this episode of '%1' from the previously recorded history?").arg(pi->GetTitle());
716
717 ShowOkPopup(message, this, &PrevRecordedList::DeleteOldEpisode, true);
718}
719
721{
723 if (!ok || !pi)
724 return;
725
727 query.prepare(
728 "DELETE FROM oldrecorded "
729 "WHERE chanid = :CHANID AND "
730 " starttime = :STARTTIME");
731 query.bindValue(":CHANID", pi->GetChanID());
732 query.bindValue(":STARTTIME", pi->GetScheduledStartTime());
733
734 if (!query.exec())
735 MythDB::DBError("ProgLister::DeleteOldEpisode", query);
736
737 ScheduledRecording::RescheduleCheck(*pi, "DeleteOldEpisode");
738
739 // Delete the current item from both m_showData and m_showList.
740 auto it = m_showData.begin() + m_showList->GetCurrentPos();
741 m_showData.erase(it);
743 m_showList->RemoveItem(item);
744}
745
747{
749
750 if (!pi)
751 return;
752
753 QString message = tr("Delete all episodes of '%1' from the previously recorded history?").arg(pi->GetTitle());
754
755 ShowOkPopup(message, this, &PrevRecordedList::DeleteOldSeries, true);
756}
757
759{
761 if (!ok || !pi)
762 return;
763 QString title = pi->GetTitle();
764
766 query.prepare("DELETE FROM oldrecorded "
767 "WHERE title = :TITLE "
768 " AND recstatus <> :PENDING "
769 " AND recstatus <> :TUNING "
770 " AND recstatus <> :RECORDING "
771 " AND recstatus <> :FAILING "
772 " AND future = 0");
773 query.bindValue(":TITLE", title);
774 query.bindValue(":PENDING", RecStatus::Pending);
775 query.bindValue(":TUNING", RecStatus::Tuning);
776 query.bindValue(":RECORDING", RecStatus::Recording);
777 query.bindValue(":FAILING", RecStatus::Failing);
778 if (!query.exec())
779 MythDB::DBError("ProgLister::DeleteOldSeries -- delete", query);
780
781 // Set the programid to the special value of "**any**" which the
782 // scheduler recognizes to mean the entire series was deleted.
783 RecordingInfo tempri(*pi);
784 tempri.SetProgramID("**any**");
785 ScheduledRecording::RescheduleCheck(tempri, "DeleteOldSeries");
786
787 // Delete the matching items from both m_showData and m_showList.
788 int pos = 0;
789 auto it = m_showData.begin();
790 while (pos < (int)m_showData.size())
791 {
792 if ((*it)->GetTitle() == title
793 && (*it)->GetRecordingStatus() != RecStatus::Pending
794 && (*it)->GetRecordingStatus() != RecStatus::Tuning
795 && (*it)->GetRecordingStatus() != RecStatus::Recording
796 && (*it)->GetRecordingStatus() != RecStatus::Failing)
797 {
798 LOG(VB_GENERAL, LOG_INFO, QString("Deleting %1 at pos %2")
799 .arg(title).arg(pos));
800 it = m_showData.erase(it);
802 m_showList->RemoveItem(item);
803 }
804 else
805 {
806 ++pos;
807 ++it;
808 }
809 }
810}
811
812#include "moc_prevreclist.cpp"
void clear(void)
iterator erase(const iterator &it)
iterator begin(void)
bool empty(void) const
void push_back(T info)
size_t size(void) const
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
Definition: mythdialogbox.h:40
static const Type kEventType
Definition: mythdialogbox.h:55
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:129
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
Definition: mythdbcon.cpp:839
QVariant value(int i) const
Definition: mythdbcon.h:205
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:620
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
Definition: mythdbcon.cpp:890
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
Definition: mythdbcon.cpp:814
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:552
void SaveSetting(const QString &key, int newValue)
int GetNumSetting(const QString &key, int defaultval=0)
MythLocale * GetLocale(void) const
static void DBError(const QString &where, const MSqlQuery &query)
Definition: mythdb.cpp:225
Basic menu dialog, message and a list of options.
QLocale ToQLocale() const
Definition: mythlocale.h:29
bool TranslateKeyPress(const QString &Context, QKeyEvent *Event, QStringList &Actions, bool AllowJumps=true)
Get a list of actions for a keypress in the given context.
MythScreenStack * GetStack(const QString &Stackname)
void addListener(QObject *listener)
Add a listener to the observable.
void removeListener(QObject *listener)
Remove a listener to the observable.
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
void LoadInBackground(const QString &message="")
void BuildFocusList(void)
MythUIType * GetFocusWidget(void) const
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
bool SetFocusWidget(MythUIType *widget=nullptr)
void CloseBusyPopup(void)
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
void SetLCDTitles(const QString &title, const QString &columnList="")
MythUIButtonListItem * GetItemCurrent() const
void SetItemCurrent(MythUIButtonListItem *item)
void RemoveItem(MythUIButtonListItem *item)
void Reset() override
Reset the widget to it's original state, should not reset changes made by the theme.
int GetCurrentPos() const
void itemClicked(MythUIButtonListItem *item)
MythUIButtonListItem * GetItemAt(int pos) const
void itemSelected(MythUIButtonListItem *item)
virtual void SetTextFromMap(const InfoMap &infoMap)
virtual void ResetMap(const InfoMap &infoMap)
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: mythuitext.cpp:65
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:115
void TakingFocus(void)
void LosingFocus(void)
void Load(void) override
Load data which will ultimately be displayed on-screen or used to determine what appears on-screen (S...
void UpdateShowList(void)
MythUIButtonList * m_showList
Definition: prevreclist.h:77
void customEvent(QEvent *event) override
void LoadShowsByTitle(void)
void UpdateList(MythUIButtonList *bnList, ProgramList *progData, bool isShows) const
void PreventRecord(void)
bool LoadTitles(void)
~PrevRecordedList() override
Definition: prevreclist.cpp:87
void updateInfo(void)
void Init(void) override
Used after calling Load() to assign data to widgets and other UI initilisation which is prohibited in...
bool Create(void) override
MythUIText * m_help2Text
Definition: prevreclist.h:82
void UpdateTitleList(void)
void ShowDeleteOldSeriesMenu(void)
PrevRecordedList(MythScreenStack *parent, uint recid=0, QString title=QString())
Definition: prevreclist.cpp:57
bool LoadDates(void)
ProgramInfo * GetCurrentProgram(void) const override
void ShowDeleteOldEpisodeMenu(void)
MythUIButtonList * m_titleList
Definition: prevreclist.h:74
void showListTakeFocus(void)
MythUIText * m_curviewText
Definition: prevreclist.h:80
void showListLoseFocus(void)
void AllowRecord(void)
void ShowItemMenu(void)
InfoMap m_infoMap
Definition: prevreclist.h:84
bool keyPressEvent(QKeyEvent *e) override
Key event handler.
ProgramList m_showData
Definition: prevreclist.h:76
void DeleteOldSeries(bool ok)
ProgramList m_titleData
Definition: prevreclist.h:73
MythUIText * m_help1Text
Definition: prevreclist.h:81
void LoadShowsByDate(void)
void ShowMenu(void) override
void DeleteOldEpisode(bool ok)
Holds information on recordings and videos.
Definition: programinfo.h:74
uint GetChanID(void) const
This is the unique key used in the database to locate tuning information.
Definition: programinfo.h:380
QString GetTitle(void) const
Definition: programinfo.h:368
QDateTime GetRecordingStartTime(void) const
Approximate time the recording started.
Definition: programinfo.h:412
QDateTime GetScheduledStartTime(void) const
The scheduled start time of program.
Definition: programinfo.h:398
bool IsDuplicate(void) const
Definition: programinfo.h:500
QString GetSortTitle(void) const
Definition: programinfo.h:369
void SetProgramID(const QString &id)
Definition: programinfo.h:545
static QString toUIState(RecStatus::Type recstatus)
Holds information on a TV Program one might wish to record.
Definition: recordinginfo.h:36
void SetDupHistory(void)
Set the duplicate flag in oldrecorded.
void ForgetHistory(void)
Forget the recording of a program so it will be recorded again.
Internal representation of a recording rule, mirrors the record table.
Definition: recordingrule.h:31
virtual void EditScheduled(void)
Creates a dialog for editing the recording schedule.
virtual void ShowDetails(void) const
Show the Program Details screen.
void customEvent(QEvent *event) override
virtual void EditCustom(void)
Creates a dialog for creating a custom recording rule.
virtual void ShowGuide(void) const
Show the program guide.
virtual void ShowUpcoming(void) const
Show the upcoming recordings for this title.
virtual void ShowChannelSearch(void) const
Show the channel search.
static void RescheduleCheck(const RecordingInfo &recinfo, const QString &why)
Event that can be dispatched from a MythScreenType when it has completed loading.
static const Type kEventType
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
unsigned int uint
Definition: compat.h:60
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
QMap< QString, QVariant > MSqlBindings
typedef for a map of string -> string bindings for generic queries.
Definition: mythdbcon.h:101
MythConfirmationDialog * ShowOkPopup(const QString &message, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
MythMainWindow * GetMythMainWindow(void)
static MythThemedMenu * menu
QHash< QString, QString > InfoMap
Definition: mythtypes.h:15
bool naturalSortCompare(const QString &a, const QString &b, Qt::CaseSensitivity caseSensitivity=Qt::CaseSensitive)
naturalCompare as a std::sort compatible function (ignoring the third parameter, which is never used)...
Definition: stringutil.h:62
#define LOC
Definition: prevreclist.cpp:50
static bool comp_sorttitle_lt_rev(const ProgramInfo *a, const ProgramInfo *b)
static bool comp_sortdate_lt_rev(const ProgramInfo *a, const ProgramInfo *b)
static bool comp_sortdate_lt(const ProgramInfo *a, const ProgramInfo *b)
static const int fReverseSort
Definition: prevreclist.cpp:54
static const int fDefault
Definition: prevreclist.cpp:55
static bool comp_sorttitle_lt(const ProgramInfo *a, const ProgramInfo *b)
static const int fTitleGroup
Definition: prevreclist.cpp:53
bool LoadFromOldRecorded(ProgramList &destination, const QString &sql, const MSqlBindings &bindings)
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
Definition: mythuiutils.h:27