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

  FILE			: cMLdkGUIPluginSetup.cpp
  VERSION		: 1.0

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

  HISTORIC  	: -

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

#include "global.h"
#include "cMLdkGUIPluginSetup.h"

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

const char *AllowedChars = " abcdefghijklmnopqrstuvwxyz0123456789-.";

/*******************************************************************
 *
 *  FUNCTION:   cMLdkGUIPluginSetup
 *
 *  RETURNS:    -
 *
 *  PARAMETERS:
 *		Input  :
 *          void
 *
 *		Output :
 *
 *  COMMENTS:   -
 *
 *******************************************************************/
cMLdkGUIPluginSetup::cMLdkGUIPluginSetup(void)
{
	strcpy(new_hostnameCore,g_CoreHostName);
	Add(new cMenuEditStrItem( "Core HostName", new_hostnameCore, 256 , tr(AllowedChars)));

	new_portCore = g_CorePort;
	Add(new cMenuEditIntItem("Core Port", &new_portCore,     1,    9999));

	strcpy(new_coreLogin,g_CoreLogin);
	Add(new cMenuEditStrItem( "Core Login", new_coreLogin, 256 , tr(AllowedChars)));

	strcpy(new_corePassWd,g_CorePassWd);
	Add(new cMenuEditStrItem( "Core PassWord", new_corePassWd, 256 , tr(AllowedChars)));
}

/*******************************************************************
 *
 *  FUNCTION:   Store
 *
 *  RETURNS:    void
 *
 *  PARAMETERS:
 *		Input  :
 *          void
 *
 *		Output :
 *
 *  COMMENTS:   -
 *
 *******************************************************************/
void cMLdkGUIPluginSetup::Store(void)
{
	SetupStore("CorePort",   g_CorePort = new_portCore);
	SetupStore("CoreHostName", 	strcpy(g_CoreHostName,new_hostnameCore));

	SetupStore("CoreLogin", 	strcpy(g_CoreLogin,new_coreLogin));
	SetupStore("CorePassWd", 	strcpy(g_CorePassWd,new_corePassWd));

}
