summaryrefslogtreecommitdiff
path: root/menuitems.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2002-05-11 18:00:00 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2002-05-11 18:00:00 +0200
commit803c6c6bf6340302f78171892bef599aa272c266 (patch)
tree01e24d99cf48cd3bed1506ed6727ff385655574e /menuitems.c
parentae8a947367b4be57c9b0ca7bbf0032de0e2018d3 (diff)
downloadvdr-patch-lnbsharing-803c6c6bf6340302f78171892bef599aa272c266.tar.gz
vdr-patch-lnbsharing-803c6c6bf6340302f78171892bef599aa272c266.tar.bz2
Version 1.1.1vdr-1.1.1
- Separated the actual DVB hardware OSD implementation from the abstract OSD interface. 'osdbase.c/.h' now implements the abstract OSD, while 'dvbosd.c/.h' is the actual implementation for the DVB hardware. This is in preparation for allowing additional kinds of OSD hardware implementations. - Fixed leftover references to the file FORMATS in MANUAL and svdrp.c. - Avoiding ambiguities in the cList template class in case one defines a "list of lists" (thanks to Stefan Huelswitt). - Simplified the basic cMenuSetupPage class for easier use in plugins. - Added setup parameters and a Setup menu to the 'hello' plugin example. - Fixed logging error message for unknown config parameters in plugins. - Rearranged cleanup sequence at the end of the main program. - Adapted PLUGINS.html to use the actual code examples from the 'hello' plugin.
Diffstat (limited to 'menuitems.c')
-rw-r--r--menuitems.c48
1 files changed, 28 insertions, 20 deletions
diff --git a/menuitems.c b/menuitems.c
index d09f5b7..3a6f94e 100644
--- a/menuitems.c
+++ b/menuitems.c
@@ -4,12 +4,13 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: menuitems.c 1.1 2002/05/09 10:10:12 kls Exp $
+ * $Id: menuitems.c 1.2 2002/05/11 10:49:45 kls Exp $
*/
#include "menuitems.h"
#include <ctype.h>
#include "i18n.h"
+#include "plugin.h"
// --- cMenuEditItem ---------------------------------------------------------
@@ -437,15 +438,13 @@ eOSState cMenuTextItem::ProcessKey(eKeys Key)
cMenuSetupPage::cMenuSetupPage(void)
:cOsdMenu("", 33)
{
- data = Setup;
- osdLanguage = Setup.OSDLanguage;
+ plugin = NULL;
}
-void cMenuSetupPage::SetupTitle(const char *s)
+void cMenuSetupPage::SetSection(const char *Section)
{
- char buf[40]; // can't call tr() for more than one string at a time!
- char *q = buf + snprintf(buf, sizeof(buf), "%s - ", tr("Setup"));
- snprintf(q, sizeof(buf) - strlen(buf), "%s", tr(s));
+ char buf[40];
+ snprintf(buf, sizeof(buf), "%s - %s", tr("Setup"), Section);
SetTitle(buf);
}
@@ -455,22 +454,31 @@ eOSState cMenuSetupPage::ProcessKey(eKeys Key)
if (state == osUnknown) {
switch (Key) {
- case kOk: state = (Setup.PrimaryDVB != data.PrimaryDVB) ? osSwitchDvb : osBack;
- cDvbApi::PrimaryDvbApi->SetVideoFormat(data.VideoFormat ? VIDEO_FORMAT_16_9 : VIDEO_FORMAT_4_3);
- Setup = data;
- Setup.Save();
- cDvbApi::SetCaCaps();
+ case kOk: Store();
+ state = osBack;
break;
default: break;
}
}
- if (data.OSDLanguage != osdLanguage) {
- int OriginalOSDLanguage = Setup.OSDLanguage;
- Setup.OSDLanguage = data.OSDLanguage;
- Set();
- Display();
- osdLanguage = data.OSDLanguage;
- Setup.OSDLanguage = OriginalOSDLanguage;
- }
return state;
}
+
+void cMenuSetupPage::SetPlugin(cPlugin *Plugin)
+{
+ plugin = Plugin;
+ char buf[40];
+ snprintf(buf, sizeof(buf), "%s '%s'", tr("Plugin"), plugin->Name());
+ SetSection(buf);
+}
+
+void cMenuSetupPage::SetupStore(const char *Name, const char *Value = NULL)
+{
+ if (plugin)
+ plugin->SetupStore(Name, Value);
+}
+
+void cMenuSetupPage::SetupStore(const char *Name, int Value)
+{
+ if (plugin)
+ plugin->SetupStore(Name, Value);
+}