diff options
Diffstat (limited to 'plugin.c')
-rw-r--r-- | plugin.c | 25 |
1 files changed, 24 insertions, 1 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: plugin.c 1.19 2006/04/14 11:45:43 kls Exp $ + * $Id: plugin.c 1.20 2006/04/15 11:17:03 kls Exp $ */ #include "plugin.h" @@ -14,6 +14,7 @@ #include <stdlib.h> #include <time.h> #include "config.h" +#include "interface.h" #define LIBVDR_PREFIX "libvdr-" #define SO_INDICATOR ".so." @@ -69,6 +70,11 @@ void cPlugin::Housekeeping(void) { } +cString cPlugin::Active(void) +{ + return NULL; +} + const char *cPlugin::MainMenuEntry(void) { return NULL; @@ -364,6 +370,23 @@ void cPluginManager::Housekeeping(void) } } +bool cPluginManager::Active(const char *Prompt) +{ + if (pluginManager) { + for (cDll *dll = pluginManager->dlls.First(); dll; dll = pluginManager->dlls.Next(dll)) { + cPlugin *p = dll->Plugin(); + if (p) { + cString s = p->Active(); + if (!isempty(*s)) { + if (!Prompt || !Interface->Confirm(cString::sprintf("%s - %s", *s, Prompt))) + return true; + } + } + } + } + return false; +} + bool cPluginManager::HasPlugins(void) { return pluginManager && pluginManager->dlls.Count(); |