MythTV  master
mythnetvision.cpp
Go to the documentation of this file.
1 // C++ headers
2 #include <unistd.h>
3 
4 // QT headers
5 #include <QApplication>
6 
7 // MythTV headers
8 #include <libmyth/mythcontext.h>
11 #include <libmythbase/mythversion.h>
13 #include <libmythbase/rssmanager.h>
15 
16 // MythNetVision headers
17 #include "netsearch.h"
18 #include "nettree.h"
19 #include "treeeditor.h"
20 
22 RSSManager *rssMan = nullptr;
23 
24 static int RunNetVision(void)
25 {
27 
28  auto *netsearch = new NetSearch(mainStack, "mythnetsearch");
29 
30  if (netsearch->Create())
31  {
32  mainStack->AddScreen(netsearch);
33  return 0;
34  }
35  delete netsearch;
36  return -1;
37 }
38 
39 static int RunNetTree(void)
40 {
42 
44  "mythnetvision.ViewMode", DLG_TREE));
45 
46  auto *nettree = new NetTree(type, mainStack, "mythnettree");
47 
48  if (nettree->Create())
49  {
50  mainStack->AddScreen(nettree);
51  return 0;
52  }
53  delete nettree;
54  return -1;
55 }
56 
57 static void runNetVision(void)
58 {
59  RunNetVision();
60 }
61 
62 static void runNetTree(void)
63 {
64  RunNetTree();
65 }
66 
67 static void setupKeys(void)
68 {
69  REG_JUMP("MythNetSearch", QT_TRANSLATE_NOOP("MythControls",
70  "Internet Television Client - Search"), "", runNetVision);
71  REG_JUMP("MythNetTree", QT_TRANSLATE_NOOP("MythControls",
72  "Internet Television Client - Site/Tree View"), "", runNetTree);
73 
74  REG_KEY("Internet Video", "PAGELEFT", QT_TRANSLATE_NOOP("MythControls",
75  "Previous Page"), "");
76  REG_KEY("Internet Video", "PAGERIGHT", QT_TRANSLATE_NOOP("MythControls",
77  "Next Page"), "");
78 }
79 
80 int mythplugin_init(const char *libversion)
81 {
82  if (!MythCoreContext::TestPluginVersion("mythnetvision",
83  libversion,
84  MYTH_BINARY_VERSION))
85  return -1;
86 
87  setupKeys();
88 
89  return 0;
90 }
91 
92 int mythplugin_run(void)
93 {
94  return RunNetVision();
95 }
96 
MythMainWindow::GetMainStack
MythScreenStack * GetMainStack()
Definition: mythmainwindow.cpp:318
netsearch.h
REG_KEY
static void REG_KEY(const QString &Context, const QString &Action, const QString &Description, const QString &Key)
Definition: mythmainwindow.h:175
RSSManager
Definition: rssmanager.h:119
mythplugin.h
MythScreenStack
Definition: mythscreenstack.h:16
MythCoreContext::TestPluginVersion
static bool TestPluginVersion(const QString &name, const QString &libversion, const QString &pluginversion)
Definition: mythcorecontext.cpp:2048
runNetVision
static void runNetVision(void)
Definition: mythnetvision.cpp:57
GrabberManager
Definition: netgrabbermanager.h:83
NetTree
Definition: nettree.h:41
RunNetVision
static int RunNetVision(void)
Definition: mythnetvision.cpp:24
nettree.h
DLG_TREE
@ DLG_TREE
Definition: nettree.h:20
runNetTree
static void runNetTree(void)
Definition: mythnetvision.cpp:62
rssmanager.h
netgrabbermanager.h
DialogType
DialogType
Definition: nettree.h:20
RunNetTree
static int RunNetTree(void)
Definition: mythnetvision.cpp:39
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:55
MythCoreContext::GetNumSetting
int GetNumSetting(const QString &key, int defaultval=0)
Definition: mythcorecontext.cpp:911
mythpluginapi.h
mythplugin_run
int mythplugin_run(void)
Definition: mythnetvision.cpp:92
NetSearch
Definition: netsearch.h:19
setupKeys
static void setupKeys(void)
Definition: mythnetvision.cpp:67
REG_JUMP
static void REG_JUMP(const QString &Destination, const QString &Description, const QString &Key, void(*Callback)(void))
Definition: mythmainwindow.h:188
mythcontext.h
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:104
rssMan
RSSManager * rssMan
Definition: mythnetvision.cpp:22
grabMan
GrabberManager * grabMan
Definition: mythnetvision.cpp:21
mythmainwindow.h
MythScreenStack::AddScreen
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Definition: mythscreenstack.cpp:52
mythplugin_init
int mythplugin_init(const char *libversion)
Definition: mythnetvision.cpp:80
treeeditor.h