69 LOG(VB_GENERAL, LOG_ERR,
"Theme is missing critical theme elements.");
129 for (
int i = 0; i < actions.size() && !handled; i++)
131 const QString&
action = actions[i];
174 QString label = tr(
"Search Options");
177 "mythnetvisionmenupopup");
179 if (menuPopup->Create())
183 menuPopup->SetReturnEvent(
this,
"options");
191 menuPopup->AddButton(tr(
"Stream Video"),
209 menuPopup->AddButton(tr(
"Play"),
214 menuPopup->AddButton(tr(
"Save This Video"),
233 menuPopup->AddButton(tr(
"Skip 10 Pages Back"),
237 menuPopup->AddButton(tr(
"Skip 10 Pages Forward"),
240 menuPopup->AddButton(tr(
"Manage Search Scripts"),
256 item->SetText(g->GetTitle(),
"title");
257 item->SetData(g->GetCommandline());
258 QString thumb = QString(
"%1mythnetvision/icons/%2")
260 item->SetImage(thumb);
269 for (
int i = 0; i < numScripts; i++)
290 QString title = tr(
"Searching %1 for \"%2\"...")
291 .arg(grabber, query);
297 connect(
m_netSearch, &QNetworkAccessManager::finished,
302 QUrl req(init.toEncoded(), QUrl::TolerantMode);
303 LOG(VB_GENERAL, LOG_INFO,
304 QString(
"Using Search URL %1").arg(req.toString()));
314 QString title = tr(
"Changing to page %1 of search \"%2\"...")
332 QString title = tr(
"Changing to page %1 of search \"%2\"...")
365 auto *item =
new Search();
366 QByteArray data =
m_reply->readAll();
371 uint searchresults = item->numResults();
372 uint returned = item->numReturned();
373 uint firstitem = item->numIndex();
382 SetText(QString::number(searchresults),
"count");
384 if (firstitem + returned == searchresults)
389 if (searchresults % returned != 0)
408 QString message = tr(
"Timed out waiting for query to "
409 "finish. API might be down.");
427 for (
const auto & result : std::as_const(list))
429 const QString& title = result->GetTitle();
431 QVariant::fromValue(result));
433 result->toMap(metadataMap);
434 item->SetTextFromMap(metadataMap);
436 if (!result->GetThumbnail().isEmpty())
438 QString dlfile = result->GetThumbnail();
440 if (dlfile.contains(
"%SHAREDIR%"))
443 item->SetImage(dlfile);
450 result->GetThumbnail(),
451 QVariant::fromValue<uint>(pos));
466 auto *searchedit =
new SearchEditor(mainStack,
"mythnetsearchedit");
468 if (searchedit->Create())
500 if (item->GetDownloadable())
510 QString title = btn->
GetText();
513 QString(), QString(),
515 QString(), QString(), QString(), QString(),
516 QDateTime(),
nullptr,
nullptr, -1, QString(), QStringList(),
517 QString(), QStringList(), 0, 0, QString(),
518 false, QStringList(), 0, 0,
false);
527 item->
toMap(metadataMap);
538 if (
filename.contains(
"%SHAREDIR%"))
565 QString title = data->
title;
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)