MythTV  master
proglist.h
Go to the documentation of this file.
1 #ifndef PROGLIST_H_
2 #define PROGLIST_H_
3 
4 // Qt headers
5 #include <QDateTime>
6 #include <QString>
7 
8 // MythTV headers
9 #include "programinfo.h" // for ProgramList
10 #include "schedulecommon.h"
11 #include "proglist_helpers.h"
12 
14  plUnknown = 0,
15  plTitle = 1,
29 };
30 
31 class ProgLister : public ScheduleCommon
32 {
33  friend class PhrasePopup;
34  friend class TimePopup;
35  friend class PowerSearchPopup;
36  friend class EditPowerSearchPopup;
37 
38  Q_OBJECT
39 
40  public:
41  ProgLister(MythScreenStack *parent, ProgListType pltype,
42  QString view, QString extraArg,
43  QDateTime selectedTime = QDateTime());
44  explicit ProgLister(MythScreenStack *parent, uint recid = 0,
45  QString title = QString());
46  ~ProgLister() override;
47 
48  bool Create(void) override; // MythScreenType
49  bool keyPressEvent(QKeyEvent *event) override; // MythScreenType
50  void customEvent(QEvent *event) override; // ScheduleCommon
51 
52  protected slots:
55 
56  void DeleteOldEpisode(bool ok);
57  void DeleteOldSeries(bool ok);
58 
59  void SetViewFromList(const QString& item);
60  void SetViewFromTime(QDateTime searchTime);
61 
62  void ShowDeleteRuleMenu(void);
63  void ShowDeleteOldEpisodeMenu(void);
64  void ShowChooseViewMenu(void);
65  void ShowOldRecordedMenu(void);
66 
67  private:
68  void Load(void) override; // MythScreenType
69 
70  void FillViewList(const QString &view);
71  void FillItemList(bool restorePosition, bool updateDisp = true);
72 
73  void ClearCurrentProgramInfo(void);
74  void UpdateDisplay(const ProgramInfo *selected = nullptr);
75  void RestoreSelection(const ProgramInfo *selected, int selectedOffset);
76  void UpdateButtonList(void);
77  void UpdateKeywordInDB(const QString &text, const QString &oldValue);
78 
79  void ShowMenu(void) override; // MythScreenType
80  void ShowDeleteItemMenu(void);
81  void ShowDeleteOldSeriesMenu(void);
82 
83  void SwitchToPreviousView(void);
84  void SwitchToNextView(void);
85 
87  SortBy GetSortBy(void) const;
88  void SortList(SortBy sortby, bool reverseSort);
89 
90  ProgramInfo *GetCurrentProgram(void) const override; // ScheduleCommon
91 
92  static bool PowerStringToSQL(
93  const QString &qphrase, QString &output, MSqlBindings &bindings) ;
94 
95  private:
98  QString m_title;
99  QString m_extraArg;
100  QDateTime m_startTime;
101  QDateTime m_searchTime;
102  QDateTime m_selectedTime;
104 
106 
107  QString m_view;
108  int m_curView {-1};
109  QStringList m_viewList;
110  QStringList m_viewTextList;
111 
115 
116  QStringList m_typeList;
117  QStringList m_genreList;
118  QStringList m_stationList;
119 
120  bool m_allowEvents {true};
121  bool m_titleSort {false};
122  bool m_reverseSort {false};
123  bool m_useGenres {false};
124 
130 
131  bool m_allowViewDialog {true};
132 };
133 
134 #endif
MSqlBindings
QMap< QString, QVariant > MSqlBindings
typedef for a map of string -> string bindings for generic queries.
Definition: mythdbcon.h:98
ProgLister::Load
void Load(void) override
Load data which will ultimately be displayed on-screen or used to determine what appears on-screen (S...
Definition: proglist.cpp:171
plPeopleSearch
@ plPeopleSearch
Definition: proglist.h:18
ProgLister::m_progList
MythUIButtonList * m_progList
Definition: proglist.h:128
ProgLister::TimePopup
friend class TimePopup
Definition: proglist.h:34
ProgLister::DeleteOldEpisode
void DeleteOldEpisode(bool ok)
Definition: proglist.cpp:636
ProgLister::GetSortBy
SortBy GetSortBy(void) const
Definition: proglist.cpp:1392
ProgLister::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: proglist.cpp:182
ProgLister::kTitleSort
@ kTitleSort
Definition: proglist.h:86
title
QString title
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:633
plChannel
@ plChannel
Definition: proglist.h:24
plUnknown
@ plUnknown
Definition: proglist.h:14
ProgLister::m_viewList
QStringList m_viewList
Definition: proglist.h:109
ProgLister::m_allowEvents
bool m_allowEvents
Definition: proglist.h:120
ProgLister::m_searchTime
QDateTime m_searchTime
Definition: proglist.h:101
MythScreenStack
Definition: mythscreenstack.h:16
plCategory
@ plCategory
Definition: proglist.h:23
ProgLister
Definition: proglist.h:32
ProgLister::ShowOldRecordedMenu
void ShowOldRecordedMenu(void)
Definition: proglist.cpp:690
slots
unsigned int slots[4]
Definition: element.cpp:38
ProgLister::m_viewTextList
QStringList m_viewTextList
Definition: proglist.h:110
schedulecommon.h
ProgLister::SwitchToPreviousView
void SwitchToPreviousView(void)
Definition: proglist.cpp:324
ProgLister::ShowDeleteRuleMenu
void ShowDeleteRuleMenu(void)
Definition: proglist.cpp:593
PowerSearchPopup
Definition: proglist_helpers.h:60
ProgLister::SortList
void SortList(SortBy sortby, bool reverseSort)
Definition: proglist.cpp:1401
ProgLister::kTimeSort
@ kTimeSort
Definition: proglist.h:86
ProgLister::UpdateKeywordInDB
void UpdateKeywordInDB(const QString &text, const QString &oldValue)
Definition: proglist.cpp:371
ProgLister::kPrevTitleSort
@ kPrevTitleSort
Definition: proglist.h:86
ProgLister::DeleteOldSeries
void DeleteOldSeries(bool ok)
Definition: proglist.cpp:669
ProgLister::m_genreList
QStringList m_genreList
Definition: proglist.h:117
MythUIButtonListItem
Definition: mythuibuttonlist.h:28
ProgLister::m_itemListSave
ProgramList m_itemListSave
Definition: proglist.h:113
plPreviouslyRecorded
@ plPreviouslyRecorded
Definition: proglist.h:28
ProgLister::m_reverseSort
bool m_reverseSort
Definition: proglist.h:122
proglist_helpers.h
plTitleSearch
@ plTitleSearch
Definition: proglist.h:16
ProgListType
ProgListType
Definition: proglist.h:13
programinfo.h
ProgLister::m_startTime
QDateTime m_startTime
Definition: proglist.h:100
ProgLister::ShowMenu
void ShowMenu(void) override
Definition: proglist.cpp:270
ProgLister::m_schedText
MythUIText * m_schedText
Definition: proglist.h:125
ProgLister::UpdateButtonList
void UpdateButtonList(void)
Definition: proglist.cpp:1542
ProgLister::HandleSelected
void HandleSelected(MythUIButtonListItem *item)
Definition: proglist.cpp:1558
ProgLister::m_curView
int m_curView
Definition: proglist.h:108
ProgLister::HandleVisible
void HandleVisible(MythUIButtonListItem *item)
Definition: proglist.cpp:1509
ProgLister::FillViewList
void FillViewList(const QString &view)
Definition: proglist.cpp:725
ProgLister::m_selectedTime
QDateTime m_selectedTime
Definition: proglist.h:102
ProgLister::m_recid
uint m_recid
Definition: proglist.h:97
ScheduleCommon
Definition: schedulecommon.h:16
RecSearchType
RecSearchType
Definition: recordingtypes.h:70
ProgLister::FillItemList
void FillItemList(bool restorePosition, bool updateDisp=true)
Definition: proglist.cpp:1068
plPowerSearch
@ plPowerSearch
Definition: proglist.h:19
ProgLister::SetViewFromTime
void SetViewFromTime(QDateTime searchTime)
Definition: proglist.cpp:506
ProgLister::PowerStringToSQL
static bool PowerStringToSQL(const QString &qphrase, QString &output, MSqlBindings &bindings)
Definition: proglist.cpp:527
kNoSearch
@ kNoSearch
Definition: recordingtypes.h:71
plTitle
@ plTitle
Definition: proglist.h:15
uint
unsigned int uint
Definition: compat.h:140
ProgLister::GetCurrentProgram
ProgramInfo * GetCurrentProgram(void) const override
Definition: proglist.cpp:577
ProgLister::m_curviewText
MythUIText * m_curviewText
Definition: proglist.h:126
plStoredSearch
@ plStoredSearch
Definition: proglist.h:27
ProgLister::SetViewFromList
void SetViewFromList(const QString &item)
Definition: proglist.cpp:520
ProgLister::m_title
QString m_title
Definition: proglist.h:98
AutoDeleteDeque< ProgramInfo * >
ProgLister::m_allowViewDialog
bool m_allowViewDialog
Definition: proglist.h:131
ProgLister::~ProgLister
~ProgLister() override
Definition: proglist.cpp:91
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:68
MythUIText
All purpose text widget, displays a text string.
Definition: mythuitext.h:29
ProgLister::m_positionText
MythUIText * m_positionText
Definition: proglist.h:127
ProgLister::ShowChooseViewMenu
void ShowChooseViewMenu(void)
Definition: proglist.cpp:416
ProgLister::ClearCurrentProgramInfo
void ClearCurrentProgramInfo(void)
Definition: proglist.cpp:1436
plTime
@ plTime
Definition: proglist.h:25
ProgLister::m_typeList
QStringList m_typeList
Definition: proglist.h:116
ProgLister::m_itemList
ProgramList m_itemList
Definition: proglist.h:112
EditPowerSearchPopup
Definition: proglist_helpers.h:101
ProgLister::m_searchType
RecSearchType m_searchType
Definition: proglist.h:105
PhrasePopup
Definition: proglist_helpers.h:18
ProgLister::m_type
ProgListType m_type
Definition: proglist.h:96
plMovies
@ plMovies
Definition: proglist.h:22
ProgLister::m_stationList
QStringList m_stationList
Definition: proglist.h:118
ProgLister::m_schedList
ProgramList m_schedList
Definition: proglist.h:114
ProgLister::m_channelOrdering
QString m_channelOrdering
Definition: proglist.h:103
ProgLister::ProgLister
ProgLister(MythScreenStack *parent, ProgListType pltype, QString view, QString extraArg, QDateTime selectedTime=QDateTime())
Definition: proglist.cpp:37
ProgLister::Create
bool Create(void) override
Definition: proglist.cpp:98
ProgLister::m_extraArg
QString m_extraArg
Definition: proglist.h:99
plRecordid
@ plRecordid
Definition: proglist.h:26
ProgLister::ShowDeleteOldEpisodeMenu
void ShowDeleteOldEpisodeMenu(void)
Definition: proglist.cpp:624
ProgLister::RestoreSelection
void RestoreSelection(const ProgramInfo *selected, int selectedOffset)
Definition: proglist.cpp:1481
plSQLSearch
@ plSQLSearch
Definition: proglist.h:20
plNewListings
@ plNewListings
Definition: proglist.h:21
ProgLister::customEvent
void customEvent(QEvent *event) override
Definition: proglist.cpp:1596
ProgLister::SwitchToNextView
void SwitchToNextView(void)
Definition: proglist.cpp:347
ProgLister::ShowDeleteItemMenu
void ShowDeleteItemMenu(void)
Definition: proglist.cpp:585
MythUIButtonList
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
Definition: mythuibuttonlist.h:144
ProgLister::SortBy
SortBy
Definition: proglist.h:86
ProgLister::ShowDeleteOldSeriesMenu
void ShowDeleteOldSeriesMenu(void)
Definition: proglist.cpp:657
ProgLister::m_titleSort
bool m_titleSort
Definition: proglist.h:121
ProgLister::UpdateDisplay
void UpdateDisplay(const ProgramInfo *selected=nullptr)
Definition: proglist.cpp:1447
output
#define output
Definition: synaesthesia.cpp:221
ProgLister::m_view
QString m_view
Definition: proglist.h:107
plKeywordSearch
@ plKeywordSearch
Definition: proglist.h:17
ProgLister::m_useGenres
bool m_useGenres
Definition: proglist.h:123
ProgLister::m_messageText
MythUIText * m_messageText
Definition: proglist.h:129