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 +
"'");
178 using MGTreeChildList = QList<MythGenericTree *>;
181 for (
auto * child : std::as_const(*lchildren))
183 if (child !=
nullptr)
189 item->SetData(QVariant::fromValue(child));
193 if (child == selectedNode)
223 int nodeInt = node->
getInt();
243 item->
SetText(site->GetTitle());
244 item->
SetText(site->GetDescription(),
"description");
245 item->
SetText(site->GetURL(),
"url");
253 video->toMap(metadataMap);
260 QString dlfile = video->GetThumbnail();
261 if (dlfile.contains(
"%SHAREDIR%"))
265 video->GetThumbnail());
271 QVariant::fromValue<uint>(pos));
276 if (!node->
GetData().toString().isEmpty())
278 QString tpath = node->
GetData().toString();
279 if (tpath.startsWith(
"http://"))
291 QVariant::fromValue<uint>(pos));
293 else if (tpath !=
"0")
296 if (
filename.contains(
"%SHAREDIR%"))
310 int nodeInt = node->
getInt();
339 bool handled =
false;
368 for (
int i = 0; i < actions.size() && !handled; i++)
370 const QString&
action = actions[i];
377 else if (
action ==
"ESCAPE")
400 QString label = tr(
"Playback/Download Options");
437 if (menuPopup->Create())
445 QString label = tr(
"View Options");
461 QString label = tr(
"Subscription Management");
471 menu->AddItem(tr(
"Enable Automatic Site Updates"),
476 menu->AddItem(tr(
"Disable Automatic Site Updates"),
510 if (nettree->Create())
515 screenStack->
PopScreen(
this,
false,
false);
533 rssGeneric->addNode(tr(
"Back"),
kUpFolder,
true,
false);
535 rssGeneric->SetData(QString(
"%1/mythnetvision/icons/rss.png")
538 for (
const auto & feed : std::as_const(
m_rssList))
544 ret->SetData(QVariant::fromValue(feed));
545 rssGeneric->addNode(ret);
549 ret->addNode(tr(
"Back"),
kUpFolder,
true,
false);
551 for (
const auto & item : std::as_const(items))
564 QMultiMap<QPair<QString,QString>,
ResultItem*> treePathsNodes =
567 QList< QPair<QString,QString> >
paths = treePathsNodes.uniqueKeys();
570 QString thumb = QString(
"%1mythnetvision/icons/%2")
572 ret->SetData(QVariant::fromValue(thumb));
576 ret->addNode(tr(
"Back"),
kUpFolder,
true,
false);
578 for (
const auto & path : std::as_const(
paths))
580 QStringList curPaths = path.first.split(
"/");
581 QString dirthumb = path.second;
582 QList<ResultItem*> videos = treePathsNodes.values(path);
592 const QString& dirthumb,
const QList<ResultItem*>& videos)
599 while (folder ==
nullptr && !
paths.empty())
601 QString curPath =
paths.takeFirst();
602 curPath.replace(
"|",
"/");
625 for (
const auto & video : std::as_const(videos))
634 title.replace(
"&",
"&");
636 sub_node->
SetData(QVariant::fromValue(video));
639 video->
toMap(textMap);
665 item->
toMap(metadataMap);
672 if (dlfile.contains(
"%SHAREDIR%"))
693 QVariant::fromValue<uint>(0));
715 QString(), QString(),
718 site->
GetAuthor(), QDateTime(),
nullptr,
nullptr, -1, QString(),
719 QStringList(), QString(), QStringList(), 0, 0, QString(),
720 false, QStringList(), 0, 0,
false);
723 res.
toMap(metadataMap);
758 thumb = node->
GetData().toString();
764 QString(), QString(),
766 QString(), thumb, QString(),
767 QString(), QDateTime(),
nullptr,
nullptr, -1, QString(),
768 QStringList(), QString(), QStringList(), 0, 0, QString(),
769 false, QStringList(), 0, 0,
false);
772 res.
toMap(metadataMap);
777 if (!thumb.startsWith(
"http://"))
779 if (thumb.contains(
"%SHAREDIR%"))
796 const QString& url = thumb;
806 if (
exists && !url.isEmpty())
856 auto *treeedit =
new TreeEditor(mainStack,
"mythnettreeedit");
858 if (treeedit->Create())
874 auto *rssedit =
new RSSEditor(mainStack,
"mythnetrssedit");
876 if (rssedit->Create())
914 QString title(tr(
"Updating RSS. This could take a while..."));
928 QString title(tr(
"Updating Site Maps. This could take a while..."));
959 QString title = data->
title;
983 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)