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;
30  std::chrono::minutes update_timeout {DEFAULT_UPDATE_TIMEOUT};
31  std::chrono::seconds retrieve_timeout {0s};
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:
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 
135 using 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;
162 
164 
170 };
171 
172 #endif /* WEATHER_SETUP_H */
SourceSetup::m_sourceList
MythUIButtonList * m_sourceList
Definition: weatherSetup.h:122
CacheMap
QMultiHash< QString, QList< ScriptInfo * > > CacheMap
Definition: weatherSetup.h:135
SourceListInfo::update_timeout
std::chrono::minutes update_timeout
Definition: weatherSetup.h:30
LocationDialog::m_screenListInfo
ScreenListInfo * m_screenListInfo
Definition: weatherSetup.h:160
ScreenSetup::m_activeList
MythUIButtonList * m_activeList
Definition: weatherSetup.h:93
ScreenSetup::m_finishButton
MythUIButton * m_finishButton
Definition: weatherSetup.h:95
mythuitext.h
GlobalSetup::loadData
void loadData(void)
Definition: weatherSetup.cpp:50
ScreenSetup::doListSelect
void doListSelect(MythUIButtonListItem *selected)
Definition: weatherSetup.cpp:450
SourceSetup::sourceListItemSelected
void sourceListItemSelected(MythUIButtonListItem *item)
Definition: weatherSetup.cpp:831
SourceSetup::m_finishButton
MythUIButton * m_finishButton
Definition: weatherSetup.h:123
GlobalSetup::saveData
void saveData(void)
Definition: weatherSetup.cpp:61
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(SourceListInfo *)
ScreenSetup::saveData
void saveData(void)
Definition: weatherSetup.cpp:355
ScreenSetup::updateHelpText
void updateHelpText(void)
Definition: weatherSetup.cpp:187
DEFAULT_UPDATE_TIMEOUT
static constexpr std::chrono::minutes DEFAULT_UPDATE_TIMEOUT
Definition: weatherUtils.h:19
ScreenSetup::~ScreenSetup
~ScreenSetup() override
Definition: weatherSetup.cpp:87
ResultListInfo
Definition: weatherSetup.h:127
ScreenSetup::Create
bool Create(void) override
Definition: weatherSetup.cpp:110
mythdialogbox.h
MythScreenStack
Definition: mythscreenstack.h:16
ScreenSetup::customEvent
void customEvent(QEvent *event) override
Definition: weatherSetup.cpp:578
MythUITextEdit
A text entry and edit widget.
Definition: mythuitextedit.h:32
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:44
ScreenSetup::showUnitsPopup
void showUnitsPopup(const QString &name, ScreenListInfo *si)
Definition: weatherSetup.cpp:534
SourceListInfo::author
QString author
Definition: weatherSetup.h:27
ScreenSetup::loadData
void loadData(void)
Definition: weatherSetup.cpp:252
ResultListInfo::idstr
QString idstr
Definition: weatherSetup.h:129
ResultListInfo::src
ScriptInfo * src
Definition: weatherSetup.h:130
mythuibuttonlist.h
ScreenSetup::m_sourceManager
SourceManager * m_sourceManager
Definition: weatherSetup.h:90
GlobalSetup::m_finishButton
MythUIButton * m_finishButton
Definition: weatherSetup.h:61
SourceListInfo::name
QString name
Definition: weatherSetup.h:26
SourceSetup::updateSpinboxUpdate
void updateSpinboxUpdate(void)
Definition: weatherSetup.cpp:813
GlobalSetup::m_backgroundCheckbox
MythUICheckBox * m_backgroundCheckbox
Definition: weatherSetup.h:58
ScreenSetup
Definition: weatherSetup.h:64
MythUIButtonListItem
Definition: mythuibuttonlist.h:27
SourceSetup::m_retrieveSpinbox
MythUISpinBox * m_retrieveSpinbox
Definition: weatherSetup.h:121
LocationDialog::m_retScreen
MythScreenType * m_retScreen
Definition: weatherSetup.h:163
LocationDialog::m_resultsText
MythUIText * m_resultsText
Definition: weatherSetup.h:168
GlobalSetup::m_timeout
int m_timeout
Definition: weatherSetup.h:60
GlobalSetup::~GlobalSetup
~GlobalSetup() override=default
LocationDialog
Definition: weatherSetup.h:137
SourceSetup::m_updateSpinbox
MythUISpinBox * m_updateSpinbox
Definition: weatherSetup.h:120
LocationDialog::m_locationEdit
MythUITextEdit * m_locationEdit
Definition: weatherSetup.h:166
SourceSetup::Create
bool Create(void) override
Definition: weatherSetup.cpp:693
SourceListInfo::retrieve_timeout
std::chrono::seconds retrieve_timeout
Definition: weatherSetup.h:31
GlobalSetup::Create
bool Create(void) override
Definition: weatherSetup.cpp:22
GlobalSetup
Screen for mythweather global settings.
Definition: weatherSetup.h:40
ScreenSetup::doLocationDialog
void doLocationDialog(ScreenListInfo *si)
Definition: weatherSetup.cpp:520
MythUIButton
A single button widget.
Definition: mythuibutton.h:21
LocationDialog::m_types
QStringList m_types
Definition: weatherSetup.h:159
SourceSetup::loadData
bool loadData(void)
Definition: weatherSetup.cpp:741
ScreenSetup::ScreenSetup
ScreenSetup(MythScreenStack *parent, const QString &name, SourceManager *srcman)
Definition: weatherSetup.cpp:75
SourceSetup::SourceSetup
SourceSetup(MythScreenStack *parent, const QString &name)
Definition: weatherSetup.cpp:674
ScreenSetup::m_helpText
MythUIText * m_helpText
Definition: weatherSetup.h:92
ScreenListInfo
Definition: weatherUtils.h:47
uint
unsigned int uint
Definition: compat.h:140
SourceListInfo::version
QString version
Definition: weatherSetup.h:29
MythUICheckBox
A checkbox widget supporting three check states - on,off,half and two conditions - selected and unsel...
Definition: mythuicheckbox.h:15
SourceSetup
Definition: weatherSetup.h:98
SourceListInfo
Definition: weatherSetup.h:24
mythuispinbox.h
LocationDialog::m_searchButton
MythUIButton * m_searchButton
Definition: weatherSetup.h:167
MythUIText
All purpose text widget, displays a text string.
Definition: mythuitext.h:30
GlobalSetup::GlobalSetup
GlobalSetup(MythScreenStack *parent, const QString &name)
Definition: weatherSetup.h:45
SourceSetup::retrieveSpinboxUpdate
void retrieveSpinboxUpdate(void)
Definition: weatherSetup.cpp:822
mythuitextedit.h
ScreenSetup::m_createdSrcMan
bool m_createdSrcMan
Definition: weatherSetup.h:91
LocationDialog::m_sourceText
MythUIText * m_sourceText
Definition: weatherSetup.h:169
LocationDialog::m_locationList
MythUIButtonList * m_locationList
Definition: weatherSetup.h:165
mythcontext.h
MythUISpinBox
A widget for offering a range of numerical values where only the the bounding values and interval are...
Definition: mythuispinbox.h:16
SourceSetup::m_sourceText
MythUIText * m_sourceText
Definition: weatherSetup.h:124
SourceSetup::saveData
void saveData(void)
Definition: weatherSetup.cpp:779
mythuibutton.h
ScreenSetup::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: weatherSetup.cpp:159
ScreenSetup::m_inactiveList
MythUIButtonList * m_inactiveList
Definition: weatherSetup.h:94
LocationDialog::m_sourceManager
SourceManager * m_sourceManager
Definition: weatherSetup.h:161
ScreenSetup::deleteScreen
void deleteScreen(void)
Definition: weatherSetup.cpp:560
mythuicheckbox.h
ScriptInfo
Definition: serverSideScripting.h:36
GlobalSetup::m_timeoutSpinbox
MythUISpinBox * m_timeoutSpinbox
Definition: weatherSetup.h:59
MythUIButtonList
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
Definition: mythuibuttonlist.h:151
SourceSetup::~SourceSetup
~SourceSetup() override
Definition: weatherSetup.cpp:683
mythmainwindow.h
LocationDialog::m_cache
CacheMap m_cache
Definition: weatherSetup.h:158
SourceListInfo::email
QString email
Definition: weatherSetup.h:28
mythscreentype.h
SourceManager
Definition: sourceManager.h:18
weatherUtils.h