53 "mythNetTree.updateFreq", 6);
55 "mythnetvision.rssBackgroundFetch",
false);
57 "mythnetvision.backgroundFetch",
false);
62 QString windowName =
"gallery";
67 windowName =
"gallery";
70 windowName =
"browser";
100 LOG(VB_GENERAL, LOG_ERR,
"Cannot load screen '" + windowName +
"'");
180 using MGTreeChildList = QList<MythGenericTree *>;
183 for (
auto * child : std::as_const(*lchildren))
185 if (child !=
nullptr)
191 item->SetData(QVariant::fromValue(child));
195 if (child == selectedNode)
225 int nodeInt = node->
getInt();
245 item->
SetText(site->GetTitle());
246 item->
SetText(site->GetDescription(),
"description");
247 item->
SetText(site->GetURL(),
"url");
255 video->toMap(metadataMap);
262 QString dlfile = video->GetThumbnail();
263 if (dlfile.contains(
"%SHAREDIR%"))
267 video->GetThumbnail());
273 QVariant::fromValue<uint>(pos));
278 if (!node->
GetData().toString().isEmpty())
280 QString tpath = node->
GetData().toString();
281 if (tpath.startsWith(
"http://"))
293 QVariant::fromValue<uint>(pos));
295 else if (tpath !=
"0")
298 if (
filename.contains(
"%SHAREDIR%"))
312 int nodeInt = node->
getInt();
341 bool handled =
false;
370 for (
int i = 0; i < actions.size() && !handled; i++)
372 const QString&
action = actions[i];
379 else if (
action ==
"ESCAPE")
402 QString label = tr(
"Playback/Download Options");
439 if (menuPopup->Create())
447 QString label = tr(
"View Options");
463 QString label = tr(
"Subscription Management");
473 menu->AddItem(tr(
"Enable Automatic Site Updates"),
478 menu->AddItem(tr(
"Disable Automatic Site Updates"),
512 if (nettree->Create())
517 screenStack->
PopScreen(
this,
false,
false);
535 rssGeneric->addNode(tr(
"Back"),
kUpFolder,
true,
false);
537 rssGeneric->SetData(QString(
"%1/mythnetvision/icons/rss.png")
540 for (
const auto & feed : std::as_const(
m_rssList))
546 ret->SetData(QVariant::fromValue(feed));
547 rssGeneric->addNode(ret);
551 ret->addNode(tr(
"Back"),
kUpFolder,
true,
false);
553 for (
const auto & item : std::as_const(items))
566 QMultiMap<QPair<QString,QString>,
ResultItem*> treePathsNodes =
569 QList< QPair<QString,QString> >
paths = treePathsNodes.uniqueKeys();
572 QString thumb = QString(
"%1mythnetvision/icons/%2")
574 ret->SetData(QVariant::fromValue(thumb));
578 ret->addNode(tr(
"Back"),
kUpFolder,
true,
false);
580 for (
const auto & path : std::as_const(
paths))
582 QStringList curPaths = path.first.split(
"/");
583 QString dirthumb = path.second;
584 QList<ResultItem*> videos = treePathsNodes.values(path);
594 const QString& dirthumb,
const QList<ResultItem*>& videos)
601 while (folder ==
nullptr && !
paths.empty())
603 QString curPath =
paths.takeFirst();
604 curPath.replace(
"|",
"/");
629 for (
const auto & video : std::as_const(videos))
638 title.replace(
"&",
"&");
640 sub_node->
SetData(QVariant::fromValue(video));
643 video->
toMap(textMap);
671 item->
toMap(metadataMap);
678 if (dlfile.contains(
"%SHAREDIR%"))
699 QVariant::fromValue<uint>(0));
721 QString(), QString(),
724 site->
GetAuthor(), QDateTime(),
nullptr,
nullptr, -1, QString(),
725 QStringList(), QString(), QStringList(), 0, 0, QString(),
726 false, QStringList(), 0, 0,
false);
729 res.
toMap(metadataMap);
766 thumb = node->
GetData().toString();
772 QString(), QString(),
774 QString(), thumb, QString(),
775 QString(), QDateTime(),
nullptr,
nullptr, -1, QString(),
776 QStringList(), QString(), QStringList(), 0, 0, QString(),
777 false, QStringList(), 0, 0,
false);
780 res.
toMap(metadataMap);
785 if (!thumb.startsWith(
"http://"))
787 if (thumb.contains(
"%SHAREDIR%"))
804 const QString& url = thumb;
814 if (
exists && !url.isEmpty())
864 auto *treeedit =
new TreeEditor(mainStack,
"mythnettreeedit");
866 if (treeedit->Create())
882 auto *rssedit =
new RSSEditor(mainStack,
"mythnetrssedit");
884 if (rssedit->Create())
922 QString title(tr(
"Updating RSS. This could take a while..."));
936 QString title(tr(
"Updating Site Maps. This could take a while..."));
967 QString title = data->
title;
991 if (item && item->
GetText() == title)
bool isRunning(void) const
void SaveBoolSetting(const QString &key, bool newValue)
void SaveSetting(const QString &key, int newValue)
int GetNumSetting(const QString &key, int defaultval=0)
bool GetBoolSetting(const QString &key, bool defaultval=false)
Basic menu dialog, message and a list of options.
QVariant GetData(void) const
QString GetText(const QString &name="") const
MythGenericTree * getParent(void) const
void SetText(const QString &text, const QString &name="", const QString &state="")
MythGenericTree * addNode(const QString &a_string, int an_int=0, bool selectable_flag=false, bool visible=true)
void SetTextFromMap(const InfoMap &infoMap, const QString &state="")
int childCount(void) const
MythGenericTree * getSelectedChild(bool onlyVisible=false) const
uint visibleChildCount() const
void DisplayState(const QString &state, const QString &name="")
MythGenericTree * getChildByName(const QString &a_name) const
void SetData(QVariant data)
QList< MythGenericTree * > * getAllChildren() const
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 PopScreen(MythScreenType *screen=nullptr, bool allowFade=true, bool deleteScreen=true)
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
MythScreenStack * GetScreenStack() const
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
bool SetFocusWidget(MythUIType *widget=nullptr)
void CloseBusyPopup(void)
virtual void SetTextFromMap(const InfoMap &infoMap)
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 Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
bool DisplayState(const QString &name)
virtual void SetVisible(bool visible)
GrabberScript::scriptList m_grabberList
void customEvent(QEvent *event) override
MythUIStateType * m_downloadable
MetadataImageDownload * m_imageDownload
void StreamWebVideo(void)
MythScreenStack * m_popupStack
MythUIImage * m_thumbImage
void DoDownloadAndPlay(void)
void UpdateResultItem(ResultItem *item)
bool Create(void) override
static void SetSubfolderData(MythGenericTree *folder)
NetTree(DialogType type, MythScreenStack *parent, const char *name=nullptr)
void RunTreeEditor(void) const
RSSSite::rssList m_rssList
void ShowMenu(void) override
MythMenu * CreateShowManageMenu(void)
static const QString kRSSNode
void SwitchBrowseView(void)
static const QString kSearchNode
ResultItem * GetStreamItem() override
void UpdateItem(MythUIButtonListItem *item)
MythMenu * CreateShowViewMenu(void)
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
void SetCurrentNode(MythGenericTree *node)
void AddFileNode(MythGenericTree *where_to_add, ResultItem *video)
void SwitchTreeView(void)
QList< ResultItem * > m_videos
void customEvent(QEvent *levent) override
void HandleDirSelect(MythGenericTree *node)
void SwitchGalleryView(void)
MythGenericTree * m_siteGeneric
MythGenericTree * m_currentNode
static const QString kDownloadNode
void UpdateCurrentItem(void)
void UpdateSiteItem(RSSSite *site)
MythUIButtonTree * m_siteMap
MythUIButtonList * m_siteButtonList
void BuildGenericTree(MythGenericTree *dst, QDomElement &domElem)
void Load() override
Load data which will ultimately be displayed on-screen or used to determine what appears on-screen (S...
void HandleSelect(MythUIButtonListItem *item)
GrabberDownloadThread * m_gdt
void RunRSSEditor(void) const
void LoadData(void) override
void toMap(InfoMap &metadataMap)
const QString & GetThumbnail() 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)
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
QString GetShareDir(void)
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
MythMainWindow * GetMythMainWindow(void)
std::shared_ptr< MythSortHelper > getMythSortHelper(void)
Get a pointer to the MythSortHelper singleton.
static MythThemedMenu * menu
QHash< QString, QString > InfoMap
MythGenericTree * GetNodePtrFromButton(MythUIButtonListItem *item)
QString GetThumbnailFilename(const QString &url, const QString &title)
QMultiMap< QPair< QString, QString >, ResultItem * > getTreeArticles(const QString &feedtitle, ArticleType type)
ResultItem::resultList getRSSArticles(const QString &feedtitle, ArticleType type)
GrabberScript::scriptList findAllDBTreeGrabbersByHost(ArticleType type)
GrabberScript::scriptList findAllDBTreeGrabbers()
QString GetDownloadFilename(const QString &title, const QString &url)
RSSSite::rssList findAllDBRSS()
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)