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 // MythTV
24 #include <libmythui/mythuibutton.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() override;
63 
64  bool Create(void) override; // MythScreenType
65  bool keyPressEvent(QKeyEvent *event) 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_timeText {nullptr};
83  MythUIText *m_dateText {nullptr};
84  MythUIText *m_loadText {nullptr};
85  MythUIText *m_diskText {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
ZMConsole::m_diskText
MythUIText * m_diskText
Definition: zmconsole.h:85
FunctionDialog
Definition: zmconsole.h:31
ZMConsole::ZMConsole
ZMConsole(MythScreenStack *parent)
Definition: zmconsole.cpp:120
ZMConsole::m_diskStat
QString m_diskStat
Definition: zmconsole.h:95
ZMConsole::~ZMConsole
~ZMConsole() override
Definition: zmconsole.cpp:134
ZMConsole::functionChanged
void functionChanged(bool changed)
Definition: zmconsole.cpp:288
zmdefines.h
ZMConsole::setMonitorFunction
void setMonitorFunction(const QString &function, int enabled)
FunctionDialog::Create
bool Create() override
Definition: zmconsole.cpp:38
ZMConsole::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: zmconsole.cpp:217
mythdialogbox.h
MythScreenStack
Definition: mythscreenstack.h:16
ZMConsole::m_cpuStat
QString m_cpuStat
Definition: zmconsole.h:94
FunctionDialog::m_functionList
MythUIButtonList * m_functionList
Definition: zmconsole.h:50
ZMConsole::m_monitorList
MythUIButtonList * m_monitorList
Definition: zmconsole.h:79
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:45
ZMConsole::getMonitorStatus
void getMonitorStatus(void)
Definition: zmconsole.cpp:212
FunctionDialog::haveResult
void haveResult(bool)
mythuibuttonlist.h
ZMConsole::updateStatus
void updateStatus()
Definition: zmconsole.cpp:185
FunctionDialog::FunctionDialog
FunctionDialog(MythScreenStack *parent, Monitor *monitor)
Definition: zmconsole.h:36
FunctionDialog::m_captionText
MythUIText * m_captionText
Definition: zmconsole.h:49
FunctionDialog::m_notificationCheck
MythUICheckBox * m_notificationCheck
Definition: zmconsole.h:52
ZMConsole::showEditFunctionPopup
void showEditFunctionPopup()
Definition: zmconsole.cpp:246
ZMConsole::m_timeTimer
QTimer * m_timeTimer
Definition: zmconsole.h:90
FunctionDialog::m_okButton
MythUIButton * m_okButton
Definition: zmconsole.h:53
ZMConsole::m_statusText
MythUIText * m_statusText
Definition: zmconsole.h:81
MythUIButton
A single button widget.
Definition: mythuibutton.h:21
ZMConsole::m_runningText
MythUIText * m_runningText
Definition: zmconsole.h:80
FunctionDialog::m_enabledCheck
MythUICheckBox * m_enabledCheck
Definition: zmconsole.h:51
FunctionDialog::m_monitor
Monitor * m_monitor
Definition: zmconsole.h:48
FunctionDialog::setMonitorFunction
void setMonitorFunction(void)
Definition: zmconsole.cpp:87
ZMConsole::getDaemonStatus
void getDaemonStatus()
Definition: zmconsole.cpp:193
ZMConsole
Definition: zmconsole.h:56
ZMConsole::m_popupStack
MythScreenStack * m_popupStack
Definition: zmconsole.h:88
MythUICheckBox
A checkbox widget supporting three check states - on,off,half and two conditions - selected and unsel...
Definition: mythuicheckbox.h:15
ZMConsole::Create
bool Create(void) override
Definition: zmconsole.cpp:139
MythUIText
All purpose text widget, displays a text string.
Definition: mythuitext.h:28
ZMConsole::updateTime
void updateTime()
Definition: zmconsole.cpp:172
ZMConsole::m_daemonStatus
QString m_daemonStatus
Definition: zmconsole.h:93
ZMConsole::m_timeFormat
QString m_timeFormat
Definition: zmconsole.h:91
mythuibutton.h
ZMConsole::updateMonitorList
void updateMonitorList()
Definition: zmconsole.cpp:262
Monitor
Definition: zmdefines.h:108
ZMConsole::m_timeText
MythUIText * m_timeText
Definition: zmconsole.h:82
mythuicheckbox.h
MythUIButtonList
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
Definition: mythuibuttonlist.h:191
ZMConsole::m_dateText
MythUIText * m_dateText
Definition: zmconsole.h:83
ZMConsole::m_functionDialog
FunctionDialog * m_functionDialog
Definition: zmconsole.h:87
ZMConsole::m_updateTimer
QTimer * m_updateTimer
Definition: zmconsole.h:97
ZMConsole::m_loadText
MythUIText * m_loadText
Definition: zmconsole.h:84
mythscreentype.h