Go to the documentation of this file.
82 LOG(VB_GENERAL, LOG_ERR,
"Theme is missing critical theme elements.");
104 for (
int i = 0; i < actions.size() && !handled; i++)
106 const QString&
action = actions[i];
111 else if (
action ==
"RANKINC")
113 else if (
action ==
"RANKDEC")
158 QString label = tr(
"Channel Options");
162 auto *menuPopup =
new MythDialogBox(label, popupStack,
"chanrecmenupopup");
164 if (!menuPopup->Create())
171 menuPopup->SetReturnEvent(
this,
"options");
173 menuPopup->AddButton(tr(
"Program List"));
187 if (chanInfo ==
nullptr)
192 if (tempRecPriority > -100 && tempRecPriority < 100)
194 chanInfo->m_recPriority = tempRecPriority;
201 item->
SetText(QString::number(chanInfo->m_recPriority),
"priority");
208 const QString &newrecpriority)
211 query.
prepare(
"UPDATE channel SET recpriority = :RECPRI "
212 "WHERE chanid = :CHANID ;");
213 query.
bindValue(
":RECPRI", newrecpriority);
222 QMap<QString, ChannelInfo>::Iterator it;
227 QString key = QString::number(chanInfo->
m_chanId);
240 QMap<int, QString> srcMap;
246 result.
prepare(
"SELECT sourceid, name FROM videosource;");
250 while (result.
next())
252 srcMap[result.
value(0).toInt()] = result.
value(1).toString();
255 result.
prepare(
"SELECT chanid, channum, sourceid, callsign, "
256 "icon, recpriority, name FROM channel "
257 "WHERE deleted IS NULL AND visible > 0");
262 while (result.
next())
266 chaninfo->m_chanNum = result.
value(1).toString();
267 chaninfo->m_sourceId = result.
value(2).toInt();
268 chaninfo->m_callSign = result.
value(3).toString();
269 QString iconurl = result.
value(4).toString();
270 if (!iconurl.isEmpty())
272 chaninfo->m_icon = iconurl;
273 chaninfo->m_recPriority = result.
value(5).toInt();
274 chaninfo->m_name = result.
value(6).toString();
276 chaninfo->SetSourceName(srcMap[chaninfo->m_sourceId]);
283 QString::number(chaninfo->m_recPriority);
300 QMap<QString, ChannelInfo*>::Iterator it;
306 QVariant::fromValue(chanInfo));
308 QString fontState =
"default";
314 chanInfo->
ToMap(infomap);
315 item->SetTextFromMap(infomap, fontState);
317 item->DisplayState(
"normal",
"status");
319 if (!chanInfo->
m_icon.isEmpty())
323 item->SetImage(iconUrl,
"icon");
324 item->SetImage(iconUrl);
327 item->SetText(QString::number(chanInfo->
m_recPriority),
"priority", fontState);
356 std::vector<RecPriorityInfo> sortingList;
357 QMap<QString, ChannelInfo>::iterator pit;
358 std::vector<RecPriorityInfo>::iterator sit;
366 sortingList.push_back(
tmp);
372 std::sort(sortingList.begin(), sortingList.end(),
377 std::sort(sortingList.begin(), sortingList.end(),
385 for (i = 0, sit = sortingList.begin(); sit != sortingList.end(); i++, ++sit)
414 channelItem->ToMap(chanmap);
437 if (!chanInfo || chanInfo->m_chanId < 1)
440 QString chanID = QString(
"%1").arg(chanInfo->m_chanId);
456 QString resultid = dce->GetId();
457 int buttonnum = dce->GetResult();
459 if (resultid ==
"options")
bool isActive(void) const
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
QSqlQuery wrapper that fetches a DB connection from the connection pool.
MythScreenStack * GetMainStack()
QMap< QString, QString > m_origRecPriorityData
Image widget, displays a single image or multiple images in sequence.
MythUIText * m_priorityText
MythUIButtonList * m_channelList
void ToMap(InfoMap &infoMap)
QMap< QString, ChannelInfo > m_channelData
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
bool Load(bool allowLoadInBackground=true, bool forceStat=false)
Load the image(s), wraps ImageLoader::LoadImage()
void saveRecPriority(void)
QVariant value(int i) const
bool Create(void) override
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
QMap< QString, ChannelInfo * > m_sortedChannel
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Screen in which all other widgets are contained and rendered.
MythUIImage * m_iconImage
MythUIType * GetFocusWidget(void) const
QHash< QString, QString > InfoMap
void addListener(QObject *listener)
Add a listener to the observable.
QString GetFormatted(ChannelFormat format) const
ChannelRecPriority(MythScreenStack *parent)
bool operator()(const RecPriorityInfo a, const RecPriorityInfo b)
ChannelInfo * m_currentItem
bool TranslateKeyPress(const QString &Context, QKeyEvent *Event, QStringList &Actions, bool AllowJumps=true)
Get a list of actions for a keypress in the given context.
Basic menu dialog, message and a list of options.
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
static void DBError(const QString &where, const MSqlQuery &query)
void BuildFocusList(void)
bool operator()(const RecPriorityInfo a, const RecPriorityInfo b)
virtual void SetTextFromMap(const InfoMap &infoMap)
void updateInfo(MythUIButtonListItem *item)
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
int GetNumSetting(const QString &key, int defaultval=0)
static void ReschedulePlace(const QString &why)
void customEvent(QEvent *event) override
~ChannelRecPriority() override
All purpose text widget, displays a text string.
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
virtual void SetText(const QString &text)
virtual void SetVisible(bool visible)
static const Type kEventType
MythMainWindow * GetMythMainWindow(void)
MythScreenStack * GetStack(const QString &Stackname)
MythUIText * m_chanstringText
void SaveSetting(const QString &key, int newValue)
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
QString GetMasterHostPrefix(const QString &storageGroup=QString(), const QString &path=QString())
void SetFilename(const QString &filename)
Must be followed by a call to Load() to load the image.
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
static void applyChannelRecPriorityChange(const QString &chanid, const QString &newrecpriority)
void removeListener(QObject *listener)
Remove a listener to the observable.
void ShowMenu(void) override
void changeRecPriority(int howMuch)
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.