MythTV master
mythprogressdialog.h
Go to the documentation of this file.
1#ifndef MYTHPROGRESSBOX_H_
2#define MYTHPROGRESSBOX_H_
3
4#include <utility>
5
6// Qt headers
7#include <QEvent>
8#include <QMutex>
9
10// MythTV headers
11#include "mythscreentype.h"
12
13class MythUIText;
15
16class MUI_PUBLIC ProgressUpdateEvent : public QEvent
17{
18 public:
19 explicit ProgressUpdateEvent(uint count, uint total=0, QString message="") :
20 QEvent(kEventType), m_total(total), m_count(count),
21 m_message(std::move(message)) { }
22 ~ProgressUpdateEvent() override;
23
24 QString GetMessage() { return m_message; }
25 uint GetTotal() const { return m_total; }
26 uint GetCount() const { return m_count; }
27
28 static const Type kEventType;
29
30 private:
31 uint m_total {0};
32 uint m_count {0};
33 QString m_message;
34};
35
37{
38 Q_OBJECT
39 public:
40 MythUIBusyDialog(const QString &message,
41 MythScreenStack *parent, const char *name);
42
43 bool Create(void) override; // MythScreenType
44 bool keyPressEvent(QKeyEvent *event) override; // MythScreenType
45 void SetMessage(const QString &message);
46 void Reset(void) override; // MythUIType
47 void Pulse(void) override; // MythUIType
48
49 protected:
51 QString m_message;
52 bool m_haveNewMessage {false};
53 QString m_newMessage;
55
56 MythUIText *m_messageText {nullptr};
57};
58
60{
61 Q_OBJECT
62 public:
63 MythUIProgressDialog(QString message,
64 MythScreenStack *parent, const char *name)
65 : MythScreenType(parent, name, false), m_message(std::move(message)) {}
66
67 bool Create(void) override; // MythScreenType
68 bool keyPressEvent(QKeyEvent *event) override; // MythScreenType
69 void customEvent(QEvent *event) override; // MythUIType
70 void SetTotal(uint total);
71 void SetProgress(uint count);
72 void SetMessage(const QString &message);
73
74 protected:
75 void UpdateProgress(void);
76
77 QString m_message;
78 uint m_total {0};
79 uint m_count {0};
80
81 MythUIText *m_messageText {nullptr};
82 MythUIText *m_progressText {nullptr};
83 MythUIProgressBar *m_progressBar {nullptr};
84};
85
86MUI_PUBLIC MythUIBusyDialog *ShowBusyPopup(const QString &message);
87
88#endif
Screen in which all other widgets are contained and rendered.
Progress bar widget.
MythUIProgressDialog(QString message, MythScreenStack *parent, const char *name)
All purpose text widget, displays a text string.
Definition: mythuitext.h:29
ProgressUpdateEvent(uint count, uint total=0, QString message="")
static const Type kEventType
unsigned int uint
Definition: compat.h:68
MUI_PUBLIC MythUIBusyDialog * ShowBusyPopup(const QString &message)
#define MUI_PUBLIC
Definition: mythuiexp.h:9
STL namespace.
VERBOSE_PREAMBLE false
Definition: verbosedefs.h:89