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;
33 };
34 
36 
41 {
42  Q_OBJECT
43 
44  public:
45  GlobalSetup(MythScreenStack *parent, const QString &name)
46  : MythScreenType(parent, name) {}
47  ~GlobalSetup() = 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};
61  int m_hold_timeout {0};
63 };
64 
66 {
67  Q_OBJECT
68 
69  public:
70  ScreenSetup(MythScreenStack *parent, const QString &name, SourceManager *srcman);
71  ~ScreenSetup();
72 
73  bool Create(void) override; // MythScreenType
74  bool keyPressEvent(QKeyEvent *) override; // MythScreenType
75  void customEvent(QEvent*) 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:
97 };
98 
100 {
101  Q_OBJECT
102 
103  public:
104  SourceSetup(MythScreenStack *parent, const QString &name);
105  ~SourceSetup();
106 
107  bool Create(void) override; // MythScreenType
108 
109  bool loadData(void);
110 
111  protected slots:
112  void sourceListItemSelected(MythUIButtonListItem *item = nullptr);
113  void updateSpinboxUpdate(void);
114  void retrieveSpinboxUpdate(void);
115  void saveData(void);
116 
117  private:
123 };
124 
126 {
127  QString idstr;
129 };
130 
132 
133 typedef QMultiHash<QString, QList<ScriptInfo*> > CacheMap;
134 
136 {
137  Q_OBJECT
138 
139  public:
140  LocationDialog(MythScreenStack *parent, const QString &name,
141  MythScreenType *retScreen,
142  ScreenListInfo *si, SourceManager *srcman);
143  ~LocationDialog();
144 
145  bool Create(void) override; // MythScreenType
146 
147  protected slots:
148  void doSearch(void);
149  void itemSelected(MythUIButtonListItem *item);
150  void itemClicked(MythUIButtonListItem *item);
151 
152  private:
153  void clearResults();
154 
155  private:
157  QStringList m_types;
160 
162 
168 };
169 
170 #endif
QMultiHash< QString, QList< ScriptInfo * > > CacheMap
Definition: weatherSetup.h:133
MythUIButtonList * m_sourceList
Definition: weatherSetup.h:120
void doListSelect(MythUIButtonListItem *selected)
MythUIButton * m_searchButton
Definition: weatherSetup.h:165
MythUIButton * m_finishButton
Definition: weatherSetup.h:121
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:159
void showUnitsPopup(const QString &name, ScreenListInfo *si)
MythUIButton * m_finishButton
Definition: weatherSetup.h:96
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:158
A checkbox widget supporting three check states - on,off,half and two conditions - selected and unsel...
SourceManager * m_sourceManager
Definition: weatherSetup.h:91
Screen for mythweather global settings.
Definition: weatherSetup.h:40
void saveData(void)
void updateHelpText(void)
uint retrieve_timeout
Definition: weatherSetup.h:31
Q_DECLARE_METATYPE(SourceListInfo *)
unsigned int uint
Definition: compat.h:140
MythUICheckBox * m_backgroundCheckbox
Definition: weatherSetup.h:58
MythUISpinBox * m_retrieveSpinbox
Definition: weatherSetup.h:119
QString version
Definition: weatherSetup.h:29
MythScreenType * m_retScreen
Definition: weatherSetup.h:161
bool Create(void) override
MythUIButton * m_finishButton
Definition: weatherSetup.h:62
MythUIText * m_sourceText
Definition: weatherSetup.h:167
MythUISpinBox * m_updateSpinbox
Definition: weatherSetup.h:118
void loadData(void)
ScreenSetup(MythScreenStack *parent, const QString &name, SourceManager *srcman)
int m_hold_timeout
Definition: weatherSetup.h:61
A text entry and edit widget.
bool loadData(void)
void updateSpinboxUpdate(void)
void doLocationDialog(ScreenListInfo *si)
MythUITextEdit * m_locationEdit
Definition: weatherSetup.h:164
MythUIText * m_resultsText
Definition: weatherSetup.h:166
const char * name
Definition: ParseText.cpp:328
bool m_createdSrcMan
Definition: weatherSetup.h:92
ScriptInfo * src
Definition: weatherSetup.h:128
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
void customEvent(QEvent *) override
bool Create(void) override
SourceSetup(MythScreenStack *parent, const QString &name)
MythUIButtonList * m_locationList
Definition: weatherSetup.h:163
bool Create(void) override
A single button widget.
Definition: mythuibutton.h:21
~GlobalSetup()=default
void sourceListItemSelected(MythUIButtonListItem *item=nullptr)
MythUIText * m_helpText
Definition: weatherSetup.h:93
MythUIButtonList * m_inactiveList
Definition: weatherSetup.h:95
void deleteScreen(void)
void retrieveSpinboxUpdate(void)
CacheMap m_cache
Definition: weatherSetup.h:156
bool keyPressEvent(QKeyEvent *) override
Key event handler.
GlobalSetup(MythScreenStack *parent, const QString &name)
Definition: weatherSetup.h:45
QStringList m_types
Definition: weatherSetup.h:157
MythUIText * m_sourceText
Definition: weatherSetup.h:122
Screen in which all other widgets are contained and rendered.
MythUIButtonList * m_activeList
Definition: weatherSetup.h:94
void saveData(void)
void loadData(void)