//EPG settings void CMiscMenue::showMiscSettingsMenuEpg(CMenuWidget *ms_epg) { ms_epg->addIntroItems(LOCALE_MISCSETTINGS_EPG_HEAD); ms_epg->addKey(CRCInput::RC_info, this, "info"); epg_save = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SAVE, &g_settings.epg_save, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this); epg_save->setHint("", LOCALE_MENU_HINT_EPG_SAVE); epg_save_standby = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SAVE_STANDBY, &g_settings.epg_save_standby, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.epg_save); epg_save_standby->setHint("", LOCALE_MENU_HINT_EPG_SAVE_STANDBY); epg_save_frequently = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SAVE_FREQUENTLY, &g_settings.epg_save_frequently, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.epg_save, this); epg_save_frequently->setHint("", LOCALE_MENU_HINT_EPG_SAVE_FREQUENTLY); epg_read = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_READ, &g_settings.epg_read, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this); epg_read->setHint("", LOCALE_MENU_HINT_EPG_READ); epg_read_frequently = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_READ_FREQUENTLY, &g_settings.epg_read_frequently, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.epg_read, this); epg_read_frequently->setHint("", LOCALE_MENU_HINT_EPG_READ_FREQUENTLY); epg_dir = new CMenuForwarder(LOCALE_MISCSETTINGS_EPG_DIR, (g_settings.epg_save || g_settings.epg_read), g_settings.epg_dir, this, "epgdir"); epg_dir->setHint("", LOCALE_MENU_HINT_EPG_DIR); epg_read_now = new CMenuForwarder(LOCALE_MISCSETTINGS_EPG_READ_NOW, g_settings.epg_read, NULL, this, "epg_read_now"); epg_read_now->setHint("", LOCALE_MENU_HINT_EPG_READ_NOW); epg_cache = to_string(g_settings.epg_cache); if (epg_cache.length() < 2) epg_cache.insert(0, 2 - epg_cache.length(), ' '); CStringInput * miscSettings_epg_cache = new CStringInput(LOCALE_MISCSETTINGS_EPG_CACHE, &epg_cache, 2,LOCALE_MISCSETTINGS_EPG_CACHE_HINT1, LOCALE_MISCSETTINGS_EPG_CACHE_HINT2 , "0123456789 ", sectionsdConfigNotifier); CMenuForwarder * mf = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_CACHE, true, epg_cache, miscSettings_epg_cache); mf->setHint("", LOCALE_MENU_HINT_EPG_CACHE); epg_extendedcache = to_string(g_settings.epg_extendedcache); if (epg_extendedcache.length() < 3) epg_extendedcache.insert(0, 3 - epg_extendedcache.length(), ' '); CStringInput * miscSettings_epg_cache_e = new CStringInput(LOCALE_MISCSETTINGS_EPG_EXTENDEDCACHE, &epg_extendedcache, 3,LOCALE_MISCSETTINGS_EPG_EXTENDEDCACHE_HINT1, LOCALE_MISCSETTINGS_EPG_EXTENDEDCACHE_HINT2 , "0123456789 ", sectionsdConfigNotifier); CMenuForwarder * mf1 = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_EXTENDEDCACHE, true, epg_extendedcache, miscSettings_epg_cache_e); mf1->setHint("", LOCALE_MENU_HINT_EPG_EXTENDEDCACHE); epg_old_events = to_string(g_settings.epg_old_events); if (epg_old_events.length() < 3) epg_old_events.insert(0, 3 - epg_old_events.length(), ' '); CStringInput * miscSettings_epg_old_events = new CStringInput(LOCALE_MISCSETTINGS_EPG_OLD_EVENTS, &epg_old_events, 3,LOCALE_MISCSETTINGS_EPG_OLD_EVENTS_HINT1, LOCALE_MISCSETTINGS_EPG_OLD_EVENTS_HINT2 , "0123456789 ", sectionsdConfigNotifier); CMenuForwarder * mf2 = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_OLD_EVENTS, true, epg_old_events, miscSettings_epg_old_events); mf2->setHint("", LOCALE_MENU_HINT_EPG_OLD_EVENTS); epg_max_events = to_string(g_settings.epg_max_events); if (epg_max_events.length() < 6) epg_max_events.insert(0, 6 - epg_max_events.length(), ' '); CStringInput * miscSettings_epg_max_events = new CStringInput(LOCALE_MISCSETTINGS_EPG_MAX_EVENTS, &epg_max_events, 6,LOCALE_MISCSETTINGS_EPG_MAX_EVENTS_HINT1, LOCALE_MISCSETTINGS_EPG_MAX_EVENTS_HINT2 , "0123456789 ", sectionsdConfigNotifier); CMenuForwarder * mf3 = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_MAX_EVENTS, true, epg_max_events, miscSettings_epg_max_events); mf3->setHint("", LOCALE_MENU_HINT_EPG_MAX_EVENTS); epg_scan = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SCAN_BOUQUETS, &g_settings.epg_scan, EPG_SCAN_OPTIONS, EPG_SCAN_OPTION_COUNT, g_settings.epg_scan_mode != CEpgScan::MODE_OFF && g_settings.epg_save_mode == 0); epg_scan->setHint("", LOCALE_MENU_HINT_EPG_SCAN); CMenuOptionChooser * mc3 = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SCAN, &g_settings.epg_scan_mode, EPG_SCAN_MODE_OPTIONS, CFEManager::getInstance()->getEnabledCount() > 1 ? EPG_SCAN_MODE_OPTION_COUNT : 2, true, this); mc3->setHint("", LOCALE_MENU_HINT_EPG_SCAN_MODE); CMenuOptionChooser * mc4 = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SAVE_MODE, &g_settings.epg_save_mode, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this); mc4->setHint("", LOCALE_MENU_HINT_EPG_SAVE_MODE); ms_epg->addItem(epg_save); ms_epg->addItem(epg_save_standby); ms_epg->addItem(epg_save_frequently); ms_epg->addItem(epg_read); ms_epg->addItem(epg_read_frequently); ms_epg->addItem(epg_dir); ms_epg->addItem(epg_read_now); ms_epg->addItem(GenericMenuSeparatorLine); ms_epg->addItem(mf); ms_epg->addItem(mf1); ms_epg->addItem(mf2); ms_epg->addItem(mf3); ms_epg->addItem(mc4); ms_epg->addItem(GenericMenuSeparatorLine); ms_epg->addItem(mc3); ms_epg->addItem(epg_scan); }
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; }
//show misc settings menue int CMiscMenue::showMiscSettingsMenu() { //misc settings fanNotifier = new CFanControlNotifier(); sectionsdConfigNotifier = new CSectionsdConfigNotifier(); CMenuWidget misc_menue(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_MISCSETUP); misc_menue.addIntroItems(LOCALE_MISCSETTINGS_HEAD); //general CMenuWidget misc_menue_general(LOCALE_MISCSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_MISCSETUP_GENERAL); showMiscSettingsMenuGeneral(&misc_menue_general); CMenuForwarder * mf = new CMenuForwarder(LOCALE_MISCSETTINGS_GENERAL, true, NULL, &misc_menue_general, NULL, CRCInput::RC_red); mf->setHint("", LOCALE_MENU_HINT_MISC_GENERAL); misc_menue.addItem(mf); //energy, shutdown if(g_info.hw_caps->can_shutdown) { mf = new CMenuForwarder(LOCALE_MISCSETTINGS_ENERGY, true, NULL, this, "energy", CRCInput::RC_green); mf->setHint("", LOCALE_MENU_HINT_MISC_ENERGY); misc_menue.addItem(mf); } //epg CMenuWidget misc_menue_epg(LOCALE_MISCSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_MISCSETUP_EPG); showMiscSettingsMenuEpg(&misc_menue_epg); mf = new CMenuForwarder(LOCALE_MISCSETTINGS_EPG_HEAD, true, NULL, &misc_menue_epg, NULL, CRCInput::RC_yellow); mf->setHint("", LOCALE_MENU_HINT_MISC_EPG); misc_menue.addItem(mf); //filebrowser settings CMenuWidget misc_menue_fbrowser(LOCALE_MISCSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_MISCSETUP_FILEBROWSER); showMiscSettingsMenuFBrowser(&misc_menue_fbrowser); mf = new CMenuForwarder(LOCALE_FILEBROWSER_HEAD, true, NULL, &misc_menue_fbrowser, NULL, CRCInput::RC_blue); mf->setHint("", LOCALE_MENU_HINT_MISC_FILEBROWSER); misc_menue.addItem(mf); misc_menue.addItem(GenericMenuSeparatorLine); //cec settings CCECSetup cecsetup; if (g_info.hw_caps->can_cec) { mf = new CMenuForwarder(LOCALE_VIDEOMENU_HDMI_CEC, true, NULL, &cecsetup, NULL, CRCInput::RC_1); mf->setHint("", LOCALE_MENU_HINT_MISC_CEC); misc_menue.addItem(mf); } if (!g_info.hw_caps->can_shutdown) { /* we don't have the energy menu, but put the sleeptimer directly here */ mf = new CMenuDForwarder(LOCALE_MISCSETTINGS_SLEEPTIMER, true, NULL, new CSleepTimerWidget(true)); mf->setHint("", LOCALE_MENU_HINT_INACT_TIMER); misc_menue.addItem(mf); } //channellist mf = new CMenuForwarder(LOCALE_MISCSETTINGS_CHANNELLIST, true, NULL, this, "channellist", CRCInput::RC_2); mf->setHint("", LOCALE_MENU_HINT_MISC_CHANNELLIST); misc_menue.addItem(mf); //start channels CZapitSetup zapitsetup; mf = new CMenuForwarder(LOCALE_ZAPITSETUP_HEAD, true, NULL, &zapitsetup, NULL, CRCInput::RC_3); mf->setHint("", LOCALE_MENU_HINT_MISC_ZAPIT); misc_menue.addItem(mf); // onlineservices mf = new CMenuForwarder(LOCALE_MISCSETTINGS_ONLINESERVICES, true, NULL, this, "onlineservices", CRCInput::RC_4); mf->setHint("", LOCALE_MENU_HINT_MISC_ONLINESERVICES); misc_menue.addItem(mf); #ifdef CPU_FREQ //CPU CMenuWidget misc_menue_cpu(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width); showMiscSettingsMenuCPUFreq(&misc_menue_cpu); mf = new CMenuForwarder(LOCALE_MISCSETTINGS_CPU, true, NULL, &misc_menue_cpu, NULL, CRCInput::RC_5); mf->setHint("", LOCALE_MENU_HINT_MISC_CPUFREQ); misc_menue.addItem(mf); #endif /*CPU_FREQ*/ #if 1 #if HAVE_SPARK_HARDWARE || HAVE_DUCKBOX_HARDWARE // kerneloptions CKernelOptions kernelOptions; mf = new CMenuForwarder(LOCALE_KERNELOPTIONS_HEAD, true, NULL, &kernelOptions, NULL, CRCInput::RC_6); mf->setHint("", LOCALE_MENU_HINT_MISC_KERNELOPTIONS); misc_menue.addItem(mf); #endif #endif int res = misc_menue.exec(NULL, ""); delete fanNotifier; delete sectionsdConfigNotifier; return res; }
int CAudioSelectMenuHandler::doMenu () { AudioSelector = new CMenuWidget(LOCALE_AUDIOSELECTMENUE_HEAD, NEUTRINO_ICON_AUDIO, width); CSubtitleChangeExec SubtitleChanger(playback); //show cancel button if configured in usermenu settings if (g_settings.personalize[SNeutrinoSettings::P_UMENU_SHOW_CANCEL]) AudioSelector->addIntroItems(NONEXISTANT_LOCALE, LOCALE_AUDIOSELECTMENUE_VOLUME, CMenuWidget::BTN_TYPE_CANCEL); else AudioSelector->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_AUDIOSELECTMENUE_VOLUME)); apid_offset = AudioSelector->getItemsCount(); AudioSelector->addKey(CRCInput::RC_right, this, "+"); AudioSelector->addKey(CRCInput::RC_left, this, "-"); AudioSelector->addKey(CRCInput::RC_red, this, "x"); AudioSelector->addKey(CRCInput::RC_green, this, "x"); AudioSelector->addKey(CRCInput::RC_yellow, this, "x"); AudioSelector->addKey(CRCInput::RC_blue, this, "x"); bool is_mp = mp->Playing(); p_count = is_mp ? mp->getAPIDCount() : g_RemoteControl->current_PIDs.APIDs.size(); sel_apid = is_mp ? mp->getAPID() : g_RemoteControl->current_PIDs.PIDs.selected_apid; int _apid[p_count]; int _perc_val[p_count]; unsigned int _is_ac3[p_count]; std::string _perc_str[p_count]; perc_val = _perc_val; perc_str = _perc_str; is_ac3 = _is_ac3; apid = _apid; chan = is_mp ? mp->getChannelId() : 0; // -- setup menue due to Audio PIDs for (int i = 0; i < p_count; i++) { if (is_mp) { mp->getAPID(i, apid[i], is_ac3[i]); } else { apid[i] = g_RemoteControl->current_PIDs.APIDs[i].pid; is_ac3[i] = g_RemoteControl->current_PIDs.APIDs[i].is_ac3; } perc_val[i] = CZapit::getInstance()->GetPidVolume(chan, apid[i], is_ac3[i]); perc_str[i] = to_string(perc_val[i]) + "%"; CMenuForwarder *fw = new CMenuForwarder(is_mp ? mp->getAPIDDesc(i).c_str() : g_RemoteControl->current_PIDs.APIDs[i].desc, true, perc_str[i], this, "s", CRCInput::convertDigitToKey(i + 1)); fw->setItemButton(NEUTRINO_ICON_BUTTON_OKAY, true); fw->setMarked(sel_apid == i); AudioSelector->addItem(fw, sel_apid == i); } unsigned int shortcut_num = p_count; #if !HAVE_SPARK_HARDWARE && !HAVE_DUCKBOX_HARDWARE if (p_count) AudioSelector->addItem(GenericMenuSeparatorLine); // -- setup menue for to Dual Channel Stereo CMenuOptionChooser* oj = new CMenuOptionChooser(LOCALE_AUDIOMENU_ANALOG_MODE, &g_settings.audio_AnalogMode, AUDIOMENU_ANALOGOUT_OPTIONS, AUDIOMENU_ANALOGOUT_OPTION_COUNT, true, audioSetupNotifier, CRCInput::RC_red); AudioSelector->addItem( oj ); oj = new CMenuOptionChooser(LOCALE_AUDIOMENU_ANALOG_OUT, &g_settings.analog_out, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, audioSetupNotifier, CRCInput::RC_green); AudioSelector->addItem( oj ); #endif CZapitChannel * cc = NULL; int subtitleCount = 0; if (is_mp) { subtitleCount = mp->getSubtitleCount(); } else { CChannelList *channelList = CNeutrinoApp::getInstance ()->channelList; int curnum = channelList->getActiveChannelNumber(); cc = channelList->getChannel(curnum); subtitleCount = (int)cc->getSubtitleCount(); } bool sep_added = false; if (subtitleCount > 0) { bool sub_active = false; for (int i = 0 ; i < subtitleCount ; ++i) { CZapitAbsSub* s = is_mp ? mp->getChannelSub(i, &s) : cc->getChannelSub(i); if (!s) continue; if (!sep_added) { sep_added = true; AudioSelector->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_SUBTITLES_HEAD)); } bool ena = false; bool add = true; char spid[64]; char item[64]; if (s->thisSubType == CZapitAbsSub::DVB) { CZapitDVBSub* sd = reinterpret_cast<CZapitDVBSub*>(s); // printf("[neutrino] adding DVB subtitle %s pid %x\n", sd->ISO639_language_code.c_str(), sd->pId); snprintf(spid,sizeof(spid), "DVB:%d", sd->pId); snprintf(item,sizeof(item), "DVB: %s (pid %x)", sd->ISO639_language_code.c_str(), sd->pId); ena = sd->pId != (is_mp ? mp->getCurrentSubPid(CZapitAbsSub::DVB) : dvbsub_getpid()); } else if (s->thisSubType == CZapitAbsSub::TTX) { CZapitTTXSub* sd = reinterpret_cast<CZapitTTXSub*>(s); // printf("[neutrino] adding TTX subtitle %s pid %x mag %X page %x\n", sd->ISO639_language_code.c_str(), sd->pId, sd->teletext_magazine_number, sd->teletext_page_number); int page = ((sd->teletext_magazine_number & 0xFF) << 8) | sd->teletext_page_number; int pid = sd->pId; snprintf(spid,sizeof(spid), "TTX:%d:%03X:%s", sd->pId, page, sd->ISO639_language_code.c_str()); snprintf(item,sizeof(item), "TTX: %s (pid %x page %03X)", sd->ISO639_language_code.c_str(), sd->pId, page); ena = !tuxtx_subtitle_running(&pid, &page, NULL); } else if (is_mp && s->thisSubType == CZapitAbsSub::SUB) { // printf("[neutrino] adding SUB subtitle %s pid %x\n", s->ISO639_language_code.c_str(), s->pId); snprintf(spid,sizeof(spid), "SUB:%d", s->pId); snprintf(item,sizeof(item), "SUB: %s (pid %x)", s->ISO639_language_code.c_str(), s->pId); ena = s->pId != mp->getCurrentSubPid(CZapitAbsSub::SUB); } else add = false; if (add) AudioSelector->addItem(new CMenuForwarder(item, ena, NULL, &SubtitleChanger, spid, CRCInput::convertDigitToKey(++shortcut_num))); if (is_mp) delete s; sub_active |= !ena; } if (sub_active) { CMenuForwarder * item = new CMenuForwarder(LOCALE_SUBTITLES_STOP, true, NULL, &SubtitleChanger, "off", CRCInput::RC_stop); item->setItemButton(NEUTRINO_ICON_BUTTON_STOP, false); AudioSelector->addItem(item); } } #if 0 AudioSelector.addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_AUDIOMENU_VOLUME_ADJUST)); /* setting volume percent to zapit with channel_id/apid = 0 means current channel and pid */ CVolume::getInstance()->SetCurrentChannel(0); CVolume::getInstance()->SetCurrentPid(0); int percent[p_count+1];//+1 avoid zero size for (uint i=0; i < p_count; i++) { percent[i] = CZapit::getInstance()->GetPidVolume(0, g_RemoteControl->current_PIDs.APIDs[i].pid, g_RemoteControl->current_PIDs.APIDs[i].is_ac3); AudioSelector.addItem(new CMenuOptionNumberChooser(g_RemoteControl->current_PIDs.APIDs[i].desc, &percent[i], i == g_RemoteControl->current_PIDs.PIDs.selected_apid, 0, 999, CVolume::getInstance())); } #endif int res = AudioSelector->exec(NULL, ""); delete AudioSelector; AudioSelector = NULL; return res; }
int COPKGManager::showMenu() { installed = false; if (checkUpdates()) DisplayInfoMessage(g_Locale->getText(LOCALE_OPKG_MESSAGEBOX_UPDATES_AVAILABLE)); #if 0 getPkgData(OM_LIST); getPkgData(OM_LIST_UPGRADEABLE); #endif menu = new CMenuWidget(g_Locale->getText(LOCALE_SERVICEMENU_UPDATE), NEUTRINO_ICON_UPDATE, width, MN_WIDGET_ID_SOFTWAREUPDATE); menu->addIntroItems(LOCALE_OPKG_TITLE, NONEXISTANT_LOCALE, CMenuWidget::BTN_TYPE_BACK, CMenuWidget::BRIEF_HINT_YES); //upgrade all installed packages upgrade_forwarder = new CMenuForwarder(LOCALE_OPKG_UPGRADE, true, NULL , this, pkg_types[OM_UPGRADE].c_str(), CRCInput::RC_red); upgrade_forwarder->setHint(NEUTRINO_ICON_HINT_SW_UPDATE, LOCALE_MENU_HINT_OPKG_UPGRADE); menu->addItem(upgrade_forwarder); //select and install local package CMenuForwarder *fw; fw = new CMenuForwarder(LOCALE_OPKG_INSTALL_LOCAL_PACKAGE, true, NULL, this, "local_package", CRCInput::RC_green); fw->setHint(NEUTRINO_ICON_HINT_SW_UPDATE, LOCALE_MENU_HINT_OPKG_INSTALL_LOCAL_PACKAGE); menu->addItem(fw); #if ENABLE_OPKG_GUI_FEED_SETUP //feed setup CMenuWidget feeds_menu(LOCALE_OPKG_TITLE, NEUTRINO_ICON_UPDATE, w_max (100, 10)); showMenuConfigFeed(&feeds_menu); fw = new CMenuForwarder(LOCALE_OPKG_FEED_ADDRESSES, true, NULL, &feeds_menu, NULL, CRCInput::RC_www); fw->setHint(NEUTRINO_ICON_HINT_SW_UPDATE, LOCALE_MENU_HINT_OPKG_FEED_ADDRESSES_EDIT); menu->addItem(fw); #endif menu->addItem(GenericMenuSeparatorLine); menu_offset = menu->getItemsCount(); menu->addKey(CRCInput::RC_info, this, "rc_info"); menu->addKey(CRCInput::RC_blue, this, "rc_blue"); menu->addKey(CRCInput::RC_yellow, this, "rc_yellow"); pkg_vec.clear(); for (map<string, struct pkg>::iterator it = pkg_map.begin(); it != pkg_map.end(); ++it) { /* this should no longer trigger at all */ if (badpackage(it->second.name)) continue; it->second.forwarder = new CMenuForwarder(it->second.desc, true, NULL , this, it->second.name.c_str()); it->second.forwarder->setHint("", it->second.desc); menu->addItem(it->second.forwarder); pkg_vec.push_back(&it->second); } updateMenu(); int res = menu->exec(NULL, ""); menu->hide (); //handling after successful installation string exit_action = ""; if (!has_err && installed){ /*! Show a success message only if restart/reboot is required and user should decide what to do or not. NOTE: marker file should be generated by opkg package itself (eg. with preinstall scripts), so it's controlled by the package maintainer! */ //restart neutrino: user decision if(!access( "/tmp/.restart", F_OK)){ int msg = ShowMsg(LOCALE_OPKG_TITLE, g_Locale->getText(LOCALE_OPKG_SUCCESS_INSTALL), CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_QUESTION, width); if (msg == CMessageBox::mbrYes) exit_action = "restart"; } //restart neutrino: forced if (!access( "/tmp/.force_restart", F_OK)) exit_action = "restart"; //reboot stb: forced if (!access( "/tmp/.reboot", F_OK)){ //ShowHint("", "Reboot ...", 300, 3); //TODO g_RCInput->postMsg( NeutrinoMessages::REBOOT, 0); res = menu_return::RETURN_EXIT_ALL; } } /* remove the package-generated files... */ unlink("/tmp/.restart"); unlink("/tmp/.force_restart"); unlink("/tmp/.reboot"); delete menu; if (!exit_action.empty()) CNeutrinoApp::getInstance()->exec(NULL, exit_action); return res; }
int CHDDMenuHandler::doMenu () { FILE * f; int fd; struct dirent **namelist; int ret; struct stat s; int root_dev = -1; bool hdd_found = 0; int n = scandir("/sys/block", &namelist, my_filter, alphasort); if (n < 0) { perror("CHDDMenuHandler::doMenu: scandir(\"/sys/block\") failed"); return menu_return::RETURN_REPAINT; } CMenuWidget* hddmenu = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_DRIVESETUP); //if no drives found, select 'back' if (hdd_found == 0 && hddmenu->getSelected() != -1) hddmenu->setSelected(2); hddmenu->addIntroItems(LOCALE_HDD_SETTINGS); CHDDFmtExec fmtexec; CHDDChkExec chkexec; CHDDDestExec hddexec; CMenuForwarder * mf = new CMenuForwarder(LOCALE_HDD_ACTIVATE, true, "", &hddexec, NULL, CRCInput::RC_red,NEUTRINO_ICON_BUTTON_RED); mf->setHint("", LOCALE_MENU_HINT_HDD_APPLY); hddmenu->addItem(mf); hddmenu->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_HDD_EXTENDED_SETTINGS)); CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_HDD_SLEEP, &g_settings.hdd_sleep, HDD_SLEEP_OPTIONS, HDD_SLEEP_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_HDD_SLEEP); hddmenu->addItem(mc); const char hdparm[] = "/sbin/hdparm"; struct stat stat_buf; bool have_nonbb_hdparm = !::lstat(hdparm, &stat_buf) && !S_ISLNK(stat_buf.st_mode); if (have_nonbb_hdparm) { mc = new CMenuOptionChooser(LOCALE_HDD_NOISE, &g_settings.hdd_noise, HDD_NOISE_OPTIONS, HDD_NOISE_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_HDD_NOISE); hddmenu->addItem(mc); } //if(n > 0) hddmenu->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_HDD_MANAGE)); ret = stat("/", &s); if (ret != -1) root_dev = (s.st_dev & 0x0ffc0); /* hda = 0x0300, hdb = 0x0340 */ printf("HDD: root_dev: 0x%04x\n", root_dev); std::string tmp_str[n]; CMenuWidget * tempMenu[n]; for(int i = 0; i < n;i++) { tempMenu[i] = NULL; char str[256]; char sstr[256]; char vendor[128], model[128]; int64_t bytes; int64_t megabytes; int removable = 0; bool isroot = false; printf("HDD: checking /sys/block/%s\n", namelist[i]->d_name); snprintf(str, sizeof(str), "/dev/%s", namelist[i]->d_name); fd = open(str, O_RDONLY); if(fd < 0) { printf("Cant open %s\n", str); continue; } if (ioctl(fd, BLKGETSIZE64, &bytes)) perror("BLKGETSIZE64"); ret = fstat(fd, &s); if (ret != -1) { if ((int)(s.st_rdev & 0x0ffc0) == root_dev) { isroot = true; /* dev_t is different sized on different architectures :-( */ printf("-> root device is on this disk 0x%04x, skipping\n", (int)s.st_rdev); } } close(fd); megabytes = bytes/1000000; snprintf(str, sizeof(str), "/sys/block/%s/device/vendor", namelist[i]->d_name); f = fopen(str, "r"); if(!f) { printf("Cant open %s\n", str); continue; } fscanf(f, "%s", vendor); fclose(f); snprintf(str, sizeof(str), "/sys/block/%s/device/model", namelist[i]->d_name); f = fopen(str, "r"); if(!f) { printf("Cant open %s\n", str); continue; } fscanf(f, "%s", model); fclose(f); snprintf(str, sizeof(str), "/sys/block/%s/removable", namelist[i]->d_name); f = fopen(str, "r"); if(!f) { printf("Cant open %s\n", str); continue; } fscanf(f, "%d", &removable); fclose(f); bool enabled = !CNeutrinoApp::getInstance()->recordingstatus && !removable && !isroot; snprintf(str, sizeof(str), "%s %s %ld %s", vendor, model, (long)(megabytes < 10000 ? megabytes : megabytes/1000), megabytes < 10000 ? "MB" : "GB"); printf("HDD: %s\n", str); tmp_str[i]=str; tempMenu[i] = new CMenuWidget(str, NEUTRINO_ICON_SETTINGS); tempMenu[i]->addIntroItems(); //tempMenu->addItem( new CMenuOptionChooser(LOCALE_HDD_FS, &g_settings.hdd_fs, HDD_FILESYS_OPTIONS, HDD_FILESYS_OPTION_COUNT, true)); mf = new CMenuForwarder(LOCALE_HDD_FORMAT, true, "", &fmtexec, namelist[i]->d_name); mf->setHint("", LOCALE_MENU_HINT_HDD_FORMAT); tempMenu[i]->addItem(mf); mf = new CMenuForwarder(LOCALE_HDD_CHECK, true, "", &chkexec, namelist[i]->d_name); mf->setHint("", LOCALE_MENU_HINT_HDD_CHECK); tempMenu[i]->addItem(mf); snprintf(sstr, sizeof(sstr), "%s (%s)", g_Locale->getText(LOCALE_HDD_REMOVABLE_DEVICE), namelist[i]->d_name); mf = new CMenuForwarder((removable ? sstr : namelist[i]->d_name), enabled, tmp_str[i], tempMenu[i]); mf->setHint("", LOCALE_MENU_HINT_HDD_TOOLS); hddmenu->addItem(mf); hdd_found = 1; free(namelist[i]); } if (n >= 0) free(namelist); if(!hdd_found) hddmenu->addItem(new CMenuForwarder(LOCALE_HDD_NOT_FOUND, false)); ret = hddmenu->exec(NULL, ""); for(int i = 0; i < n;i++) { if( hdd_found && tempMenu[i] != NULL ){ delete tempMenu[i]; } } delete hddmenu; return ret; }
int CVfdSetup::showBrightnessSetup() { CMenuOptionNumberChooser * nc; CMenuForwarder * mf; CMenuWidget *mn_widget = new CMenuWidget(LOCALE_LCDMENU_HEAD, NEUTRINO_ICON_LCD,width, MN_WIDGET_ID_VFDSETUP_LCD_SLIDERS); mn_widget->addItem(new CMenuSeparator(CMenuSeparator::ALIGN_LEFT | CMenuSeparator::SUB_HEAD | CMenuSeparator::STRING, LOCALE_LCDMENU_LCDCONTROLER)); mn_widget->addItem(GenericMenuSeparator); mf = new CMenuForwarder(LOCALE_MENU_BACK, true); mf->setItemButton(!g_settings.menu_left_exit ? NEUTRINO_ICON_BUTTON_HOME : NEUTRINO_ICON_BUTTON_LEFT); mf->setActivateObserver(this); mn_widget->addItem(mf); mn_widget->addItem(GenericMenuSeparatorLine); brightness = CVFD::getInstance()->getBrightness(); brightnessstandby = CVFD::getInstance()->getBrightnessStandby(); brightnessdeepstandby = CVFD::getInstance()->getBrightnessDeepStandby(); nc = new CMenuOptionNumberChooser(LOCALE_LCDCONTROLER_BRIGHTNESS, &brightness, true, 0, 15, this, CRCInput::RC_nokey, NULL, 0, 0, NONEXISTANT_LOCALE, true); nc->setHint("", LOCALE_MENU_HINT_VFD_BRIGHTNESS); nc->setActivateObserver(this); mn_widget->addItem(nc); nc = new CMenuOptionNumberChooser(LOCALE_LCDCONTROLER_BRIGHTNESSSTANDBY, &brightnessstandby, true, 0, 15, this, CRCInput::RC_nokey, NULL, 0, 0, NONEXISTANT_LOCALE, true); nc->setHint("", LOCALE_MENU_HINT_VFD_BRIGHTNESSSTANDBY); nc->setActivateObserver(this); mn_widget->addItem(nc); if(cs_get_revision() > 7) { nc = new CMenuOptionNumberChooser(LOCALE_LCDCONTROLER_BRIGHTNESSDEEPSTANDBY, &brightnessdeepstandby, true, 0, 15, this, CRCInput::RC_nokey, NULL, 0, 0, NONEXISTANT_LOCALE, true); nc->setHint("", LOCALE_MENU_HINT_VFD_BRIGHTNESSDEEPSTANDBY); nc->setActivateObserver(this); mn_widget->addItem(nc); } nc = new CMenuOptionNumberChooser(LOCALE_LCDMENU_DIM_BRIGHTNESS, &g_settings.lcd_setting_dim_brightness, vfd_enabled, -1, 15, NULL, CRCInput::RC_nokey, NULL, 0, -1, LOCALE_OPTIONS_OFF, true); nc->setHint("", LOCALE_MENU_HINT_VFD_BRIGHTNESSDIM); nc->setActivateObserver(this); mn_widget->addItem(nc); mn_widget->addItem(GenericMenuSeparatorLine); CStringInput *dim_time = new CStringInput(LOCALE_LCDMENU_DIM_TIME, &g_settings.lcd_setting_dim_time, 3, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE,"0123456789 "); mf = new CMenuForwarder(LOCALE_LCDMENU_DIM_TIME, vfd_enabled, g_settings.lcd_setting_dim_time, dim_time); mf->setHint("", LOCALE_MENU_HINT_VFD_DIMTIME); mf->setActivateObserver(this); mn_widget->addItem(mf); mn_widget->addItem(GenericMenuSeparatorLine); mf = new CMenuForwarder(LOCALE_OPTIONS_DEFAULT, true, NULL, this, "def", CRCInput::RC_red); mf->setHint("", LOCALE_MENU_HINT_VFD_DEFAULTS); mf->setActivateObserver(this); mn_widget->addItem(mf); int res = mn_widget->exec(this, ""); delete mn_widget; g_settings.lcd_setting[SNeutrinoSettings::LCD_BRIGHTNESS] = brightness; g_settings.lcd_setting[SNeutrinoSettings::LCD_STANDBY_BRIGHTNESS] = brightnessstandby; return res; }
int CRecordSetup::showRecordSetup() { CMenuForwarder * mf; //menue init CMenuWidget* recordingSettings = new CMenuWidget(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_RECORDSETUP); recordingSettings->addIntroItems(LOCALE_MAINSETTINGS_RECORDING); #if 0 //apply settings mf = new CMenuForwarder(LOCALE_RECORDINGMENU_SETUPNOW, true, NULL, this, "recording", CRCInput::RC_red); mf->setHint("", LOCALE_MENU_HINT_RECORD_APPLY); recordingSettings->addItem(mf); recordingSettings->addItem(GenericMenuSeparatorLine); #endif bool recstatus = CNeutrinoApp::getInstance()->recordingstatus; //record dir CMenuForwarder* fRecDir = new CMenuForwarder(LOCALE_RECORDINGMENU_DEFDIR, !recstatus, g_settings.network_nfs_recordingdir, this, "recordingdir"); fRecDir->setHint("", LOCALE_MENU_HINT_RECORD_DIR); recordingSettings->addItem(fRecDir); CMenuOptionChooser* channel_rec_dir = new CMenuOptionChooser(LOCALE_RECORDINGMENU_SAVE_IN_CHANNELDIR, &g_settings.recording_save_in_channeldir, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); channel_rec_dir->setHint("", LOCALE_MENU_HINT_RECORD_CHANDIR); recordingSettings->addItem(channel_rec_dir); //rec hours CMenuOptionNumberChooser * mc = new CMenuOptionNumberChooser(LOCALE_EXTRA_RECORD_TIME, &g_settings.record_hours, true, 1, 24, NULL); mc->setNumberFormat(std::string("%d ") + g_Locale->getText(LOCALE_UNIT_SHORT_HOUR)); mc->setHint("", LOCALE_MENU_HINT_RECORD_TIME); recordingSettings->addItem(mc); // end of recording CMenuOptionChooser* end_of_recording = new CMenuOptionChooser(LOCALE_RECORDINGMENU_END_OF_RECORDING_NAME, &g_settings.recording_epg_for_end, END_OF_RECORDING, END_OF_RECORDING_COUNT, true); end_of_recording->setHint("", LOCALE_MENU_HINT_RECORD_END); recordingSettings->addItem(end_of_recording); // already_found CMenuOptionChooser* already_found = new CMenuOptionChooser(LOCALE_RECORDINGMENU_ALREADY_FOUND_CHECK, &g_settings.recording_already_found_check, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); already_found->setHint("", LOCALE_MENU_HINT_RECORD_ALREADY_FOUND_CHECK); recordingSettings->addItem(already_found); CMenuOptionChooser* slow_warn = new CMenuOptionChooser(LOCALE_RECORDINGMENU_SLOW_WARN, &g_settings.recording_slow_warning, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); slow_warn->setHint("", LOCALE_MENU_HINT_RECORD_SLOW_WARN); recordingSettings->addItem(slow_warn); CMenuOptionChooser* startstop_msg = new CMenuOptionChooser(LOCALE_RECORDING_STARTSTOP_MSG, &g_settings.recording_startstop_msg, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); startstop_msg->setHint("", LOCALE_MENU_HINT_RECORD_STARTSTOP_MSG); recordingSettings->addItem(startstop_msg); //filename template CKeyboardInput* filename_template = new CKeyboardInput(LOCALE_RECORDINGMENU_FILENAME_TEMPLATE, &g_settings.recording_filename_template, 0, NULL, NULL, LOCALE_RECORDINGMENU_FILENAME_TEMPLATE_HINT, LOCALE_RECORDINGMENU_FILENAME_TEMPLATE_HINT2); CMenuForwarder* ft = new CMenuDForwarder(LOCALE_RECORDINGMENU_FILENAME_TEMPLATE, true, g_settings.recording_filename_template, filename_template, NULL, CRCInput::RC_1); ft->setHint("", LOCALE_MENU_HINT_RECORD_FILENAME_TEMPLATE); recordingSettings->addItem(ft); CMenuOptionChooser* cover = new CMenuOptionChooser(LOCALE_RECORDINGMENU_AUTO_COVER, &g_settings.auto_cover, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); cover->setHint("", LOCALE_MENU_HINT_RECORD_AUTO_COVER); recordingSettings->addItem(cover); #if HAVE_SPARK_HARDWARE || HAVE_DUCKBOX_HARDWARE CMenuOptionNumberChooser *ch; ch = new CMenuOptionNumberChooser(LOCALE_EXTRA_RECORD_BUFSIZE, &g_settings.recording_bufsize, true, 1, 25, NULL); ch->setNumberFormat("%d MB"); recordingSettings->addItem(ch); ch = new CMenuOptionNumberChooser(LOCALE_EXTRA_RECORD_BUFSIZE_DMX, &g_settings.recording_bufsize_dmx, true, 1, 25, NULL); ch->setNumberFormat("%d MB"); recordingSettings->addItem(ch); #endif recordingSettings->addItem(GenericMenuSeparatorLine); //timeshift CMenuWidget recordingTsSettings(LOCALE_MAINSETTINGS_RECORDING, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_RECORDSETUP_TIMESHIFT); showRecordTimeShiftSetup(&recordingTsSettings); mf = new CMenuForwarder(LOCALE_RECORDINGMENU_TIMESHIFT, true, NULL, &recordingTsSettings, NULL, CRCInput::RC_green); mf->setHint("", LOCALE_MENU_HINT_RECORD_TIMESHIFT); recordingSettings->addItem(mf); //timersettings CMenuWidget recordingTimerSettings(LOCALE_MAINSETTINGS_RECORDING, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_RECORDSETUP_TIMERSETTINGS); showRecordTimerSetup(&recordingTimerSettings); mf = new CMenuForwarder(LOCALE_TIMERSETTINGS_SEPARATOR, true, NULL, &recordingTimerSettings, NULL, CRCInput::RC_yellow); mf->setHint("", LOCALE_MENU_HINT_RECORD_TIMER); recordingSettings->addItem(mf); //audiosettings CMenuWidget recordingaAudioSettings(LOCALE_MAINSETTINGS_RECORDING, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_RECORDSETUP_AUDIOSETTINGS); showRecordAudioSetup(&recordingaAudioSettings); mf = new CMenuForwarder(LOCALE_RECORDINGMENU_APIDS, true, NULL, &recordingaAudioSettings, NULL, CRCInput::RC_blue); mf->setHint("", LOCALE_MENU_HINT_RECORD_APIDS); recordingSettings->addItem(mf); //datasettings CMenuWidget recordingaDataSettings(LOCALE_MAINSETTINGS_RECORDING, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_RECORDSETUP_DATASETTINGS); showRecordDataSetup(&recordingaDataSettings); mf = new CMenuForwarder(LOCALE_RECORDINGMENU_DATA_PIDS, true, NULL, &recordingaDataSettings, NULL, CRCInput::RC_2); mf->setHint("", LOCALE_MENU_HINT_RECORD_DATA); recordingSettings->addItem(mf); int res = recordingSettings->exec(NULL, ""); delete recordingSettings; /* activate changes */ CRecordManager::getInstance()->SetDirectory(g_settings.network_nfs_recordingdir); CRecordManager::getInstance()->Config(g_settings.recording_stopsectionsd, g_settings.recording_stream_vtxt_pid, g_settings.recording_stream_pmt_pid, g_settings.recording_stream_subtitle_pids); return res; }
int CAudioSelectMenuHandler::doMenu () { CMenuWidget AudioSelector(LOCALE_AUDIOSELECTMENUE_HEAD, NEUTRINO_ICON_AUDIO, width); CSubtitleChangeExec SubtitleChanger; //show cancel button if configured in usermenu settings if (g_settings.personalize[SNeutrinoSettings::P_UMENU_SHOW_CANCEL]) AudioSelector.addIntroItems(NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, CMenuWidget::BTN_TYPE_CANCEL); else AudioSelector.addItem(GenericMenuSeparator); unsigned int shortcut_num = 1; uint p_count = g_RemoteControl->current_PIDs.APIDs.size(); // -- setup menue due to Audio PIDs for( uint i=0; i < p_count; i++ ) { char apid[5]; sprintf(apid, "%d", i); CMenuForwarder *fw = new CMenuForwarder(g_RemoteControl->current_PIDs.APIDs[i].desc, true, NULL, this, apid, CRCInput::convertDigitToKey(i + 1)); fw->setItemButton(NEUTRINO_ICON_BUTTON_OKAY, true); AudioSelector.addItem(fw, (i == g_RemoteControl->current_PIDs.PIDs.selected_apid)); shortcut_num = i+1; } if (p_count) AudioSelector.addItem(GenericMenuSeparatorLine); // -- setup menue for to Dual Channel Stereo CMenuOptionChooser* oj = new CMenuOptionChooser(LOCALE_AUDIOMENU_ANALOG_MODE, &g_settings.audio_AnalogMode, AUDIOMENU_ANALOGOUT_OPTIONS, AUDIOMENU_ANALOGOUT_OPTION_COUNT, true, audioSetupNotifier, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED); AudioSelector.addItem( oj ); oj = new CMenuOptionChooser(LOCALE_AUDIOMENU_ANALOG_OUT, &g_settings.analog_out, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, audioSetupNotifier, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN); AudioSelector.addItem( oj ); CChannelList *channelList = CNeutrinoApp::getInstance ()->channelList; int curnum = channelList->getActiveChannelNumber(); CZapitChannel * cc = channelList->getChannel(curnum); bool sep_added = false; if(cc) { for (int i = 0 ; i < (int)cc->getSubtitleCount() ; ++i) { CZapitAbsSub* s = cc->getChannelSub(i); if (s->thisSubType == CZapitAbsSub::DVB) { CZapitDVBSub* sd = reinterpret_cast<CZapitDVBSub*>(s); printf("[neutrino] adding DVB subtitle %s pid %x\n", sd->ISO639_language_code.c_str(), sd->pId); if(!sep_added) { sep_added = true; AudioSelector.addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_SUBTITLES_HEAD)); } char spid[10]; snprintf(spid,sizeof(spid), "DVB:%d", sd->pId); char item[64]; snprintf(item,sizeof(item), "DVB: %s (pid %x)", sd->ISO639_language_code.c_str(), sd->pId); AudioSelector.addItem(new CMenuForwarder(item /*sd->ISO639_language_code.c_str()*/, sd->pId != dvbsub_getpid(), NULL, &SubtitleChanger, spid, CRCInput::convertDigitToKey(++shortcut_num))); } if (s->thisSubType == CZapitAbsSub::TTX) { CZapitTTXSub* sd = reinterpret_cast<CZapitTTXSub*>(s); printf("[neutrino] adding TTX subtitle %s pid %x mag %X page %x\n", sd->ISO639_language_code.c_str(), sd->pId, sd->teletext_magazine_number, sd->teletext_page_number); if(!sep_added) { sep_added = true; AudioSelector.addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_SUBTITLES_HEAD)); } char spid[64]; int page = ((sd->teletext_magazine_number & 0xFF) << 8) | sd->teletext_page_number; int pid = sd->pId; snprintf(spid,sizeof(spid), "TTX:%d:%03X:%s", sd->pId, page, sd->ISO639_language_code.c_str()); char item[64]; snprintf(item,sizeof(item), "TTX: %s (pid %x page %03X)", sd->ISO639_language_code.c_str(), sd->pId, page); AudioSelector.addItem(new CMenuForwarder(item /*sd->ISO639_language_code.c_str()*/, !tuxtx_subtitle_running(&pid, &page, NULL), NULL, &SubtitleChanger, spid, CRCInput::convertDigitToKey(++shortcut_num))); } } if(sep_added) { CMenuForwarder * item = new CMenuForwarder(LOCALE_SUBTITLES_STOP, true, NULL, &SubtitleChanger, "off", CRCInput::RC_stop); item->setItemButton(NEUTRINO_ICON_BUTTON_STOP, false); AudioSelector.addItem(item); } } AudioSelector.addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_AUDIOMENU_VOLUME_ADJUST)); /* setting volume percent to zapit with channel_id/apid = 0 means current channel and pid */ CVolume::getInstance()->SetCurrentChannel(0); CVolume::getInstance()->SetCurrentPid(0); int percent[p_count]; for (uint i=0; i < p_count; i++) { percent[i] = CZapit::getInstance()->GetPidVolume(0, g_RemoteControl->current_PIDs.APIDs[i].pid); AudioSelector.addItem(new CMenuOptionNumberChooser(g_RemoteControl->current_PIDs.APIDs[i].desc, &percent[i], i == g_RemoteControl->current_PIDs.PIDs.selected_apid, 0, 999, CVolume::getInstance())); } return AudioSelector.exec(NULL, ""); }
int CVfdSetup::showSetup() { CMenuWidget *vfds = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_LCD, width, MN_WIDGET_ID_VFDSETUP); vfds->addIntroItems(LOCALE_LCDMENU_HEAD); CMenuForwarder * mf; #ifndef HAVE_DUCKBOX_HARDWARE //led menu if (cs_get_revision() > 7) // not HD1 and BSE { CMenuWidget * ledMenu = new CMenuWidget(LOCALE_LCDMENU_HEAD, NEUTRINO_ICON_LCD, width, MN_WIDGET_ID_VFDSETUP_LED_SETUP); showLedSetup(ledMenu); mf = new CMenuDForwarder(LOCALE_LEDCONTROLER_MENU, true, NULL, ledMenu, NULL, CRCInput::RC_red); mf->setHint("", LOCALE_MENU_HINT_POWER_LEDS); vfds->addItem(mf); } #endif //if (g_info.hw_caps->can_set_display_brightness) if (CVFD::getInstance()->has_lcd) //j00zek: j00ztrino is cross platform and has different mechanism. Do NOT change it. { //vfd brightness menu if (CVFD::getInstance()->supports_brightness) { mf = new CMenuForwarder(LOCALE_LCDMENU_LCDCONTROLER, vfd_enabled, NULL, this, "brightness", CRCInput::RC_green); mf->setHint("", LOCALE_MENU_HINT_VFD_BRIGHTNESS_SETUP); vfds->addItem(mf); } if (cs_get_revision() == 9) // Tank only { //backlight menu CMenuWidget * blMenu = new CMenuWidget(LOCALE_LCDMENU_HEAD, NEUTRINO_ICON_LCD, width, MN_WIDGET_ID_VFDSETUP_BACKLIGHT); showBacklightSetup(blMenu); mf = new CMenuDForwarder(LOCALE_LEDCONTROLER_BACKLIGHT, true, NULL, blMenu, NULL, CRCInput::RC_yellow); mf->setHint("", LOCALE_MENU_HINT_BACKLIGHT); vfds->addItem(mf); } vfds->addItem(GenericMenuSeparatorLine); //status and info line options CMenuOptionChooser* oj = new CMenuOptionChooser(LOCALE_LCDMENU_STATUSLINE, &g_settings.lcd_setting[SNeutrinoSettings::LCD_SHOW_VOLUME], LCDMENU_STATUSLINE_OPTIONS, LCDMENU_STATUSLINE_OPTION_COUNT, vfd_enabled); oj->setHint("", LOCALE_MENU_HINT_VFD_STATUSLINE); CMenuOptionChooser* lcd_clock_channelname_menu = new CMenuOptionChooser(LOCALE_LCD_INFO_LINE, &g_settings.lcd_info_line, LCD_INFO_OPTIONS, LCD_INFO_OPTION_COUNT, vfd_enabled); lcd_clock_channelname_menu->setHint("", LOCALE_MENU_HINT_VFD_INFOLINE); vfds->addItem(oj); vfds->addItem(lcd_clock_channelname_menu); #if HAVE_DUCKBOX_HARDWARE //scroll items on vfd if (g_settings.lcd_vfd_size > 4) vfds->addItem(new CMenuOptionNumberChooser(LOCALE_LCDMENU_VFD_SCROLL, &g_settings.lcd_vfd_scroll, true, 0, 999, this, 0, 0, NONEXISTANT_LOCALE, true)); else vfds->addItem(new CMenuOptionNumberChooser(LOCALE_LCDMENU_VFD_SCROLL, &g_settings.lcd_vfd_scroll, true, 0, 999, this, 0, 0, NONEXISTANT_LOCALE, false)); if (g_settings.lcd_vfd_size >= 4) { //vfd format in standby vfds->addItem(new CMenuOptionChooser(LOCALE_J00ZEK_VFD_TIME_FORMAT, &g_settings.lcd_vfd_time_format, OPTIONS_LCD_TIME_FORMAT, OPTIONS_LCD_TIME_FORMAT_COUNT, true)); //vfd mrygajacy dwukropek vfds->addItem(new CMenuOptionChooser(LOCALE_J00ZEK_VFD_TIME_BLINKING_DOT, &g_settings.lcd_vfd_time_blinking_dot, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, vfd_enabled)); } //recicon CMenuOptionChooser* ri = new CMenuOptionChooser(LOCALE_J00ZEK_VFD_RECICON, &g_settings.lcd_vfd_recicon, LCDMENU_RECICON_OPTIONS, LCDMENU_RECICON_OPTION_COUNT, true); ri->setHint("", LOCALE_J00ZEK_VFD_RECICON_HINT); vfds->addItem(ri); //vfd LED in standby vfds->addItem(new CMenuOptionChooser(LOCALE_J00ZEK_VFD_LED_IN_STANDBY, &g_settings.lcd_vfd_led_in_standby, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, vfd_enabled)); #elif HAVE_SPARK_HARDWARE vfds->addItem(new CMenuOptionNumberChooser(LOCALE_LCDMENU_VFD_SCROLL, &g_settings.lcd_vfd_scroll, (g_info.hw_caps->display_type == HW_DISPLAY_LINE_TEXT), 0, 999, this, 0, 0, NONEXISTANT_LOCALE, true)); #else oj = new CMenuOptionChooser(LOCALE_LCDMENU_SCROLL, &g_settings.lcd_scroll, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, vfd_enabled); oj->setHint("", LOCALE_MENU_HINT_VFD_SCROLL); vfds->addItem(oj); #endif oj = new CMenuOptionChooser(LOCALE_LCDMENU_NOTIFY_RCLOCK, &g_settings.lcd_notify_rclock, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, vfd_enabled); oj->setHint("", LOCALE_MENU_HINT_VFD_NOTIFY_RCLOCK); vfds->addItem(oj); } #ifdef ENABLE_GRAPHLCD vfds->addItem(GenericMenuSeparatorLine); GLCD_Menu glcdMenu; vfds->addItem(new CMenuForwarder(LOCALE_GLCD_HEAD, true, NULL, &glcdMenu, NULL, CRCInput::RC_blue)); #endif int res = vfds->exec(NULL, ""); delete vfds; return res; }
/* service menu*/ void CNeutrinoApp::InitMenuService() { dprintf(DEBUG_DEBUG, "init service menu...\n"); //CMenuWidget &menu = personalize.getWidget(MENU_SERVICE); // Dynamic renumbering personalize.setShortcut(); // back button, no personalized personalize.addIntroItems(MENU_SERVICE); //1st section*************************************************************************************************** CMenuForwarder * mf; // tuner setup if(CFEManager::getInstance()->haveSat() || CFEManager::getInstance()->getFrontendCount() > 1) { mf = new CMenuForwarder(LOCALE_SATSETUP_FE_SETUP, true, NULL, CScanSetup::getInstance(), "setup_frontend", CRCInput::RC_red); mf->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_SCAN_FESETUP); personalize.addItem(MENU_SERVICE, mf, &g_settings.personalize[SNeutrinoSettings::P_MSER_TUNER]); } // channel scan mf = new CMenuForwarder(LOCALE_SERVICEMENU_SCANTS , true, NULL, CScanSetup::getInstance(), "", CRCInput::RC_green); mf->setHint(NEUTRINO_ICON_HINT_SERVICE_SCAN, LOCALE_MENU_HINT_SERVICE_SCAN); personalize.addItem(MENU_SERVICE, mf, &g_settings.personalize[SNeutrinoSettings::P_MSER_SCANTS], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, NULL, DCOND_MODE_TS); if (!g_settings.easymenu) { //reload channels mf = new CMenuForwarder(LOCALE_SERVICEMENU_RELOAD , true, NULL, CScanSetup::getInstance(), "reloadchannels", CRCInput::RC_yellow); mf->setHint(NEUTRINO_ICON_HINT_RELOAD_CHANNELS, LOCALE_MENU_HINT_RELOAD_CHANNELS); personalize.addItem(MENU_SERVICE, mf, &g_settings.personalize[SNeutrinoSettings::P_MSER_RELOAD_CHANNELS]); } //bouquet edit // TODO: this needs a neutrino restart after changing parentallock_prompt to activate :-( if (!g_settings.easymenu) { CLockedMenuForwarder *lf; lf = new CLockedMenuForwarder(LOCALE_BOUQUETEDITOR_NAME, g_settings.parentallock_pincode, g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_CHANGETOLOCKED, true, NULL, new CBEBouquetWidget(), NULL, CRCInput::RC_blue); /* does not work with CLockedMenuForwarder yet? lf->setHint(NEUTRINO_ICON_HINT_BEDIT, LOCALE_MENU_HINT_BEDIT); */ personalize.addItem(MENU_SERVICE, lf, &g_settings.personalize[SNeutrinoSettings::P_MSER_BOUQUET_EDIT]); } //channel reset CDataResetNotifier *resetNotifier = new CDataResetNotifier(); if (g_settings.easymenu) mf = new CMenuForwarder(LOCALE_RESET_CHANNELS , true, NULL, resetNotifier, "channels", CRCInput::RC_yellow); else mf = new CMenuForwarder(LOCALE_RESET_CHANNELS , true, NULL, resetNotifier, "channels"); mf->setHint(NEUTRINO_ICON_HINT_DELETE_CHANNELS, LOCALE_MENU_HINT_DELETE_CHANNELS); personalize.addItem(MENU_SERVICE, mf, &g_settings.personalize[SNeutrinoSettings::P_MSER_RESET_CHANNELS]); if (!g_settings.easymenu) { /* todo: only show if (g_settings.make_removed_list) */ mf = new CMenuForwarder(LOCALE_RESET_REMOVED, true, NULL, resetNotifier, "delete_removed"); mf->setHint(NEUTRINO_ICON_HINT_DELETE_CHANNELS, LOCALE_MENU_HINT_DELETE_REMOVED); personalize.addItem(MENU_SERVICE, mf, &g_settings.personalize[SNeutrinoSettings::P_MSER_RESET_CHANNELS]); } //separator personalize.addSeparator(MENU_SERVICE); if (!g_settings.easymenu) { personalize.addSeparator(MENU_SERVICE); //restart neutrino mf = new CMenuForwarder(LOCALE_SERVICEMENU_RESTART , true, NULL, this, "restart", CRCInput::RC_standby); mf->setHint(NEUTRINO_ICON_HINT_SOFT_RESTART, LOCALE_MENU_HINT_SOFT_RESTART); personalize.addItem(MENU_SERVICE, mf, &g_settings.personalize[SNeutrinoSettings::P_MSER_RESTART]); //reload plugins mf = new CMenuForwarder(LOCALE_SERVICEMENU_GETPLUGINS, true, NULL, this, "reloadplugins"); mf->setHint(NEUTRINO_ICON_HINT_RELOAD_CHANNELS, LOCALE_MENU_HINT_RELOAD_PLUGINS); personalize.addItem(MENU_SERVICE, mf, &g_settings.personalize[SNeutrinoSettings::P_MSER_RELOAD_PLUGINS]); //separator personalize.addSeparator(MENU_SERVICE); } //2nd section*************************************************************************************************** //infomenu if (!g_settings.easymenu) { mf = new CMenuForwarder(LOCALE_MESSAGEBOX_INFO, true, NULL, new CInfoMenu(), NULL, CRCInput::RC_info); mf->setHint(NEUTRINO_ICON_HINT_INFO, LOCALE_MENU_HINT_INFO); personalize.addItem(MENU_SERVICE, mf, &g_settings.personalize[SNeutrinoSettings::P_MSER_SERVICE_INFOMENU]); } //firmware update if (g_settings.easymenu) mf = new CMenuForwarder(LOCALE_SERVICEMENU_UPDATE, true, NULL, new CSoftwareUpdate(), NULL, CRCInput::RC_blue); else mf = new CMenuForwarder(LOCALE_SERVICEMENU_UPDATE, true, NULL, new CSoftwareUpdate()); mf->setHint(NEUTRINO_ICON_HINT_SW_UPDATE, LOCALE_MENU_HINT_SW_UPDATE); personalize.addItem(MENU_SERVICE, mf, &g_settings.personalize[SNeutrinoSettings::P_MSER_SOFTUPDATE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, NULL, DCOND_MODE_TS); }
//settings menue void CNeutrinoApp::InitMenuSettings() { dprintf(DEBUG_DEBUG, "init settings menue...\n"); //CMenuWidget &menu = personalize.getWidget(MENU_SETTINGS); // Dynamic renumbering personalize.setShortcut(); // back button, no personalized personalize.addIntroItems(MENU_SETTINGS); static int show = CPersonalizeGui::PERSONALIZE_MODE_VISIBLE; //*************************************************************************************************** // save CMenuForwarder * mf; if (!g_settings.easymenu) { mf = new CMenuForwarder(LOCALE_MAINSETTINGS_SAVESETTINGSNOW, true, NULL, this, "savesettings", CRCInput::RC_red); mf->setHint(NEUTRINO_ICON_HINT_SAVE_SETTINGS, LOCALE_MENU_HINT_SAVE_SETTINGS); personalize.addItem(MENU_SETTINGS, mf, &show, false, CPersonalizeGui::PERSONALIZE_SHOW_NO); } // settings manager if (g_settings.easymenu) { mf = new CMenuForwarder(LOCALE_MAINSETTINGS_MANAGE, true, NULL, new CSettingsManager(), NULL, CRCInput::RC_red); personalize.addItem(MENU_SETTINGS, mf, &g_settings.personalize[SNeutrinoSettings::P_MSET_SETTINGS_MANAGER]); } else { mf = new CMenuForwarder(LOCALE_MAINSETTINGS_MANAGE, true, NULL, new CSettingsManager(), NULL, CRCInput::RC_green); personalize.addItem(MENU_SETTINGS, mf, &g_settings.personalize[SNeutrinoSettings::P_MSET_SETTINGS_MANAGER], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ACCESS_OPTION); } mf->setHint(NEUTRINO_ICON_HINT_MANAGE_SETTINGS, LOCALE_MENU_HINT_MANAGE_SETTINGS); // personalize if (!g_settings.easymenu) { mf = new CMenuForwarder(LOCALE_PERSONALIZE_HEAD, true, NULL, &personalize, NULL, CRCInput::RC_yellow, NULL, NEUTRINO_ICON_LOCK); mf->setHint(NEUTRINO_ICON_HINT_PERSONALIZE, LOCALE_MENU_HINT_PERSONALIZE); personalize.addItem(MENU_SETTINGS, mf, &show, false, CPersonalizeGui::PERSONALIZE_SHOW_NO); } // miscSettings if (!g_settings.easymenu) { mf = new CMenuForwarder(LOCALE_MAINSETTINGS_MISC, true, NULL, new CMiscMenue() , NULL, CRCInput::RC_blue); mf->setHint(NEUTRINO_ICON_HINT_EXTENDED, LOCALE_MENU_HINT_EXTENDED); personalize.addItem(MENU_SETTINGS, mf, &g_settings.personalize[SNeutrinoSettings::P_MSET_MISC]); //separator personalize.addSeparator(MENU_SETTINGS); } //1st section*************************************************************************************************** //use only 10 shortcuts (1-9, 0), >9 means -> no shortcut // video. if (g_settings.easymenu) mf = new CMenuForwarder(LOCALE_MAINSETTINGS_VIDEO, true, NULL, g_videoSettings, NULL, CRCInput::RC_green); else mf = new CMenuForwarder(LOCALE_MAINSETTINGS_VIDEO, true, NULL, g_videoSettings); mf->setHint(NEUTRINO_ICON_HINT_VIDEO, LOCALE_MENU_HINT_VIDEO); personalize.addItem(MENU_SETTINGS, mf, &g_settings.personalize[SNeutrinoSettings::P_MSET_VIDEO]); // audio if (g_settings.easymenu) mf = new CMenuForwarder(LOCALE_MAINSETTINGS_AUDIO, true, NULL, new CAudioSetup(), NULL, CRCInput::RC_yellow); else mf = new CMenuForwarder(LOCALE_MAINSETTINGS_AUDIO, true, NULL, new CAudioSetup()); mf->setHint(NEUTRINO_ICON_HINT_AUDIO, LOCALE_MENU_HINT_AUDIO); personalize.addItem(MENU_SETTINGS, mf, &g_settings.personalize[SNeutrinoSettings::P_MSET_AUDIO]); // channel list if (g_settings.easymenu) { mf = new CMenuForwarder(LOCALE_MISCSETTINGS_CHANNELLIST, true, NULL, new CMiscMenue(), "channellist", CRCInput::RC_blue); mf->setHint("", LOCALE_MENU_HINT_MISC_CHANNELLIST); personalize.addItem(MENU_SETTINGS, mf, &g_settings.personalize[SNeutrinoSettings::P_MSET_MISC]); } // parental lock mf = new CMenuForwarder(LOCALE_PARENTALLOCK_PARENTALLOCK, true, NULL, new CParentalSetup()); mf->setHint(NEUTRINO_ICON_HINT_PROTECTION, LOCALE_MENU_HINT_PROTECTION); personalize.addItem(MENU_SETTINGS, mf, &show, false, CPersonalizeGui::PERSONALIZE_SHOW_NO); // network mf = new CMenuForwarder(LOCALE_MAINSETTINGS_NETWORK, true, NULL, CNetworkSetup::getInstance()); mf->setHint(NEUTRINO_ICON_HINT_NETWORK, LOCALE_MENU_HINT_NETWORK); personalize.addItem(MENU_SETTINGS, mf, &g_settings.personalize[SNeutrinoSettings::P_MSET_NETWORK]); // record settings if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) { mf = new CMenuForwarder(LOCALE_MAINSETTINGS_RECORDING, true, NULL, new CRecordSetup()); mf->setHint(NEUTRINO_ICON_HINT_RECORDING, LOCALE_MENU_HINT_RECORDING); personalize.addItem(MENU_SETTINGS, mf, &g_settings.personalize[SNeutrinoSettings::P_MSET_RECORDING]); } // osdlang mf = new CMenuForwarder(LOCALE_MAINSETTINGS_LANGUAGE, true, NULL, new COsdLangSetup()); mf->setHint(NEUTRINO_ICON_HINT_LANGUAGE, LOCALE_MENU_HINT_LANGUAGE); personalize.addItem(MENU_SETTINGS, mf, &g_settings.personalize[SNeutrinoSettings::P_MSET_OSDLANG]); // osd if (!g_settings.easymenu) { mf = new CMenuForwarder(LOCALE_MAINSETTINGS_OSD, true, NULL, new COsdSetup()); mf->setHint(NEUTRINO_ICON_HINT_OSD, LOCALE_MENU_HINT_OSD); personalize.addItem(MENU_SETTINGS, mf, &g_settings.personalize[SNeutrinoSettings::P_MSET_OSD]); } // lcd mf = new CMenuForwarder(LOCALE_MAINSETTINGS_LCD, true, NULL, new CVfdSetup()); mf->setHint(NEUTRINO_ICON_HINT_VFD, LOCALE_MENU_HINT_VFD); personalize.addItem(MENU_SETTINGS, mf, &g_settings.personalize[SNeutrinoSettings::P_MSET_VFD]); // drive settings if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) { mf = new CMenuForwarder(LOCALE_HDD_SETTINGS, true, NULL, CHDDMenuHandler::getInstance()); mf->setHint(NEUTRINO_ICON_HINT_HDD, LOCALE_MENU_HINT_HDD); personalize.addItem(MENU_SETTINGS, mf, &g_settings.personalize[SNeutrinoSettings::P_MSET_DRIVES]); } // energy if (g_settings.easymenu) { mf = new CMenuForwarder(LOCALE_MISCSETTINGS_ENERGY, true, NULL, new CMiscMenue(), "energy"); mf->setHint("", LOCALE_MENU_HINT_MISC_ENERGY); personalize.addItem(MENU_SETTINGS, mf, &g_settings.personalize[SNeutrinoSettings::P_MSET_MISC]); } if (!g_settings.easymenu) { // cisettings mf = new CMenuForwarder(LOCALE_CI_SETTINGS, true, NULL, g_CamHandler); mf->setHint(NEUTRINO_ICON_HINT_CI, LOCALE_MENU_HINT_CI); personalize.addItem(MENU_SETTINGS, mf, &g_settings.personalize[SNeutrinoSettings::P_MSET_CISETTINGS]); // keybindings mf = new CMenuForwarder(LOCALE_MAINSETTINGS_KEYBINDING, true, NULL, new CKeybindSetup()); mf->setHint(NEUTRINO_ICON_HINT_KEYS, LOCALE_MENU_HINT_KEYS); personalize.addItem(MENU_SETTINGS, mf, &g_settings.personalize[SNeutrinoSettings::P_MSET_KEYBINDING]); // multimedia settings mf = new CMenuForwarder(LOCALE_MAINSETTINGS_MULTIMEDIA, true, NULL, new CMediaPlayerSetup()); mf->setHint(NEUTRINO_ICON_HINT_A_PIC, LOCALE_MENU_HINT_A_PIC); personalize.addItem(MENU_SETTINGS, mf, &g_settings.personalize[SNeutrinoSettings::P_MSET_MEDIAPLAYER]); } }
//init main menu void CNeutrinoApp::InitMenuMain() { dprintf(DEBUG_DEBUG, "init mainmenue\n"); // Dynamic renumbering personalize.setShortcut(); CMenuWidget &menu = personalize.getWidget(MENU_MAIN); menu.addKey(CRCInput::RC_stop, this, "easyswitch"); //top personalize.addItem(MENU_MAIN, GenericMenuSeparator, NULL, false, CPersonalizeGui::PERSONALIZE_SHOW_NO); //1st section*************************************************************************************************** if (g_settings.easymenu) { if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) { CMenuForwarder *mb = new CMenuForwarder(LOCALE_MOVIEBROWSER_HEAD, true, NULL, CMediaPlayerMenu::getInstance(), "movieplayer", CRCInput::RC_red); mb->setHint(NEUTRINO_ICON_HINT_MB, LOCALE_MENU_HINT_MB); personalize.addItem(MENU_MAIN, mb, &g_settings.personalize[SNeutrinoSettings::P_MPLAYER_MBROWSER], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, NULL, DCOND_MODE_TS); } #if 0 CMenuForwarder *cl = new CMenuForwarder(LOCALE_MAINMENU_CHANNELS, true, NULL, this, "channels", CRCInput::RC_green); cl->setHint(NEUTRINO_ICON_HINT_TVMODE, LOCALE_MENU_HINT_CHANNELS); personalize.addItem(MENU_MAIN, cl); #endif CMenuForwarder * mf = new CMenuForwarder(LOCALE_BOUQUETEDITOR_NAME , true, NULL, new CBEBouquetWidget(), NULL, CRCInput::RC_green); mf->setHint(NEUTRINO_ICON_HINT_BEDIT, LOCALE_MENU_HINT_BEDIT); personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MSER_BOUQUET_EDIT], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ACCESS_OPTION); } else { //tv <-> radio toggle CMenuForwarder *tvradio_switch = new CMenuForwarder(LOCALE_MAINMENU_TVRADIO_SWITCH, true, NULL, this, "tv_radio_switch", CRCInput::RC_red); tvradio_switch->setHint(NEUTRINO_ICON_HINT_TVRADIO_SWITCH, LOCALE_MENU_HINT_TVRADIO_SWITCH); personalize.addItem(MENU_MAIN, tvradio_switch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TV_RADIO_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, NULL, DCOND_MODE_TS); //tv-mode CMenuForwarder *tvswitch = new CMenuForwarder(LOCALE_MAINMENU_TVMODE, true, NULL, this, "tv", CRCInput::RC_red); tvswitch->setHint(NEUTRINO_ICON_HINT_TVMODE, LOCALE_MENU_HINT_TVMODE); personalize.addItem(MENU_MAIN, tvswitch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TV_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, tvradio_switch, DCOND_MODE_TV | DCOND_MODE_TS); //observed //radio-mode CMenuForwarder *radioswitch = new CMenuForwarder(LOCALE_MAINMENU_RADIOMODE, true, NULL, this, "radio", CRCInput::RC_green); radioswitch->setHint(NEUTRINO_ICON_HINT_RADIOMODE, LOCALE_MENU_HINT_RADIOMODE); personalize.addItem(MENU_MAIN, radioswitch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_RADIO_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, tvradio_switch, DCOND_MODE_RADIO | DCOND_MODE_TS); //observed } //timer CMenuForwarder *timerlist = new CMenuForwarder(LOCALE_TIMERLIST_NAME, true, NULL, new CTimerList(), NULL, CRCInput::RC_yellow); timerlist->setHint(NEUTRINO_ICON_HINT_TIMERS, LOCALE_MENU_HINT_TIMERS); personalize.addItem(MENU_MAIN, timerlist, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TIMER]); //multimedia menu CMenuForwarder *media = new CMenuForwarder(LOCALE_MAINMENU_MEDIA, true, NULL, CMediaPlayerMenu::getInstance(), NULL, CRCInput::RC_blue); media->setHint(NEUTRINO_ICON_HINT_MEDIA, LOCALE_MENU_HINT_MEDIA); if (g_settings.easymenu) personalize.addItem(MENU_MAIN, media, &g_settings.personalize[SNeutrinoSettings::P_MAIN_MEDIA], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ACCESS_OPTION); else personalize.addItem(MENU_MAIN, media, &g_settings.personalize[SNeutrinoSettings::P_MAIN_MEDIA]); CMenuForwarder * mf; if (!g_settings.easymenu) { //games bool show_games = g_PluginList->hasPlugin(CPlugins::P_TYPE_GAME); mf = new CMenuForwarder(LOCALE_MAINMENU_GAMES, show_games, NULL, new CPluginList(LOCALE_MAINMENU_GAMES,CPlugins::P_TYPE_GAME)); mf->setHint(NEUTRINO_ICON_HINT_GAMES, LOCALE_MENU_HINT_GAMES); personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_GAMES]); #if 0 //tools bool show_tools = g_PluginList->hasPlugin(CPlugins::P_TYPE_TOOL); mf = new CMenuForwarder(LOCALE_MAINMENU_TOOLS, show_tools, NULL, new CPluginList(LOCALE_MAINMENU_TOOLS,CPlugins::P_TYPE_TOOL)); mf->setHint(NEUTRINO_ICON_HINT_SCRIPTS, LOCALE_MENU_HINT_TOOLS); personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TOOLS]); //scripts bool show_scripts = g_PluginList->hasPlugin(CPlugins::P_TYPE_SCRIPT); mf = new CMenuForwarder(LOCALE_MAINMENU_SCRIPTS, show_scripts, NULL, new CPluginList(LOCALE_MAINMENU_SCRIPTS,CPlugins::P_TYPE_SCRIPT)); mf->setHint(NEUTRINO_ICON_HINT_SCRIPTS, LOCALE_MENU_HINT_SCRIPTS); personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_SCRIPTS]); //lua bool show_lua = g_PluginList->hasPlugin(CPlugins::P_TYPE_LUA); mf = new CMenuForwarder(LOCALE_MAINMENU_LUA, show_lua, NULL, new CPluginList(LOCALE_MAINMENU_LUA,CPlugins::P_TYPE_LUA)); mf->setHint(NEUTRINO_ICON_HINT_SCRIPTS, LOCALE_MENU_HINT_LUA); personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_LUA]); #else bool show_plugins = g_PluginList->hasPlugin(CPlugins::P_TYPE_NO_GAME); mf = new CMenuForwarder(LOCALE_MAINMENU_LUA, show_plugins, NULL, new CPluginList(LOCALE_MAINMENU_LUA, CPlugins::P_TYPE_NO_GAME)); mf->setHint(NEUTRINO_ICON_HINT_SCRIPTS, LOCALE_MENU_HINT_LUA); personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_LUA]); #endif } //separator personalize.addSeparator(MENU_MAIN); //2nd section*************************************************************************************************** // settings, also as pin protected option in personalize menu, as a result of parameter value CPersonalizeGui::PERSONALIZE_SHOW_AS_ACCESS_OPTION mf = new CMenuForwarder(LOCALE_MAINMENU_SETTINGS, true, NULL, &personalize.getWidget(MENU_SETTINGS)); mf->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_SETTINGS); personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_SETTINGS], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ACCESS_OPTION); // service, also as pin protected option in personalize menu, as a result of parameter value CPersonalizeGui::PERSONALIZE_SHOW_AS_ACCESS_OPTION mf = new CMenuForwarder(LOCALE_MAINMENU_SERVICE, true, NULL, &personalize.getWidget(MENU_SERVICE)); mf->setHint(NEUTRINO_ICON_HINT_SERVICE, LOCALE_MENU_HINT_SERVICE); personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_SERVICE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ACCESS_OPTION); //separator personalize.addSeparator(MENU_MAIN); //3rd section*************************************************************************************************** if (!g_settings.easymenu) { //10. -- only 10 shortcuts (1-9, 0), the next could be the last also!(10. => 0) //sleeptimer mf = new CMenuForwarder(LOCALE_MAINMENU_SLEEPTIMER, true, NULL, new CSleepTimerWidget); mf->setHint(NEUTRINO_ICON_HINT_SLEEPTIMER, LOCALE_MENU_HINT_SLEEPTIMER); personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_SLEEPTIMER]); //reboot mf = new CMenuForwarder(LOCALE_MAINMENU_REBOOT, true, NULL, this, "reboot"); mf->setHint(NEUTRINO_ICON_HINT_REBOOT, LOCALE_MENU_HINT_REBOOT); personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_REBOOT]); //shutdown if (g_info.hw_caps->can_shutdown) { mf = new CMenuForwarder(LOCALE_MAINMENU_SHUTDOWN, true, NULL, this, "shutdown", CRCInput::RC_standby); mf->setHint(NEUTRINO_ICON_HINT_SHUTDOWN, LOCALE_MENU_HINT_SHUTDOWN); personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_SHUTDOWN]); } } //separator personalize.addSeparator(MENU_MAIN); //4th section*************************************************************************************************** //infomenu mf = new CMenuForwarder(LOCALE_MESSAGEBOX_INFO, true, NULL, new CInfoMenu(), NULL, CRCInput::RC_info); mf->setHint(NEUTRINO_ICON_HINT_INFO, LOCALE_MENU_HINT_INFO); personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_INFOMENU]); //cisettings if (!g_settings.easymenu && (cCA::GetInstance()->GetNumberCISlots() > 0 || cCA::GetInstance()->GetNumberSmartCardSlots() > 0)) { mf = new CMenuForwarder(LOCALE_CI_SETTINGS, true, NULL, g_CamHandler); mf->setHint(NEUTRINO_ICON_HINT_CI, LOCALE_MENU_HINT_CI); personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_CISETTINGS]); } if (g_settings.easymenu) { personalize.addIntroItems(MENU_SHUTDOWN); mf = new CMenuForwarder(LOCALE_MAINMENU_SHUTDOWN_MENU, true, NULL, &personalize.getWidget(MENU_SHUTDOWN), NULL, CRCInput::RC_standby); mf->setHint(NEUTRINO_ICON_HINT_SHUTDOWN, LOCALE_MENU_HINT_SHUTDOWN_MENU); personalize.addItem(MENU_MAIN, mf); // standby mf = new CMenuForwarder(LOCALE_MAINMENU_STANDBY, true, NULL, this, "standby", CRCInput::RC_red); mf->setHint(NEUTRINO_ICON_HINT_SLEEPTIMER, LOCALE_MENU_HINT_STANDBY); personalize.addItem(MENU_SHUTDOWN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_STANDBY]); //sleeptimer mf = new CMenuForwarder(LOCALE_MAINMENU_SLEEPTIMER, true, NULL, new CSleepTimerWidget, NULL, CRCInput::RC_green); mf->setHint(NEUTRINO_ICON_HINT_SLEEPTIMER, LOCALE_MENU_HINT_SLEEPTIMER); personalize.addItem(MENU_SHUTDOWN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_SLEEPTIMER]); //reboot mf = new CMenuForwarder(LOCALE_MAINMENU_REBOOT, true, NULL, this, "reboot", CRCInput::RC_yellow); mf->setHint(NEUTRINO_ICON_HINT_REBOOT, LOCALE_MENU_HINT_REBOOT); personalize.addItem(MENU_SHUTDOWN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_REBOOT]); //shutdown if (g_info.hw_caps->can_shutdown) { mf = new CMenuForwarder(LOCALE_MAINMENU_SHUTDOWN, true, NULL, this, "shutdown", CRCInput::RC_blue); mf->setHint(NEUTRINO_ICON_HINT_SHUTDOWN, LOCALE_MENU_HINT_SHUTDOWN); personalize.addItem(MENU_SHUTDOWN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_SHUTDOWN]); } } #ifdef ENABLE_TESTING personalize.addItem(MENU_MAIN, new CMenuForwarder("Test menu", true, NULL, new CTestMenu()), NULL, false, CPersonalizeGui::PERSONALIZE_SHOW_NO); #endif }
int CProgressbarSetup::showMenu() { CMenuWidget m(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_OSDSETUP_PROGRESSBAR); m.addIntroItems(LOCALE_MISCSETTINGS_PROGRESSBAR /*, LOCALE_MISCSETTINGS_GENERAL*/); // general progress bar design CMenuOptionChooser *mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_PROGRESSBAR_DESIGN_LONG, &g_settings.progressbar_design, PROGRESSBAR_COLOR_OPTIONS + 1, PROGRESSBAR_COLOR_OPTION_COUNT - 1, true, this); mc->setHint("", LOCALE_MENU_HINT_PROGRESSBAR_COLOR); m.addItem(mc); // progress bar gradient mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_PROGRESSBAR_GRADIENT, &g_settings.progressbar_gradient, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this); mc->setHint("", LOCALE_MENU_HINT_PROGRESSBAR_GRADIENT); m.addItem(mc); // preview CMenuProgressbar *mb = new CMenuProgressbar(LOCALE_MISCSETTINGS_PROGRESSBAR_PREVIEW); mb->setHint("", LOCALE_MENU_HINT_PROGRESSBAR_PREVIEW); m.addItem(mb); m.addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_MISCSETTINGS_PROGRESSBAR_TIMESCALE)); CMenuOptionNumberChooser *nc; nc = new CMenuOptionNumberChooser(LOCALE_MISCSETTINGS_PROGRESSBAR_TIMESCALE_RED, &g_settings.progressbar_timescale_red, true, 0, 100, this); nc->setNumericInput(true); nc->setNumberFormat("%d %%"); nc->setHint("", LOCALE_MENU_HINT_PROGRESSBAR_TIMESCALE_RED); m.addItem(nc); nc = new CMenuOptionNumberChooser(LOCALE_MISCSETTINGS_PROGRESSBAR_TIMESCALE_YELLOW, &g_settings.progressbar_timescale_yellow, true, 0, 100, this); nc->setNumericInput(true); nc->setNumberFormat("%d %%"); nc->setHint("", LOCALE_MENU_HINT_PROGRESSBAR_TIMESCALE_YELLOW); m.addItem(nc); nc = new CMenuOptionNumberChooser(LOCALE_MISCSETTINGS_PROGRESSBAR_TIMESCALE_GREEN, &g_settings.progressbar_timescale_green, true, 0, 100, this); nc->setNumericInput(true); nc->setNumberFormat("%d %%"); nc->setHint("", LOCALE_MENU_HINT_PROGRESSBAR_TIMESCALE_GREEN); m.addItem(nc); mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_PROGRESSBAR_TIMESCALE_INVERT, &g_settings.progressbar_timescale_invert, PROGRESSBAR_TIMESCALE_INVERT_OPTIONS, PROGRESSBAR_TIMESCALE_INVERT_OPTION_COUNT, true, this); mc->setHint("", LOCALE_MENU_HINT_PROGRESSBAR_TIMESCALE_INVERT); m.addItem(mc); mb = new CMenuProgressbar(LOCALE_MISCSETTINGS_PROGRESSBAR_PREVIEW); mb->setHint("", LOCALE_MENU_HINT_PROGRESSBAR_PREVIEW); mb->getScale()->setType(CProgressBar::PB_TIMESCALE); m.addItem(mb); CMenuForwarder* mf = new CMenuForwarder(LOCALE_OPTIONS_DEFAULT, true, NULL, this, "reset", CRCInput::RC_red); mf->setHint("", LOCALE_OPTIONS_HINT_DEFAULT); m.addItem(mf); // extended channel list (progressbars) m.addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_MAINMENU_CHANNELS)); mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_EXTENDED, &g_settings.channellist_progressbar_design, PROGRESSBAR_COLOR_OPTIONS, PROGRESSBAR_COLOR_OPTION_COUNT, true, this); mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_EXTENDED); m.addItem(mc); mb = new CMenuProgressbar(LOCALE_MISCSETTINGS_PROGRESSBAR_PREVIEW); mb->setHint("", LOCALE_MENU_HINT_PROGRESSBAR_PREVIEW); mb->getScale()->setType(CProgressBar::PB_TIMESCALE); mb->getScale()->setDesign(g_settings.channellist_progressbar_design); mb->getScale()->doPaintBg(false); m.addItem(mb); return m.exec(NULL, ""); }