MythTV master
nettree.cpp
Go to the documentation of this file.
1// qt
2#include <QFileInfo>
3#include <QString>
4#include <QtAlgorithms>
5
6// MythTV
23
24// mythnetvision
25#include "netcommon.h"
26#include "nettree.h"
27#include "rsseditor.h"
28#include "treeeditor.h"
29
30class GrabberScript;
31
32const QString NetTree::kRSSNode = tr("RSS Feeds");
33const QString NetTree::kSearchNode = tr("Searches");
34const QString NetTree::kDownloadNode = tr("Downloaded Files");
35
36namespace
37{
39 {
40 if (item)
41 return item->GetData().value<MythGenericTree *>();
42
43 return nullptr;
44 }
45}
46
48 : NetBase(parent, name),
49 m_gdt(new GrabberDownloadThread(this)), m_type(type)
50{
53 "mythNetTree.updateFreq", 6);
55 "mythnetvision.rssBackgroundFetch", false);
57 "mythnetvision.backgroundFetch", false);
58}
59
61{
62 QString windowName = "gallery";
63
64 switch (m_type)
65 {
66 case DLG_GALLERY:
67 windowName = "gallery";
68 break;
69 case DLG_BROWSER:
70 windowName = "browser";
71 break;
72 case DLG_TREE:
73 windowName = "tree";
74 break;
75 case DLG_DEFAULT:
76 default:
77 break;
78 }
79
80 if (!LoadWindowFromXML("netvision-ui.xml", windowName, this))
81 return false;
82
83 bool err = false;
84 if (m_type == DLG_TREE)
85 UIUtilE::Assign(this, m_siteMap, "videos", &err);
86 else
87 UIUtilE::Assign(this, m_siteButtonList, "videos", &err);
88
89 UIUtilW::Assign(this, m_noSites, "nosites");
90
91 UIUtilW::Assign(this, m_thumbImage, "preview");
92
93 UIUtilW::Assign(this, m_downloadable, "downloadable");
94
95 m_siteGeneric = new MythGenericTree("site root", 0, false);
97
98 if (err)
99 {
100 LOG(VB_GENERAL, LOG_ERR, "Cannot load screen '" + windowName + "'");
101 return false;
102 }
103
105
107
108 if (m_type == DLG_TREE)
109 {
111
118 }
119 else
120 {
122
124 this, &NetTree::HandleSelect);
127 }
128
129 return true;
130}
131
133{
136
137 FillTree();
138}
139
141{
142 if (!node)
143 return;
144
145 m_currentNode = node;
146}
147
149{
150 delete m_siteGeneric;
151 m_siteGeneric = nullptr;
152
153 delete m_gdt;
154 m_gdt = nullptr;
155
156 m_rssList.clear();
157
158 qDeleteAll(m_videos);
159 m_videos.clear();
160}
161
163{
164 if (m_type == DLG_TREE)
165 {
167 }
168 else
169 {
171
172 if (!m_currentNode)
173 {
175 return;
176 }
177
179
180 using MGTreeChildList = QList<MythGenericTree *>;
181 MGTreeChildList *lchildren = m_currentNode->getAllChildren();
182
183 for (auto * child : std::as_const(*lchildren))
184 {
185 if (child != nullptr)
186 {
187 auto *item =
188 new MythUIButtonListItem(m_siteButtonList, QString(), nullptr,
190
191 item->SetData(QVariant::fromValue(child));
192
193 UpdateItem(item);
194
195 if (child == selectedNode)
197 }
198 }
199
201 }
202
203 if (m_siteGeneric->childCount() == 0 && m_noSites)
204 m_noSites->SetVisible(true);
205 else if (m_noSites)
206 m_noSites->SetVisible(false);
207
208 if (m_siteGeneric->childCount() == 0)
210}
211
213{
214 if (!item)
215 return;
216
218
219 if (!node)
220 return;
221
222 auto *site = node->GetData().value<RSSSite *>();
223 auto *video = node->GetData().value<ResultItem *>();
224
225 int nodeInt = node->getInt();
226
227 if (nodeInt == kSubFolder)
228 {
229 item->SetText(QString("%1").arg(node->visibleChildCount()),
230 "childcount");
231 item->DisplayState("subfolder", "nodetype");
232 item->SetText(node->GetText(), "title");
233 item->SetText(node->GetText());
234 item->SetImage(node->GetData().toString());
235 }
236 else if (nodeInt == kUpFolder)
237 {
238 item->DisplayState("upfolder", "nodetype");
239 item->SetText(node->GetText(), "title");
240 item->SetText(node->GetText());
241 }
242
243 if (site)
244 {
245 item->SetText(site->GetTitle());
246 item->SetText(site->GetDescription(), "description");
247 item->SetText(site->GetURL(), "url");
248 item->SetImage(site->GetImage());
249 }
250 else if (video)
251 {
252 item->SetText(video->GetTitle());
253
254 InfoMap metadataMap;
255 video->toMap(metadataMap);
256 item->SetTextFromMap(metadataMap);
257
258 int pos = 0;
259 if (m_type != DLG_TREE)
260 pos = m_siteButtonList->GetItemPos(item);
261
262 QString dlfile = video->GetThumbnail();
263 if (dlfile.contains("%SHAREDIR%"))
264 dlfile.replace("%SHAREDIR%", GetShareDir());
265 else
266 dlfile = getDownloadFilename(video->GetTitle(),
267 video->GetThumbnail());
268
269 if (QFile::exists(dlfile))
270 item->SetImage(dlfile);
271 else if (m_imageDownload && video->GetThumbnail().startsWith("http"))
272 m_imageDownload->addThumb(video->GetTitle(), video->GetThumbnail(),
273 QVariant::fromValue<uint>(pos));
274 }
275 else
276 {
277 item->SetText(node->GetText());
278 if (!node->GetData().toString().isEmpty())
279 {
280 QString tpath = node->GetData().toString();
281 if (tpath.startsWith("http://"))
282 {
283 uint pos = 0;
284 if (m_type != DLG_TREE)
285 pos = m_siteButtonList->GetItemPos(item);
286
287 QString dlfile = GetThumbnailFilename(tpath,
288 node->GetText());
289 if (QFile::exists(dlfile))
290 item->SetImage(dlfile);
291 else if (m_imageDownload)
292 m_imageDownload->addThumb(node->GetText(), tpath,
293 QVariant::fromValue<uint>(pos));
294 }
295 else if (tpath != "0")
296 {
297 QString filename = node->GetData().toString();
298 if (filename.contains("%SHAREDIR%"))
299 filename.replace("%SHAREDIR%", GetShareDir());
300 item->SetImage(filename);
301 }
302 }
303 }
304}
305
307{
309 if (!node)
310 return;
311
312 int nodeInt = node->getInt();
313
314 switch (nodeInt)
315 {
316 case kSubFolder:
317 HandleDirSelect(node);
318 break;
319 case kUpFolder:
320 GoBack();
321 break;
322 default:
323 {
325 }
326 }
328}
329
331{
334
335 SetCurrentNode(node);
336 LoadData();
337}
338
340{
341 bool handled = false;
342
345
347 {
349 if (lparent)
350 {
351 SetCurrentNode(lparent);
352 handled = true;
353 }
354 }
355
356 LoadData();
357
358 return handled;
359}
360
361bool NetTree::keyPressEvent(QKeyEvent *event)
362{
363 if (GetFocusWidget()->keyPressEvent(event))
364 return true;
365
366 QStringList actions;
367 bool handled = GetMythMainWindow()->TranslateKeyPress("Internet Video",
368 event, actions);
369
370 for (int i = 0; i < actions.size() && !handled; i++)
371 {
372 const QString& action = actions[i];
373 handled = true;
374
375 if (action == "MENU")
376 {
377 ShowMenu();
378 }
379 else if (action == "ESCAPE")
380 {
381 if (m_type != DLG_TREE
382 && !GetMythMainWindow()->IsExitingToMain()
384 handled = GoBack();
385 else
386 handled = false;
387 }
388 else
389 {
390 handled = false;
391 }
392 }
393
394 if (!handled && MythScreenType::keyPressEvent(event))
395 handled = true;
396
397 return handled;
398}
399
401{
402 QString label = tr("Playback/Download Options");
403
404 auto *menu = new MythMenu(label, this, "options");
405
406 ResultItem *item = nullptr;
407 if (m_type == DLG_TREE)
408 {
410
411 if (node)
412 item = node->GetData().value<ResultItem *>();
413 }
414 else
415 {
416 MythGenericTree *node =
418
419 if (node)
420 item = node->GetData().value<ResultItem *>();
421 }
422
423 if (item)
424 {
425 if (item->GetDownloadable())
426 menu->AddItem(tr("Stream Video"), &NetTree::StreamWebVideo);
427 menu->AddItem(tr("Open Web Link"), &NetTree::ShowWebVideo);
428
429 if (item->GetDownloadable())
430 menu->AddItem(tr("Save This Video"), &NetTree::DoDownloadAndPlay);
431 }
432
433 menu->AddItem(tr("Scan/Manage Subscriptions"), nullptr, CreateShowManageMenu());
434 menu->AddItem(tr("Change View"), nullptr, CreateShowViewMenu());
435
436 auto *menuPopup =
437 new MythDialogBox(menu, m_popupStack, "mythnettreemenupopup");
438
439 if (menuPopup->Create())
440 m_popupStack->AddScreen(menuPopup);
441 else
442 delete menuPopup;
443}
444
446{
447 QString label = tr("View Options");
448
449 auto *menu = new MythMenu(label, this, "options");
450
451 if (m_type != DLG_TREE)
452 menu->AddItem(tr("Switch to List View"), &NetTree::SwitchTreeView);
453 if (m_type != DLG_GALLERY)
454 menu->AddItem(tr("Switch to Gallery View"), &NetTree::SwitchGalleryView);
455 if (m_type != DLG_BROWSER)
456 menu->AddItem(tr("Switch to Browse View"), &NetTree::SwitchBrowseView);
457
458 return menu;
459}
460
462{
463 QString label = tr("Subscription Management");
464
465 auto *menu = new MythMenu(label, this, "options");
466
467 menu->AddItem(tr("Update Site Maps"), &NetTree::UpdateTrees);
468 menu->AddItem(tr("Update RSS"), &NetTree::UpdateRSS);
469 menu->AddItem(tr("Manage Site Subscriptions"), &NetTree::RunTreeEditor);
470 menu->AddItem(tr("Manage RSS Subscriptions"), &NetTree::RunRSSEditor);
471 if (!m_treeAutoUpdate)
472 {
473 menu->AddItem(tr("Enable Automatic Site Updates"),
475 }
476 else
477 {
478 menu->AddItem(tr("Disable Automatic Site Updates"),
480 }
481// if (!m_rssAutoUpdate)
482// menu->AddItem(tr("Enable Automatic RSS Updates"), &NetTree::ToggleRSSUpdates);
483// else
484// menu->AddItem(tr("Disable Automatic RSS Updates"), &NetTree::ToggleRSSUpdates);
485
486 return menu;
487}
488
490{
492 SwitchView();
493}
494
496{
498 SwitchView();
499}
500
502{
504 SwitchView();
505}
506
508{
509 auto *nettree =
510 new NetTree(m_type, GetMythMainWindow()->GetMainStack(), "nettree");
511
512 if (nettree->Create())
513 {
514 gCoreContext->SaveSetting("mythnetvision.ViewMode", m_type);
515 MythScreenStack *screenStack = GetScreenStack();
516 screenStack->AddScreen(nettree);
517 screenStack->PopScreen(this, false, false);
518 deleteLater();
519 }
520 else
521 {
522 delete nettree;
523 }
524}
525
527{
528 // First let's add all the RSS
529 if (!m_rssList.isEmpty())
530 {
531 auto *rssGeneric = new MythGenericTree(kRSSNode, kSubFolder, false);
532
533 // Add an upfolder
534 if (m_type != DLG_TREE)
535 rssGeneric->addNode(tr("Back"), kUpFolder, true, false);
536
537 rssGeneric->SetData(QString("%1/mythnetvision/icons/rss.png")
538 .arg(GetShareDir()));
539
540 for (const auto & feed : std::as_const(m_rssList))
541 {
542 ResultItem::resultList items = getRSSArticles(feed->GetTitle(),
544 auto *ret =
545 new MythGenericTree(feed->GetTitle(), kSubFolder, false);
546 ret->SetData(QVariant::fromValue(feed));
547 rssGeneric->addNode(ret);
548
549 // Add an upfolder
550 if (m_type != DLG_TREE)
551 ret->addNode(tr("Back"), kUpFolder, true, false);
552
553 for (const auto & item : std::as_const(items))
554 AddFileNode(ret, item);
555 SetSubfolderData(ret);
556 }
557
558 m_siteGeneric->addNode(rssGeneric);
559 SetSubfolderData(rssGeneric);
560 }
561
562 // Now let's add all the grabber trees
563 for (const auto & g : std::as_const(m_grabberList))
564 {
565
566 QMultiMap<QPair<QString,QString>, ResultItem*> treePathsNodes =
567 getTreeArticles(g->GetTitle(), VIDEO_FILE);
568
569 QList< QPair<QString,QString> > paths = treePathsNodes.uniqueKeys();
570
571 auto *ret = new MythGenericTree(g->GetTitle(), kSubFolder, false);
572 QString thumb = QString("%1mythnetvision/icons/%2")
573 .arg(GetShareDir(), g->GetImage());
574 ret->SetData(QVariant::fromValue(thumb));
575
576 // Add an upfolder
577 if (m_type != DLG_TREE)
578 ret->addNode(tr("Back"), kUpFolder, true, false);
579
580 for (const auto & path : std::as_const(paths))
581 {
582 QStringList curPaths = path.first.split("/");
583 QString dirthumb = path.second;
584 QList<ResultItem*> videos = treePathsNodes.values(path);
585 BuildGenericTree(ret, curPaths, dirthumb, videos);
586 }
588 SetSubfolderData(ret);
589 }
591}
592
594 const QString& dirthumb, const QList<ResultItem*>& videos)
595{
596 MythGenericTree *folder = nullptr;
597
598 // A little loop to determine what path of the provided path might
599 // already exist in the tree.
600
601 while (folder == nullptr && !paths.empty())
602 {
603 QString curPath = paths.takeFirst();
604 curPath.replace("|", "/");
605 MythGenericTree *tmp = dst->getChildByName(curPath);
606 if (tmp)
607 dst = tmp;
608 else
609 folder = new MythGenericTree(curPath, kSubFolder, false);
610 }
611
612 if (!folder)
613 return;
614
615 folder->SetData(dirthumb);
616 dst->addNode(folder);
617
618 // Add an upfolder
619 if (m_type != DLG_TREE)
620 folder->addNode(tr("Back"), kUpFolder, true, false);
621
622 if (!paths.empty())
623 {
624 BuildGenericTree(folder, paths, dirthumb, videos);
625 }
626 else
627 {
628 // File Handling
629 for (const auto & video : std::as_const(videos))
630 AddFileNode(folder, video);
631 }
632 SetSubfolderData(folder);
633}
634
636{
637 QString title = video->GetTitle();
638 title.replace("&amp;", "&");
639 MythGenericTree *sub_node = where_to_add->addNode(title, 0, true);
640 sub_node->SetData(QVariant::fromValue(video));
641
642 InfoMap textMap;
643 video->toMap(textMap);
644 sub_node->SetTextFromMap(textMap);
645
646 m_videos.append(video);
647}
648
650{
651 ResultItem *item = nullptr;
652
653 if (m_type == DLG_TREE)
654 {
655 item = m_siteMap->GetCurrentNode()->GetData().value<ResultItem *>();
656 }
657 else
658 {
659 MythGenericTree *node =
661
662 if (node)
663 item = node->GetData().value<ResultItem *>();
664 }
665 return item;
666}
667
669{
670 InfoMap metadataMap;
671 item->toMap(metadataMap);
672 SetTextFromMap(metadataMap);
673
674 if (!item->GetThumbnail().isEmpty() && m_thumbImage)
675 {
677 QString dlfile = item->GetThumbnail();
678 if (dlfile.contains("%SHAREDIR%"))
679 {
680 dlfile.replace("%SHAREDIR%", GetShareDir());
681 m_thumbImage->SetFilename(dlfile);
683 }
684 else
685 {
686 QString sFilename = getDownloadFilename(item->GetTitle(),
687 item->GetThumbnail());
688
689 bool exists = QFile::exists(sFilename);
690 if (exists)
691 {
692 m_thumbImage->SetFilename(sFilename);
694 }
695 else if (item->GetThumbnail().startsWith("http"))
696 {
698 item->GetThumbnail(),
699 QVariant::fromValue<uint>(0));
700 }
701 }
702 }
703 else if (m_thumbImage)
704 {
706 }
707
708 if (m_downloadable)
709 {
710 if (item->GetDownloadable())
712 else
714 }
715}
716
718{
719 ResultItem res =
720 ResultItem(site->GetTitle(), site->GetSortTitle(),
721 QString(), QString(), // no subtitle information
722 site->GetDescription(),
723 site->GetURL(), site->GetImage(), QString(),
724 site->GetAuthor(), QDateTime(), nullptr, nullptr, -1, QString(),
725 QStringList(), QString(), QStringList(), 0, 0, QString(),
726 false, QStringList(), 0, 0, false);
727
728 InfoMap metadataMap;
729 res.toMap(metadataMap);
730 SetTextFromMap(metadataMap);
731
732 if (!site->GetImage().isEmpty() && m_thumbImage)
733 {
736 }
737 else if (m_thumbImage)
738 {
740 }
741
742 if (m_downloadable)
744}
745
747{
748 QString title;
749
750 if (m_type == DLG_TREE)
751 title = m_siteMap->GetItemCurrent()->GetText();
752 else
754
755 QString thumb;
756 if (m_type == DLG_TREE)
757 {
758 thumb = m_siteMap->GetCurrentNode()->GetData().toString();
759 }
760 else
761 {
762 MythGenericTree *node =
764
765 if (node)
766 thumb = node->GetData().toString();
767 }
768
769 std::shared_ptr<MythSortHelper>sh = getMythSortHelper();
770 ResultItem res =
771 ResultItem(title, sh->doTitle(title), // title, sortTitle
772 QString(), QString(), // no subtitle information
773 QString(), // description
774 QString(), thumb, QString(),
775 QString(), QDateTime(), nullptr, nullptr, -1, QString(),
776 QStringList(), QString(), QStringList(), 0, 0, QString(),
777 false, QStringList(), 0, 0, false);
778
779 InfoMap metadataMap;
780 res.toMap(metadataMap);
781 SetTextFromMap(metadataMap);
782
783 if (m_thumbImage)
784 {
785 if (!thumb.startsWith("http://"))
786 {
787 if (thumb.contains("%SHAREDIR%"))
788 thumb.replace("%SHAREDIR%", GetShareDir());
789
790 bool exists = QFile::exists(thumb);
791
792 if (exists)
793 {
796 }
797 else
798 {
800 }
801 }
802 else
803 {
804 const QString& url = thumb;
805 QString title2;
806 if (m_type == DLG_TREE)
807 title2 = m_siteMap->GetItemCurrent()->GetText();
808 else
810
811 QString sFilename = GetDownloadFilename(title2, url);
812
813 bool exists = QFile::exists(sFilename);
814 if (exists && !url.isEmpty())
815 {
816 m_thumbImage->SetFilename(sFilename);
818 }
819 else
820 {
822 }
823 }
824 }
825
826 if (m_downloadable)
828}
829
831{
832 ResultItem *item = nullptr;
833 RSSSite *site = nullptr;
834
835 if (m_type == DLG_TREE)
836 {
837 item = m_siteMap->GetCurrentNode()->GetData().value<ResultItem *>();
838 site = m_siteMap->GetCurrentNode()->GetData().value<RSSSite *>();
839 }
840 else
841 {
842 MythGenericTree *node =
844
845 if (!node)
846 return;
847
848 item = node->GetData().value<ResultItem *>();
849 site = node->GetData().value<RSSSite *>();
850 }
851
852 if (item)
853 UpdateResultItem(item);
854 else if (site)
855 UpdateSiteItem(site);
856 else
858}
859
861{
863
864 auto *treeedit = new TreeEditor(mainStack, "mythnettreeedit");
865
866 if (treeedit->Create())
867 {
868 connect(treeedit, &NetEditorBase::ItemsChanged, this, &NetTree::DoTreeRefresh);
869
870 mainStack->AddScreen(treeedit);
871 }
872 else
873 {
874 delete treeedit;
875 }
876}
877
879{
881
882 auto *rssedit = new RSSEditor(mainStack, "mythnetrssedit");
883
884 if (rssedit->Create())
885 {
886 connect(rssedit, &RSSEditor::ItemsChanged, this, &NetTree::UpdateRSS);
887
888 mainStack->AddScreen(rssedit);
889 }
890 else
891 {
892 delete rssedit;
893 }
894}
895
897{
899
900 TreeRefresh();
901}
902
904{
905 delete m_siteGeneric;
906 m_siteGeneric = new MythGenericTree("site root", 0, false);
908
911
912 FillTree();
913 LoadData();
914 SwitchView();
915}
916
918{
919 if (findAllDBRSS().isEmpty())
920 return;
921
922 QString title(tr("Updating RSS. This could take a while..."));
923 OpenBusyPopup(title);
924
925 auto *rssMan = new RSSManager();
928 rssMan->doUpdate();
929}
930
932{
933 if (m_grabberList.count() == 0)
934 return;
935
936 QString title(tr("Updating Site Maps. This could take a while..."));
937 OpenBusyPopup(title);
938 m_gdt->refreshAll();
939}
940
942{
944 gCoreContext->SaveBoolSetting("mythnetvision.rssBackgroundFetch",
946}
947
949{
951 gCoreContext->SaveBoolSetting("mythnetvision.backgroundFetch",
953}
954
955void NetTree::customEvent(QEvent *event)
956{
957 if (event->type() == ThumbnailDLEvent::kEventType)
958 {
959 auto *tde = dynamic_cast<ThumbnailDLEvent *>(event);
960 if (!tde)
961 return;
962
963 ThumbnailData *data = tde->m_thumb;
964 if (!data)
965 return;
966
967 QString title = data->title;
968 QString file = data->url;
969 uint pos = data->data.value<uint>();
970
971 if (file.isEmpty())
972 return;
973
974 if (m_type == DLG_TREE)
975 {
976 if (title == m_siteMap->GetCurrentNode()->GetText() &&
978 {
982 }
983 }
984 else
985 {
986 if (!((uint)m_siteButtonList->GetCount() >= pos))
987 return;
988
990
991 if (item && item->GetText() == title)
992 item->SetImage(file);
993 }
994 }
995 else
996 {
998 }
999}
1000
1002{
1003 folder->SetText(QString("%1").arg(folder->visibleChildCount()),
1004 "childcount");
1005 folder->DisplayState("subfolder", "nodetype");
1006}
ArticleType m_type
bool isRunning(void) const
Definition: mthread.cpp:247
void addThumb(QString title, QString url, QVariant data)
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.
int getInt() const
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)
void DisplayState(const QString &state, const QString &name)
void SetTextFromMap(const InfoMap &infoMap, const QString &state="")
void SetImage(MythImage *image, const QString &name="")
Sets an image directly, should only be used in special circumstances since it bypasses the cache.
QString GetText(const QString &name="") const
void SetText(const QString &text, const QString &name="", const QString &state="")
MythUIButtonListItem * GetItemCurrent() const
void SetItemCurrent(MythUIButtonListItem *item)
void Reset() override
Reset the widget to it's original state, should not reset changes made by the theme.
int GetItemPos(MythUIButtonListItem *item) const
void itemClicked(MythUIButtonListItem *item)
MythUIButtonListItem * GetItemAt(int pos) const
void itemSelected(MythUIButtonListItem *item)
MythGenericTree * GetCurrentNode(void) const
void nodeChanged(MythGenericTree *node)
void itemSelected(MythUIButtonListItem *item)
void itemClicked(MythUIButtonListItem *item)
bool AssignTree(MythGenericTree *tree)
Assign the root node of the tree to be displayed.
MythUIButtonListItem * GetItemCurrent(void) const
Return the currently selected list item.
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)
void Show(void)
GrabberScript::scriptList m_grabberList
Definition: netbase.h:53
void ShowWebVideo(void)
Definition: netbase.cpp:112
void customEvent(QEvent *event) override
Definition: netbase.cpp:231
MythUIStateType * m_downloadable
Definition: netbase.h:47
MetadataImageDownload * m_imageDownload
Definition: netbase.h:50
void StreamWebVideo(void)
Definition: netbase.cpp:92
MythScreenStack * m_popupStack
Definition: netbase.h:48
MythUIImage * m_thumbImage
Definition: netbase.h:46
void DoDownloadAndPlay(void)
Definition: netbase.cpp:290
void ItemsChanged(void)
void UpdateResultItem(ResultItem *item)
Definition: nettree.cpp:668
bool Create(void) override
Definition: nettree.cpp:60
static void SetSubfolderData(MythGenericTree *folder)
Definition: nettree.cpp:1001
NetTree(DialogType type, MythScreenStack *parent, const char *name=nullptr)
Definition: nettree.cpp:47
void RunTreeEditor(void) const
Definition: nettree.cpp:860
RSSSite::rssList m_rssList
Definition: nettree.h:94
bool m_treeAutoUpdate
Definition: nettree.h:100
void ShowMenu(void) override
Definition: nettree.cpp:400
MythMenu * CreateShowManageMenu(void)
Definition: nettree.cpp:461
static const QString kRSSNode
Definition: nettree.h:126
void SwitchBrowseView(void)
Definition: nettree.cpp:501
static const QString kSearchNode
Definition: nettree.h:127
ResultItem * GetStreamItem() override
Definition: nettree.cpp:649
void SlotItemChanged()
Definition: nettree.cpp:830
void UpdateItem(MythUIButtonListItem *item)
Definition: nettree.cpp:212
MythMenu * CreateShowViewMenu(void)
Definition: nettree.cpp:445
MythUIText * m_noSites
Definition: nettree.h:91
void SwitchView(void)
Definition: nettree.cpp:507
void TreeRefresh()
Definition: nettree.cpp:903
void FillTree(void)
Definition: nettree.cpp:526
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: nettree.cpp:361
void SetCurrentNode(MythGenericTree *node)
Definition: nettree.cpp:140
bool m_rssAutoUpdate
Definition: nettree.h:99
void AddFileNode(MythGenericTree *where_to_add, ResultItem *video)
Definition: nettree.cpp:635
void SwitchTreeView(void)
Definition: nettree.cpp:489
QList< ResultItem * > m_videos
Definition: nettree.h:84
void customEvent(QEvent *levent) override
Definition: nettree.cpp:955
void HandleDirSelect(MythGenericTree *node)
Definition: nettree.cpp:330
void ToggleRSSUpdates()
Definition: nettree.cpp:941
void SwitchGalleryView(void)
Definition: nettree.cpp:495
void UpdateRSS()
Definition: nettree.cpp:917
MythGenericTree * m_siteGeneric
Definition: nettree.h:88
MythGenericTree * m_currentNode
Definition: nettree.h:89
static const QString kDownloadNode
Definition: nettree.h:128
void UpdateCurrentItem(void)
Definition: nettree.cpp:746
void UpdateSiteItem(RSSSite *site)
Definition: nettree.cpp:717
MythUIButtonTree * m_siteMap
Definition: nettree.h:86
void DoTreeRefresh()
Definition: nettree.cpp:896
MythUIButtonList * m_siteButtonList
Definition: nettree.h:87
void UpdateTrees()
Definition: nettree.cpp:931
~NetTree() override
Definition: nettree.cpp:148
void ToggleTreeUpdates()
Definition: nettree.cpp:948
void BuildGenericTree(MythGenericTree *dst, QDomElement &domElem)
bool GoBack()
Definition: nettree.cpp:339
void Load() override
Load data which will ultimately be displayed on-screen or used to determine what appears on-screen (S...
Definition: nettree.cpp:132
void HandleSelect(MythUIButtonListItem *item)
Definition: nettree.cpp:306
DialogType m_type
Definition: nettree.h:96
GrabberDownloadThread * m_gdt
Definition: nettree.h:93
void RunRSSEditor(void) const
Definition: nettree.cpp:878
void LoadData(void) override
Definition: nettree.cpp:162
uint m_updateFreq
Definition: nettree.h:98
void ItemsChanged(void)
void doUpdate()
Definition: rssmanager.cpp:44
void startTimer()
Definition: rssmanager.cpp:34
void finished()
const QString & GetImage() const
Definition: rssmanager.h:57
const QString & GetAuthor() const
Definition: rssmanager.h:61
const QString & GetTitle() const
Definition: rssmanager.h:55
const QString & GetSortTitle() const
Definition: rssmanager.h:56
const QString & GetDescription() const
Definition: rssmanager.h:59
const QString & GetURL() const
Definition: rssmanager.h:60
void toMap(InfoMap &metadataMap)
Definition: rssparse.cpp:70
const QString & GetThumbnail() const
Definition: rssparse.h:140
const QString & GetTitle() const
Definition: rssparse.h:134
const bool & GetDownloadable() const
Definition: rssparse.h:154
QList< ResultItem * > resultList
Definition: rssparse.h:114
static const Type kEventType
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
unsigned int uint
Definition: compat.h:60
QString getDownloadFilename(const QString &title, const QString &url)
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
QString GetShareDir(void)
Definition: mythdirs.cpp:283
RSSManager * rssMan
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
MythMainWindow * GetMythMainWindow(void)
std::shared_ptr< MythSortHelper > getMythSortHelper(void)
Get a pointer to the MythSortHelper singleton.
static MythThemedMenu * menu
QHash< QString, QString > InfoMap
Definition: mythtypes.h:15
MythGenericTree * GetNodePtrFromButton(MythUIButtonListItem *item)
Definition: nettree.cpp:38
bool exists(str path)
Definition: xbmcvfs.py:51
QString GetThumbnailFilename(const QString &url, const QString &title)
Definition: netcommon.cpp:9
DialogType
Definition: nettree.h:21
@ DLG_DEFAULT
Definition: nettree.h:21
@ DLG_TREE
Definition: nettree.h:21
@ DLG_BROWSER
Definition: nettree.h:22
@ DLG_GALLERY
Definition: nettree.h:21
QMultiMap< QPair< QString, QString >, ResultItem * > getTreeArticles(const QString &feedtitle, ArticleType type)
Definition: netutils.cpp:463
ResultItem::resultList getRSSArticles(const QString &feedtitle, ArticleType type)
Definition: netutils.cpp:797
GrabberScript::scriptList findAllDBTreeGrabbersByHost(ArticleType type)
Definition: netutils.cpp:149
GrabberScript::scriptList findAllDBTreeGrabbers()
Definition: netutils.cpp:115
QString GetDownloadFilename(const QString &title, const QString &url)
Definition: netutils.cpp:854
RSSSite::rssList findAllDBRSS()
Definition: netutils.cpp:610
@ VIDEO_FILE
Definition: rssparse.h:21
@ VIDEO_PODCAST
Definition: rssparse.h:22
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
Definition: mythuiutils.h:27
@ kSubFolder
Definition: videolist.h:6
@ kUpFolder
Definition: videolist.h:7