bool CNetworkSetup::changeNotify(const neutrino_locale_t locale, void * Data)
{
	if(locale == LOCALE_NETWORKMENU_IPADDRESS) {
		char ip[16];
		unsigned char _ip[4];
		sscanf((char*) Data, "%hhu.%hhu.%hhu.%hhu", &_ip[0], &_ip[1], &_ip[2], &_ip[3]);

		sprintf(ip, "%hhu.%hhu.%hhu.255", _ip[0], _ip[1], _ip[2]);
		networkConfig->broadcast = ip;
		network_broadcast = networkConfig->broadcast;

		networkConfig->netmask = (_ip[0] == 10) ? "255.0.0.0" : "255.255.255.0";
		network_netmask = networkConfig->netmask;

	} else if(locale == LOCALE_NETWORKMENU_SELECT_IF) {
		networkConfig->readConfig(g_settings.ifname);
		readNetworkSettings();
		printf("CNetworkSetup::changeNotify: using %s, static %d\n", g_settings.ifname, CNetworkConfig::getInstance()->inet_static);

		changeNotify(LOCALE_NETWORKMENU_DHCP, &CNetworkConfig::getInstance()->inet_static);

		int ecnt = sizeof(wlanEnable) / sizeof(CMenuForwarder*);
		for(int i = 0; i < ecnt; i++)
			wlanEnable[i]->setActive(CNetworkConfig::getInstance()->wireless);

	} else if(locale == LOCALE_NETWORKMENU_DHCP) {
		CNetworkConfig::getInstance()->inet_static = (network_dhcp == NETWORK_DHCP_OFF);
		int ecnt = sizeof(dhcpDisable) / sizeof(CMenuForwarder*);

		for(int i = 0; i < ecnt; i++)
			dhcpDisable[i]->setActive(CNetworkConfig::getInstance()->inet_static);
	}
	return false;
}
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;
}
//prepares internal settings before commit
void CNetworkSetup::prepareSettings()
{
	networkConfig->automatic_start 	= (network_automatic_start == 1);
	networkConfig->inet_static 	= (network_dhcp ? false : true);
	networkConfig->address 		= network_address;
	networkConfig->netmask 		= network_netmask;
	networkConfig->broadcast 	= network_broadcast;
	networkConfig->gateway 		= network_gateway;
	networkConfig->nameserver 	= network_nameserver;
	networkConfig->hostname 	= network_hostname;
	networkConfig->ssid 		= network_ssid;
	networkConfig->key 		= network_key;

	readNetworkSettings();
	backupNetworkSettings();
}
bool CNetworkSetup::changeNotify(const neutrino_locale_t locale, void * /*Data*/)
{
	if(locale == LOCALE_NETWORKMENU_IPADDRESS) {
		setBroadcast();
	} else if(locale == LOCALE_NETWORKMENU_NETMASK) {
		setBroadcast();
	} else if(locale == LOCALE_NETWORKMENU_SELECT_IF) {
		networkConfig->readConfig(g_settings.ifname);
		readNetworkSettings();
		printf("CNetworkSetup::changeNotify: using %s, static %d\n", g_settings.ifname.c_str(), CNetworkConfig::getInstance()->inet_static);

		changeNotify(LOCALE_NETWORKMENU_DHCP, &CNetworkConfig::getInstance()->inet_static);

		wlanEnable.Activate(CNetworkConfig::getInstance()->wireless);
	} else if(locale == LOCALE_NETWORKMENU_DHCP) {
		CNetworkConfig::getInstance()->inet_static = (network_dhcp == NETWORK_DHCP_OFF);
		dhcpDisable.Activate(CNetworkConfig::getInstance()->inet_static);
	}
	return false;
}
int CNetworkSetup::showNetworkSetup()
{
	struct dirent **namelist;

	//if select

	int ifcount = scandir("/sys/class/net", &namelist, my_filter, alphasort);

	CMenuOptionStringChooser * ifSelect = new CMenuOptionStringChooser(LOCALE_NETWORKMENU_SELECT_IF, &g_settings.ifname, ifcount > 1, this, CRCInput::RC_nokey, "", true);
	ifSelect->setHint("", LOCALE_MENU_HINT_NET_IF);

	bool found = false;

	for(int i = 0; i < ifcount; i++) {
		ifSelect->addOption(namelist[i]->d_name);
		if(strcmp(g_settings.ifname.c_str(), namelist[i]->d_name) == 0)
			found = true;
		free(namelist[i]);
	}

	if (ifcount >= 0)
		free(namelist);

	if(!found)
		g_settings.ifname = "eth0";

	networkConfig->readConfig(g_settings.ifname);
	readNetworkSettings();
	backupNetworkSettings();

	//menue init
	CMenuWidget* networkSettings = new CMenuWidget(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_NETWORKSETUP);
	networkSettings->setWizardMode(is_wizard);

	//apply button
	CMenuForwarder *m0 = new CMenuForwarder(LOCALE_NETWORKMENU_SETUPNOW, true, NULL, this, "networkapply", CRCInput::RC_red);
	m0->setHint("", LOCALE_MENU_HINT_NET_SETUPNOW);

	//eth id
	CMenuForwarder *mac = new CMenuForwarder("MAC", false, mac_addr);

	//prepare input entries
	CIPInput networkSettings_NetworkIP(LOCALE_NETWORKMENU_IPADDRESS  , &network_address   , LOCALE_IPSETUP_HINT_1, LOCALE_IPSETUP_HINT_2, this);
	CIPInput networkSettings_NetMask  (LOCALE_NETWORKMENU_NETMASK    , &network_netmask   , LOCALE_IPSETUP_HINT_1, LOCALE_IPSETUP_HINT_2, this);
	CIPInput networkSettings_Gateway  (LOCALE_NETWORKMENU_GATEWAY    , &network_gateway   , LOCALE_IPSETUP_HINT_1, LOCALE_IPSETUP_HINT_2);
	CIPInput networkSettings_NameServer(LOCALE_NETWORKMENU_NAMESERVER, &network_nameserver, LOCALE_IPSETUP_HINT_1, LOCALE_IPSETUP_HINT_2);

	//hostname
	CKeyboardInput networkSettings_Hostname(LOCALE_NETWORKMENU_HOSTNAME, &network_hostname, 0, NULL, NULL, LOCALE_NETWORKMENU_HOSTNAME_HINT1, LOCALE_NETWORKMENU_HOSTNAME_HINT2);

	//auto start
	CMenuOptionChooser* o1 = new CMenuOptionChooser(LOCALE_NETWORKMENU_SETUPONSTARTUP, &network_automatic_start, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true);
	o1->setHint("", LOCALE_MENU_HINT_NET_SETUPONSTARTUP);

	//dhcp
	network_dhcp 	= networkConfig->inet_static ? NETWORK_DHCP_OFF : NETWORK_DHCP_ON;

	CMenuForwarder *m1 = new CMenuForwarder(LOCALE_NETWORKMENU_IPADDRESS , networkConfig->inet_static, network_address   , &networkSettings_NetworkIP );
	CMenuForwarder *m2 = new CMenuForwarder(LOCALE_NETWORKMENU_NETMASK   , networkConfig->inet_static, network_netmask   , &networkSettings_NetMask   );
	setBroadcast();
	CMenuForwarder *m3 = new CMenuForwarder(LOCALE_NETWORKMENU_BROADCAST , false,                      network_broadcast);
	CMenuForwarder *m4 = new CMenuForwarder(LOCALE_NETWORKMENU_GATEWAY   , networkConfig->inet_static, network_gateway   , &networkSettings_Gateway   );
	CMenuForwarder *m5 = new CMenuForwarder(LOCALE_NETWORKMENU_NAMESERVER, networkConfig->inet_static, network_nameserver, &networkSettings_NameServer);
	CMenuForwarder *m8 = new CMenuForwarder(LOCALE_NETWORKMENU_HOSTNAME  , true , network_hostname , &networkSettings_Hostname  );

	m1->setHint("", LOCALE_MENU_HINT_NET_IPADDRESS);
	m2->setHint("", LOCALE_MENU_HINT_NET_NETMASK);
	m3->setHint("", LOCALE_MENU_HINT_NET_BROADCAST);
	m4->setHint("", LOCALE_MENU_HINT_NET_GATEWAY);
	m5->setHint("", LOCALE_MENU_HINT_NET_NAMESERVER);
	m8->setHint("", LOCALE_MENU_HINT_NET_HOSTNAME);

	dhcpDisable.Add(m1);
	dhcpDisable.Add(m2);
	dhcpDisable.Add(m3);
	dhcpDisable.Add(m4);
	dhcpDisable.Add(m5);

	CMenuOptionChooser* o2 = new CMenuOptionChooser(LOCALE_NETWORKMENU_DHCP, &network_dhcp, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this);
	o2->setHint("", LOCALE_MENU_HINT_NET_DHCP);

	//paint menu items
	networkSettings->addIntroItems(LOCALE_MAINSETTINGS_NETWORK); //intros
	//-------------------------------------------------
	networkSettings->addItem( m0 ); //apply
	CMenuForwarder * mf = new CMenuForwarder(LOCALE_NETWORKMENU_TEST, true, NULL, this, "networktest", CRCInput::RC_green);
	mf->setHint("", LOCALE_MENU_HINT_NET_TEST);
	networkSettings->addItem(mf); //test

	mf = new CMenuForwarder(LOCALE_NETWORKMENU_SHOW, true, NULL, this, "networkshow", CRCInput::RC_info);
	mf->setHint("", LOCALE_MENU_HINT_NET_SHOW);
	networkSettings->addItem(mf);	//show settings

	networkSettings->addItem(GenericMenuSeparatorLine);
	//------------------------------------------------
	if(ifcount)
		networkSettings->addItem(ifSelect);	//if select
	else
		delete ifSelect;

	networkSettings->addItem(o1);	//set on start
	networkSettings->addItem(GenericMenuSeparatorLine);
	//------------------------------------------------
	if(ifcount > 1) // if there is only one, its probably wired
	{
		//ssid
		CKeyboardInput * networkSettings_ssid = new CKeyboardInput(LOCALE_NETWORKMENU_SSID, &network_ssid);
		//key
		CKeyboardInput * networkSettings_key = new CKeyboardInput(LOCALE_NETWORKMENU_PASSWORD, &network_key);
		CMenuForwarder *m9 = new CMenuDForwarder(LOCALE_NETWORKMENU_SSID      , networkConfig->wireless, network_ssid , networkSettings_ssid );
		CMenuForwarder *m10 = new CMenuDForwarder(LOCALE_NETWORKMENU_PASSWORD , networkConfig->wireless, network_key , networkSettings_key );
		CMenuForwarder *m11 = new CMenuForwarder(LOCALE_NETWORKMENU_SSID_SCAN , networkConfig->wireless, NULL, this, "scanssid");

		m9->setHint("", LOCALE_MENU_HINT_NET_SSID);
		m10->setHint("", LOCALE_MENU_HINT_NET_PASS);
		m11->setHint("", LOCALE_MENU_HINT_NET_SSID_SCAN);

		wlanEnable.Add(m9);
		wlanEnable.Add(m10);
		wlanEnable.Add(m11);

		networkSettings->addItem( m11);	//ssid scan
		networkSettings->addItem( m9);	//ssid
		networkSettings->addItem( m10);	//key
		networkSettings->addItem(GenericMenuSeparatorLine);
	}
	//------------------------------------------------
	networkSettings->addItem(mac);	//eth id
	networkSettings->addItem(GenericMenuSeparatorLine);
	//-------------------------------------------------
	networkSettings->addItem(o2);	//dhcp on/off
	networkSettings->addItem( m8);	//hostname
	networkSettings->addItem(GenericMenuSeparatorLine);
	//-------------------------------------------------
	networkSettings->addItem( m1);	//adress
	networkSettings->addItem( m2);	//mask
	networkSettings->addItem( m3);	//broadcast
	networkSettings->addItem(GenericMenuSeparatorLine);
	//------------------------------------------------
	networkSettings->addItem( m4);	//gateway
	networkSettings->addItem( m5);	//nameserver
	//------------------------------------------------
	sectionsdConfigNotifier = NULL;
	CMenuWidget ntp(LOCALE_MAINSETTINGS_NETWORK, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_NETWORKSETUP_NTP);
#ifdef ENABLE_GUI_MOUNT
	CMenuWidget networkmounts(LOCALE_MAINSETTINGS_NETWORK, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_NETWORKSETUP_MOUNTS);
#endif
	CProxySetup proxy(LOCALE_MAINSETTINGS_NETWORK);
	CNetworkServiceSetup services;

	//ntp submenu
	sectionsdConfigNotifier = new CSectionsdConfigNotifier;
	mf = new CMenuForwarder(LOCALE_NETWORKMENU_NTPTITLE, true, NULL, &ntp, NULL, CRCInput::RC_yellow);
	mf->setHint("", LOCALE_MENU_HINT_NET_NTP);
	networkSettings->addItem(mf);

	showNetworkNTPSetup(&ntp);

#ifdef ENABLE_GUI_MOUNT
	//nfs mount submenu
	mf = new CMenuForwarder(LOCALE_NETWORKMENU_MOUNT, true, NULL, &networkmounts, NULL, CRCInput::RC_blue);
	mf->setHint("", LOCALE_MENU_HINT_NET_MOUNT);
	networkSettings->addItem(mf);
	showNetworkNFSMounts(&networkmounts);
#endif

	//proxyserver submenu
	mf = new CMenuForwarder(LOCALE_FLASHUPDATE_PROXYSERVER_SEP, true, NULL, &proxy, NULL, CRCInput::RC_0);
	mf->setHint("", LOCALE_MENU_HINT_NET_PROXY);
	networkSettings->addItem(mf);

	//services
	mf = new CMenuForwarder(LOCALE_NETWORKMENU_SERVICES, true, NULL, &services, NULL, CRCInput::RC_1);
	mf->setHint("", LOCALE_MENU_HINT_NET_SERVICES);
	networkSettings->addItem(mf);

	int ret = 0;
	while(true) {
		int res = menu_return::RETURN_EXIT;
		ret = networkSettings->exec(NULL, "");

		if (settingsChanged())
			res = saveChangesDialog();
		if(res == menu_return::RETURN_EXIT)
			break;
	}

	dhcpDisable.Clear();
	wlanEnable.Clear();
	delete networkSettings;
	delete sectionsdConfigNotifier;
	return ret;
}
Beispiel #6
0
void CNetworkSettings::showMenu()
{
	dprintf(DEBUG_NORMAL, "CNetworkSettings::showMenu:\n");
	
	CMenuWidget networkSettings(LOCALE_NETWORKMENU_HEAD, NEUTRINO_ICON_NETWORK);
	
	struct dirent **namelist;

	//if select
	int ifcount = scandir("/sys/class/net", &namelist, my_filter, alphasort);

	CMenuOptionStringChooser * ifSelect = new CMenuOptionStringChooser(LOCALE_NETWORKMENU_SELECT_IF, g_settings.ifname, ifcount > 1, this, CRCInput::RC_nokey, "", true);

	bool found = false;

	for(int i = 0; i < ifcount; i++) 
	{
		ifSelect->addOption(namelist[i]->d_name);
		
		if(strcmp(g_settings.ifname, namelist[i]->d_name) == 0)
			found = true;
		free(namelist[i]);
	}

	if (ifcount >= 0)
		free(namelist);

	if(!found)
		strcpy(g_settings.ifname, "eth0");
	
	// read network settings
	readNetworkSettings(g_settings.ifname);

	// init IP changer
	MyIPChanger = new CIPChangeNotifier;
	
	//eth id
	CMenuForwarder * mac = new CMenuForwarder("MAC", false, mac_addr);
	
	CIPInput * networkSettings_NetworkIP = new CIPInput(LOCALE_NETWORKMENU_IPADDRESS, networkConfig->address, LOCALE_IPSETUP_HINT_1, LOCALE_IPSETUP_HINT_2, MyIPChanger);

	CIPInput * networkSettings_NetMask = new CIPInput(LOCALE_NETWORKMENU_NETMASK, networkConfig->netmask, LOCALE_IPSETUP_HINT_1, LOCALE_IPSETUP_HINT_2);

	CIPInput * networkSettings_Broadcast = new CIPInput(LOCALE_NETWORKMENU_BROADCAST, networkConfig->broadcast, LOCALE_IPSETUP_HINT_1, LOCALE_IPSETUP_HINT_2);

	CIPInput * networkSettings_Gateway = new CIPInput(LOCALE_NETWORKMENU_GATEWAY, networkConfig->gateway, LOCALE_IPSETUP_HINT_1, LOCALE_IPSETUP_HINT_2);

	CIPInput * networkSettings_NameServer = new CIPInput(LOCALE_NETWORKMENU_NAMESERVER, networkConfig->nameserver, LOCALE_IPSETUP_HINT_1, LOCALE_IPSETUP_HINT_2);
	
	//hostname
	CStringInputSMS * networkSettings_Hostname = new CStringInputSMS(LOCALE_NETWORKMENU_HOSTNAME, &network_hostname);

        CSectionsdConfigNotifier * sectionsdConfigNotifier = new CSectionsdConfigNotifier;
	// ntp server
        CStringInputSMS * networkSettings_NtpServer = new CStringInputSMS(LOCALE_NETWORKMENU_NTPSERVER, &g_settings.network_ntpserver, MAX_INPUT_CHARS, LOCALE_NETWORKMENU_NTPSERVER_HINT1, LOCALE_NETWORKMENU_NTPSERVER_HINT2, "abcdefghijklmnopqrstuvwxyz0123456789-. ", sectionsdConfigNotifier);
        CStringInput * networkSettings_NtpRefresh = new CStringInput(LOCALE_NETWORKMENU_NTPREFRESH, &g_settings.network_ntprefresh, 3, LOCALE_NETWORKMENU_NTPREFRESH_HINT1, LOCALE_NETWORKMENU_NTPREFRESH_HINT2 , "0123456789 ", sectionsdConfigNotifier);

	CMenuForwarder * m0 = new CMenuForwarder(LOCALE_NETWORKMENU_SETUPNOW, true, NULL, this, "network", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN);

	CMenuForwarder * m1 = new CMenuForwarder(LOCALE_NETWORKMENU_IPADDRESS, networkConfig->inet_static, networkConfig->address, networkSettings_NetworkIP );

	CMenuForwarder * m2 = new CMenuForwarder(LOCALE_NETWORKMENU_NETMASK, networkConfig->inet_static, networkConfig->netmask, networkSettings_NetMask   );

	CMenuForwarder * m3 = new CMenuForwarder(LOCALE_NETWORKMENU_BROADCAST, networkConfig->inet_static, networkConfig->broadcast, networkSettings_Broadcast );

	CMenuForwarder * m4 = new CMenuForwarder(LOCALE_NETWORKMENU_GATEWAY, networkConfig->inet_static, networkConfig->gateway, networkSettings_Gateway   );

	CMenuForwarder * m5 = new CMenuForwarder(LOCALE_NETWORKMENU_NAMESERVER, networkConfig->inet_static, networkConfig->nameserver, networkSettings_NameServer);

        CMenuForwarder * m6 = new CMenuForwarder( LOCALE_NETWORKMENU_NTPSERVER, true, g_settings.network_ntpserver, networkSettings_NtpServer );

        CMenuForwarder * m7 = new CMenuForwarder( LOCALE_NETWORKMENU_NTPREFRESH, true, g_settings.network_ntprefresh, networkSettings_NtpRefresh );
	
	CMenuForwarder * m8 = new CMenuForwarder(LOCALE_NETWORKMENU_HOSTNAME, true, network_hostname, networkSettings_Hostname);

	CDHCPNotifier * dhcpNotifier = new CDHCPNotifier(m1, m2, m3, m4, m5);

	// setup network on startup
	CMenuOptionChooser * oj = new CMenuOptionChooser(LOCALE_NETWORKMENU_SETUPONSTARTUP, &network_automatic_start, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true);

	// intros
	networkSettings.addItem(new CMenuForwarder(LOCALE_MENU_BACK, true, NULL, NULL, NULL, CRCInput::RC_nokey, NEUTRINO_ICON_BUTTON_LEFT));
	networkSettings.addItem( new CMenuSeparator(CMenuSeparator::LINE) );
	
	// save settings
	networkSettings.addItem(new CMenuForwarder(LOCALE_MAINSETTINGS_SAVESETTINGSNOW, true, NULL, this, "savesettings", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED));
	networkSettings.addItem( new CMenuSeparator(CMenuSeparator::LINE) );
	
	// setup network on start
	networkSettings.addItem( oj );

	// test network now
	networkSettings.addItem(new CMenuForwarder(LOCALE_NETWORKMENU_TEST, true, NULL, this, "networktest"));

	// show active network settings
	networkSettings.addItem(new CMenuForwarder(LOCALE_NETWORKMENU_SHOW, true, NULL, this, "networkshow", CRCInput::RC_info, NEUTRINO_ICON_BUTTON_HELP_SMALL));
	
	// setup network now
	networkSettings.addItem( m0 );
	
	// mac id
	networkSettings.addItem(new CMenuSeparator(CMenuSeparator::LINE));
	networkSettings.addItem(mac);	//eth id
	
	// if select
	if(ifcount)
		networkSettings.addItem(ifSelect);	//if select
	else
		delete ifSelect;

	networkSettings.addItem(new CMenuSeparator(CMenuSeparator::LINE));

	// dhcp on/off
	oj = new CMenuOptionChooser(LOCALE_NETWORKMENU_DHCP, &network_dhcp, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, dhcpNotifier);
	networkSettings.addItem(oj);

	// hostname
	networkSettings.addItem( m8);

	// ip
	networkSettings.addItem(new CMenuSeparator(CMenuSeparator::LINE));
	networkSettings.addItem( m1);

	// netmask
	networkSettings.addItem( m2);

	// broadcast
	networkSettings.addItem( m3);

	// default gateway
	networkSettings.addItem(new CMenuSeparator(CMenuSeparator::LINE));
	networkSettings.addItem( m4);

	// nameserver
	networkSettings.addItem( m5);
	
	//
	if(ifcount > 1) // if there is only one, its probably wired
	{
		//ssid
		CStringInputSMS * networkSettings_ssid = new CStringInputSMS(LOCALE_NETWORKMENU_SSID, &network_ssid);
		CMenuForwarder * m9 = new CMenuForwarder(LOCALE_NETWORKMENU_SSID, networkConfig->wireless, network_ssid , networkSettings_ssid );

		//key
		CStringInputSMS *networkSettings_key = new CStringInputSMS(LOCALE_NETWORKMENU_PASSWORD, &network_key);
		CMenuForwarder *m10 = new CMenuForwarder(LOCALE_NETWORKMENU_PASSWORD, networkConfig->wireless, network_key , networkSettings_key );

		wlanEnable[0] = m9;
		wlanEnable[1] = m10;
		
		// ssid
		networkSettings.addItem(new CMenuSeparator(CMenuSeparator::LINE));
		networkSettings.addItem( m9);

		// key
		networkSettings.addItem( m10);

		//encryption
		CMenuOptionChooser * m11 = new CMenuOptionChooser(LOCALE_NETWORKMENU_WLAN_SECURITY, &network_encryption, OPTIONS_WLAN_SECURITY_OPTIONS, OPTIONS_WLAN_SECURITY_OPTION_COUNT, true);
		wlanEnable[2] = m11;
		networkSettings.addItem( m11); //encryption
	}
	
	// ntp
	networkSettings.addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_NETWORKMENU_NTPTITLE));

	networkSettings.addItem(new CMenuOptionChooser(LOCALE_NETWORKMENU_NTPENABLE, &g_settings.network_ntpenable, OPTIONS_NTPENABLE_OPTIONS, OPTIONS_NTPENABLE_OPTION_COUNT, true, sectionsdConfigNotifier));

	// ntp server
        networkSettings.addItem( m6);

	// ntp refresh
        networkSettings.addItem( m7);
	
	//proxyserver submenu
	networkSettings.addItem(new CMenuSeparator(CMenuSeparator::LINE));
	networkSettings.addItem(new CMenuForwarder(LOCALE_FLASHUPDATE_PROXYSERVER_SEP, true, NULL, new CProxySetup(LOCALE_FLASHUPDATE_PROXYSERVER_SEP), NULL, CRCInput::RC_nokey, NULL));

	// mount manager
	networkSettings.addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_NETWORKMENU_MOUNT));

	networkSettings.addItem(new CMenuForwarder(LOCALE_NFS_MOUNT , true, NULL, new CNFSMountGui(), NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW));

	networkSettings.addItem(new CMenuForwarder(LOCALE_NFS_UMOUNT, true, NULL, new CNFSUmountGui(), NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE));
	
	networkSettings.exec(NULL, "");
	networkSettings.hide();

	delete MyIPChanger;
	delete dhcpNotifier;
	delete sectionsdConfigNotifier;
}