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