Go to the documentation of this file.
168 using pws = std::map<ParentalLevel::Level, QString>;
173 m_passwords.insert(pws::value_type(level, password));
182 auto p = m_passwords.find(i.GetLevel());
183 if (
p != m_passwords.end() && !
p->second.isEmpty())
184 ret.push_back(
p->second);
196 auto p = m_passwords.find(i.GetLevel());
197 if (
p != m_passwords.end() && !
p->second.isEmpty())
259 if (
m_pm.FirstAtOrBelow(which_level.
GetLevel()).isEmpty())
267 if (last_time_stamp.isEmpty() || last_parent_lvl == -1)
269 LOG(VB_GENERAL, LOG_ERR,
270 QString(
"%1: Could not read password/pin time "
271 "stamp. This is only an issue if it "
272 "happens repeatedly.").arg(__FILE__));
280 last_time.secsTo(curr_time) < 120)
296 QString pw =
m_pm.FirstAtOrBelow(which_level.
GetLevel());
330 if (password != valid_pwd)
375 #include "parentalcontrols.moc"
ParentalLevel::Level toParentalLevel(int pl)
bool operator==(const ParentalLevel &lhs, const ParentalLevel &rhs)
void Add(ParentalLevel::Level level, const QString &password)
bool operator>(const ParentalLevel &lhs, const ParentalLevel &rhs)
std::map< ParentalLevel::Level, QString > pws
ParentalLevel::Level prevParentalLevel(ParentalLevel::Level cpl)
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
void SigDone(bool passwordValid, ParentalLevel::Level toLevel)
ParentalLevelChangeCheckerPrivate(QObject *lparent)
class ParentalLevelChangeCheckerPrivate * m_private
void Check(ParentalLevel::Level fromLevel, ParentalLevel::Level toLevel)
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
bool operator>=(const ParentalLevel &lhs, const ParentalLevel &rhs)
ParentalLevelChangeChecker()
bool operator!=(const ParentalLevel &lhs, const ParentalLevel &rhs)
QString FirstAtOrBelow(ParentalLevel::Level level)
ParentalLevel & operator=(const ParentalLevel &rhs)
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
bool operator<=(const ParentalLevel &lhs, const ParentalLevel &rhs)
void SigResultReady(bool passwordValid, ParentalLevel::Level newLevel)
int GetNumSetting(const QString &key, int defaultval=0)
ParentalLevel::Level boundedParentalLevel(ParentalLevel::Level pl)
ParentalLevel::Level nextParentalLevel(ParentalLevel::Level cpl)
QDateTime fromString(const QString &dtstr)
Converts kFilename && kISODate formats to QDateTime.
bool operator<(const ParentalLevel &lhs, const ParentalLevel &rhs)
QStringList AtOrAbove(ParentalLevel::Level level)
void Check(ParentalLevel::Level fromLevel, ParentalLevel::Level toLevel)
void OnResultReady(bool passwordValid, ParentalLevel::Level newLevel)
ParentalLevel & operator+=(int amount)
MythMainWindow * GetMythMainWindow(void)
QStringList m_validPasswords
QString current_iso_string(bool stripped)
Returns current Date and Time in UTC as a string.
MythScreenStack * GetStack(const QString &Stackname)
ParentalLevel & operator-=(int amount)
Dialog prompting the user to enter a text string.
void SaveSetting(const QString &key, int newValue)
ParentalLevel::Level m_toLevel
ParentalLevel & operator--()
ParentalLevel::Level m_fromLevel
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
void OnPasswordEntered(const QString &password)
QString GetSetting(const QString &key, const QString &defaultval="")
ParentalLevel & operator++()