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
11#include <libmythbase/mythversion.h>
15
16// MythNetVision headers
17#include "netsearch.h"
18#include "nettree.h"
19#include "treeeditor.h"
20
22RSSManager *rssMan = nullptr;
23
24static 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
39static 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
57static void runNetVision(void)
58{
60}
61
62static void runNetTree(void)
63{
64 RunNetTree();
65}
66
67static 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
80int 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
93{
94 return RunNetVision();
95}
96
int GetNumSetting(const QString &key, int defaultval=0)
static bool TestPluginVersion(const QString &name, const QString &libversion, const QString &pluginversion)
MythScreenStack * GetMainStack()
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
MythMainWindow * GetMythMainWindow(void)
static void REG_JUMP(const QString &Destination, const QString &Description, const QString &Key, void(*Callback)(void))
static void REG_KEY(const QString &Context, const QString &Action, const QString &Description, const QString &Key)
GrabberManager * grabMan
static void setupKeys(void)
static int RunNetVision(void)
RSSManager * rssMan
static void runNetVision(void)
int mythplugin_run(void)
int mythplugin_init(const char *libversion)
static int RunNetTree(void)
static void runNetTree(void)
DialogType
Definition: nettree.h:21
@ DLG_TREE
Definition: nettree.h:21