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 "
102 setLabel(PlayGroupConfig::tr(
"Time stretch (speed x 100)"));
103 setHelpText(PlayGroupConfig::tr(
"Initial playback speed with adjusted "
104 "audio. Use 100 for normal speed, 50 "
105 "for half speed and 200 for double "
156 query.
prepare(
"INSERT playgroup "
157 "(name, titlematch, skipahead, skipback, jump, timestretch) "
159 "(:NEWNAME, :TITLEMATCH, :SKIPAHEAD, :SKIPBACK, :JUMP, :TIMESTRETCH);");
177 return (
getName() !=
"Default");
183 query.
prepare(
"DELETE FROM playgroup "
184 "WHERE name = :NAME ;");
196 query.
prepare(
"SELECT COUNT(name) FROM playgroup "
197 "WHERE name <> 'Default' ORDER BY name;");
200 else if (query.
next())
201 names = query.
value(0).toInt();
211 query.
prepare(
"SELECT name FROM playgroup "
212 "WHERE name <> 'Default' ORDER BY name;");
218 names << query.
value(0).toString();
226 QString res =
"Default";
231 query.
prepare(
"SELECT name FROM playgroup "
232 "WHERE name = :TITLE1 OR "
233 " name = :CATEGORY OR "
234 " (titlematch <> '' AND "
235 " :TITLE2 REGEXP titlematch) ");
242 else if (query.
next())
243 res = query.
value(0).toString();
254 query.
prepare(QString(
"SELECT name, %1 FROM playgroup "
255 "WHERE (name = :NAME OR name = 'Default') "
257 "ORDER BY name = 'Default';")
262 else if (query.
next())
263 res = query.
value(1).toInt();
282 tr(
"Enter new group name"));
284 if (settingdialog->Create())
291 delete settingdialog;
298 ShowOkPopup(tr(
"Sorry, this Playback Group name cannot be blank."));
305 "WHERE name = :NAME");
316 ShowOkPopup(tr(
"Sorry, this Playback Group name is already in use."));
330 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.