MythTV  master
nettree.h
Go to the documentation of this file.
1 #ifndef NETTREE_H
2 #define NETTREE_H
3 
4 #include "netbase.h"
5 
6 // libmythui
7 #include <mythuibuttonlist.h>
8 #include <mythuibuttontree.h>
9 #include <mythgenerictree.h>
10 #include <mythuiprogressbar.h>
11 #include <mythprogressdialog.h>
12 #include <mythuistatetype.h>
13 #include <mythscreentype.h>
14 #include <mythdialogbox.h>
15 #include <netgrabbermanager.h>
16 #include <mythrssmanager.h>
17 #include <mythdownloadmanager.h>
19 
20 enum DialogType { DLG_DEFAULT = 0, DLG_GALLERY = 0x1, DLG_TREE = 0x2,
21  DLG_BROWSER = 0x4, dtLast };
22 
24  kSubFolder = -1,
25  kUpFolder = -2,
26  kRootNode = -3,
27  kNoFilesFound = -4
28 };
29 
30 // Tree node attribute index
32  kNodeSort
33 };
34 
35 enum NodeOrder {
39 };
40 
41 class NetTree : public NetBase
42 {
43  Q_OBJECT
44 
45  public:
46  NetTree(DialogType type, MythScreenStack *parent, const char *name = nullptr);
47  ~NetTree() override;
48 
49  bool Create(void) override; // MythScreenType
50  bool keyPressEvent(QKeyEvent *event) override; // MythScreenType
51 
52  protected:
53  ResultItem *GetStreamItem() override; // NetBase
54 
55  private:
56  void Load() override; // MythScreenType
57 
58  void FillTree(void);
59  void SetCurrentNode(MythGenericTree *node);
60  void HandleDirSelect(MythGenericTree *node);
61  bool GoBack();
62  void UpdateItem(MythUIButtonListItem *item);
63 
65  QDomElement& domElem);
67  QStringList paths,
68  const QString& dirthumb,
69  const QList<ResultItem*>& videos);
70 
71  void AddFileNode(MythGenericTree *where_to_add,
72  ResultItem *video);
73 
74  void SwitchView(void);
75 
76  static void SetSubfolderData(MythGenericTree *folder);
77  void UpdateResultItem(ResultItem *item);
78  void UpdateSiteItem(RSSSite *site);
79  void UpdateCurrentItem(void);
80 
81  // Only to keep track of what to delete
82  QList<ResultItem*> m_videos;
83 
88 
89  MythUIText *m_noSites {nullptr};
90 
93 
95 
97  bool m_rssAutoUpdate {false};
98  bool m_treeAutoUpdate {false};
99 
100  private slots:
101  void ShowMenu(void) override; // MythScreenType
104  void RunTreeEditor(void);
105  void RunRSSEditor(void);
106  void LoadData(void) override; // NetBase
108 
109  void SwitchTreeView(void);
110  void SwitchGalleryView(void);
111  void SwitchBrowseView(void);
112 
113  void UpdateRSS();
114  void UpdateTrees();
115  void ToggleRSSUpdates();
116  void ToggleTreeUpdates();
117 
118  void SlotItemChanged();
119 
120  void DoTreeRefresh();
121  void TreeRefresh();
122 
123  void customEvent(QEvent *levent) override; // NetBase
124 
125  protected:
126  static const QString kRSSNode;
127  static const QString kSearchNode;
128  static const QString kDownloadNode;
129 };
130 
131 #endif
NodeOrder
NodeOrder
Definition: nettree.h:35
mythuibuttontree.h
NetTree::DoTreeRefresh
void DoTreeRefresh()
Definition: nettree.cpp:873
NetTree::m_currentNode
MythGenericTree * m_currentNode
Definition: nettree.h:87
NetTree::CreateShowViewMenu
MythMenu * CreateShowViewMenu(void)
Definition: nettree.cpp:442
kNodeSort
@ kNodeSort
Definition: nettree.h:32
mythuiprogressbar.h
NetTree::HandleDirSelect
void HandleDirSelect(MythGenericTree *node)
Definition: nettree.cpp:329
NetTree::UpdateResultItem
void UpdateResultItem(ResultItem *item)
Definition: nettree.cpp:659
kUpFolder
@ kUpFolder
Definition: nettree.h:25
mythrssmanager.h
NetTree::TreeRefresh
void TreeRefresh()
Definition: nettree.cpp:880
NetTree::UpdateRSS
void UpdateRSS()
Definition: nettree.cpp:894
DLG_BROWSER
@ DLG_BROWSER
Definition: nettree.h:21
NetTree::UpdateSiteItem
void UpdateSiteItem(RSSSite *site)
Definition: nettree.cpp:706
NetTree::SwitchTreeView
void SwitchTreeView(void)
Definition: nettree.cpp:486
NetTree::m_siteGeneric
MythGenericTree * m_siteGeneric
Definition: nettree.h:86
DLG_GALLERY
@ DLG_GALLERY
Definition: nettree.h:20
mythdialogbox.h
MythScreenStack
Definition: mythscreenstack.h:16
NetTree::m_gdt
GrabberDownloadThread * m_gdt
Definition: nettree.h:91
slots
unsigned int slots[4]
Definition: element.cpp:38
NetTree::CreateShowManageMenu
MythMenu * CreateShowManageMenu(void)
Definition: nettree.cpp:458
mythuistatetype.h
NetTree::RunRSSEditor
void RunRSSEditor(void)
Definition: nettree.cpp:857
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:132
mythuibuttonlist.h
NetTree::SwitchView
void SwitchView(void)
Definition: nettree.cpp:504
NetTree::SwitchGalleryView
void SwitchGalleryView(void)
Definition: nettree.cpp:492
mythprogressdialog.h
video
QDomElement video
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:658
NetTree
Definition: nettree.h:42
NetTree::NetTree
NetTree(DialogType type, MythScreenStack *parent, const char *name=nullptr)
Definition: nettree.cpp:47
MythUIButtonListItem
Definition: mythuibuttonlist.h:28
kOrderUp
@ kOrderUp
Definition: nettree.h:36
NetTree::SwitchBrowseView
void SwitchBrowseView(void)
Definition: nettree.cpp:498
DLG_TREE
@ DLG_TREE
Definition: nettree.h:20
NetTree::ToggleTreeUpdates
void ToggleTreeUpdates()
Definition: nettree.cpp:925
metadataimagedownload.h
NetTree::LoadData
void LoadData(void) override
Definition: nettree.cpp:162
NetTree::UpdateItem
void UpdateItem(MythUIButtonListItem *item)
Definition: nettree.cpp:211
netgrabbermanager.h
kSubFolder
@ kSubFolder
Definition: nettree.h:24
NetTree::AddFileNode
void AddFileNode(MythGenericTree *where_to_add, ResultItem *video)
Definition: nettree.cpp:628
NetTree::m_siteButtonList
MythUIButtonList * m_siteButtonList
Definition: nettree.h:85
DialogType
DialogType
Definition: nettree.h:20
NetTree::m_treeAutoUpdate
bool m_treeAutoUpdate
Definition: nettree.h:98
NetTree::m_videos
QList< ResultItem * > m_videos
Definition: nettree.h:82
MythUIButtonTree
A tree widget for displaying and navigating a MythGenericTree()
Definition: mythuibuttontree.h:17
mythgenerictree.h
NetTree::customEvent
void customEvent(QEvent *levent) override
Definition: nettree.cpp:932
NetTree::HandleSelect
void HandleSelect(MythUIButtonListItem *item)
Definition: nettree.cpp:305
uint
unsigned int uint
Definition: compat.h:140
kOrderItem
@ kOrderItem
Definition: nettree.h:38
NetTree::m_rssList
RSSSite::rssList m_rssList
Definition: nettree.h:92
TreeNodeAttributes
TreeNodeAttributes
Definition: videolist.h:14
NetTree::BuildGenericTree
void BuildGenericTree(MythGenericTree *dst, QDomElement &domElem)
NetTree::SetCurrentNode
void SetCurrentNode(MythGenericTree *node)
Definition: nettree.cpp:140
MythMenu
Definition: mythdialogbox.h:93
NetTree::m_rssAutoUpdate
bool m_rssAutoUpdate
Definition: nettree.h:97
MythUIText
All purpose text widget, displays a text string.
Definition: mythuitext.h:29
NetTree::SetSubfolderData
static void SetSubfolderData(MythGenericTree *folder)
Definition: nettree.cpp:976
NetTree::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: nettree.cpp:360
ResultItem
Definition: rssparse.h:110
NetTree::m_type
DialogType m_type
Definition: nettree.h:94
NetTree::RunTreeEditor
void RunTreeEditor(void)
Definition: nettree.cpp:841
NetTree::GetStreamItem
ResultItem * GetStreamItem() override
Definition: nettree.cpp:642
MythGenericTree
Definition: mythgenerictree.h:21
NetTree::m_siteMap
MythUIButtonTree * m_siteMap
Definition: nettree.h:84
NetTree::kRSSNode
static const QString kRSSNode
Definition: nettree.h:126
kOrderSub
@ kOrderSub
Definition: nettree.h:37
DLG_DEFAULT
@ DLG_DEFAULT
Definition: nettree.h:20
NetTree::m_updateFreq
uint m_updateFreq
Definition: nettree.h:96
NetTree::m_noSites
MythUIText * m_noSites
Definition: nettree.h:89
NetTree::FillTree
void FillTree(void)
Definition: nettree.cpp:521
NetTree::~NetTree
~NetTree() override
Definition: nettree.cpp:148
NetTree::kSearchNode
static const QString kSearchNode
Definition: nettree.h:127
netbase.h
kRootNode
@ kRootNode
Definition: nettree.h:26
TreeNodeType
TreeNodeType
Definition: videolist.h:5
NetTree::UpdateCurrentItem
void UpdateCurrentItem(void)
Definition: nettree.cpp:733
NetBase
Definition: netbase.h:19
NetTree::ShowMenu
void ShowMenu(void) override
Definition: nettree.cpp:397
NetTree::UpdateTrees
void UpdateTrees()
Definition: nettree.cpp:908
NetTree::Create
bool Create(void) override
Definition: nettree.cpp:60
dtLast
@ dtLast
Definition: nettree.h:21
NetTree::kDownloadNode
static const QString kDownloadNode
Definition: nettree.h:128
mythdownloadmanager.h
MythUIButtonList
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
Definition: mythuibuttonlist.h:144
NetTree::SlotItemChanged
void SlotItemChanged()
Definition: nettree.cpp:811
NetTree::GoBack
bool GoBack()
Definition: nettree.cpp:338
kNoFilesFound
@ kNoFilesFound
Definition: nettree.h:27
RSSSite
Definition: mythrssmanager.h:20
mythscreentype.h
RSSSite::rssList
QList< RSSSite * > rssList
Definition: mythrssmanager.h:51
GrabberDownloadThread
Definition: netgrabbermanager.h:110
NetTree::ToggleRSSUpdates
void ToggleRSSUpdates()
Definition: nettree.cpp:918
build_compdb.paths
paths
Definition: build_compdb.py:13