00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include <iostream>
00023
00024 #include <qapplication.h>
00025 #include <unistd.h>
00026
00027 #include "mythnews.h"
00028 #include "mythnewsconfig.h"
00029
00030 #include <mythtv/mythcontext.h>
00031 #include <mythtv/mythdialogs.h>
00032 #include <mythtv/mythplugin.h>
00033 #include <mythtv/mythpluginapi.h>
00034
00035 using namespace std;
00036
00037 void runNews(void);
00038
00039 void setupKeys(void)
00040 {
00041 REG_JUMP("MythNews", "RSS News feed reader", "", runNews);
00042
00043 REG_KEY("News", "RETRIEVENEWS", "Update news items", "I");
00044 REG_KEY("News", "FORCERETRIEVE", "Force update news items", "M");
00045 REG_KEY("News", "CANCEL", "Cancel news item updating", "C");
00046 }
00047
00048 int mythplugin_init(const char *libversion)
00049 {
00050 if (!gContext->TestPopupVersion("mythnews",
00051 libversion,
00052 MYTH_BINARY_VERSION))
00053 return -1;
00054
00055 setupKeys();
00056
00057 return 0;
00058 }
00059
00060 void runNews(void)
00061 {
00062 gContext->addCurrentLocation("mythnews");
00063 MythNews news(gContext->GetMainWindow(), "news");
00064 news.exec();
00065 gContext->removeCurrentLocation();
00066 }
00067
00068 int mythplugin_run(void)
00069 {
00070 runNews();
00071 return 0;
00072 }
00073
00074 int mythplugin_config(void)
00075 {
00076 MythNewsConfig config(gContext->GetMainWindow(), "news");
00077 config.exec();
00078
00079 return 0;
00080 }
00081
00082
00083