16#define LOC QString("NetEditorBase: ")
17#define LOC_WARN QString("NetEditorBase, Warning: ")
18#define LOC_ERR QString("NetEditorBase, Error: ")
25 const QString &name) :
60 LOG(VB_GENERAL, LOG_ERR,
"Cannot load screen 'treeeditor'");
76 QString msg = tr(
"Querying Backend for Internet Content Sources...");
81 connect(
m_manager, &QNetworkAccessManager::finished,
106 doc.setContent(
m_reply->readAll());
107 QDomElement root = doc.documentElement();
108 QDomElement
content = root.firstChildElement(
"InternetContent");
109 QDomElement grabber =
content.firstChildElement(
"grabber");
111 while (!grabber.isNull())
122 title = grabber.firstChildElement(
"name").text();
123 commandline = grabber.firstChildElement(
"command").text();
124 author = grabber.firstChildElement(
"author").text();
125 image = grabber.firstChildElement(
"thumbnail").text();
126 type = grabber.firstChildElement(
"type").text();
127 description = grabber.firstChildElement(
"description").text();
128 double version = grabber.firstChildElement(
"version").text().toDouble();
130 QString searchstring = grabber.firstChildElement(
"search").text();
132 if (!searchstring.isEmpty() &&
133 (searchstring.toLower() ==
"true" ||
134 searchstring.toLower() ==
"yes" ||
135 searchstring ==
"1"))
138 QString treestring = grabber.firstChildElement(
"tree").text();
140 if (!treestring.isEmpty() &&
141 (treestring.toLower() ==
"true" ||
142 treestring.toLower() ==
"yes" ||
146 if (
type.toLower() ==
"video" &&
Matches(search, tree))
148 LOG(VB_GENERAL, LOG_INFO,
149 QString(
"Found Source %1...").arg(title));
151 author, search, tree,
152 description, commandline,
156 grabber = grabber.nextSiblingElement(
"grabber");
178 const QString& message = title;
181 "mythvideobusydialog");
197 item->SetText(g->GetTitle(),
"title");
198 item->SetData(QVariant::fromValue(g));
199 const QString& img = g->GetImage();
202 if (!img.startsWith(
"/") && !img.isEmpty())
204 thumb = QString(
"%1mythnetvision/icons/%2")
212 item->SetImage(thumb);
213 item->setCheckable(
true);
215 QFileInfo fi(g->GetCommandline());
bool TranslateKeyPress(const QString &Context, QKeyEvent *Event, QStringList &Actions, bool AllowJumps=true)
Get a list of actions for a keypress in the given context.
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)
MythUIType * GetFocusWidget(void) const
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
bool Create(void) override
MythScreenStack * m_popupStack
virtual bool Matches(bool search, bool tree)=0
virtual bool FindGrabberInDB(const QString &filename)=0
void SlotLoadedData(void)
QNetworkAccessManager * m_manager
virtual bool InsertInDB(GrabberScript *script)=0
MythUIBusyDialog * m_busyPopup
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
virtual bool RemoveFromDB(GrabberScript *script)=0
MythUIButtonList * m_grabbers
void CreateBusyDialog(const QString &title)
void FillGrabberButtonList()
~NetEditorBase() override
GrabberScript::scriptList m_grabberList
NetEditorBase(MythScreenStack *parent, const QString &name)
Creates a new NetEditorBase Screen.
void ToggleItem(MythUIButtonListItem *item)
bool Create(void) override
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
QString GetShareDir(void)
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
MythMainWindow * GetMythMainWindow(void)
QString GetMythXMLURL(void)
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)