4 #include <QCoreApplication> 5 #include <QDomDocument> 54 QDateTime dt =
m_Time.toLocalTime();
85 const QString &
filename, QDomElement &element,
bool showWarnings)
87 if (element.tagName() ==
"format" ||
88 element.tagName() ==
"template")
91 format = qApp->translate(
"ThemeUI", format.toUtf8());
92 format.replace(
"%TIME%",
m_TimeFormat, Qt::CaseInsensitive);
93 format.replace(
"%DATE%",
m_DateFormat, Qt::CaseInsensitive);
112 auto *clock = dynamic_cast<MythUIClock *>(base);
116 LOG(VB_GENERAL, LOG_ERR,
"ERROR, bad parsing");
138 auto *clock =
new MythUIClock(parent, objectName());
139 clock->CopyFrom(
this);
void CreateCopy(MythUIType *parent) override
Copy the state of this widget to the one given, it must be of the same type.
bool ParseElement(const QString &filename, QDomElement &element, bool showWarnings) override
Parse the xml definition of this widget setting the state of the object accordingly.
All purpose text widget, displays a text string.
virtual void SetText(const QString &text)
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
QString m_ShortDateFormat
The base class on which all widgets and screens are based.
MythUIClock(MythUIType *parent, const QString &name)
void Pulse(void) override
Pulse is called 70 times a second to trigger a single frame of an animation.
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
MythFontProperties * m_Font
bool ParseElement(const QString &filename, QDomElement &element, bool showWarnings) override
Parse the xml definition of this widget setting the state of the object accordingly.
QString GetTimeText(void)
This creates a string based on m_Time, and sets m_nextUpdate to the second following m_Time.
QString GetSetting(const QString &_key, const QString &defaultval)
static QString parseText(QDomElement &element)
void Pulse(void) override
Looks up the time and sets the clock if the current time is greater than or equal to m_nextUpdate.
void CopyFrom(MythUIType *base) override
Copy this widgets state from another.
#define LOG(_MASK_, _LEVEL_, _STRING_)
void SetText(const QString &text) override
This sets the text, unless the string is blank, in that case the time is looked up and set as the tex...
void CopyFrom(MythUIType *base) override
Copy this widgets state from another.