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 void customEvent(QEvent *event) override; // MythUIType
74
75 protected slots:
76 void updateHelpText(void);
77 void saveData(void);
78 void doListSelect(MythUIButtonListItem *selected);
79
80 private:
81 void loadData(void);
82
83 void showUnitsPopup(const QString &name, ScreenListInfo *si);
85
86 void deleteScreen(void);
87
88 private:
90 bool m_createdSrcMan { false };
91 MythUIText *m_helpText { nullptr };
95};
96
98{
99 Q_OBJECT
100
101 public:
102 SourceSetup(MythScreenStack *parent, const QString &name)
103 : MythScreenType(parent, name) {};
104 ~SourceSetup() override;
105
106 bool Create(void) override; // MythScreenType
107
108 bool loadData(void);
109
110 protected slots:
112#if 0
114#endif
115 void updateSpinboxUpdate(void);
116 void retrieveSpinboxUpdate(void);
117 void saveData(void);
118
119 private:
125};
126
128{
129 QString idstr;
130 ScriptInfo *src { nullptr };
131};
132
134
135using CacheMap = QMultiHash<QString, QList<ScriptInfo*> >;
136
138{
139 Q_OBJECT
140
141 public:
142 LocationDialog(MythScreenStack *parent, const QString &name,
143 MythScreenType *retScreen,
144 ScreenListInfo *si, SourceManager *srcman);
145 ~LocationDialog() override;
146
147 bool Create(void) override; // MythScreenType
148
149 protected slots:
150 void doSearch(void);
151 void itemSelected(MythUIButtonListItem *item);
152 void itemClicked(MythUIButtonListItem *item);
153
154 private:
155 void clearResults();
156
157 private:
159 QStringList m_types;
160 ScreenListInfo *m_screenListInfo { nullptr };
161 SourceManager *m_sourceManager { nullptr };
162
163 MythScreenType *m_retScreen { nullptr };
164
165 MythUIButtonList *m_locationList { nullptr };
166 MythUITextEdit *m_locationEdit { nullptr };
167 MythUIButton *m_searchButton { nullptr };
168 MythUIText *m_resultsText { nullptr };
169 MythUIText *m_sourceText { nullptr };
170};
171
172#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:159
CacheMap m_cache
Definition: weatherSetup.h:158
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:23
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:92
void customEvent(QEvent *event) override
void loadData(void)
void saveData(void)
MythUIText * m_helpText
Definition: weatherSetup.h:91
MythUIButtonList * m_inactiveList
Definition: weatherSetup.h:93
~ScreenSetup() override
bool Create(void) override
SourceManager * m_sourceManager
Definition: weatherSetup.h:89
bool m_createdSrcMan
Definition: weatherSetup.h:90
MythUIButton * m_finishButton
Definition: weatherSetup.h:94
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:121
MythUIText * m_sourceText
Definition: weatherSetup.h:124
void retrieveSpinboxUpdate(void)
MythUISpinBox * m_updateSpinbox
Definition: weatherSetup.h:120
void sourceListItemSelected(MythUIButtonListItem *item)
SourceSetup(MythScreenStack *parent, const QString &name)
Definition: weatherSetup.h:102
bool loadData(void)
bool Create(void) override
void saveData(void)
MythUIButtonList * m_sourceList
Definition: weatherSetup.h:122
~SourceSetup() override
MythUIButton * m_finishButton
Definition: weatherSetup.h:123
unsigned int uint
Definition: freesurround.h:24
ScriptInfo * src
Definition: weatherSetup.h:130
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:135
static constexpr std::chrono::minutes DEFAULT_UPDATE_TIMEOUT
Definition: weatherUtils.h:20