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
void updateLogItem(MythUIButtonListItem *item)
Definition: logviewer.cpp:179
void toggleAutoUpdate(void)
Definition: logviewer.cpp:169
bool keyPressEvent(QKeyEvent *e) override
Key event handler.
Definition: logviewer.cpp:139
MythUIButtonList * m_logList
Definition: logviewer.h:55
All purpose text widget, displays a text string.
Definition: mythuitext.h:28
QString m_fullLog
Definition: logviewer.h:53
void showProgressLog(void)
Definition: logviewer.cpp:319
unsigned int slots[4]
Definition: element.cpp:38
MythUIButton * m_exitButton
Definition: logviewer.h:58
QTimer * m_updateTimer
Definition: logviewer.h:49
MythUIText * m_logText
Definition: logviewer.h:56
MythUIButton * m_cancelButton
Definition: logviewer.h:59
static bool loadFile(const QString &filename, QStringList &list, int startline)
Definition: logviewer.cpp:265
void showFullLog(void)
Definition: logviewer.cpp:326
QString m_currentLog
Definition: logviewer.h:51
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
~LogViewer(void) override
Definition: logviewer.cpp:87
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
A single button widget.
Definition: mythuibutton.h:21
LogViewer(MythScreenStack *parent)
Definition: logviewer.cpp:79
void updateClicked(void)
Definition: logviewer.cpp:201
int m_updateTime
Definition: logviewer.h:48
QString m_progressLog
Definition: logviewer.h:52
static QString getSetting(const QString &key)
Definition: logviewer.cpp:238
MythUIButton * m_updateButton
Definition: logviewer.h:60
void ShowMenu(void) override
Definition: logviewer.cpp:333
void updateTimerTimeout(void)
Definition: logviewer.cpp:164
Screen in which all other widgets are contained and rendered.
void showLogViewer(void)
Definition: logviewer.cpp:24
void setFilenames(const QString &progressLog, const QString &fullLog)
Definition: logviewer.cpp:312
static void cancelClicked(void)
Definition: logviewer.cpp:185
bool Create(void) override
Definition: logviewer.cpp:94
const int DEFAULT_UPDATE_TIME
Definition: logviewer.h:10
bool m_autoUpdate
Definition: logviewer.h:47