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 <QDateTime>
27#include <QString>
28
29//MythTV
31#include "libmythbase/mythdb.h"
43#include "libmythui/mythuiutils.h" // for UIUtilE, UIUtilW
45
46// MythFrontend
47#include "prevreclist.h"
48
49#define LOC QString("PrevRecordedList: ")
50
51// flags for PrevRecSortFlags setting
52static const int fTitleGroup = 1;
53static const int fReverseSort = 2;
54static const int fDefault = fReverseSort;
55
57 QString title) :
58 ScheduleCommon(parent,"PrevRecordedList"),
59 m_recid(recid),
60 m_title(std::move(title))
61{
62
63 if (m_recid && !m_title.isEmpty())
64 {
65 m_where = QString(" AND ( recordid = %1 OR title = :MTITLE )")
66 .arg(m_recid);
67 }
68 else if (!m_title.isEmpty())
69 {
70 m_where = QString("AND title = :MTITLE ");
71 }
72 else if (m_recid)
73 {
74 m_where = QString("AND recordid = %1 ").arg(m_recid);
75 }
76 else
77 {
78 // Get sort options if this is not a filtered list
79 int flags = gCoreContext->GetNumSetting("PrevRecSortFlags",fDefault);
80 m_titleGroup = ((flags & fTitleGroup) != 0);
81 m_reverseSort = ((flags & fReverseSort) != 0);
82
83 }
84}
85
87{
88 if (m_where.isEmpty())
89 {
90 // Save sort setting if this is not a filtered list
91 int flags = 0;
92 if (m_titleGroup)
93 flags |= fTitleGroup;
94 if (m_reverseSort)
95 flags |= fReverseSort;
96 gCoreContext->SaveSetting("PrevRecSortFlags", flags);
97 }
101}
102
104{
105 if (!LoadWindowFromXML("schedule-ui.xml", "prevreclist", this))
106 return false;
107
108 bool err = false;
109 UIUtilE::Assign(this, m_titleList, "titles", &err);
110 UIUtilE::Assign(this, m_showList, "shows", &err);
111 UIUtilW::Assign(this, m_help1Text, "help1text");
112 UIUtilW::Assign(this, m_help2Text, "help2text");
113 UIUtilW::Assign(this, m_curviewText, "curview");
114
115 if (err)
116 {
117 LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'prevreclist'");
118 return false;
119 }
120
121 m_titleList->SetLCDTitles(tr("Programs"), "title");
122 m_showList->SetLCDTitles(tr("Episodes"), "startdate|parttitle");
123
126 m_loadShows = false;
128
129 return true;
130}
131
133{
143
145 updateInfo();
146}
147
148// When m_loadShows is false we are loading the left hand
149// button list, when it is true the right hand.
151{
152 if (m_loadShows)
153 {
154 if (m_titleGroup)
156 else
158 }
159 else
160 {
161 if (m_titleGroup)
162 LoadTitles();
163 else
164 LoadDates();
165 }
166 auto *slce = new ScreenLoadCompletionEvent(objectName());
167 QCoreApplication::postEvent(this, slce);
168}
169
170static bool comp_sorttitle_lt(const ProgramInfo *a, const ProgramInfo *b)
171{
173}
174
175static bool comp_sorttitle_lt_rev(const ProgramInfo *a, const ProgramInfo *b)
176{
178}
179
181 const ProgramInfo *a, const ProgramInfo *b)
182{
184}
185
187 const ProgramInfo *a, const ProgramInfo *b)
188{
190}
191
192// Load a list of titles without subtitle or other info.
193// each title can represent multiple recordings.
195{
196 QString querystr = "SELECT DISTINCT title FROM oldrecorded "
197 "WHERE oldrecorded.future = 0 " + m_where;
198
200
202 query.prepare(querystr);
203
204 if (!m_title.isEmpty())
205 query.bindValue(":MTITLE", m_title);
206
207 if (!query.exec())
208 {
209 MythDB::DBError("PrevRecordedList::LoadTitles", query);
210 return false;
211 }
212
213 while (query.next())
214 {
215 QString title(query.value(0).toString());
216 auto *program = new ProgramInfo();
217 program->SetTitle(title);
218 m_titleData.push_back(program);
219 }
220 if (m_reverseSort)
221 std::ranges::stable_sort(m_titleData, comp_sorttitle_lt_rev);
222 else
223 std::ranges::stable_sort(m_titleData, comp_sorttitle_lt);
224 return true;
225}
226
228{
229 QString querystr = "SELECT DISTINCT "
230 "YEAR(CONVERT_TZ(starttime,'UTC','SYSTEM')), "
231 "MONTH(CONVERT_TZ(starttime,'UTC','SYSTEM')) "
232 "FROM oldrecorded "
233 "WHERE oldrecorded.future = 0 " + m_where;
234
236
238 query.prepare(querystr);
239
240 if (!m_title.isEmpty())
241 query.bindValue(":MTITLE", m_title);
242
243 if (!query.exec())
244 {
245 MythDB::DBError("PrevRecordedList::LoadDates", query);
246 return false;
247 }
248
249 // Create "Last two weeks" entry
250 // It is identified by bogus date of 0000/00
251
252 auto *program = new ProgramInfo();
253 program->SetRecordingStartTime(QDateTime::currentDateTime());
254 program->SetTitle(tr("Last two weeks"), "0000/00");
255 m_titleData.push_back(program);
256
257 while (query.next())
258 {
259 int year(query.value(0).toInt());
260 int month(query.value(1).toInt());
261 program = new ProgramInfo();
262 QDate startdate(year,month,1);
263 QDateTime starttime = startdate.startOfDay();
264 program->SetRecordingStartTime(starttime);
265 QString date = QString("%1/%2")
266 .arg(year,4,10,QChar('0')).arg(month,2,10,QChar('0'));
267 QLocale locale = gCoreContext->GetLocale()->ToQLocale();
268 QString title = QString("%1 %2").
269 arg(locale.monthName(month)).arg(year);
270 program->SetTitle(title, date);
271 m_titleData.push_back(program);
272 }
273 if (m_reverseSort)
274 std::ranges::stable_sort(m_titleData, comp_sortdate_lt_rev);
275 else
276 std::ranges::stable_sort(m_titleData, comp_sortdate_lt);
277 return true;
278}
279
281{
283}
284
286{
288}
289
291 ProgramList *progData, bool isShows) const
292{
293 bnList->Reset();
294 for (auto *pg : *progData)
295 {
296 auto *item = new MythUIButtonListItem(bnList, "",
297 QVariant::fromValue(pg));
298 InfoMap infoMap;
299 pg->ToMap(infoMap,true);
300 QString state;
301 if (isShows)
302 {
303 QString partTitle;
304 if (m_titleGroup)
305 partTitle = infoMap["subtitle"];
306 else
307 partTitle = infoMap["titlesubtitle"];
308 infoMap["parttitle"] = partTitle;
309 state = RecStatus::toUIState(pg->GetRecordingStatus());
310 if ((state == "warning"))
311 state = "disabled";
312 }
313 else
314 {
315 infoMap["buttontext"] = infoMap["title"];
316 }
317
318 item->SetTextFromMap(infoMap, state);
319 }
320}
321
323{
324 if (m_help1Text)
326 if (m_help2Text)
328
329 if (!m_showData.empty())
330 {
331 InfoMap infoMap;
332 m_showData[m_showList->GetCurrentPos()]->ToMap(infoMap,true);
333 SetTextFromMap(infoMap);
334 m_infoMap = infoMap;
335 }
336 else
337 {
339
340 if (m_titleGroup)
341 {
342 m_titleList->SetLCDTitles(tr("Programs"), "title");
343 m_showList->SetLCDTitles(tr("Episodes"), "startdate|parttitle");
344 if (m_help1Text)
345 m_help1Text->SetText(tr("Select a program..."));
346 if (m_help2Text)
347 {
349 "Select the title of the program you wish to find. "
350 "When finished return with the left arrow key. "
351 "To search by date press 1."));
352 }
353 if (m_curviewText)
354 {
355 if (m_reverseSort)
356 m_curviewText->SetText(tr("Reverse Title","Sort sequence"));
357 else
358 m_curviewText->SetText(tr("Title","Sort sequence"));
359 }
360 }
361 else
362 {
363 m_titleList->SetLCDTitles(tr("Dates"), "title");
364 m_showList->SetLCDTitles(tr("Programs"), "startdate|parttitle");
365 if (m_help1Text)
366 m_help1Text->SetText(tr("Select a month ..."));
367 if (m_help2Text)
368 {
370 "Select a month to search. "
371 "When finished return with the left arrow key. "
372 "To search by title press 2."));
373 }
374 if (m_curviewText)
375 {
376 if (m_reverseSort)
377 m_curviewText->SetText(tr("Reverse Time","Sort sequence"));
378 else
379 m_curviewText->SetText(tr("Time","Sort sequence"));
380 }
381 }
382 }
383}
384
386{
388 m_showList->Reset();
389 updateInfo();
390}
391
393{
394 m_loadShows = true;
396}
397
399{
400 MSqlBindings bindings;
401 QString sql = " AND oldrecorded.title = :TITLE " + m_where;
402 uint selected = m_titleList->GetCurrentPos();
403 if (selected < m_titleData.size() && (m_titleData[selected] != nullptr))
404 bindings[":TITLE"] = m_titleData[selected]->GetTitle();
405 else
406 bindings[":TITLE"] = "";
407 if (!m_title.isEmpty())
408 bindings[":MTITLE"] = m_title;
410 LoadFromOldRecorded(m_showData, sql, bindings);
411}
412
414{
415 MSqlBindings bindings;
416 int selected = m_titleList->GetCurrentPos();
417 if (m_titleData[selected] == nullptr)
418 {
419 LOG(VB_GENERAL, LOG_ERR, LOC +
420 QString("Invalid selection in title data: %1").arg(selected));
421 return;
422 }
423 QString sortTitle = m_titleData[selected]->GetSortTitle();
424 QStringList dateParts = sortTitle.split('/');
425 if (dateParts.size() != 2)
426 {
427 LOG(VB_GENERAL, LOG_ERR, LOC +
428 QString("Invalid sort Date: %1").arg(sortTitle));
429 return;
430 }
431 QString sortorder;
432 if (m_reverseSort)
433 sortorder = "DESC";
434 QString sql;
435 if (dateParts[0] == "0000")
436 {
437 sql = "AND TIMESTAMPDIFF(DAY, starttime, NOW()) < 14 ";
438 }
439 else
440 {
441 sql =
442 " AND YEAR(CONVERT_TZ(starttime,'UTC','SYSTEM')) = :YEAR "
443 " AND MONTH(CONVERT_TZ(starttime,'UTC','SYSTEM')) = :MONTH ";
444 bindings[":YEAR"] = dateParts[0];
445 bindings[":MONTH"] = dateParts[1];
446 }
447 sql = sql + m_where + QString(" ORDER BY starttime %1 ").arg(sortorder);
448 if (!m_title.isEmpty())
449 bindings[":MTITLE"] = m_title;
451 LoadFromOldRecorded(m_showData, sql, bindings);
452}
453
455{
456 if (!m_allowEvents)
457 return true;
458
460 {
461 m_allowEvents = true;
462 return true;
463 }
464
465 m_allowEvents = false;
466
467 QStringList actions;
468 bool handled = GetMythMainWindow()->TranslateKeyPress(
469 "TV Frontend", e, actions);
470
471 bool needUpdate = false;
472 for (uint i = 0; i < uint(actions.size()) && !handled; ++i)
473 {
474 const QString& action = actions[i];
475 handled = true;
476
477 if (action == "CUSTOMEDIT") {
478 EditCustom();
479 } else if (action == "EDIT") {
481 } else if (action == "DELETE") {
483 } else if (action == "DETAILS" || action == "INFO") {
484 ShowDetails();
485 } else if (action == "GUIDE") {
486 ShowGuide();
487 } else if (action == "UPCOMING") {
488 ShowUpcoming();
489 } else if (action == "1") {
490 if (m_titleGroup)
491 {
492 m_titleGroup = false;
493 m_reverseSort = true;
494 }
495 else
496 {
498 }
499 needUpdate = true;
500 } else if (action == "2") {
501 if (!m_titleGroup)
502 {
503 m_titleGroup = true;
504 m_reverseSort = false;
505 }
506 else
507 {
509 }
510 needUpdate = true;
511 } else {
512 handled = false;
513 }
514 }
515
516 if (!handled && MythScreenType::keyPressEvent(e))
517 handled = true;
518
519 if (needUpdate)
520 {
521 m_loadShows = false;
523 }
524
525 m_allowEvents = true;
526
527 return handled;
528}
529
531{
532 auto *sortMenu = new MythMenu(tr("Sort Options"), this, "sortmenu");
533 sortMenu->AddItem(tr("Reverse Sort Order"));
534 sortMenu->AddItem(tr("Sort By Title"));
535 sortMenu->AddItem(tr("Sort By Time"));
536
537 auto *menu = new MythMenu(tr("List Options"), this, "menu");
538
539 menu->AddItem(tr("Sort"), nullptr, sortMenu);
540
542 if (pi)
543 {
544 menu->AddItem(tr("Edit Schedule"), qOverload<>(&PrevRecordedList::EditScheduled));
545 menu->AddItem(tr("Custom Edit"), &PrevRecordedList::EditCustom);
546 menu->AddItem(tr("Program Details"), &PrevRecordedList::ShowDetails);
547 menu->AddItem(tr("Upcoming"), qOverload<>(&PrevRecordedList::ShowUpcoming));
548 menu->AddItem(tr("Channel Search"), &PrevRecordedList::ShowChannelSearch);
549 }
550 menu->AddItem(tr("Program Guide"), &PrevRecordedList::ShowGuide);
551 MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
552 auto *menuPopup = new MythDialogBox(menu, popupStack, "menuPopup");
553
554 if (!menuPopup->Create())
555 {
556 delete menuPopup;
557 return;
558 }
559
560 popupStack->AddScreen(menuPopup);
561}
562
564{
565 auto *menu = new MythMenu(tr("Recording Options"), this, "menu");
566
568 if (pi)
569 {
570 if (pi->IsDuplicate())
571 menu->AddItem(tr("Allow this episode to re-record"), &PrevRecordedList::AllowRecord);
572 else
573 menu->AddItem(tr("Never record this episode"), &PrevRecordedList::PreventRecord);
574 menu->AddItem(tr("Remove this episode from the list"),
576 menu->AddItem(tr("Remove all episodes for this title"),
578 }
579 MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
580 auto *menuPopup = new MythDialogBox(menu, popupStack, "menuPopup");
581
582 if (!menuPopup->Create())
583 {
584 delete menuPopup;
585 return;
586 }
587
588 popupStack->AddScreen(menuPopup);
589}
590
592{
593 bool needUpdate = false;
594
595 if (event->type() == DialogCompletionEvent::kEventType)
596 {
597 auto *dce = (DialogCompletionEvent*)event;
598
599 QString resultid = dce->GetId();
600// QString resulttext = dce->GetResultText();
601 int buttonnum = dce->GetResult();
602
603 if (resultid == "sortmenu")
604 {
605 switch (buttonnum)
606 {
607 case 0:
609 needUpdate = true;
610 break;
611 case 1:
612 m_titleGroup = true;
613 m_reverseSort = false;
614 needUpdate = true;
615 break;
616 case 2:
617 m_titleGroup = false;
618 m_reverseSort = true;
619 needUpdate = true;
620 break;
621 }
622 }
623 else if (resultid == "deleterule")
624 {
625 auto *record = dce->GetData().value<RecordingRule *>();
626 if (record && buttonnum > 0 && !record->Delete())
627 {
628 LOG(VB_GENERAL, LOG_ERR, LOC +
629 "Failed to delete recording rule");
630 }
631 delete record;
632 }
633 else
634 {
636 }
637 }
638 else if (event->type() == ScreenLoadCompletionEvent::kEventType)
639 {
640 auto *slce = (ScreenLoadCompletionEvent*)event;
641 QString id = slce->GetId();
642
643 if (id == objectName())
644 {
645 // CloseBusyPopup(); // opened by LoadInBackground()
646 if (m_loadShows)
647 {
649 CloseBusyPopup(); // opened by LoadInBackground()
650 }
651 else
652 {
655 m_showList->Reset();
656 updateInfo();
657 CloseBusyPopup(); // opened by LoadInBackground()
659 }
660 }
661 }
662
663 if (needUpdate)
664 {
665 m_loadShows = false;
667 }
668}
669
671{
673 if (pi)
674 {
675 int pos = m_showList->GetCurrentPos();
676 RecordingInfo ri(*pi);
677 ri.ForgetHistory();
679 updateInfo();
681 }
682}
683
685{
687 if (pi)
688 {
689 int pos = m_showList->GetCurrentPos();
690 RecordingInfo ri(*pi);
691 ri.SetDupHistory();
693 updateInfo();
695 }
696}
697
698
700{
701 int pos = m_showList->GetCurrentPos();
702 if (pos >= 0 && pos < (int) m_showData.size())
703 return m_showData[pos];
704 return nullptr;
705}
706
708{
710
711 if (!pi)
712 return;
713
714 QString message = tr("Delete this episode of '%1' from the previously recorded history?").arg(pi->GetTitle());
715
716 ShowOkPopup(message, this, &PrevRecordedList::DeleteOldEpisode, true);
717}
718
720{
722 if (!ok || !pi)
723 return;
724
726 query.prepare(
727 "DELETE FROM oldrecorded "
728 "WHERE chanid = :CHANID AND "
729 " starttime = :STARTTIME");
730 query.bindValue(":CHANID", pi->GetChanID());
731 query.bindValue(":STARTTIME", pi->GetScheduledStartTime());
732
733 if (!query.exec())
734 MythDB::DBError("ProgLister::DeleteOldEpisode", query);
735
736 ScheduledRecording::RescheduleCheck(*pi, "DeleteOldEpisode");
737
738 // Delete the current item from both m_showData and m_showList.
739 auto it = m_showData.begin() + m_showList->GetCurrentPos();
740 m_showData.erase(it);
742 m_showList->RemoveItem(item);
743}
744
746{
748
749 if (!pi)
750 return;
751
752 QString message = tr("Delete all episodes of '%1' from the previously recorded history?").arg(pi->GetTitle());
753
754 ShowOkPopup(message, this, &PrevRecordedList::DeleteOldSeries, true);
755}
756
758{
760 if (!ok || !pi)
761 return;
762 QString title = pi->GetTitle();
763
765 query.prepare("DELETE FROM oldrecorded "
766 "WHERE title = :TITLE "
767 " AND recstatus <> :PENDING "
768 " AND recstatus <> :TUNING "
769 " AND recstatus <> :RECORDING "
770 " AND recstatus <> :FAILING "
771 " AND future = 0");
772 query.bindValue(":TITLE", title);
773 query.bindValue(":PENDING", RecStatus::Pending);
774 query.bindValue(":TUNING", RecStatus::Tuning);
775 query.bindValue(":RECORDING", RecStatus::Recording);
776 query.bindValue(":FAILING", RecStatus::Failing);
777 if (!query.exec())
778 MythDB::DBError("ProgLister::DeleteOldSeries -- delete", query);
779
780 // Set the programid to the special value of "**any**" which the
781 // scheduler recognizes to mean the entire series was deleted.
782 RecordingInfo tempri(*pi);
783 tempri.SetProgramID("**any**");
784 ScheduledRecording::RescheduleCheck(tempri, "DeleteOldSeries");
785
786 // Delete the matching items from both m_showData and m_showList.
787 int pos = 0;
788 auto it = m_showData.begin();
789 while (pos < (int)m_showData.size())
790 {
791 if ((*it)->GetTitle() == title
792 && (*it)->GetRecordingStatus() != RecStatus::Pending
793 && (*it)->GetRecordingStatus() != RecStatus::Tuning
794 && (*it)->GetRecordingStatus() != RecStatus::Recording
795 && (*it)->GetRecordingStatus() != RecStatus::Failing)
796 {
797 LOG(VB_GENERAL, LOG_INFO, QString("Deleting %1 at pos %2")
798 .arg(title).arg(pos));
799 it = m_showData.erase(it);
801 m_showList->RemoveItem(item);
802 }
803 else
804 {
805 ++pos;
806 ++it;
807 }
808 }
809}
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:128
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
Definition: mythdbcon.cpp:838
QVariant value(int i) const
Definition: mythdbcon.h:204
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:619
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
Definition: mythdbcon.cpp:889
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
Definition: mythdbcon.cpp:813
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:551
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:86
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:56
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:30
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:100
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:61
#define LOC
Definition: prevreclist.cpp:49
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:53
static const int fDefault
Definition: prevreclist.cpp:54
static bool comp_sorttitle_lt(const ProgramInfo *a, const ProgramInfo *b)
static const int fTitleGroup
Definition: prevreclist.cpp:52
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