MythTV master
weatherSetup.h
Go to the documentation of this file.
1#ifndef WEATHER_SETUP_H
2#define WEATHER_SETUP_H
3
4// QT headers
5#include <QList>
6
7// MythTV headers
17
18// MythWeather headers
19#include "weatherUtils.h"
20
21class SourceManager;
22
24{
25 QString name;
26 QString author;
27 QString email;
28 QString version;
29 std::chrono::minutes update_timeout {DEFAULT_UPDATE_TIMEOUT};
30 std::chrono::seconds retrieve_timeout {0s};
31 uint id {};
32};
33
35
40{
41 Q_OBJECT
42
43 public:
44 GlobalSetup(MythScreenStack *parent, const QString &name)
45 : MythScreenType(parent, name) {}
46 ~GlobalSetup() override = default;
47
48 bool Create(void) override; // MythScreenType
49
50 protected slots:
51 void saveData(void);
52
53 private:
54 void loadData(void);
55
56 private:
59 int m_timeout {0};
61};
62
64{
65 Q_OBJECT
66
67 public:
68 ScreenSetup(MythScreenStack *parent, const QString &name, SourceManager *srcman);
69 ~ScreenSetup() override;
70
71 bool Create(void) override; // MythScreenType
72 bool keyPressEvent(QKeyEvent *event) override; // MythScreenType
73
74 protected:
75 void customEvent(QEvent *event) override; // MythUIType
76
77 protected slots:
78 void updateHelpText(void);
79 void saveData(void);
80 void doListSelect(MythUIButtonListItem *selected);
81
82 private:
83 void loadData(void);
84
85 void showUnitsPopup(const QString &name, ScreenListInfo *si);
87
88 void deleteScreen(void);
89
90 private:
92 bool m_createdSrcMan { false };
93 MythUIText *m_helpText { nullptr };
97};
98
100{
101 Q_OBJECT
102
103 public:
104 SourceSetup(MythScreenStack *parent, const QString &name)
105 : MythScreenType(parent, name) {};
106 ~SourceSetup() override;
107
108 bool Create(void) override; // MythScreenType
109
110 bool loadData(void);
111
112 protected slots:
114#if 0
116#endif
117 void updateSpinboxUpdate(void);
118 void retrieveSpinboxUpdate(void);
119 void saveData(void);
120
121 private:
127};
128
130{
131 QString idstr;
132 ScriptInfo *src { nullptr };
133};
134
136
137using CacheMap = QMultiHash<QString, QList<ScriptInfo*> >;
138
140{
141 Q_OBJECT
142
143 public:
144 LocationDialog(MythScreenStack *parent, const QString &name,
145 MythScreenType *retScreen,
146 ScreenListInfo *si, SourceManager *srcman);
147 ~LocationDialog() override;
148
149 bool Create(void) override; // MythScreenType
150
151 protected slots:
152 void doSearch(void);
153 void itemSelected(MythUIButtonListItem *item);
154 void itemClicked(MythUIButtonListItem *item);
155
156 private:
157 void clearResults();
158
159 private:
161 QStringList m_types;
162 ScreenListInfo *m_screenListInfo { nullptr };
163 SourceManager *m_sourceManager { nullptr };
164
165 MythScreenType *m_retScreen { nullptr };
166
167 MythUIButtonList *m_locationList { nullptr };
168 MythUITextEdit *m_locationEdit { nullptr };
169 MythUIButton *m_searchButton { nullptr };
170 MythUIText *m_resultsText { nullptr };
171 MythUIText *m_sourceText { nullptr };
172};
173
174#endif /* WEATHER_SETUP_H */
Screen for mythweather global settings.
Definition: weatherSetup.h:40
void saveData(void)
bool Create(void) override
void loadData(void)
GlobalSetup(MythScreenStack *parent, const QString &name)
Definition: weatherSetup.h:44
MythUICheckBox * m_backgroundCheckbox
Definition: weatherSetup.h:57
~GlobalSetup() override=default
MythUISpinBox * m_timeoutSpinbox
Definition: weatherSetup.h:58
MythUIButton * m_finishButton
Definition: weatherSetup.h:60
QStringList m_types
Definition: weatherSetup.h:161
CacheMap m_cache
Definition: weatherSetup.h:160
Screen in which all other widgets are contained and rendered.
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
A single button widget.
Definition: mythuibutton.h:22
A checkbox widget supporting three check states - on,off,half and two conditions - selected and unsel...
A widget for offering a range of numerical values where only the the bounding values and interval are...
Definition: mythuispinbox.h:19
A text entry and edit widget.
All purpose text widget, displays a text string.
Definition: mythuitext.h:29
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
MythUIButtonList * m_activeList
Definition: weatherSetup.h:94
void customEvent(QEvent *event) override
void loadData(void)
void saveData(void)
MythUIText * m_helpText
Definition: weatherSetup.h:93
MythUIButtonList * m_inactiveList
Definition: weatherSetup.h:95
~ScreenSetup() override
bool Create(void) override
SourceManager * m_sourceManager
Definition: weatherSetup.h:91
bool m_createdSrcMan
Definition: weatherSetup.h:92
MythUIButton * m_finishButton
Definition: weatherSetup.h:96
void doLocationDialog(ScreenListInfo *si)
void updateHelpText(void)
void doListSelect(MythUIButtonListItem *selected)
ScreenSetup(MythScreenStack *parent, const QString &name, SourceManager *srcman)
void deleteScreen(void)
void showUnitsPopup(const QString &name, ScreenListInfo *si)
void updateSpinboxUpdate(void)
MythUISpinBox * m_retrieveSpinbox
Definition: weatherSetup.h:123
MythUIText * m_sourceText
Definition: weatherSetup.h:126
void retrieveSpinboxUpdate(void)
MythUISpinBox * m_updateSpinbox
Definition: weatherSetup.h:122
void sourceListItemSelected(MythUIButtonListItem *item)
SourceSetup(MythScreenStack *parent, const QString &name)
Definition: weatherSetup.h:104
bool loadData(void)
bool Create(void) override
void saveData(void)
MythUIButtonList * m_sourceList
Definition: weatherSetup.h:124
~SourceSetup() override
MythUIButton * m_finishButton
Definition: weatherSetup.h:125
unsigned int uint
Definition: compat.h:60
ScriptInfo * src
Definition: weatherSetup.h:132
std::chrono::seconds retrieve_timeout
Definition: weatherSetup.h:30
QString author
Definition: weatherSetup.h:26
QString version
Definition: weatherSetup.h:28
std::chrono::minutes update_timeout
Definition: weatherSetup.h:29
Q_DECLARE_METATYPE(SourceListInfo *)
QMultiHash< QString, QList< ScriptInfo * > > CacheMap
Definition: weatherSetup.h:137
static constexpr std::chrono::minutes DEFAULT_UPDATE_TIMEOUT
Definition: weatherUtils.h:20