Go to the documentation of this file. 1 #include <QDomDocument>
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());
QNetworkAccessManager * m_manager
MythUIBusyDialog * m_busyPopup
virtual bool RemoveFromDB(GrabberScript *script)=0
void FillGrabberButtonList()
~NetEditorBase() override
virtual bool Matches(bool search, bool tree)=0
virtual bool FindGrabberInDB(const QString &filename)=0
bool Create(void) override
MythScreenStack * m_popupStack
virtual bool InsertInDB(GrabberScript *script)=0
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
void SlotLoadedData(void)
Screen in which all other widgets are contained and rendered.
MythUIType * GetFocusWidget(void) const
NetEditorBase(MythScreenStack *parent, const QString &name)
Creates a new NetEditorBase Screen.
void CreateBusyDialog(const QString &title)
bool TranslateKeyPress(const QString &Context, QKeyEvent *Event, QStringList &Actions, bool AllowJumps=true)
Get a list of actions for a keypress in the given context.
MythUIButtonList * m_grabbers
QString GetMythXMLURL(void)
QString GetShareDir(void)
void ToggleItem(MythUIButtonListItem *item)
void BuildFocusList(void)
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
GrabberScript::scriptList m_grabberList
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
MythMainWindow * GetMythMainWindow(void)
MythScreenStack * GetStack(const QString &Stackname)
bool Create(void) override
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)