33 LOG(VB_GENERAL, LOG_ERR,
"Cannot load screen 'phrasepopup'");
49 for (
const QString& item : std::as_const(
m_list))
136 QString text =
m_list[view];
137 const QString& qphrase = text;
140 query.
prepare(
"DELETE FROM keyword "
141 "WHERE phrase = :PHRASE AND searchtype = :TYPE;");
152 if (view < m_parent->m_curView)
169 if (text.trimmed().isEmpty())
174 LOG(VB_GENERAL, LOG_ERR,
"Unknown search in ProgLister");
186 fromgenre = QString(
"LEFT JOIN programgenres ON "
187 "program.chanid = programgenres.chanid AND "
188 "program.starttime = programgenres.starttime ");
199 record->LoadBySearch(
m_searchType, text, what, fromgenre);
203 if (schededit->Create())
230 LOG(VB_GENERAL, LOG_ERR,
"Cannot load screen 'powersearchpopup'");
237 for (
const QString &item : std::as_const(
m_list))
295 QString currentItem =
":::::";
302 if (!popup->Create())
320 QString text =
m_list[view];
321 const QString& qphrase = text;
324 query.
prepare(
"DELETE FROM keyword "
325 "WHERE phrase = :PHRASE AND searchtype = :TYPE;");
336 if (view < m_parent->m_curView)
353 if (text.trimmed().isEmpty())
358 LOG(VB_GENERAL, LOG_ERR,
"Unknown search in ProgLister");
371 "LEFT JOIN programgenres ON "
372 "program.chanid = programgenres.chanid AND "
373 "program.starttime = programgenres.starttime ");
384 record->LoadBySearch(
m_searchType, text, what, fromgenre);
388 if (schededit->Create())
404 QString ¤tValue)
407 m_currentValue(
std::move(currentValue))
411 if (field.count() != 6)
413 LOG(VB_GENERAL, LOG_ERR, QString(
"Error. PowerSearch %1 has %2 fields")
435 LOG(VB_GENERAL, LOG_ERR,
"Cannot load screen 'editpowersearchpopup'");
508 query.
prepare(
"SELECT genre FROM programgenres GROUP BY genre;");
514 QString category = query.
value(0).toString();
515 if (category.isEmpty() || category.trimmed().isEmpty())
517 category = query.
value(0).toString();
520 if (category == field[4])
527 "ChannelOrdering",
"channum");
536 for (
auto & channel : channels)
547 channel.ToMap(chanmap);
548 item->SetTextFromMap(chanmap);
551 if (channel.m_callSign == field[5])
std::vector< ChannelInfo > ChannelInfoList
static void SortChannels(ChannelInfoList &list, const QString &order, bool eliminate_duplicates=false)
static ChannelInfoList GetChannels(uint sourceid, bool visible_only, const QString &group_by=QString(), uint channel_groupid=0)
QSqlQuery wrapper that fetches a DB connection from the connection pool.
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
QVariant value(int i) const
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
QString GetSetting(const QString &key, const QString &defaultval="")
static void DBError(const QString &where, const MSqlQuery &query)
MythScreenStack * GetMainStack()
MythScreenStack * GetStack(const QString &Stackname)
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Screen in which all other widgets are contained and rendered.
void BuildFocusList(void)
bool SetFocusWidget(MythUIType *widget=nullptr)
QString GetText(void) const
void SetText(const QString &text, bool moveCursor=true)
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
virtual void SetText(const QString &text)
void SetEnabled(bool enable)
QStringList m_viewTextList
void SetViewFromList(const QString &item)
void FillViewList(const QString &view)
static bool PowerStringToSQL(const QString &qphrase, QString &output, MSqlBindings &bindings)
void UpdateKeywordInDB(const QString &text, const QString &oldValue)
Internal representation of a recording rule, mirrors the record table.
Construct a recording schedule.
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
void MSqlEscapeAsAQuery(QString &query, const MSqlBindings &bindings)
Given a partial query string and a bindings object, escape the string.
QMap< QString, QVariant > MSqlBindings
typedef for a map of string -> string bindings for generic queries.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
MythMainWindow * GetMythMainWindow(void)
QHash< QString, QString > InfoMap
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)