summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsvntcreutz <svntcreutz@cd0d6b48-d4f9-0310-940f-ab8c4eb44d3f>2007-08-25 21:43:58 +0000
committersvntcreutz <svntcreutz@cd0d6b48-d4f9-0310-940f-ab8c4eb44d3f>2007-08-25 21:43:58 +0000
commit6c42c17749cdbb4d733fdfb9e1a06508e4635fe0 (patch)
treeeb5f1cc45fee86a9faf36f7600847679dde729f9 /src
parent8ba068032518c32762b32468ef1f4415fefe7574 (diff)
downloadvdr-plugin-menuorg-6c42c17749cdbb4d733fdfb9e1a06508e4635fe0.tar.gz
vdr-plugin-menuorg-6c42c17749cdbb4d733fdfb9e1a06508e4635fe0.tar.bz2
first changes for the OSD Setup Menu
git-svn-id: file:///home/tobias/sandbox/vdr/--/vdr-pkg/vdr-pkg/menuorg/trunk@5991 cd0d6b48-d4f9-0310-940f-ab8c4eb44d3f
Diffstat (limited to 'src')
-rw-r--r--src/menuorg.cpp7
-rw-r--r--src/menuorg.h2
-rw-r--r--src/menuorgsetup.cpp72
-rw-r--r--src/menuorgsetup.h37
-rw-r--r--src/menusetup.cpp38
-rw-r--r--src/menusetup.h30
6 files changed, 184 insertions, 2 deletions
diff --git a/src/menuorg.cpp b/src/menuorg.cpp
index f773f9e..8efb341 100644
--- a/src/menuorg.cpp
+++ b/src/menuorg.cpp
@@ -33,6 +33,7 @@
#include "menuconfiguration.h"
#include "mainmenuitemsprovider.h"
#include "i18n.h"
+#include "menuorgsetup.h"
using namespace std;
@@ -41,6 +42,8 @@ MenuOrgPlugin::MenuOrgPlugin(void)
// Initialize any member variables here.
// DON'T DO ANYTHING ELSE THAT MAY HAVE SIDE EFFECTS, REQUIRE GLOBAL
// VDR OBJECTS TO EXIST OR PRODUCE ANY OUTPUT!
+ _pluginIsActive = 1;
+ getLostPlugins = 1;
}
MenuOrgPlugin::~MenuOrgPlugin()
@@ -129,7 +132,7 @@ cOsdObject *MenuOrgPlugin::MainMenuAction(void)
cMenuSetupPage *MenuOrgPlugin::SetupMenu(void)
{
// Return a setup menu in case the plugin supports one.
- return NULL;
+ return new cMenuOrgPluginSetup(&_pluginIsActive, &getLostPlugins);
}
bool MenuOrgPlugin::SetupParse(const char *Name, const char *Value)
@@ -140,7 +143,7 @@ bool MenuOrgPlugin::SetupParse(const char *Name, const char *Value)
bool MenuOrgPlugin::Service(const char *Id, void *Data)
{
- if (strcmp(Id, MENU_ITEMS_PROVIDER_SERVICE_ID) == 0)
+ if (strcmp(Id, MENU_ITEMS_PROVIDER_SERVICE_ID) == 0 && _pluginIsActive == 1)
{
if (_subMenuProvider)
{
diff --git a/src/menuorg.h b/src/menuorg.h
index 913de4a..8b0b886 100644
--- a/src/menuorg.h
+++ b/src/menuorg.h
@@ -33,6 +33,8 @@ class MenuOrgPlugin : public cPlugin
private:
MainMenuItemsProvider* _subMenuProvider;
std::string configFile;
+ int _pluginIsActive;
+ int getLostPlugins;
public:
MenuOrgPlugin(void);
diff --git a/src/menuorgsetup.cpp b/src/menuorgsetup.cpp
new file mode 100644
index 0000000..a2963ab
--- /dev/null
+++ b/src/menuorgsetup.cpp
@@ -0,0 +1,72 @@
+/*
+ * vdr-menuorg - A plugin for the Linux Video Disk Recorder
+ * Copyright (C) 2007 Thomas Creutz, Tobias Grimm
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id$
+ *
+ */
+
+#include <vdr/menu.h>
+#include "menuorg.h"
+#include "menuorgsetup.h"
+#include "menusetup.h"
+
+cMenuOrgPluginSetup::cMenuOrgPluginSetup(int *pluginActive, int *getLostPlugins)
+{
+ newpluginActive = *pluginActive;
+ newgetLostPlugins = *getLostPlugins;
+ Add(new cMenuEditBoolItem(tr("PluginActive"), &newpluginActive));
+ Add(new cMenuEditBoolItem(tr("Add lost Plugins to MainMenu"), &newgetLostPlugins));
+ Add(new cOsdItem(tr("Configure Menu"), osUser1));
+}
+
+void cMenuOrgPluginSetup::Store(void)
+{
+
+
+}
+
+eOSState cMenuOrgPluginSetup::ProcessKey(eKeys Key)
+{
+ eOSState state = cOsdMenu::ProcessKey(Key);
+ switch(state)
+ {
+ case osUser1:
+ return AddSubMenu(new cMenuSetup);
+ break;
+
+ case osContinue:
+ if(NORMALKEY(Key)==kUp || NORMALKEY(Key)==kDown)
+ {
+ cOsdItem *item=Get(Current());
+ if(item) item->ProcessKey(kNone);
+ }
+ break;
+
+ case osUnknown:
+ if(Key==kOk)
+ {
+ Store();
+ state=osBack;
+ }
+ break;
+
+ default:
+ break;
+ }
+ return state;
+}
diff --git a/src/menuorgsetup.h b/src/menuorgsetup.h
new file mode 100644
index 0000000..234bb61
--- /dev/null
+++ b/src/menuorgsetup.h
@@ -0,0 +1,37 @@
+/*
+ * vdr-menuorg - A plugin for the Linux Video Disk Recorder
+ * Copyright (C) 2007 Thomas Creutz, Tobias Grimm
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id$
+ *
+ */
+
+#include <vdr/menu.h>
+
+class cMenuOrgPluginSetup : public cMenuSetupPage
+{
+ private:
+ int newpluginActive;
+ int newgetLostPlugins;
+
+ protected:
+ virtual void Store(void);
+
+ public:
+ cMenuOrgPluginSetup(int *pluginActive, int *getLostPlugins);
+ virtual eOSState ProcessKey(eKeys Key);
+};
diff --git a/src/menusetup.cpp b/src/menusetup.cpp
new file mode 100644
index 0000000..a9f9495
--- /dev/null
+++ b/src/menusetup.cpp
@@ -0,0 +1,38 @@
+/*
+ * vdr-menuorg - A plugin for the Linux Video Disk Recorder
+ * Copyright (C) 2007 Thomas Creutz, Tobias Grimm
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id$
+ *
+ */
+
+#include <vdr/menu.h>
+#include "menusetup.h"
+
+cMenuSetup::cMenuSetup(void)
+:cOsdMenu(tr("MENU"),25)
+{
+ //TODO
+
+}
+
+eOSState cMenuSetup::ProcessKey(eKeys Key)
+{
+ eOSState state=cOsdMenu::ProcessKey(Key);
+ if(state==osUnknown && Key==kOk) state=osBack;
+ return state;
+}
diff --git a/src/menusetup.h b/src/menusetup.h
new file mode 100644
index 0000000..acfcaa6
--- /dev/null
+++ b/src/menusetup.h
@@ -0,0 +1,30 @@
+/*
+ * vdr-menuorg - A plugin for the Linux Video Disk Recorder
+ * Copyright (C) 2007 Thomas Creutz, Tobias Grimm
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id$
+ *
+ */
+
+#include <vdr/menu.h>
+
+class cMenuSetup : public cOsdMenu
+{
+ public:
+ cMenuSetup(void);
+ virtual eOSState ProcessKey(eKeys Key);
+};