int CNFSMountGui::menu() { CMenuWidget mountMenuW(LOCALE_NFS_MOUNT, NEUTRINO_ICON_NETWORK, 720); mountMenuW.disableMenuPosition(); // intros mountMenuW.addItem(new CMenuForwarder(LOCALE_MENU_BACK, true, NULL, NULL, NULL, CRCInput::RC_nokey, NEUTRINO_ICON_BUTTON_LEFT)); mountMenuW.addItem(new CMenuSeparator(CMenuSeparator::LINE)); char s2[12]; for(int i = 0 ; i < NETWORK_NFS_NR_OF_ENTRIES ; i++) { sprintf(s2, "mountentry%d", i); sprintf(ISO_8859_1_entry[i],ZapitTools::UTF8_to_Latin1(m_entry[i]).c_str()); CMenuForwarder *forwarder = new CMenuForwarder("", true, ISO_8859_1_entry[i], this, s2); if (CFSMounter::isMounted(g_settings.network_nfs_local_dir[i])) { forwarder->iconName = NEUTRINO_ICON_MOUNTED; } else { forwarder->iconName = NEUTRINO_ICON_NOT_MOUNTED; } mountMenuW.addItem(forwarder); } int ret = mountMenuW.exec(this, ""); return ret; }
int CWIRELESSSearchGui::menu() { CMenuWidget mountMenuW(LOCALE_WIRELESS_HEAD, "network.raw", 720); mountMenuW.addItem(GenericMenuSeparator); mountMenuW.addItem(GenericMenuBack); mountMenuW.addItem(GenericMenuSeparatorLine); char s2[12]; iface = getWirelessInterface(); //if not detect interface, try with ra0 if (iface=="null") iface = "ra0"; CNetworkConfig::startWirelessNetwork(iface); networks=getWirelessNetworks(iface); printf("Scan wireless networks\n"); for (int i=0;i<20;i++) { printf("ESSID: %s\n", networks[i].c_str()); if (!networks[i].empty()) { strcpy(g_settings.network_wireless_essid[i],networks[i].c_str()); nNetworkFound++; } } if (nNetworkFound>NETWORK_WIRELESS_NR_OF_ENTRIES) nNetworkFound= NETWORK_WIRELESS_NR_OF_ENTRIES; if (nNetworkFound==0) { sprintf(s2,"netentry%d"); sprintf(ISO_8859_1_entry[0],ZapitTools::UTF8_to_Latin1("Not networks found, add manually").c_str()); CMenuForwarderNonLocalized *forwarder = new CMenuForwarderNonLocalized("", true, ISO_8859_1_entry[0], this, s2); forwarder->iconName = NEUTRINO_ICON_NOT_MOUNTED; mountMenuW.addItem(forwarder); } else for(int i=0 ; i < nNetworkFound; i++) { sprintf(s2,"netentry%d",i); //sprintf(ISO_8859_1_entry[i],ZapitTools::UTF8_to_Latin1(m_entry[i]).c_str()); sprintf(ISO_8859_1_entry[i],ZapitTools::UTF8_to_Latin1(networks[i].c_str()).c_str()); //Insert name of wifi here CMenuForwarderNonLocalized *forwarder = new CMenuForwarderNonLocalized("", true,g_settings.network_wireless_essid[i], this, s2); forwarder->iconName = NEUTRINO_ICON_NOT_MOUNTED; mountMenuW.addItem(forwarder); } int ret=mountMenuW.exec(this,""); return ret; }
int CNFSMountGui::menu() { CMenuWidget mountMenuW(LOCALE_NFS_MOUNT, NEUTRINO_ICON_STREAMING, 720); mountMenuW.addIntroItems(); char s2[12]; for(int i=0 ; i < NETWORK_NFS_NR_OF_ENTRIES ; i++) { sprintf(s2,"mountentry%d",i); sprintf(ISO_8859_1_entry[i],ZapitTools::UTF8_to_Latin1(m_entry[i]).c_str()); mountMenuEntry[i] = new CMenuForwarderNonLocalized("", true, ISO_8859_1_entry[i], this, s2); if (CFSMounter::isMounted(g_settings.network_nfs_local_dir[i])) mountMenuEntry[i]->iconName = NEUTRINO_ICON_MOUNTED; else mountMenuEntry[i]->iconName = NEUTRINO_ICON_NOT_MOUNTED; mountMenuW.addItem(mountMenuEntry[i]); } int ret=mountMenuW.exec(this,""); return ret; }