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,
28 };
29 
30 // Tree node attribute index
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
void TreeRefresh()
Definition: nettree.cpp:880
void RunTreeEditor(void)
Definition: nettree.cpp:841
bool m_treeAutoUpdate
Definition: nettree.h:98
unsigned int slots[4]
Definition: element.c:38
uint m_updateFreq
Definition: nettree.h:96
MythUIText * m_noSites
Definition: nettree.h:89
GrabberDownloadThread * m_gdt
Definition: nettree.h:91
All purpose text widget, displays a text string.
Definition: mythuitext.h:28
void SwitchBrowseView(void)
Definition: nettree.cpp:498
void UpdateItem(MythUIButtonListItem *item)
Definition: nettree.cpp:211
void HandleDirSelect(MythGenericTree *node)
Definition: nettree.cpp:329
void ShowMenu(void) override
Definition: nettree.cpp:397
void RunRSSEditor(void)
Definition: nettree.cpp:857
void UpdateTrees()
Definition: nettree.cpp:908
void UpdateResultItem(ResultItem *item)
Definition: nettree.cpp:659
void UpdateRSS()
Definition: nettree.cpp:894
void customEvent(QEvent *levent) override
Definition: nettree.cpp:932
MythMenu * CreateShowManageMenu(void)
Definition: nettree.cpp:458
MythUIButtonList * m_siteButtonList
Definition: nettree.h:85
void SlotItemChanged()
Definition: nettree.cpp:811
void SwitchView(void)
Definition: nettree.cpp:504
NetTree(DialogType type, MythScreenStack *parent, const char *name=nullptr)
Definition: nettree.cpp:47
void SwitchTreeView(void)
Definition: nettree.cpp:486
DialogType
Definition: nettree.h:20
TreeNodeType
Definition: videolist.h:5
ResultItem * GetStreamItem() override
Definition: nettree.cpp:642
Definition: nettree.h:21
void BuildGenericTree(MythGenericTree *dst, QDomElement &domElem)
void FillTree(void)
Definition: nettree.cpp:521
void DoTreeRefresh()
Definition: nettree.cpp:873
unsigned int uint
Definition: compat.h:140
MythMenu * CreateShowViewMenu(void)
Definition: nettree.cpp:442
static const QString kDownloadNode
Definition: nettree.h:128
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: nettree.cpp:360
void SwitchGalleryView(void)
Definition: nettree.cpp:492
void UpdateSiteItem(RSSSite *site)
Definition: nettree.cpp:706
DialogType m_type
Definition: nettree.h:94
QList< RSSSite * > rssList
RSSSite::rssList m_rssList
Definition: nettree.h:92
MythUIButtonTree * m_siteMap
Definition: nettree.h:84
void LoadData(void) override
Definition: nettree.cpp:162
~NetTree() override
Definition: nettree.cpp:148
void ToggleRSSUpdates()
Definition: nettree.cpp:918
void UpdateCurrentItem(void)
Definition: nettree.cpp:733
void SetCurrentNode(MythGenericTree *node)
Definition: nettree.cpp:140
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
static void SetSubfolderData(MythGenericTree *folder)
Definition: nettree.cpp:976
QList< ResultItem * > m_videos
Definition: nettree.h:82
bool m_rssAutoUpdate
Definition: nettree.h:97
bool GoBack()
Definition: nettree.cpp:338
TreeNodeAttributes
Definition: videolist.h:14
NodeOrder
Definition: nettree.h:35
void HandleSelect(MythUIButtonListItem *item)
Definition: nettree.cpp:305
static const QString kRSSNode
Definition: nettree.h:126
MythGenericTree * m_siteGeneric
Definition: nettree.h:86
void ToggleTreeUpdates()
Definition: nettree.cpp:925
void AddFileNode(MythGenericTree *where_to_add, ResultItem *video)
Definition: nettree.cpp:628
static const QString kSearchNode
Definition: nettree.h:127
A tree widget for displaying and navigating a MythGenericTree()
bool Create(void) override
Definition: nettree.cpp:60
MythGenericTree * m_currentNode
Definition: nettree.h:87