4 #include <QCoreApplication> 15 if (screenName ==
"Current Conditions")
16 return QCoreApplication::translate(
"(Weather Screens)",
17 "Current Conditions");
18 if (screenName ==
"Three Day Forecast")
19 return QCoreApplication::translate(
"(Weather Screens)",
20 "Three Day Forecast");
21 if (screenName ==
"18 Hour Forecast")
22 return QCoreApplication::translate(
"(Weather Screens)",
24 if (screenName ==
"Severe Weather Alerts")
25 return QCoreApplication::translate(
"(Weather Screens)",
26 "Severe Weather Alerts");
27 if (screenName ==
"Six Day Forecast")
28 return QCoreApplication::translate(
"(Weather Screens)",
30 if (screenName ==
"Static Map")
31 return QCoreApplication::translate(
"(Weather Screens)",
33 if (screenName ==
"Animated Map")
34 return QCoreApplication::translate(
"(Weather Screens)",
47 QStringList::iterator it;
48 for (it = searchpath.begin(); it != searchpath.end(); ++it)
50 QString
filename = (*it) +
"weather-screens.xml";
53 LOG(VB_GENERAL, LOG_INFO,
54 QString(
"Loading from: %1").arg(
filename));
66 LOG(VB_GENERAL, LOG_ERR,
67 QString(
"Unable to parse weather-screens.xml"));
78 if (!f.open(QIODevice::ReadOnly))
83 if ( !doc.setContent( &f ) )
90 QDomElement docElem = doc.documentElement();
92 for (QDomNode n = docElem.firstChild(); !n.isNull();
95 QDomElement e = n.toElement();
98 if ( (e.tagName() ==
"screen") && !screens.contains(e.attribute(
"name")) )
100 screens[e.attribute(
"name")].m_multiLoc =
false;
101 screens[e.attribute(
"name")].m_name = e.attribute(
"name");
102 screens[e.attribute(
"name")].m_title =
104 QString hasUnits = e.attribute(
"hasunits");
105 if (hasUnits.toLower() ==
"no")
106 screens[e.attribute(
"name")].m_hasUnits =
false;
108 screens[e.attribute(
"name")].m_hasUnits =
true;
109 screens[e.attribute(
"name")].m_dataTypes =
loadScreen(e);
119 QStringList typesList;
124 QDomElement e = n.toElement();
127 if (e.tagName() ==
"datum")
129 QString name = e.attribute(
"name");
QStringList loadScreen(const QDomElement &ScreenListInfo)
QStringList GetThemeSearchPath(void)
bool doLoadScreens(const QString &filename, ScreenListMap &screens)
QString GetShareDir(void)
MythUIHelper * GetMythUI()
#define LOG(_MASK_, _LEVEL_, _STRING_)
ScreenListMap loadScreens()
static QString getScreenTitle(const QString &screenName)
QMap< QString, ScreenListInfo > ScreenListMap