MythTV  master
statusbox.h
Go to the documentation of this file.
1 #ifndef STATUSBOX_H_
2 #define STATUSBOX_H_
3 
4 // Qt
5 #include <QTimer>
6 
7 // MythTV
8 #include "mythscreentype.h"
9 #include "mythuibuttonlist.h"
10 
11 // Std
12 #include <vector> // For std::vector
13 using namespace std;
14 
15 class ProgramInfo;
16 class MythUIText;
17 class MythUIButtonList;
18 
19 class MythUIStateType;
20 
21 using recprof2bps_t = QMap<QString, unsigned int>;
22 
23 class StatusBoxItem : public QTimer, public MythUIButtonListItem
24 {
25  Q_OBJECT
26 
27  public:
28  StatusBoxItem(MythUIButtonList *lbtype, const QString& text, QVariant data)
29  : QTimer(),
30  MythUIButtonListItem (lbtype, text, data) { }
31 
32  void Start(int Interval = 1); // Seconds
33 
34  signals:
35  void UpdateRequired(StatusBoxItem* Item);
36 };
37 
38 class StatusBox : public MythScreenType
39 {
40  Q_OBJECT
41  public:
42  explicit StatusBox(MythScreenStack *parent);
43  ~StatusBox(void) override;
44 
45  bool Create(void) override; // MythScreenType
46  bool keyPressEvent(QKeyEvent *event) override; // MythScreenType
47  void customEvent(QEvent *event) override; // MythUIType
48 
49  signals:
50  void updateLog();
51 
52  protected:
53  void Init(void) override; // MythScreenType
54 
55  private slots:
56  void setHelpText(MythUIButtonListItem *item);
57  void updateLogList(MythUIButtonListItem *item);
58  void clicked(MythUIButtonListItem *item);
59 
60  void doListingsStatus();
61  void doScheduleStatus();
62  void doTunerStatus();
63  void doLogEntries();
64  void doJobQueueStatus();
65  void doMachineStatus();
66  void doAutoExpireList(bool updateExpList = true);
67  void doDisplayStatus();
68  void doDecoderStatus();
69 
70  private:
71  StatusBoxItem* AddLogLine(const QString & line,
72  const QString & help = "",
73  const QString & detail = "",
74  const QString & helpdetail = "",
75  const QString & state = "",
76  const QString & data = "");
77 
78  void getActualRecordedBPS(const QString& hostnames);
79 
80  MythUIText *m_helpText {nullptr};
81  MythUIText *m_justHelpText {nullptr};
82  MythUIButtonList *m_categoryList {nullptr};
83  MythUIButtonList *m_logList {nullptr};
84  MythUIStateType *m_iconState {nullptr};
85 
87 
88  vector<ProgramInfo *> m_expList;
89 
90  MythScreenStack *m_popupStack {nullptr};
91 
92  int m_minLevel {5};
93 
94  bool m_isBackendActive {false};
95 };
96 
97 #endif
This widget is used for grouping other widgets for display when a particular named state is called.
unsigned int slots[4]
Definition: element.c:38
vector< ProgramInfo * > m_expList
Definition: statusbox.h:88
All purpose text widget, displays a text string.
Definition: mythuitext.h:28
Holds information on recordings and videos.
Definition: programinfo.h:67
recprof2bps_t m_recordingProfilesBps
Definition: statusbox.h:86
StatusBoxItem(MythUIButtonList *lbtype, const QString &text, QVariant data)
Definition: statusbox.h:28
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
Reports on various status items.
Definition: statusbox.h:38
Screen in which all other widgets are contained and rendered.
QMap< QString, unsigned int > recprof2bps_t
Definition: statusbox.h:21