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];
176 QString label = tr(
"Search Options");
179 "mythnetvisionmenupopup");
181 if (menuPopup->Create())
185 menuPopup->SetReturnEvent(
this,
"options");
193 menuPopup->AddButton(tr(
"Stream Video"),
211 menuPopup->AddButton(tr(
"Play"),
216 menuPopup->AddButton(tr(
"Save This Video"),
235 menuPopup->AddButton(tr(
"Skip 10 Pages Back"),
239 menuPopup->AddButton(tr(
"Skip 10 Pages Forward"),
242 menuPopup->AddButton(tr(
"Manage Search Scripts"),
258 item->SetText(g->GetTitle(),
"title");
259 item->SetData(g->GetCommandline());
260 QString thumb = QString(
"%1mythnetvision/icons/%2")
262 item->SetImage(thumb);
271 for (
int i = 0; i < numScripts; i++)
292 QString title = tr(
"Searching %1 for \"%2\"...")
293 .arg(grabber, query);
299 connect(
m_netSearch, &QNetworkAccessManager::finished,
304 QUrl req(init.toEncoded(), QUrl::TolerantMode);
305 LOG(VB_GENERAL, LOG_INFO,
306 QString(
"Using Search URL %1").arg(req.toString()));
316 QString title = tr(
"Changing to page %1 of search \"%2\"...")
334 QString title = tr(
"Changing to page %1 of search \"%2\"...")
367 auto *item =
new Search();
368 QByteArray data =
m_reply->readAll();
373 uint searchresults = item->numResults();
374 uint returned = item->numReturned();
375 uint firstitem = item->numIndex();
384 SetText(QString::number(searchresults),
"count");
386 if (firstitem + returned == searchresults)
393 if (searchresults % returned != 0)
412 QString message = tr(
"Timed out waiting for query to "
413 "finish. API might be down.");
433 for (
const auto & result : std::as_const(list))
435 const QString& title = result->GetTitle();
437 QVariant::fromValue(result));
439 result->toMap(metadataMap);
440 item->SetTextFromMap(metadataMap);
442 if (!result->GetThumbnail().isEmpty())
444 QString dlfile = result->GetThumbnail();
446 if (dlfile.contains(
"%SHAREDIR%"))
449 item->SetImage(dlfile);
456 result->GetThumbnail(),
457 QVariant::fromValue<uint>(pos));
472 auto *searchedit =
new SearchEditor(mainStack,
"mythnetsearchedit");
474 if (searchedit->Create())
506 if (item->GetDownloadable())
516 QString title = btn->
GetText();
519 QString(), QString(),
521 QString(), QString(), QString(), QString(),
522 QDateTime(),
nullptr,
nullptr, -1, QString(), QStringList(),
523 QString(), QStringList(), 0, 0, QString(),
524 false, QStringList(), 0, 0,
false);
533 item->
toMap(metadataMap);
544 if (
filename.contains(
"%SHAREDIR%"))
571 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)