int CNetworkSetup::exec(CMenuTarget* parent, const std::string &actionKey)
{
	int   res = menu_return::RETURN_REPAINT;

	if (parent)
		parent->hide();

	if(actionKey=="networkapply")
	{
		applyNetworkSettings();
		readNetworkSettings();
		backupNetworkSettings();
		return res;
	}
	else if(actionKey=="networktest")
	{
		printf("[network setup] doing network test...\n");
#if 0
		testNetworkSettings(	networkConfig->address.c_str(),
					networkConfig->netmask.c_str(),
					networkConfig->broadcast.c_str(),
					networkConfig->gateway.c_str(),
					networkConfig->nameserver.c_str(),
					networkConfig->inet_static);
#endif
		testNetworkSettings();
		return res;
	}
	else if(actionKey=="networkshow")
	{
		dprintf(DEBUG_INFO, "show current network settings...\n");
		showCurrentNetworkSettings();
		return res;
	}
	else if(actionKey=="scanssid")
	{
		return showWlanList();
	}
	else if(actionKey=="restore")
	{
		int result =  	ShowMsg(LOCALE_MAINSETTINGS_NETWORK, g_Locale->getText(LOCALE_NETWORKMENU_RESET_SETTINGS_NOW), CMessageBox::mbrNo,
				CMessageBox::mbYes |
				CMessageBox::mbNo ,
				NEUTRINO_ICON_QUESTION,
				width);

		if (result ==  CMessageBox::mbrYes) {
			restoreNetworkSettings();
		}
		return res;
	}

	printf("[neutrino] init network setup...\n");
	res = showNetworkSetup();

	return res;
}
int CNetworkSettings::exec(CMenuTarget* parent, const std::string& actionKey)
{
	dprintf(DEBUG_NORMAL, "CNetworkSettings::exec: actionKey: %s\n", actionKey.c_str());
	
	int ret = menu_return::RETURN_REPAINT;
	
	if(parent)
		parent->hide();
	
	if(actionKey == "savesettings")
	{
		networkConfig->automatic_start = (network_automatic_start == 1);
		networkConfig->commitConfig();

		CNeutrinoApp::getInstance()->exec(NULL, "savesettings");
		
		return ret;
	}
	else if(actionKey == "network") 
	{
		CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_NETWORKMENU_SETUPNOW)); // UTF-8
		hintBox->paint();
		
		networkConfig->automatic_start = (network_automatic_start == 1);

		networkConfig->stopNetwork();
		networkConfig->commitConfig();
		networkConfig->startNetwork();
		
		hintBox->hide();
		delete hintBox;
		hintBox = NULL;
		
		return ret;
	}
	else if(actionKey == "networktest") 
	{
		dprintf(DEBUG_INFO, "CNeutrinoApp::exec: doing network test...\n");

		testNetworkSettings(networkConfig->address.c_str(), networkConfig->netmask.c_str(), networkConfig->broadcast.c_str(), networkConfig->gateway.c_str(), networkConfig->nameserver.c_str(), networkConfig->inet_static);
		
		return ret;
	}
	else if(actionKey == "networkshow") 
	{
		dprintf(DEBUG_INFO, "CNeutrinoApp::exec: showing current network settings...\n");
		showCurrentNetworkSettings();
		
		return ret;
	}
	
	showMenu();
	
	return ret;
}
int CNetworkSetup::exec(CMenuTarget* parent, const std::string &actionKey)
{
	int   res = menu_return::RETURN_REPAINT;

	if (parent)
	{
		parent->hide();
	}
	
	if(actionKey=="networkapply")
	{
		applyNetworkSettings();
		return res;
	}
	else if(actionKey=="networktest")
	{
		printf("[network setup] doing network test...\n");
		testNetworkSettings();
		return res;
	}
	else if(actionKey=="networkshow")
	{
		dprintf(DEBUG_INFO, "show current network settings...\n");
		showCurrentNetworkSettings();
		return res;
	}
	else if(actionKey=="networksave")
	{
		saveNetworkSettings();
		return res;
	}

	printf("[neutrino] init network setup...\n");
	res = showNetworkSetup();
	
	return res;
}