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