MythTV  master
guistartup.h
Go to the documentation of this file.
1 // Copyright (c) 2017 MythTV Developers <mythtv-dev@mythtv.org>
3 //
4 // This is part of MythTV (https://www.mythtv.org)
5 //
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with this program. If not, see <http://www.gnu.org/licenses/>.
22 //
24 
25 #ifndef GUISTARTUP_H_
26 #define GUISTARTUP_H_
27 
28 // QT headers
29 #include <QObject>
30 #include <QTranslator>
31 #include <QEventLoop>
32 #include <QTimer>
33 
34 // MythDB headers
35 #include "mythexp.h"
36 
37 // MythBase headers
38 #include "libmythbase/mythchrono.h"
39 
40 // MythUI headers
42 
43 class QEventLoop;
44 class MythUIButton;
45 class MythUIText;
46 class MythScreenStack;
47 class MythUIStateType;
48 class MythUIProgressBar;
49 class MythTimer;
50 
52 {
53  Q_OBJECT
54 
55  public:
56 
57  bool m_Exit {false};
58  bool m_Setup {false};
59  bool m_Retry {false};
60  bool m_Search {false};
61 
62  GUIStartup(MythScreenStack *parent, QEventLoop *eventLoop);
63  ~GUIStartup(void) override;
64  bool Create(void) override; // MythScreenType
65  bool setStatusState(const QString &name);
66  bool setMessageState(const QString &name);
67  void setTotal(std::chrono::seconds total);
68 
69  public slots:
70  bool updateProgress(bool finished);
71  void updateProgress(void);
72 
73  private slots:
74  void Retry(void);
75  void Search(void);
76  void Setup(void);
77  void Close(void) override; // MythScreenType
78  void OnClosePromptReturn(bool submit);
79 
80  signals:
81  void cancelPortCheck(void);
82 
83  private:
84  MythUIButton *m_dummyButton {nullptr};
85  MythUIButton *m_retryButton {nullptr};
86  MythUIButton *m_searchButton {nullptr};
87  MythUIButton *m_setupButton {nullptr};
88  MythUIButton *m_exitButton {nullptr};
89  MythUIStateType *m_statusState {nullptr};
90  MythUIStateType *m_messageState {nullptr};
91  MythUIProgressBar *m_progressBar {nullptr};
92  MythTimer *m_progressTimer {nullptr};
93  QEventLoop *m_loop {nullptr};
94  QEventLoop m_dlgLoop;
95  std::chrono::milliseconds m_total {0ms};
96  QTimer m_timer;
97 };
98 
99 #endif
MPUBLIC
#define MPUBLIC
Definition: mythexp.h:10
MythTimer
A QElapsedTimer based timer to replace use of QTime as a timer.
Definition: mythtimer.h:13
MythScreenType::Close
virtual void Close()
Definition: mythscreentype.cpp:386
mythexp.h
MythScreenStack
Definition: mythscreenstack.h:16
MythScreenType::Create
virtual bool Create(void)
Definition: mythscreentype.cpp:266
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:45
GUIStartup::m_dlgLoop
QEventLoop m_dlgLoop
Definition: guistartup.h:94
MythUIProgressBar
Progress bar widget.
Definition: mythuiprogressbar.h:12
MythUIButton
A single button widget.
Definition: mythuibutton.h:21
Search
Definition: netgrabbermanager.h:148
MythUIText
All purpose text widget, displays a text string.
Definition: mythuitext.h:28
GUIStartup
Definition: guistartup.h:51
mythchrono.h
GUIStartup::m_timer
QTimer m_timer
Definition: guistartup.h:96
MythUIStateType
This widget is used for grouping other widgets for display when a particular named state is called....
Definition: mythuistatetype.h:22
mythscreentype.h