70 LOG(VB_GENERAL, LOG_ERR,
"Theme is missing critical theme elements.");
130 for (
int i = 0; i < actions.size() && !handled; i++)
132 const QString&
action = actions[i];
177 QString label = tr(
"Search Options");
180 "mythnetvisionmenupopup");
182 if (menuPopup->Create())
186 menuPopup->SetReturnEvent(
this,
"options");
194 menuPopup->AddButton(tr(
"Stream Video"),
212 menuPopup->AddButton(tr(
"Play"),
217 menuPopup->AddButton(tr(
"Save This Video"),
236 menuPopup->AddButton(tr(
"Skip 10 Pages Back"),
240 menuPopup->AddButton(tr(
"Skip 10 Pages Forward"),
243 menuPopup->AddButton(tr(
"Manage Search Scripts"),
259 item->SetText(g->GetTitle(),
"title");
260 item->SetData(g->GetCommandline());
261 QString thumb = QString(
"%1mythnetvision/icons/%2")
263 item->SetImage(thumb);
272 for (
int i = 0; i < numScripts; i++)
293 QString title = tr(
"Searching %1 for \"%2\"...")
294 .arg(grabber, query);
300 connect(
m_netSearch, &QNetworkAccessManager::finished,
305 QUrl req(init.toEncoded(), QUrl::TolerantMode);
306 LOG(VB_GENERAL, LOG_INFO,
307 QString(
"Using Search URL %1").arg(req.toString()));
317 QString title = tr(
"Changing to page %1 of search \"%2\"...")
335 QString title = tr(
"Changing to page %1 of search \"%2\"...")
368 auto *item =
new Search();
369 QByteArray data =
m_reply->readAll();
374 uint searchresults = item->numResults();
375 uint returned = item->numReturned();
376 uint firstitem = item->numIndex();
385 SetText(QString::number(searchresults),
"count");
387 if (firstitem + returned == searchresults)
394 if (searchresults % returned != 0)
413 QString message = tr(
"Timed out waiting for query to "
414 "finish. API might be down.");
434 for (
const auto & result : std::as_const(list))
436 const QString& title = result->GetTitle();
438 QVariant::fromValue(result));
440 result->toMap(metadataMap);
441 item->SetTextFromMap(metadataMap);
443 if (!result->GetThumbnail().isEmpty())
445 QString dlfile = result->GetThumbnail();
447 if (dlfile.contains(
"%SHAREDIR%"))
450 item->SetImage(dlfile);
457 result->GetThumbnail(),
458 QVariant::fromValue<uint>(pos));
473 auto *searchedit =
new SearchEditor(mainStack,
"mythnetsearchedit");
475 if (searchedit->Create())
507 if (item->GetDownloadable())
517 QString title = btn->
GetText();
520 QString(), QString(),
522 QString(), QString(), QString(), QString(),
523 QDateTime(),
nullptr,
nullptr, -1, QString(), QStringList(),
524 QString(), QStringList(), 0, 0, QString(),
525 false, QStringList(), 0, 0,
false);
534 item->
toMap(metadataMap);
545 if (
filename.contains(
"%SHAREDIR%"))
572 QString title = data->
title;
596#include "moc_netsearch.cpp"
Dialog asking for user confirmation.
bool Create(void) override
Basic menu dialog, message and a list of options.
MythScreenStack * GetMainStack()
bool TranslateKeyPress(const QString &Context, QKeyEvent *Event, QStringList &Actions, bool AllowJumps=true)
Get a list of actions for a keypress in the given context.
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
void LoadInBackground(const QString &message="")
void OpenBusyPopup(const QString &message="")
void BuildFocusList(void)
MythUIType * GetFocusWidget(void) const
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
bool SetFocusWidget(MythUIType *widget=nullptr)
void CloseBusyPopup(void)
virtual void SetTextFromMap(const InfoMap &infoMap)
Image widget, displays a single image or multiple images in sequence.
bool Load(bool allowLoadInBackground=true, bool forceStat=false)
Load the image(s), wraps ImageLoader::LoadImage()
void SetFilename(const QString &filename)
Must be followed by a call to Load() to load the image.
void Reset(void) override
Reset the image back to the default defined in the theme.
void SetVisible(bool visible) override
This widget is used for grouping other widgets for display when a particular named state is called.
bool DisplayState(const QString &name)
A text entry and edit widget.
QString GetText(void) const
void SetMaxLength(int length)
All purpose text widget, displays a text string.
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
virtual void SetText(const QString &text)
virtual void SetVisible(bool visible)
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
GrabberScript::scriptList m_grabberList
void customEvent(QEvent *event) override
MythUIStateType * m_downloadable
void SlotDeleteVideo(void)
MetadataImageDownload * m_imageDownload
void StreamWebVideo(void)
MythScreenStack * m_popupStack
MythUIImage * m_thumbImage
void DoDownloadAndPlay(void)
QNetworkAccessManager * m_netSearch
void SetTextAndThumbnail(MythUIButtonListItem *btn, ResultItem *item)
NetSearch(MythScreenStack *parent, const char *name=nullptr)
void ShowMenu(void) override
bool Create(void) override
void LoadData(void) override
void FillGrabberButtonList(void)
void customEvent(QEvent *levent) override
void SearchTimeout(Search *item)
void RunSearchEditor() const
void SearchFinished(void)
ResultItem * GetStreamItem() override
MythUIProgressBar * m_progress
MythUIButtonList * m_searchResultList
MythUIButtonList * m_siteList
void PopulateResultList(const ResultItem::resultList &list)
void SlotItemChanged(void)
void SetThumbnail(MythUIButtonListItem *btn)
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
void Load() override
Load data which will ultimately be displayed on-screen or used to determine what appears on-screen (S...
MythConfirmationDialog * m_okPopup
MythUITextEdit * m_search
static bool Exists(const QString &url, struct stat *fileinfo)
void toMap(InfoMap &metadataMap)
const QString & GetMediaURL() const
const QString & GetTitle() const
const bool & GetDownloadable() const
QList< ResultItem * > resultList
static const Type kEventType
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
QString GetShareDir(void)
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
MythMainWindow * GetMythMainWindow(void)
std::shared_ptr< MythSortHelper > getMythSortHelper(void)
Get a pointer to the MythSortHelper singleton.
QHash< QString, QString > InfoMap
QUrl GetMythXMLSearch(const QString &url, const QString &query, const QString &grabber, const QString &pagenum)
QString GetMythXMLURL(void)
GrabberScript::scriptList findAllDBSearchGrabbers(ArticleType type)
QString GetDownloadFilename(const QString &title, const QString &url)