Go to the documentation of this file.
4 #include <QImageReader>
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];
175 QString label = tr(
"Search Options");
178 "mythnetvisionmenupopup");
180 if (menuPopup->Create())
184 menuPopup->SetReturnEvent(
this,
"options");
192 menuPopup->AddButton(tr(
"Stream Video"),
210 menuPopup->AddButton(tr(
"Play"),
215 menuPopup->AddButton(tr(
"Save This Video"),
234 menuPopup->AddButton(tr(
"Skip 10 Pages Back"),
238 menuPopup->AddButton(tr(
"Skip 10 Pages Forward"),
241 menuPopup->AddButton(tr(
"Manage Search Scripts"),
257 item->SetText(g->GetTitle(),
"title");
258 item->SetData(g->GetCommandline());
259 QString thumb = QString(
"%1mythnetvision/icons/%2")
261 item->SetImage(thumb);
270 for (
int i = 0; i < numScripts; i++)
291 QString title = tr(
"Searching %1 for \"%2\"...")
292 .arg(grabber, query);
298 connect(
m_netSearch, &QNetworkAccessManager::finished,
303 QUrl req(init.toEncoded(), QUrl::TolerantMode);
304 LOG(VB_GENERAL, LOG_INFO,
305 QString(
"Using Search URL %1").arg(req.toString()));
315 QString title = tr(
"Changing to page %1 of search \"%2\"...")
333 QString title = tr(
"Changing to page %1 of search \"%2\"...")
366 auto *item =
new Search();
367 QByteArray data =
m_reply->readAll();
372 uint searchresults = item->numResults();
373 uint returned = item->numReturned();
374 uint firstitem = item->numIndex();
383 SetText(QString::number(searchresults),
"count");
385 if (firstitem + returned == searchresults)
390 if (searchresults % returned != 0)
409 QString message = tr(
"Timed out waiting for query to "
410 "finish. API might be down.");
428 for (
const auto & result : std::as_const(list))
430 const QString& title = result->GetTitle();
432 QVariant::fromValue(result));
434 result->toMap(metadataMap);
435 item->SetTextFromMap(metadataMap);
437 if (!result->GetThumbnail().isEmpty())
439 QString dlfile = result->GetThumbnail();
441 if (dlfile.contains(
"%SHAREDIR%"))
444 item->SetImage(dlfile);
451 result->GetThumbnail(),
452 QVariant::fromValue<uint>(pos));
467 auto *searchedit =
new SearchEditor(mainStack,
"mythnetsearchedit");
469 if (searchedit->Create())
501 if (item->GetDownloadable())
511 QString title = btn->
GetText();
514 QString(), QString(),
516 QString(), QString(), QString(), QString(),
517 QDateTime(),
nullptr,
nullptr, -1, QString(), QStringList(),
518 QString(), QStringList(), 0, 0, QString(),
519 false, QStringList(), 0, 0,
false);
528 item->
toMap(metadataMap);
539 if (
filename.contains(
"%SHAREDIR%"))
566 QString title = data->
title;
void LoadInBackground(const QString &message="")
MythScreenStack * GetMainStack()
void SetMaxLength(int length)
Image widget, displays a single image or multiple images in sequence.
QString GetDownloadFilename(const QString &title, const QString &url)
bool Create(void) override
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
std::shared_ptr< MythSortHelper > getMythSortHelper(void)
Get a pointer to the MythSortHelper singleton.
void FillGrabberButtonList(void)
void SlotItemChanged(void)
GrabberScript::scriptList findAllDBSearchGrabbers(ArticleType type)
void RunSearchEditor() const
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
static bool Exists(const QString &url, struct stat *fileinfo)
static const Type kEventType
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
bool Load(bool allowLoadInBackground=true, bool forceStat=false)
Load the image(s), wraps ImageLoader::LoadImage()
void SearchTimeout(Search *item)
void SlotDeleteVideo(void)
MythConfirmationDialog * m_okPopup
const QString & GetTitle() const
QUrl GetMythXMLSearch(const QString &url, const QString &query, const QString &grabber, const QString &pagenum)
void SetTextAndThumbnail(MythUIButtonListItem *btn, ResultItem *item)
A text entry and edit widget.
void OpenBusyPopup(const QString &message="")
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
void customEvent(QEvent *event) override
QString GetText(void) const
void ShowMenu(void) override
void Reset(void) override
Reset the image back to the default defined in the theme.
void Load() override
Load data which will ultimately be displayed on-screen or used to determine what appears on-screen (S...
MythUIImage * m_thumbImage
MythUIButtonList * m_siteList
MythUIType * GetFocusWidget(void) const
void LoadData(void) override
QHash< QString, QString > InfoMap
bool Create(void) override
MythScreenStack * m_popupStack
void SearchFinished(void)
MythUIProgressBar * m_progress
QString doTitle(const QString &title) const
Create the sortable form of an title string.
bool TranslateKeyPress(const QString &Context, QKeyEvent *Event, QStringList &Actions, bool AllowJumps=true)
Get a list of actions for a keypress in the given context.
void customEvent(QEvent *levent) override
GrabberScript::scriptList m_grabberList
bool SetFocusWidget(MythUIType *widget=nullptr)
Basic menu dialog, message and a list of options.
QString GetMythXMLURL(void)
QString GetShareDir(void)
MetadataImageDownload * m_imageDownload
void BuildFocusList(void)
ResultItem * GetStreamItem() override
MythUIButtonList * m_searchResultList
virtual void SetTextFromMap(const InfoMap &infoMap)
QNetworkAccessManager * m_netSearch
void toMap(InfoMap &metadataMap)
void StreamWebVideo(void)
NetSearch(MythScreenStack *parent, const char *name=nullptr)
All purpose text widget, displays a text string.
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
void PopulateResultList(const ResultItem::resultList &list)
Dialog asking for user confirmation. Ok and optional Cancel button.
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
void SetThumbnail(MythUIButtonListItem *btn)
virtual void SetText(const QString &text)
virtual void SetVisible(bool visible)
MythUITextEdit * m_search
MythMainWindow * GetMythMainWindow(void)
QList< ResultItem * > resultList
MythUIStateType * m_downloadable
void SetFilename(const QString &filename)
Must be followed by a call to Load() to load the image.
void SetVisible(bool visible) override
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
const bool & GetDownloadable() const
void CloseBusyPopup(void)
This widget is used for grouping other widgets for display when a particular named state is called....
void DoDownloadAndPlay(void)
bool DisplayState(const QString &name)
const QString & GetMediaURL() const