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