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 {
222 std::stable_sort(m_titleData.begin(), m_titleData.end(),
224 }
225 else
226 {
227 std::stable_sort(m_titleData.begin(), m_titleData.end(),
229 }
230 return true;
231}
232
234{
235 QString querystr = "SELECT DISTINCT "
236 "YEAR(CONVERT_TZ(starttime,'UTC','SYSTEM')), "
237 "MONTH(CONVERT_TZ(starttime,'UTC','SYSTEM')) "
238 "FROM oldrecorded "
239 "WHERE oldrecorded.future = 0 " + m_where;
240
242
244 query.prepare(querystr);
245
246 if (!m_title.isEmpty())
247 query.bindValue(":MTITLE", m_title);
248
249 if (!query.exec())
250 {
251 MythDB::DBError("PrevRecordedList::LoadDates", query);
252 return false;
253 }
254
255 // Create "Last two weeks" entry
256 // It is identified by bogus date of 0000/00
257
258 auto *program = new ProgramInfo();
259 program->SetRecordingStartTime(QDateTime::currentDateTime());
260 program->SetTitle(tr("Last two weeks"), "0000/00");
261 m_titleData.push_back(program);
262
263 while (query.next())
264 {
265 int year(query.value(0).toInt());
266 int month(query.value(1).toInt());
267 program = new ProgramInfo();
268 QDate startdate(year,month,1);
269 QDateTime starttime = startdate.startOfDay();
270 program->SetRecordingStartTime(starttime);
271 QString date = QString("%1/%2")
272 .arg(year,4,10,QChar('0')).arg(month,2,10,QChar('0'));
273 QLocale locale = gCoreContext->GetLocale()->ToQLocale();
274 QString title = QString("%1 %2").
275 arg(locale.monthName(month)).arg(year);
276 program->SetTitle(title, date);
277 m_titleData.push_back(program);
278 }
279 if (m_reverseSort)
280 {
281 std::stable_sort(m_titleData.begin(), m_titleData.end(),
283 }
284 else
285 {
286 std::stable_sort(m_titleData.begin(), m_titleData.end(),
288 }
289 return true;
290}
291
293{
295}
296
298{
300}
301
303 ProgramList *progData, bool isShows) const
304{
305 bnList->Reset();
306 for (auto *pg : *progData)
307 {
308 auto *item = new MythUIButtonListItem(bnList, "",
309 QVariant::fromValue(pg));
310 InfoMap infoMap;
311 pg->ToMap(infoMap,true);
312 QString state;
313 if (isShows)
314 {
315 QString partTitle;
316 if (m_titleGroup)
317 partTitle = infoMap["subtitle"];
318 else
319 partTitle = infoMap["titlesubtitle"];
320 infoMap["parttitle"] = partTitle;
321 state = RecStatus::toUIState(pg->GetRecordingStatus());
322 if ((state == "warning"))
323 state = "disabled";
324 }
325 else
326 {
327 infoMap["buttontext"] = infoMap["title"];
328 }
329
330 item->SetTextFromMap(infoMap, state);
331 }
332}
333
335{
336 if (m_help1Text)
338 if (m_help2Text)
340
341 if (!m_showData.empty())
342 {
343 InfoMap infoMap;
344 m_showData[m_showList->GetCurrentPos()]->ToMap(infoMap,true);
345 SetTextFromMap(infoMap);
346 m_infoMap = infoMap;
347 }
348 else
349 {
351
352 if (m_titleGroup)
353 {
354 m_titleList->SetLCDTitles(tr("Programs"), "title");
355 m_showList->SetLCDTitles(tr("Episodes"), "startdate|parttitle");
356 if (m_help1Text)
357 m_help1Text->SetText(tr("Select a program..."));
358 if (m_help2Text)
359 {
361 "Select the title of the program you wish to find. "
362 "When finished return with the left arrow key. "
363 "To search by date press 1."));
364 }
365 if (m_curviewText)
366 {
367 if (m_reverseSort)
368 m_curviewText->SetText(tr("Reverse Title","Sort sequence"));
369 else
370 m_curviewText->SetText(tr("Title","Sort sequence"));
371 }
372 }
373 else
374 {
375 m_titleList->SetLCDTitles(tr("Dates"), "title");
376 m_showList->SetLCDTitles(tr("Programs"), "startdate|parttitle");
377 if (m_help1Text)
378 m_help1Text->SetText(tr("Select a month ..."));
379 if (m_help2Text)
380 {
382 "Select a month to search. "
383 "When finished return with the left arrow key. "
384 "To search by title press 2."));
385 }
386 if (m_curviewText)
387 {
388 if (m_reverseSort)
389 m_curviewText->SetText(tr("Reverse Time","Sort sequence"));
390 else
391 m_curviewText->SetText(tr("Time","Sort sequence"));
392 }
393 }
394 }
395}
396
398{
400 m_showList->Reset();
401 updateInfo();
402}
403
405{
406 m_loadShows = true;
408}
409
411{
412 MSqlBindings bindings;
413 QString sql = " AND oldrecorded.title = :TITLE " + m_where;
414 uint selected = m_titleList->GetCurrentPos();
415 if (selected < m_titleData.size() && (m_titleData[selected] != nullptr))
416 bindings[":TITLE"] = m_titleData[selected]->GetTitle();
417 else
418 bindings[":TITLE"] = "";
419 if (!m_title.isEmpty())
420 bindings[":MTITLE"] = m_title;
422 LoadFromOldRecorded(m_showData, sql, bindings);
423}
424
426{
427 MSqlBindings bindings;
428 int selected = m_titleList->GetCurrentPos();
429 if (m_titleData[selected] == nullptr)
430 {
431 LOG(VB_GENERAL, LOG_ERR, LOC +
432 QString("Invalid selection in title data: %1").arg(selected));
433 return;
434 }
435 QString sortTitle = m_titleData[selected]->GetSortTitle();
436 QStringList dateParts = sortTitle.split('/');
437 if (dateParts.size() != 2)
438 {
439 LOG(VB_GENERAL, LOG_ERR, LOC +
440 QString("Invalid sort Date: %1").arg(sortTitle));
441 return;
442 }
443 QString sortorder;
444 if (m_reverseSort)
445 sortorder = "DESC";
446 QString sql;
447 if (dateParts[0] == "0000")
448 sql = "AND TIMESTAMPDIFF(DAY, starttime, NOW()) < 14 ";
449 else
450 {
451 sql =
452 " AND YEAR(CONVERT_TZ(starttime,'UTC','SYSTEM')) = :YEAR "
453 " AND MONTH(CONVERT_TZ(starttime,'UTC','SYSTEM')) = :MONTH ";
454 bindings[":YEAR"] = dateParts[0];
455 bindings[":MONTH"] = dateParts[1];
456 }
457 sql = sql + m_where + QString(" ORDER BY starttime %1 ").arg(sortorder);
458 if (!m_title.isEmpty())
459 bindings[":MTITLE"] = m_title;
461 LoadFromOldRecorded(m_showData, sql, bindings);
462}
463
465{
466 if (!m_allowEvents)
467 return true;
468
470 {
471 m_allowEvents = true;
472 return true;
473 }
474
475 m_allowEvents = false;
476
477 QStringList actions;
478 bool handled = GetMythMainWindow()->TranslateKeyPress(
479 "TV Frontend", e, actions);
480
481 bool needUpdate = false;
482 for (uint i = 0; i < uint(actions.size()) && !handled; ++i)
483 {
484 const QString& action = actions[i];
485 handled = true;
486
487 if (action == "CUSTOMEDIT")
488 EditCustom();
489 else if (action == "EDIT")
491 else if (action == "DELETE")
493 else if (action == "DETAILS" || action == "INFO")
494 ShowDetails();
495 else if (action == "GUIDE")
496 ShowGuide();
497 else if (action == "UPCOMING")
498 ShowUpcoming();
499 else if (action == "1")
500 {
501 if (m_titleGroup)
502 {
503 m_titleGroup = false;
504 m_reverseSort = true;
505 }
506 else
507 {
509 }
510 needUpdate = true;
511 }
512 else if (action == "2")
513 {
514 if (!m_titleGroup)
515 {
516 m_titleGroup = true;
517 m_reverseSort = false;
518 }
519 else
520 {
522 }
523 needUpdate = true;
524 }
525 else
526 {
527 handled = false;
528 }
529 }
530
531 if (!handled && MythScreenType::keyPressEvent(e))
532 handled = true;
533
534 if (needUpdate)
535 {
536 m_loadShows = false;
538 }
539
540 m_allowEvents = true;
541
542 return handled;
543}
544
546{
547 auto *sortMenu = new MythMenu(tr("Sort Options"), this, "sortmenu");
548 sortMenu->AddItem(tr("Reverse Sort Order"));
549 sortMenu->AddItem(tr("Sort By Title"));
550 sortMenu->AddItem(tr("Sort By Time"));
551
552 auto *menu = new MythMenu(tr("List Options"), this, "menu");
553
554 menu->AddItem(tr("Sort"), nullptr, sortMenu);
555
557 if (pi)
558 {
559 menu->AddItem(tr("Edit Schedule"), qOverload<>(&PrevRecordedList::EditScheduled));
560 menu->AddItem(tr("Custom Edit"), &PrevRecordedList::EditCustom);
561 menu->AddItem(tr("Program Details"), &PrevRecordedList::ShowDetails);
562 menu->AddItem(tr("Upcoming"), qOverload<>(&PrevRecordedList::ShowUpcoming));
563 menu->AddItem(tr("Channel Search"), &PrevRecordedList::ShowChannelSearch);
564 }
565 menu->AddItem(tr("Program Guide"), &PrevRecordedList::ShowGuide);
566 MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
567 auto *menuPopup = new MythDialogBox(menu, popupStack, "menuPopup");
568
569 if (!menuPopup->Create())
570 {
571 delete menuPopup;
572 return;
573 }
574
575 popupStack->AddScreen(menuPopup);
576}
577
579{
580 auto *menu = new MythMenu(tr("Recording Options"), this, "menu");
581
583 if (pi)
584 {
585 if (pi->IsDuplicate())
586 menu->AddItem(tr("Allow this episode to re-record"), &PrevRecordedList::AllowRecord);
587 else
588 menu->AddItem(tr("Never record this episode"), &PrevRecordedList::PreventRecord);
589 menu->AddItem(tr("Remove this episode from the list"),
591 menu->AddItem(tr("Remove all episodes for this title"),
593 }
594 MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
595 auto *menuPopup = new MythDialogBox(menu, popupStack, "menuPopup");
596
597 if (!menuPopup->Create())
598 {
599 delete menuPopup;
600 return;
601 }
602
603 popupStack->AddScreen(menuPopup);
604}
605
607{
608 bool needUpdate = false;
609
610 if (event->type() == DialogCompletionEvent::kEventType)
611 {
612 auto *dce = (DialogCompletionEvent*)(event);
613
614 QString resultid = dce->GetId();
615// QString resulttext = dce->GetResultText();
616 int buttonnum = dce->GetResult();
617
618 if (resultid == "sortmenu")
619 {
620 switch (buttonnum)
621 {
622 case 0:
624 needUpdate = true;
625 break;
626 case 1:
627 m_titleGroup = true;
628 m_reverseSort = false;
629 needUpdate = true;
630 break;
631 case 2:
632 m_titleGroup = false;
633 m_reverseSort = true;
634 needUpdate = true;
635 break;
636 }
637 }
638 else if (resultid == "deleterule")
639 {
640 auto *record = dce->GetData().value<RecordingRule *>();
641 if (record && buttonnum > 0 && !record->Delete())
642 {
643 LOG(VB_GENERAL, LOG_ERR, LOC +
644 "Failed to delete recording rule");
645 }
646 delete record;
647 }
648 else
649 {
651 }
652 }
653 else if (event->type() == ScreenLoadCompletionEvent::kEventType)
654 {
655 auto *slce = (ScreenLoadCompletionEvent*)(event);
656 QString id = slce->GetId();
657
658 if (id == objectName())
659 {
660 // CloseBusyPopup(); // opened by LoadInBackground()
661 if (m_loadShows)
662 {
664 CloseBusyPopup(); // opened by LoadInBackground()
665 }
666 else
667 {
670 m_showList->Reset();
671 updateInfo();
672 CloseBusyPopup(); // opened by LoadInBackground()
674 }
675 }
676 }
677
678 if (needUpdate)
679 {
680 m_loadShows = false;
682 }
683}
684
686{
688 if (pi)
689 {
690 int pos = m_showList->GetCurrentPos();
691 RecordingInfo ri(*pi);
692 ri.ForgetHistory();
694 updateInfo();
696 }
697}
698
700{
702 if (pi)
703 {
704 int pos = m_showList->GetCurrentPos();
705 RecordingInfo ri(*pi);
706 ri.SetDupHistory();
708 updateInfo();
710 }
711}
712
713
715{
716 int pos = m_showList->GetCurrentPos();
717 if (pos >= 0 && pos < (int) m_showData.size())
718 return m_showData[pos];
719 return nullptr;
720}
721
723{
725
726 if (!pi)
727 return;
728
729 QString message = tr("Delete this episode of '%1' from the previously recorded history?").arg(pi->GetTitle());
730
731 ShowOkPopup(message, this, &PrevRecordedList::DeleteOldEpisode, true);
732}
733
735{
737 if (!ok || !pi)
738 return;
739
741 query.prepare(
742 "DELETE FROM oldrecorded "
743 "WHERE chanid = :CHANID AND "
744 " starttime = :STARTTIME");
745 query.bindValue(":CHANID", pi->GetChanID());
746 query.bindValue(":STARTTIME", pi->GetScheduledStartTime());
747
748 if (!query.exec())
749 MythDB::DBError("ProgLister::DeleteOldEpisode", query);
750
751 ScheduledRecording::RescheduleCheck(*pi, "DeleteOldEpisode");
752
753 // Delete the current item from both m_showData and m_showList.
754 auto it = m_showData.begin() + m_showList->GetCurrentPos();
755 m_showData.erase(it);
757 m_showList->RemoveItem(item);
758}
759
761{
763
764 if (!pi)
765 return;
766
767 QString message = tr("Delete all episodes of '%1' from the previously recorded history?").arg(pi->GetTitle());
768
769 ShowOkPopup(message, this, &PrevRecordedList::DeleteOldSeries, true);
770}
771
773{
775 if (!ok || !pi)
776 return;
777 QString title = pi->GetTitle();
778
780 query.prepare("DELETE FROM oldrecorded "
781 "WHERE title = :TITLE "
782 " AND recstatus <> :PENDING "
783 " AND recstatus <> :TUNING "
784 " AND recstatus <> :RECORDING "
785 " AND recstatus <> :FAILING "
786 " AND future = 0");
787 query.bindValue(":TITLE", title);
788 query.bindValue(":PENDING", RecStatus::Pending);
789 query.bindValue(":TUNING", RecStatus::Tuning);
790 query.bindValue(":RECORDING", RecStatus::Recording);
791 query.bindValue(":FAILING", RecStatus::Failing);
792 if (!query.exec())
793 MythDB::DBError("ProgLister::DeleteOldSeries -- delete", query);
794
795 // Set the programid to the special value of "**any**" which the
796 // scheduler recognizes to mean the entire series was deleted.
797 RecordingInfo tempri(*pi);
798 tempri.SetProgramID("**any**");
799 ScheduledRecording::RescheduleCheck(tempri, "DeleteOldSeries");
800
801 // Delete the matching items from both m_showData and m_showList.
802 int pos = 0;
803 auto it = m_showData.begin();
804 while (pos < (int)m_showData.size())
805 {
806 if ((*it)->GetTitle() == title
807 && (*it)->GetRecordingStatus() != RecStatus::Pending
808 && (*it)->GetRecordingStatus() != RecStatus::Tuning
809 && (*it)->GetRecordingStatus() != RecStatus::Recording
810 && (*it)->GetRecordingStatus() != RecStatus::Failing)
811 {
812 LOG(VB_GENERAL, LOG_INFO, QString("Deleting %1 at pos %2")
813 .arg(title).arg(pos));
814 it = m_showData.erase(it);
816 m_showList->RemoveItem(item);
817 }
818 else
819 {
820 ++pos;
821 ++it;
822 }
823 }
824}
iterator erase(iterator it)
void clear(void)
iterator begin(void)
iterator end(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:41
static const Type kEventType
Definition: mythdialogbox.h:56
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:837
QVariant value(int i) const
Definition: mythdbcon.h:204
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:618
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
Definition: mythdbcon.cpp:888
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
Definition: mythdbcon.cpp:812
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:550
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:226
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:75
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:80
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:72
void showListTakeFocus(void)
MythUIText * m_curviewText
Definition: prevreclist.h:78
void showListLoseFocus(void)
void AllowRecord(void)
void ShowItemMenu(void)
InfoMap m_infoMap
Definition: prevreclist.h:82
bool keyPressEvent(QKeyEvent *e) override
Key event handler.
ProgramList m_showData
Definition: prevreclist.h:74
void DeleteOldSeries(bool ok)
ProgramList m_titleData
Definition: prevreclist.h:71
MythUIText * m_help1Text
Definition: prevreclist.h:79
void LoadShowsByDate(void)
void ShowMenu(void) override
void DeleteOldEpisode(bool ok)
Holds information on recordings and videos.
Definition: programinfo.h:68
uint GetChanID(void) const
This is the unique key used in the database to locate tuning information.
Definition: programinfo.h:373
QString GetTitle(void) const
Definition: programinfo.h:362
QDateTime GetRecordingStartTime(void) const
Approximate time the recording started.
Definition: programinfo.h:405
QDateTime GetScheduledStartTime(void) const
The scheduled start time of program.
Definition: programinfo.h:391
bool IsDuplicate(void) const
Definition: programinfo.h:493
QString GetSortTitle(void) const
Definition: programinfo.h:363
void SetProgramID(const QString &id)
Definition: programinfo.h:538
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: freesurround.h:24
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:57
STL namespace.
#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