MythTV  master
zmconsole.h
Go to the documentation of this file.
1 /* ============================================================
2  * This program is free software; you can redistribute it
3  * and/or modify it under the terms of the GNU General
4  * Public License as published bythe Free Software Foundation;
5  * either version 2, or (at your option)
6  * any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * ============================================================ */
14 
15 #ifndef ZMCONSOLE_H
16 #define ZMCONSOLE_H
17 
18 // qt
19 #include <QKeyEvent>
20 
21 // libmythui
22 #include <mythuibuttonlist.h>
23 #include <mythuibutton.h>
24 #include <mythuicheckbox.h>
25 #include <mythscreentype.h>
26 #include <mythdialogbox.h>
27 
28 // zm
29 #include "zmdefines.h"
30 
32 {
33  Q_OBJECT
34 
35  public:
37  : MythScreenType(parent, "functionpopup"), m_monitor(monitor) {}
38 
39  bool Create() override; // MythScreenType
40 
41  signals:
42  void haveResult(bool);
43 
44  private slots:
45  void setMonitorFunction(void);
46 
47  private:
48  Monitor *m_monitor {nullptr};
54 };
55 
56 class ZMConsole : public MythScreenType
57 {
58  Q_OBJECT
59 
60  public:
61  explicit ZMConsole(MythScreenStack *parent);
62  ~ZMConsole();
63 
64  bool Create(void) override; // MythScreenType
65  bool keyPressEvent(QKeyEvent *) override; // MythScreenType
66 
67  private slots:
68  void updateTime();
69  void updateStatus();
70  void getDaemonStatus();
71  void getMonitorStatus(void);
72  void showEditFunctionPopup();
73  void functionChanged(bool changed);
74 
75  private:
76  void updateMonitorList();
77  void setMonitorFunction(const QString &function, int enabled);
78 
82  MythUIText *m_time_text {nullptr};
83  MythUIText *m_date_text {nullptr};
84  MythUIText *m_load_text {nullptr};
85  MythUIText *m_disk_text {nullptr};
86 
89 
90  QTimer *m_timeTimer {nullptr};
91  QString m_timeFormat {"h:mm AP"};
92 
93  QString m_daemonStatus;
94  QString m_cpuStat;
95  QString m_diskStat;
96 
97  QTimer *m_updateTimer {nullptr};
98 };
99 
100 #endif
unsigned int slots[4]
Definition: element.c:38
Monitor * m_monitor
Definition: zmconsole.h:48
void functionChanged(bool changed)
Definition: zmconsole.cpp:284
All purpose text widget, displays a text string.
Definition: mythuitext.h:28
MythUIButton * m_okButton
Definition: zmconsole.h:53
QString m_cpuStat
Definition: zmconsole.h:94
A checkbox widget supporting three check states - on,off,half and two conditions - selected and unsel...
MythUICheckBox * m_enabledCheck
Definition: zmconsole.h:51
QString m_daemonStatus
Definition: zmconsole.h:93
bool Create() override
Definition: zmconsole.cpp:36
bool Create(void) override
Definition: zmconsole.cpp:137
void showEditFunctionPopup()
Definition: zmconsole.cpp:242
void getDaemonStatus()
Definition: zmconsole.cpp:191
MythUIText * m_captionText
Definition: zmconsole.h:49
void updateStatus()
Definition: zmconsole.cpp:183
MythUIText * m_load_text
Definition: zmconsole.h:84
bool keyPressEvent(QKeyEvent *) override
Key event handler.
Definition: zmconsole.cpp:215
QString m_diskStat
Definition: zmconsole.h:95
QString m_timeFormat
Definition: zmconsole.h:91
void getMonitorStatus(void)
Definition: zmconsole.cpp:210
void setMonitorFunction(const QString &function, int enabled)
MythUIButtonList * m_functionList
Definition: zmconsole.h:50
ZMConsole(MythScreenStack *parent)
Definition: zmconsole.cpp:118
MythScreenStack * m_popupStack
Definition: zmconsole.h:88
FunctionDialog * m_functionDialog
Definition: zmconsole.h:87
FunctionDialog(MythScreenStack *parent, Monitor *monitor)
Definition: zmconsole.h:36
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
MythUIText * m_running_text
Definition: zmconsole.h:80
MythUICheckBox * m_notificationCheck
Definition: zmconsole.h:52
A single button widget.
Definition: mythuibutton.h:21
MythUIText * m_time_text
Definition: zmconsole.h:82
void updateTime()
Definition: zmconsole.cpp:170
QTimer * m_updateTimer
Definition: zmconsole.h:97
MythUIText * m_date_text
Definition: zmconsole.h:83
QTimer * m_timeTimer
Definition: zmconsole.h:90
MythUIText * m_disk_text
Definition: zmconsole.h:85
void updateMonitorList()
Definition: zmconsole.cpp:258
MythUIText * m_status_text
Definition: zmconsole.h:81
Screen in which all other widgets are contained and rendered.
void setMonitorFunction(void)
Definition: zmconsole.cpp:85
void haveResult(bool)
MythUIButtonList * m_monitor_list
Definition: zmconsole.h:79