Go to the documentation of this file.
2 #include <QCoreApplication>
16 const QString& _name) :
28 QString nameTag(
":WHERENAME");
29 QString query(
"name = " + nameTag);
42 setLabel(PlayGroupConfig::tr(
"Title match (regex)"));
43 setHelpText(PlayGroupConfig::tr(
"Automatically set new recording rules "
44 "to use this group if the title "
45 "matches this regular expression. "
46 "For example, \"(News|CNN)\" would "
47 "match any title in which \"News\" or "
60 setLabel(PlayGroupConfig::tr(
"Skip ahead (seconds)"));
61 setHelpText(PlayGroupConfig::tr(
"How many seconds to skip forward on "
73 setLabel(PlayGroupConfig::tr(
"Skip back (seconds)"));
74 setHelpText(PlayGroupConfig::tr(
"How many seconds to skip backward on "
86 setLabel(PlayGroupConfig::tr(
"Jump amount (minutes)"));
87 setHelpText(PlayGroupConfig::tr(
"How many minutes to jump forward or "
88 "backward when the jump keys are "
101 setLabel(PlayGroupConfig::tr(
"Time stretch (speed x 100)"));
102 setHelpText(PlayGroupConfig::tr(
"Initial playback speed with adjusted "
103 "audio. Use 100 for normal speed, 50 "
104 "for half speed and 200 for double "
154 if (titleMatch.isNull())
158 query.
prepare(
"INSERT playgroup "
159 "(name, titlematch, skipahead, skipback, jump, timestretch) "
161 "(:NEWNAME, :TITLEMATCH, :SKIPAHEAD, :SKIPBACK, :JUMP, :TIMESTRETCH);");
164 query.
bindValue(
":TITLEMATCH", titleMatch);
181 return (
getName() !=
"Default");
187 query.
prepare(
"DELETE FROM playgroup "
188 "WHERE name = :NAME ;");
200 query.
prepare(
"SELECT COUNT(name) FROM playgroup "
201 "WHERE name <> 'Default' ORDER BY name;");
204 else if (query.
next())
205 names = query.
value(0).toInt();
215 query.
prepare(
"SELECT name FROM playgroup "
216 "WHERE name <> 'Default' ORDER BY name;");
222 names << query.
value(0).toString();
230 QString res =
"Default";
235 query.
prepare(
"SELECT name FROM playgroup "
236 "WHERE name = :TITLE1 OR "
237 " name = :CATEGORY OR "
238 " (titlematch <> '' AND "
239 " :TITLE2 REGEXP titlematch) ");
246 else if (query.
next())
247 res = query.
value(0).toString();
258 query.
prepare(QString(
"SELECT name, %1 FROM playgroup "
259 "WHERE (name = :NAME OR name = 'Default') "
261 "ORDER BY name = 'Default';")
266 else if (query.
next())
267 res = query.
value(1).toInt();
286 tr(
"Enter new group name"));
288 if (settingdialog->Create())
296 delete settingdialog;
304 ShowOkPopup(tr(
"Sorry, this Playback Group name cannot be blank."));
311 "WHERE name = :NAME");
322 ShowOkPopup(tr(
"Sorry, this Playback Group name is already in use."));
336 while (!names.isEmpty())
static int GetSetting(const QString &name, const QString &field, int defval)
QMap< QString, QVariant > MSqlBindings
typedef for a map of string -> string bindings for generic queries.
MythUISpinBoxSetting * m_skipAhead
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
QSqlQuery wrapper that fetches a DB connection from the connection pool.
virtual void setName(const QString &name)
virtual void setValue(const QString &newValue)
TitleMatch(const PlayGroupConfig &_parent)
const PlayGroupConfig & m_parent
static QString GetInitialName(const ProgramInfo *pi)
PlayGroupConfig(const QString &label, const QString &name, bool isNew=false)
SkipAhead(const PlayGroupConfig &_parent)
QVariant value(int i) const
SkipBack(const PlayGroupConfig &_parent)
QString GetCategory(void) const
void updateButton(MythUIButtonListItem *item) override
This method is called whenever the UI need to reflect a change Reimplement this If you widget need a ...
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
void CreateNewPlayBackGroup() const
MythUISpinBoxSetting * m_jumpMinutes
void CreateNewPlayBackGroupSlot(const QString &name)
TimeStretch(const PlayGroupConfig &_parent)
static QStringList GetNames(void)
void setChanged(bool changed)
void settingsChanged(StandardSetting *selectedSetting=nullptr)
virtual void addChild(StandardSetting *child)
static int GetCount(void)
MythUISpinBoxSetting * m_timeStrech
QString getName(void) const
QString GetTitle(void) const
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
static void DBError(const QString &where, const MSqlQuery &query)
virtual void setHelpText(const QString &str)
bool canDelete(void) override
MythUISpinBoxSetting * m_skipBack
virtual QString getValue(void) const
virtual void setLabel(QString str)
StandardSetting * m_titleMatch
Holds information on recordings and videos.
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
MythMainWindow * GetMythMainWindow(void)
MythScreenStack * GetStack(const QString &Stackname)
PlayGroupDBStorage(StandardSetting *_setting, const PlayGroupConfig &_parent, const QString &_name)
Dialog prompting the user to enter a text string.
QString GetWhereClause(MSqlBindings &bindings) const override
void deleteEntry(void) override
JumpMinutes(const PlayGroupConfig &_parent)
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
MythConfirmationDialog * ShowOkPopup(const QString &message, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
ButtonStandardSetting * m_addGroupButton
void updateButton(MythUIButtonListItem *item) override
This method is called whenever the UI need to reflect a change Reimplement this If you widget need a ...
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.