/*----------------------------------------------------------
  PROJECT		: mldkgui

  FILE			: cMLdkGUIPlugin.cpp
  VERSION		: 1.0

  CREATION		: 08.03.2004
  AUTHOR		: JLac
  LANGUAGE		: cpp
  AIM			: implementation of the cMLdkGUIPlugin class.

  HISTORIC  	: -

-----------------------------------------------------------*/
#include <plugin.h>
#include <osd.h>

#include "cMLdkGUIPluginSetup.h"
#include "MLdkGUIStart.h"

#include "LogMsg.h"

#include "global.h"
#include "cMLdkGUIPlugin.h"


//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

/*******************************************************************
 *
 *  FUNCTION:   cMLdkGUIPlugin
 *
 *  RETURNS:    -
 *
 *  PARAMETERS:
 *		Input  :
 *          -
 *
 *		Output :
 *
 *  COMMENTS:   -
 *
 *******************************************************************/
cMLdkGUIPlugin::cMLdkGUIPlugin()
{
	strcpy(g_CoreHostName,"127.0.0.1");
	g_CorePort = 4001;

	strcpy(g_CoreLogin,"admin");
	strcpy(g_CorePassWd,"");
}

/*******************************************************************
 *
 *  FUNCTION:   MainMenuAction
 *
 *  RETURNS:    cOsdObject *
 *
 *  PARAMETERS:
 *		Input  :
 *          void
 *
 *		Output :
 *
 *  COMMENTS:   -
 *
 *******************************************************************/
cOsdObject *cMLdkGUIPlugin::MainMenuAction(void)
{
	return(new MLdkGUIStart);
}

/*******************************************************************
 *
 *  FUNCTION:   SetupParse
 *
 *  RETURNS:    bool
 *
 *  PARAMETERS:
 *		Input  :
 *          const char *Name,const char *Value
 *
 *		Output :
 *
 *  COMMENTS:   -
 *
 *******************************************************************/
bool cMLdkGUIPlugin::SetupParse(const char *Name,const char *Value)
{
	if      (!strcasecmp(Name, "CoreHostName"))    strcpy(g_CoreHostName,Value);
	else if (!strcasecmp(Name, "CorePort"))        g_CorePort = atoi(Value);
	else if (!strcasecmp(Name, "CoreLogin"))       strcpy(g_CoreLogin,Value);
	else if (!strcasecmp(Name, "CorePassWd"))      strcpy(g_CorePassWd,Value);
	else
		return (false);

	return (true);
}

VDRPLUGINCREATOR(cMLdkGUIPlugin);
