summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsvntcreutz <svntcreutz@cd0d6b48-d4f9-0310-940f-ab8c4eb44d3f>2007-08-28 12:20:45 +0000
committersvntcreutz <svntcreutz@cd0d6b48-d4f9-0310-940f-ab8c4eb44d3f>2007-08-28 12:20:45 +0000
commit5fb8bd4b953e93a699f6aa9a1c646b6f558475c3 (patch)
treed08ebf86f0d7f93b22dc849504dc82ab9640ac87
parent8ffe4729c56d10b6d5b6a600d9da358a97b5a899 (diff)
downloadvdr-plugin-menuorg-5fb8bd4b953e93a699f6aa9a1c646b6f558475c3.tar.gz
vdr-plugin-menuorg-5fb8bd4b953e93a699f6aa9a1c646b6f558475c3.tar.bz2
renamed cMenuSetup to cMenuOrgSetup and added some config stuff
git-svn-id: file:///home/tobias/sandbox/vdr/--/vdr-pkg/vdr-pkg/menuorg/trunk@6098 cd0d6b48-d4f9-0310-940f-ab8c4eb44d3f
-rw-r--r--src/menuorg.cpp19
-rw-r--r--src/menuorg.h2
-rw-r--r--src/menusetup.cpp20
-rw-r--r--src/menusetup.h6
-rw-r--r--src/pluginsetup.cpp14
-rw-r--r--src/pluginsetup.h8
6 files changed, 49 insertions, 20 deletions
diff --git a/src/menuorg.cpp b/src/menuorg.cpp
index f63c072..60a5964 100644
--- a/src/menuorg.cpp
+++ b/src/menuorg.cpp
@@ -45,6 +45,8 @@ MenuOrgPlugin::MenuOrgPlugin(void)
// VDR OBJECTS TO EXIST OR PRODUCE ANY OUTPUT!
_customMenuShouldBeActive = true;
_unconfiguredPluginsShouldBeIncluded = true;
+ _hideMainMenuEntry = true;
+ _flatMenuSetup = false;
_subMenuProvider = NULL;
_menuConfiguration = NULL;
}
@@ -67,7 +69,10 @@ const char* MenuOrgPlugin::Description(void)
const char* MenuOrgPlugin::MainMenuEntry(void)
{
- return NULL;
+ if(_hideMainMenuEntry)
+ return NULL;
+ else
+ return tr("Menu-Organizer");
}
const char *MenuOrgPlugin::CommandLineHelp(void)
@@ -123,13 +128,13 @@ bool MenuOrgPlugin::Initialize(void)
cOsdObject *MenuOrgPlugin::MainMenuAction(void)
{
// Perform the action when selected from the main VDR menu.
- return new cMenuSetup(*_menuConfiguration, 1);
+ return new cMenuOrgSetup(*_menuConfiguration, _flatMenuSetup);
}
cMenuSetupPage *MenuOrgPlugin::SetupMenu(void)
{
// Return a setup menu in case the plugin supports one.
- return new PluginSetup(_customMenuShouldBeActive, _unconfiguredPluginsShouldBeIncluded, *_menuConfiguration);
+ return new PluginSetup(_customMenuShouldBeActive, _unconfiguredPluginsShouldBeIncluded, _hideMainMenuEntry, _flatMenuSetup, *_menuConfiguration);
}
bool MenuOrgPlugin::SetupParse(const char *Name, const char *Value)
@@ -142,6 +147,14 @@ bool MenuOrgPlugin::SetupParse(const char *Name, const char *Value)
{
_unconfiguredPluginsShouldBeIncluded = (atoi(Value) != 0);
}
+ else if(!strcasecmp(Name, PluginSetup::SetupName::HideMainMenuEntry))
+ {
+ _hideMainMenuEntry = (atoi(Value) != 0);
+ }
+ else if(!strcasecmp(Name, PluginSetup::SetupName::MenuSetupStyle))
+ {
+ _flatMenuSetup = (atoi(Value) != 0);
+ }
else
return false;
diff --git a/src/menuorg.h b/src/menuorg.h
index 749bf83..7b9dece 100644
--- a/src/menuorg.h
+++ b/src/menuorg.h
@@ -36,6 +36,8 @@ class MenuOrgPlugin : public cPlugin
std::string configFile;
bool _customMenuShouldBeActive;
bool _unconfiguredPluginsShouldBeIncluded;
+ bool _hideMainMenuEntry;
+ bool _flatMenuSetup;
MenuConfiguration* _menuConfiguration;
public:
diff --git a/src/menusetup.cpp b/src/menusetup.cpp
index 906e6ed..6d87a8c 100644
--- a/src/menusetup.cpp
+++ b/src/menusetup.cpp
@@ -31,14 +31,14 @@
using namespace xmlpp;
using namespace std;
-cMenuSetup::cMenuSetup(MenuConfiguration& menuConfiguration, int displayMode)
+cMenuOrgSetup::cMenuOrgSetup(MenuConfiguration& menuConfiguration, bool flatMenuSetup)
:cOsdMenu(tr("Menu Setup")),_menuConfiguration(menuConfiguration)
{
- _displayMode = displayMode;
+ _flatMenuSetup = flatMenuSetup;
CreateMenuItems(_menuConfiguration.Configuration(), 0);
}
-void cMenuSetup::CreateMenuItems(const Element* menuRoot, int iCount)
+void cMenuOrgSetup::CreateMenuItems(const Element* menuRoot, int iCount)
{
int cur=Current();
@@ -60,10 +60,10 @@ void cMenuSetup::CreateMenuItems(const Element* menuRoot, int iCount)
for (int i=0; i <= iCount ;i++)
name = " " + name;
- if ( type == "menu" && _displayMode == 1)
+ if ( type == "menu" && _flatMenuSetup)
{
name = "+" + name;
- Add(new cOsdItem(name.c_str()),true);
+ Add(new cOsdItem(name.c_str()), true);
CreateMenuItems(childElement, iCount+1);
}
else
@@ -71,7 +71,7 @@ void cMenuSetup::CreateMenuItems(const Element* menuRoot, int iCount)
if(iCount > 0)
name = " " + name;
- Add(new cOsdItem(name.c_str()),true);
+ Add(new cOsdItem(name.c_str()), true);
}
}
}
@@ -83,18 +83,18 @@ void cMenuSetup::CreateMenuItems(const Element* menuRoot, int iCount)
}
}
-eOSState cMenuSetup::ProcessKey(eKeys Key)
+eOSState cMenuOrgSetup::ProcessKey(eKeys Key)
{
dsyslog("menuorg: cMenuSetup::ProcessKey called");
std::cerr << "menuorg: cMenuSetup::ProcessKey called" << std::endl;
eOSState state = cOsdMenu::ProcessKey(Key);
- if (HasSubMenu())
+ if(HasSubMenu())
{
return state;
}
- if (state == osUnknown)
+ if(state == osUnknown)
{
switch(Key)
{
@@ -140,7 +140,7 @@ eOSState cMenuSetup::ProcessKey(eKeys Key)
return state;
}
-void cMenuSetup::DrawButton(void)
+void cMenuOrgSetup::DrawButton(void)
{
SetHelp(tr("Create"),tr("Edit"),tr("Delete"),tr("Move"));
Display();
diff --git a/src/menusetup.h b/src/menusetup.h
index 979ee63..8fd64e7 100644
--- a/src/menusetup.h
+++ b/src/menusetup.h
@@ -30,14 +30,14 @@ namespace xmlpp { class Element; }
class MenuConfiguration;
-class cMenuSetup : public cOsdMenu
+class cMenuOrgSetup : public cOsdMenu
{
private:
MenuConfiguration& _menuConfiguration;
- int _displayMode;
+ bool _flatMenuSetup;
public:
- cMenuSetup(MenuConfiguration& menuConfiguration, int displayMode);
+ cMenuOrgSetup(MenuConfiguration& menuConfiguration, bool flatMenuSetup);
virtual eOSState ProcessKey(eKeys Key);
private:
diff --git a/src/pluginsetup.cpp b/src/pluginsetup.cpp
index f1b2c19..6609f76 100644
--- a/src/pluginsetup.cpp
+++ b/src/pluginsetup.cpp
@@ -28,13 +28,17 @@
const char* PluginSetup::SetupName::CustomMenuActive = "customMenuActive";
const char* PluginSetup::SetupName::UnconfiguredPluginsIncluded = "unconfiguredPluginsIncluded";
+const char* PluginSetup::SetupName::HideMainMenuEntry = "hideMainMenuEntry";
+const char* PluginSetup::SetupName::MenuSetupStyle = "menuSetupStyle";
-PluginSetup::PluginSetup(bool& customMenuActive, bool& unconfiguredPluginsIncluded, MenuConfiguration& menuConfiguration)
- :_customMenuActive(customMenuActive), _unconfiguredPluginsIncluded(unconfiguredPluginsIncluded),
+PluginSetup::PluginSetup(bool& customMenuActive, bool& unconfiguredPluginsIncluded, bool& hideMainMenuEntry, bool& menuSetupStyle, MenuConfiguration& menuConfiguration)
+ :_customMenuActive(customMenuActive), _unconfiguredPluginsIncluded(unconfiguredPluginsIncluded), _hideMainMenuEntry(hideMainMenuEntry), _menuSetupStyle(menuSetupStyle),
_menuConfiguration(menuConfiguration)
{
_newCustomMenuActive = _customMenuActive;
_newUnconfiguredPluginsIncluded = _unconfiguredPluginsIncluded;
+ _newHideMainMenuEntry = _hideMainMenuEntry;
+ _newMenuSetupStyle = _menuSetupStyle;
CreateMenuItems();
}
@@ -42,6 +46,8 @@ void PluginSetup::Store(void)
{
SetupStore(SetupName::CustomMenuActive, _customMenuActive = _newCustomMenuActive);
SetupStore(SetupName::UnconfiguredPluginsIncluded, _unconfiguredPluginsIncluded = _newUnconfiguredPluginsIncluded);
+ SetupStore(SetupName::HideMainMenuEntry, _hideMainMenuEntry = _newHideMainMenuEntry);
+ SetupStore(SetupName::MenuSetupStyle, _menuSetupStyle = _newMenuSetupStyle);
}
eOSState PluginSetup::ProcessKey(eKeys Key)
@@ -57,7 +63,7 @@ eOSState PluginSetup::ProcessKey(eKeys Key)
switch(state)
{
case osUser1:
- return AddSubMenu(new cMenuSetup(_menuConfiguration, 1));
+ return AddSubMenu(new cMenuOrgSetup(_menuConfiguration, _menuSetupStyle));
break;
case osContinue:
@@ -86,5 +92,7 @@ void PluginSetup::CreateMenuItems()
{
Add(new cMenuEditBoolItem(tr("Enable custom menu"), &_newCustomMenuActive));
Add(new cMenuEditBoolItem(tr("Include unconfigured Plugins"), &_newUnconfiguredPluginsIncluded));
+ Add(new cMenuEditBoolItem(tr("Hide MainMenu Entry"), &_newHideMainMenuEntry));
+ Add(new cMenuEditBoolItem(tr("Menusetup Style"), &_newMenuSetupStyle, tr("MenuBased"),tr("Flat")));
Add(new cOsdItem(tr("Configure Menu"), osUser1));
}
diff --git a/src/pluginsetup.h b/src/pluginsetup.h
index 554679a..fc2f578 100644
--- a/src/pluginsetup.h
+++ b/src/pluginsetup.h
@@ -30,8 +30,12 @@ class PluginSetup : public cMenuSetupPage
private:
int _newCustomMenuActive;
int _newUnconfiguredPluginsIncluded;
+ int _newHideMainMenuEntry;
+ int _newMenuSetupStyle;
bool& _customMenuActive;
bool& _unconfiguredPluginsIncluded;
+ bool& _hideMainMenuEntry;
+ bool& _menuSetupStyle;
MenuConfiguration& _menuConfiguration;
public:
@@ -39,10 +43,12 @@ class PluginSetup : public cMenuSetupPage
{
static const char* CustomMenuActive;
static const char* UnconfiguredPluginsIncluded;
+ static const char* HideMainMenuEntry;
+ static const char* MenuSetupStyle;
};
public:
- PluginSetup(bool& customMenuActive, bool& unconfiguredPluginsIncluded, MenuConfiguration& menuConfiguration);
+ PluginSetup(bool& customMenuActive, bool& unconfiguredPluginsIncluded, bool& hideMainMenuEntry, bool& menuSetupStyle, MenuConfiguration& menuConfiguration);
virtual eOSState ProcessKey(eKeys Key);
protected: