Go to the documentation of this file.
20 m_screenDefn(screenDefn),
21 m_name(m_screenDefn->m_name),
27 for (
const QString&
type : std::as_const(
types))
55 if (i.key().isEmpty())
57 LOG(VB_GENERAL, LOG_DEBUG, i.key());
74 DataMap::iterator itr = data.begin();
75 while (itr != data.end())
84 LOG(VB_GENERAL, LOG_ERR,
"Theme is missing a required widget!");
92 return QString::fromUtf8(
"°") +
"F";
93 return QString::fromUtf8(
"°") +
"C";
101 QString name = itr.key();
106 LOG(VB_GENERAL, LOG_ERR,
"Widget not found " + itr.key());
108 if (name ==
"copyright")
110 LOG(VB_GENERAL, LOG_WARNING,
111 QString(
"No copyright widget found, skipping screen %1.")
115 if (name ==
"copyrightlogo")
117 LOG(VB_GENERAL, LOG_WARNING,
118 QString(
"No copyrightlogo widget found, skipping screen %1.")
124 if( !widget || checkOnly )
130 if (
auto *w2 =
dynamic_cast<MythUIText *
>(widget))
132 w2->SetText(itr.value());
134 else if (
auto *w3 =
dynamic_cast<MythUIImage *
>(widget))
136 w3->SetFilename(itr.value());
163 if (key.startsWith(
"relative_humidity") || key.startsWith(
"pop"))
166 if (key ==
"pressure")
169 if (key ==
"visibility")
172 if (key.startsWith(
"temp") ||
173 key.startsWith(
"appt") ||
174 key.startsWith(
"low") ||
175 key.startsWith(
"high"))
177 if ((value ==
"NA") || (value ==
"N/A"))
182 if (key.startsWith(
"wind_gust") ||
183 key.startsWith(
"wind_spdgst") ||
184 key.startsWith(
"wind_speed"))
189 if (key.startsWith(
"date"))
191 bool isNumber =
false;
192 (void)value.toInt( &isNumber);
196 int dayOfWeek = value.toInt();
207 return tr(
"Tuesday");
210 return tr(
"Wednesday");
213 return tr(
"Thursday");
219 return tr(
"Saturday");
225 if (key ==
"copyrightlogo" && value ==
"none")
virtual bool keyPressEvent(QKeyEvent *event)
Key event handler.
Image widget, displays a single image or multiple images in sequence.
static WeatherScreen * loadScreen(MythScreenStack *parent, ScreenListInfo *screenDefn, int id)
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
bool Load(bool allowLoadInBackground=true, bool forceStat=false)
Load the image(s), wraps ImageLoader::LoadImage()
void setValue(const QString &key, const QString &value)
static const struct wl_interface * types[]
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Screen in which all other widgets are contained and rendered.
MythUIType * GetFocusWidget(void) const
static constexpr uint8_t ENG_UNITS
virtual void newData(const QString &, units_t, DataMap data)
QMap< QString, QString > DataMap
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
WeatherScreen(MythScreenStack *parent, ScreenListInfo *screenDefn, int id)
virtual bool prepareScreen(bool checkOnly=false)
virtual bool canShowScreen()
The base class on which all widgets and screens are based.
All purpose text widget, displays a text string.
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
virtual QString prepareDataItem(const QString &key, const QString &value)
virtual QString getTemperatureUnit()
ScreenListInfo * m_screenDefn
void screenReady(WeatherScreen *)
bool Create(void) override
QString formatDataItem(const QString &key, const QString &value)
QMap< QString, QString > m_dataValueMap
virtual void prepareWidget(MythUIType *widget)