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 "libmyth/programinfo.h" // for ProgramList
10 
11 // MythFrontend
12 #include "proglist_helpers.h"
13 #include "schedulecommon.h"
14 
16  plUnknown = 0,
17  plTitle = 1,
31 };
32 
33 class ProgLister : public ScheduleCommon
34 {
35  friend class PhrasePopup;
36  friend class TimePopup;
37  friend class PowerSearchPopup;
38  friend class EditPowerSearchPopup;
39 
40  Q_OBJECT
41 
42  public:
43  ProgLister(MythScreenStack *parent, ProgListType pltype,
44  QString view, QString extraArg,
45  QDateTime selectedTime = QDateTime());
46  explicit ProgLister(MythScreenStack *parent, uint recid = 0,
47  QString title = QString());
48  ~ProgLister() override;
49 
50  bool Create(void) override; // MythScreenType
51  bool keyPressEvent(QKeyEvent *event) override; // MythScreenType
52  void customEvent(QEvent *event) override; // ScheduleCommon
53 
54  protected slots:
57 
58  void DeleteOldEpisode(bool ok);
59  void DeleteOldSeries(bool ok);
60 
61  void SetViewFromList(const QString& item);
62  void SetViewFromTime(QDateTime searchTime);
63 
64  void ShowDeleteRuleMenu(void);
65  void ShowDeleteOldEpisodeMenu(void);
66  void ShowChooseViewMenu(void);
67  void ShowOldRecordedMenu(void);
68 
69  private:
70  void Load(void) override; // MythScreenType
71 
72  void FillViewList(const QString &view);
73  void FillItemList(bool restorePosition, bool updateDisp = true);
74 
75  void ClearCurrentProgramInfo(void);
76  void UpdateDisplay(const ProgramInfo *selected = nullptr);
77  void RestoreSelection(const ProgramInfo *selected, int selectedOffset);
78  void UpdateButtonList(void);
79  void UpdateKeywordInDB(const QString &text, const QString &oldValue);
80 
81  void ShowMenu(void) override; // MythScreenType
82  void ShowDeleteItemMenu(void);
83  void ShowDeleteOldSeriesMenu(void);
84 
85  void SwitchToPreviousView(void);
86  void SwitchToNextView(void);
87 
89  SortBy GetSortBy(void) const;
90  void SortList(SortBy sortby, bool reverseSort);
91 
92  ProgramInfo *GetCurrentProgram(void) const override; // ScheduleCommon
93 
94  static bool PowerStringToSQL(
95  const QString &qphrase, QString &output, MSqlBindings &bindings) ;
96 
97  private:
100  QString m_title;
101  QString m_extraArg;
102  QDateTime m_startTime;
103  QDateTime m_searchTime;
104  QDateTime m_selectedTime;
106 
108 
109  QString m_view;
110  int m_curView {-1};
111  QStringList m_viewList;
112  QStringList m_viewTextList;
113 
117 
118  QStringList m_typeList;
119  QStringList m_genreList;
120  QStringList m_stationList;
121 
122  bool m_allowEvents {true};
123  bool m_titleSort {false};
124  bool m_reverseSort {false};
125  bool m_useGenres {false};
126 
132 
133  bool m_allowViewDialog {true};
134 };
135 
136 #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:169
plPeopleSearch
@ plPeopleSearch
Definition: proglist.h:20
ProgLister::m_progList
MythUIButtonList * m_progList
Definition: proglist.h:130
ProgLister::TimePopup
friend class TimePopup
Definition: proglist.h:36
ProgLister::DeleteOldEpisode
void DeleteOldEpisode(bool ok)
Definition: proglist.cpp:646
ProgLister::GetSortBy
SortBy GetSortBy(void) const
Definition: proglist.cpp:1402
ProgLister::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: proglist.cpp:180
ProgLister::kTitleSort
@ kTitleSort
Definition: proglist.h:88
plChannel
@ plChannel
Definition: proglist.h:26
plUnknown
@ plUnknown
Definition: proglist.h:16
ProgLister::m_viewList
QStringList m_viewList
Definition: proglist.h:111
ProgLister::m_allowEvents
bool m_allowEvents
Definition: proglist.h:122
ProgLister::m_searchTime
QDateTime m_searchTime
Definition: proglist.h:103
MythScreenStack
Definition: mythscreenstack.h:16
plCategory
@ plCategory
Definition: proglist.h:25
ProgLister
Definition: proglist.h:33
ProgLister::ShowOldRecordedMenu
void ShowOldRecordedMenu(void)
Definition: proglist.cpp:700
ProgLister::m_viewTextList
QStringList m_viewTextList
Definition: proglist.h:112
schedulecommon.h
ProgLister::SwitchToPreviousView
void SwitchToPreviousView(void)
Definition: proglist.cpp:322
ProgLister::ShowDeleteRuleMenu
void ShowDeleteRuleMenu(void)
Definition: proglist.cpp:603
PowerSearchPopup
Definition: proglist_helpers.h:59
ProgLister::SortList
void SortList(SortBy sortby, bool reverseSort)
Definition: proglist.cpp:1411
ProgLister::kTimeSort
@ kTimeSort
Definition: proglist.h:88
ProgLister::UpdateKeywordInDB
void UpdateKeywordInDB(const QString &text, const QString &oldValue)
Definition: proglist.cpp:369
ProgLister::kPrevTitleSort
@ kPrevTitleSort
Definition: proglist.h:88
ProgLister::DeleteOldSeries
void DeleteOldSeries(bool ok)
Definition: proglist.cpp:679
ProgLister::m_genreList
QStringList m_genreList
Definition: proglist.h:119
MythUIButtonListItem
Definition: mythuibuttonlist.h:41
ProgLister::m_itemListSave
ProgramList m_itemListSave
Definition: proglist.h:115
plPreviouslyRecorded
@ plPreviouslyRecorded
Definition: proglist.h:30
ProgLister::m_reverseSort
bool m_reverseSort
Definition: proglist.h:124
proglist_helpers.h
plTitleSearch
@ plTitleSearch
Definition: proglist.h:18
ProgListType
ProgListType
Definition: proglist.h:15
programinfo.h
ProgLister::m_startTime
QDateTime m_startTime
Definition: proglist.h:102
ProgLister::ShowMenu
void ShowMenu(void) override
Definition: proglist.cpp:268
ProgLister::m_schedText
MythUIText * m_schedText
Definition: proglist.h:127
ProgLister::UpdateButtonList
void UpdateButtonList(void)
Definition: proglist.cpp:1552
ProgLister::HandleSelected
void HandleSelected(MythUIButtonListItem *item)
Definition: proglist.cpp:1568
ProgLister::m_curView
int m_curView
Definition: proglist.h:110
ProgLister::HandleVisible
void HandleVisible(MythUIButtonListItem *item)
Definition: proglist.cpp:1519
ProgLister::FillViewList
void FillViewList(const QString &view)
Definition: proglist.cpp:735
ProgLister::m_selectedTime
QDateTime m_selectedTime
Definition: proglist.h:104
ProgLister::m_recid
uint m_recid
Definition: proglist.h:99
ScheduleCommon
Definition: schedulecommon.h:15
RecSearchType
RecSearchType
Definition: recordingtypes.h:71
ProgLister::FillItemList
void FillItemList(bool restorePosition, bool updateDisp=true)
Definition: proglist.cpp:1078
plPowerSearch
@ plPowerSearch
Definition: proglist.h:21
ProgLister::SetViewFromTime
void SetViewFromTime(QDateTime searchTime)
Definition: proglist.cpp:516
ProgLister::PowerStringToSQL
static bool PowerStringToSQL(const QString &qphrase, QString &output, MSqlBindings &bindings)
Definition: proglist.cpp:537
kNoSearch
@ kNoSearch
Definition: recordingtypes.h:73
plTitle
@ plTitle
Definition: proglist.h:17
uint
unsigned int uint
Definition: compat.h:79
ProgLister::GetCurrentProgram
ProgramInfo * GetCurrentProgram(void) const override
Definition: proglist.cpp:587
ProgLister::m_curviewText
MythUIText * m_curviewText
Definition: proglist.h:128
plStoredSearch
@ plStoredSearch
Definition: proglist.h:29
ProgLister::SetViewFromList
void SetViewFromList(const QString &item)
Definition: proglist.cpp:530
ProgLister::m_title
QString m_title
Definition: proglist.h:100
AutoDeleteDeque< ProgramInfo * >
ProgLister::m_allowViewDialog
bool m_allowViewDialog
Definition: proglist.h:133
ProgLister::~ProgLister
~ProgLister() override
Definition: proglist.cpp:89
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:67
MythUIText
All purpose text widget, displays a text string.
Definition: mythuitext.h:28
ProgLister::m_positionText
MythUIText * m_positionText
Definition: proglist.h:129
ProgLister::ShowChooseViewMenu
void ShowChooseViewMenu(void)
Definition: proglist.cpp:414
ProgLister::ClearCurrentProgramInfo
void ClearCurrentProgramInfo(void)
Definition: proglist.cpp:1446
plTime
@ plTime
Definition: proglist.h:27
ProgLister::m_typeList
QStringList m_typeList
Definition: proglist.h:118
ProgLister::m_itemList
ProgramList m_itemList
Definition: proglist.h:114
EditPowerSearchPopup
Definition: proglist_helpers.h:100
ProgLister::m_searchType
RecSearchType m_searchType
Definition: proglist.h:107
PhrasePopup
Definition: proglist_helpers.h:17
ProgLister::m_type
ProgListType m_type
Definition: proglist.h:98
plMovies
@ plMovies
Definition: proglist.h:24
ProgLister::m_stationList
QStringList m_stationList
Definition: proglist.h:120
ProgLister::m_schedList
ProgramList m_schedList
Definition: proglist.h:116
ProgLister::m_channelOrdering
QString m_channelOrdering
Definition: proglist.h:105
ProgLister::ProgLister
ProgLister(MythScreenStack *parent, ProgListType pltype, QString view, QString extraArg, QDateTime selectedTime=QDateTime())
Definition: proglist.cpp:35
ProgLister::Create
bool Create(void) override
Definition: proglist.cpp:96
ProgLister::m_extraArg
QString m_extraArg
Definition: proglist.h:101
plRecordid
@ plRecordid
Definition: proglist.h:28
ProgLister::ShowDeleteOldEpisodeMenu
void ShowDeleteOldEpisodeMenu(void)
Definition: proglist.cpp:634
ProgLister::RestoreSelection
void RestoreSelection(const ProgramInfo *selected, int selectedOffset)
Definition: proglist.cpp:1491
plSQLSearch
@ plSQLSearch
Definition: proglist.h:22
plNewListings
@ plNewListings
Definition: proglist.h:23
ProgLister::customEvent
void customEvent(QEvent *event) override
Definition: proglist.cpp:1606
ProgLister::SwitchToNextView
void SwitchToNextView(void)
Definition: proglist.cpp:345
ProgLister::ShowDeleteItemMenu
void ShowDeleteItemMenu(void)
Definition: proglist.cpp:595
MythUIButtonList
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
Definition: mythuibuttonlist.h:191
ProgLister::SortBy
SortBy
Definition: proglist.h:88
ProgLister::ShowDeleteOldSeriesMenu
void ShowDeleteOldSeriesMenu(void)
Definition: proglist.cpp:667
ProgLister::m_titleSort
bool m_titleSort
Definition: proglist.h:123
ProgLister::UpdateDisplay
void UpdateDisplay(const ProgramInfo *selected=nullptr)
Definition: proglist.cpp:1457
output
#define output
Definition: synaesthesia.cpp:218
ProgLister::m_view
QString m_view
Definition: proglist.h:109
plKeywordSearch
@ plKeywordSearch
Definition: proglist.h:19
ProgLister::m_useGenres
bool m_useGenres
Definition: proglist.h:125
ProgLister::m_messageText
MythUIText * m_messageText
Definition: proglist.h:131