MythTV  master
logviewer.h
Go to the documentation of this file.
1 #ifndef LOGVIEWER_H_
2 #define LOGVIEWER_H_
3 
4 // qt
5 #include <QTimer>
6 
7 // myth
8 #include <mythscreentype.h>
9 
10 const int DEFAULT_UPDATE_TIME = 5;
11 
12 class MythUIButton;
13 class MythUIButtonList;
14 class MythUIText;
15 
16 void showLogViewer(void);
17 
18 class LogViewer : public MythScreenType
19 {
20  Q_OBJECT
21 
22  public:
23 
24  explicit LogViewer(MythScreenStack *parent);
25  ~LogViewer(void) override;
26 
27  bool Create(void) override; // MythScreenType
28  bool keyPressEvent(QKeyEvent *e) override; // MythScreenType
29 
30  void setFilenames(const QString &progressLog, const QString &fullLog);
31 
32  protected slots:
33  static void cancelClicked(void);
34  void updateClicked(void);
35  void updateTimerTimeout(void);
36  void toggleAutoUpdate(void);
37  static bool loadFile(const QString& filename, QStringList &list, int startline);
38  void showProgressLog(void);
39  void showFullLog(void);
40  void ShowMenu(void) override; // MythScreenType
42 
43  private:
44  void Init(void) override; // MythScreenType
45  static QString getSetting(const QString &key);
46 
47  bool m_autoUpdate {false};
49  QTimer *m_updateTimer {nullptr};
50 
51  QString m_currentLog;
52  QString m_progressLog;
53  QString m_fullLog;
54 
56  MythUIText *m_logText {nullptr};
57 
61 };
62 
63 #endif
LogViewer::toggleAutoUpdate
void toggleAutoUpdate(void)
Definition: logviewer.cpp:169
LogViewer::~LogViewer
~LogViewer(void) override
Definition: logviewer.cpp:87
e
QDomElement e
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:1420
showLogViewer
void showLogViewer(void)
Definition: logviewer.cpp:24
LogViewer::m_updateTime
int m_updateTime
Definition: logviewer.h:48
LogViewer::setFilenames
void setFilenames(const QString &progressLog, const QString &fullLog)
Definition: logviewer.cpp:312
LogViewer::updateLogItem
void updateLogItem(MythUIButtonListItem *item)
Definition: logviewer.cpp:179
MythScreenStack
Definition: mythscreenstack.h:16
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:45
LogViewer
Definition: logviewer.h:19
LogViewer::cancelClicked
static void cancelClicked(void)
Definition: logviewer.cpp:185
LogViewer::Create
bool Create(void) override
Definition: logviewer.cpp:94
MythUIButtonListItem
Definition: mythuibuttonlist.h:28
LogViewer::getSetting
static QString getSetting(const QString &key)
Definition: logviewer.cpp:238
DEFAULT_UPDATE_TIME
const int DEFAULT_UPDATE_TIME
Definition: logviewer.h:10
LogViewer::m_autoUpdate
bool m_autoUpdate
Definition: logviewer.h:47
LogViewer::m_exitButton
MythUIButton * m_exitButton
Definition: logviewer.h:58
LogViewer::m_updateButton
MythUIButton * m_updateButton
Definition: logviewer.h:60
LogViewer::m_updateTimer
QTimer * m_updateTimer
Definition: logviewer.h:49
LogViewer::ShowMenu
void ShowMenu(void) override
Definition: logviewer.cpp:333
MythUIButton
A single button widget.
Definition: mythuibutton.h:22
LogViewer::m_logText
MythUIText * m_logText
Definition: logviewer.h:56
LogViewer::Init
void Init(void) override
Used after calling Load() to assign data to widgets and other UI initilisation which is prohibited in...
Definition: logviewer.cpp:132
filename
QString filename
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:637
LogViewer::m_cancelButton
MythUIButton * m_cancelButton
Definition: logviewer.h:59
LogViewer::showFullLog
void showFullLog(void)
Definition: logviewer.cpp:326
MythUIText
All purpose text widget, displays a text string.
Definition: mythuitext.h:29
LogViewer::LogViewer
LogViewer(MythScreenStack *parent)
Definition: logviewer.cpp:79
LogViewer::showProgressLog
void showProgressLog(void)
Definition: logviewer.cpp:319
LogViewer::updateTimerTimeout
void updateTimerTimeout(void)
Definition: logviewer.cpp:164
LogViewer::m_progressLog
QString m_progressLog
Definition: logviewer.h:52
LogViewer::loadFile
static bool loadFile(const QString &filename, QStringList &list, int startline)
Definition: logviewer.cpp:265
LogViewer::updateClicked
void updateClicked(void)
Definition: logviewer.cpp:201
MythUIButtonList
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
Definition: mythuibuttonlist.h:144
LogViewer::m_logList
MythUIButtonList * m_logList
Definition: logviewer.h:55
LogViewer::m_currentLog
QString m_currentLog
Definition: logviewer.h:51
LogViewer::m_fullLog
QString m_fullLog
Definition: logviewer.h:53
mythscreentype.h
LogViewer::keyPressEvent
bool keyPressEvent(QKeyEvent *e) override
Key event handler.
Definition: logviewer.cpp:139