void CRecordSetup::showRecordTimeShiftSetup(CMenuWidget *menu_ts) { menu_ts->addIntroItems(LOCALE_RECORDINGMENU_TIMESHIFT); //timeshift dir bool recstatus = CNeutrinoApp::getInstance()->recordingstatus; CMenuForwarder* fTsDir = new CMenuForwarder(LOCALE_RECORDINGMENU_TSDIR, !recstatus, g_settings.timeshiftdir, this, "timeshiftdir"); fTsDir->setHint("", LOCALE_MENU_HINT_RECORD_TDIR); menu_ts->addItem(fTsDir); if (1) //has_hdd { CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_EXTRA_TIMESHIFT_PAUSE, &g_settings.timeshift_pause, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_RECORD_TIMESHIFT_PAUSE); menu_ts->addItem(mc); CMenuOptionNumberChooser * mn = new CMenuOptionNumberChooser(LOCALE_EXTRA_AUTO_TIMESHIFT, &g_settings.auto_timeshift, true, 0, 300, NULL); mn->setHint("", LOCALE_MENU_HINT_RECORD_TIMESHIFT_AUTO); menu_ts->addItem(mn); mc = new CMenuOptionChooser(LOCALE_EXTRA_AUTO_DELETE, &g_settings.auto_delete, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_RECORD_TIMESHIFT_DELETE); menu_ts->addItem(mc); mc = new CMenuOptionChooser(LOCALE_EXTRA_TEMP_TIMESHIFT, &g_settings.temp_timeshift, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_RECORD_TIMESHIFT_TEMP); menu_ts->addItem(mc); //rec hours mn = new CMenuOptionNumberChooser(LOCALE_EXTRA_RECORD_TIME_TS, &g_settings.timeshift_hours, true, 1, 24, NULL); mn->setNumberFormat(std::string("%d ") + g_Locale->getText(LOCALE_UNIT_SHORT_HOUR)); mn->setHint("", LOCALE_MENU_HINT_RECORD_TIME_TS); menu_ts->addItem(mn); } }
void CKeybindSetup::showKeyBindSpecialSetup(CMenuWidget *bindSettings_special) { bindSettings_special->addIntroItems(LOCALE_KEYBINDINGMENU_SPECIAL_ACTIVE); for (int i = NKEY_FORMAT_MODE; i <= NKEY_PIC_SIZE; i++) { CMenuOptionChooser * mf = new CMenuOptionChooser(key_settings[i].keydescription, key_settings[i].keyvalue_p, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); mf->setHint("", key_settings[i].hint); bindSettings_special->addItem(mf); } }
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; //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); } if (CVFD::getInstance()->has_lcd) { //vfd brightness menu 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); 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); } int res = vfds->exec(NULL, ""); delete vfds; return res; }
//channellist int CMiscMenue::showMiscSettingsMenuChanlist() { CMenuWidget * ms_chanlist = new CMenuWidget(LOCALE_MISCSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_MISCSETUP_CHANNELLIST); ms_chanlist->addIntroItems(LOCALE_MISCSETTINGS_CHANNELLIST); bool make_hd_list = g_settings.make_hd_list; bool make_webtv_list = g_settings.make_webtv_list; bool show_empty_favorites = g_settings.show_empty_favorites; CMenuOptionChooser * mc; mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_MAKE_HDLIST , &g_settings.make_hd_list , OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_MAKE_HDLIST); ms_chanlist->addItem(mc); mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_MAKE_WEBTVLIST , &g_settings.make_webtv_list , OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_MAKE_WEBTVLIST); ms_chanlist->addItem(mc); mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_MAKE_NEWLIST, &g_settings.make_new_list , OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_MAKE_NEWLIST); ms_chanlist->addItem(mc); mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_MAKE_REMOVEDLIST, &g_settings.make_removed_list , OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_MAKE_REMOVEDLIST); ms_chanlist->addItem(mc); mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_KEEP_NUMBERS, &g_settings.keep_channel_numbers , OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_KEEP_NUMBERS); ms_chanlist->addItem(mc); mc = new CMenuOptionChooser(LOCALE_EXTRA_ZAP_CYCLE , &g_settings.zap_cycle , OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_ZAP_CYCLE); ms_chanlist->addItem(mc); mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_NEW_ZAP_MODE, &g_settings.channellist_new_zap_mode, CHANNELLIST_NEW_ZAP_MODE_OPTIONS, CHANNELLIST_NEW_ZAP_MODE_OPTION_COUNT, true ); mc->setHint("", LOCALE_MENU_HINT_NEW_ZAP_MODE); ms_chanlist->addItem(mc); mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_NUMERIC_ADJUST, &g_settings.channellist_numeric_adjust, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_NUMERIC_ADJUST); ms_chanlist->addItem(mc); mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_SHOW_EMPTY_FAVS, &g_settings.show_empty_favorites, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_SHOW_EMPTY_FAVS); ms_chanlist->addItem(mc); int res = ms_chanlist->exec(NULL, ""); delete ms_chanlist; if (make_hd_list != g_settings.make_hd_list || make_webtv_list != g_settings.make_webtv_list || show_empty_favorites != g_settings.show_empty_favorites) g_RCInput->postMsg(NeutrinoMessages::EVT_SERVICESCHANGED, 0); return res; }
int CParentalSetup::showParentalSetup() { //menue init CMenuWidget* plock = new CMenuWidget(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_LOCK, width, MN_WIDGET_ID_PLOCKSETUP); //subhead plock->addItem( new CMenuSeparator(CMenuSeparator::ALIGN_LEFT | CMenuSeparator::SUB_HEAD | CMenuSeparator::STRING, LOCALE_PARENTALLOCK_PARENTALLOCK)); // intros plock->addIntroItems(); CMenuForwarder * mf; CPersonalizeGui &p = CNeutrinoApp::getInstance()->getPersonalizeGui(); if (g_settings.easymenu) { mf = new CMenuForwarder(LOCALE_PARENTALLOCK_MENU, true, NULL, &p, NULL, CRCInput::RC_red , NEUTRINO_ICON_BUTTON_RED); mf->setHint("", LOCALE_MENU_HINT_PARENTALLOCK_MENU); plock->addItem(mf); } CMenuOptionChooser * mc; if (g_settings.easymenu) mc = new CMenuOptionChooser(LOCALE_PARENTALLOCK_PROMPT , &g_settings.parentallock_prompt , PARENTALLOCK_PROMPT_OPTIONS, PARENTALLOCK_PROMPT_OPTION_COUNT , !parentallocked, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN); else mc = new CMenuOptionChooser(LOCALE_PARENTALLOCK_PROMPT , &g_settings.parentallock_prompt , PARENTALLOCK_PROMPT_OPTIONS, PARENTALLOCK_PROMPT_OPTION_COUNT , !parentallocked); mc->setHint("", LOCALE_MENU_HINT_PARENTALLOCK_PROMPT); plock->addItem(mc); if (g_settings.easymenu) mc = new CMenuOptionChooser(LOCALE_PARENTALLOCK_LOCKAGE, &g_settings.parentallock_lockage, PARENTALLOCK_LOCKAGE_OPTIONS, PARENTALLOCK_LOCKAGE_OPTION_COUNT, !parentallocked, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW); else mc = new CMenuOptionChooser(LOCALE_PARENTALLOCK_LOCKAGE, &g_settings.parentallock_lockage, PARENTALLOCK_LOCKAGE_OPTIONS, PARENTALLOCK_LOCKAGE_OPTION_COUNT, !parentallocked); mc->setHint("", LOCALE_MENU_HINT_PARENTALLOCK_LOCKAGE); plock->addItem(mc); if (g_settings.easymenu) mc = new CMenuOptionChooser(LOCALE_PARENTALLOCK_BOUQUETMODE, &g_settings.parentallock_defaultlocked, PARENTALLOCK_DEFAULTLOCKED_OPTIONS, PARENTALLOCK_DEFAULTLOCKED_OPTION_COUNT, !parentallocked, NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE); else mc = new CMenuOptionChooser(LOCALE_PARENTALLOCK_BOUQUETMODE, &g_settings.parentallock_defaultlocked, PARENTALLOCK_DEFAULTLOCKED_OPTIONS, PARENTALLOCK_DEFAULTLOCKED_OPTION_COUNT, !parentallocked); plock->addItem(mc); CPINChangeWidget pinChangeWidget(LOCALE_PARENTALLOCK_CHANGEPIN, &g_settings.parentallock_pincode, 4, LOCALE_PARENTALLOCK_CHANGEPIN_HINT1); mf = new CMenuForwarder(LOCALE_PARENTALLOCK_CHANGEPIN, true, g_settings.parentallock_pincode, &pinChangeWidget); mf->setHint("", LOCALE_MENU_HINT_PARENTALLOCK_CHANGEPIN); plock->addItem(mf); int res = plock->exec(NULL, ""); delete plock; return res; }
//energy and shutdown settings int CMiscMenue::showMiscSettingsMenuEnergy() { CMenuWidget *ms_energy = new CMenuWidget(LOCALE_MISCSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_MISCSETUP_ENERGY); ms_energy->addIntroItems(LOCALE_MISCSETTINGS_ENERGY); CMenuOptionChooser *m1 = new CMenuOptionChooser(LOCALE_MISCSETTINGS_SHUTDOWN_REAL_RCDELAY, &g_settings.shutdown_real_rcdelay, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, !g_settings.shutdown_real); m1->setHint("", LOCALE_MENU_HINT_SHUTDOWN_RCDELAY); std::string shutdown_count = to_string(g_settings.shutdown_count); if (shutdown_count.length() < 3) shutdown_count.insert(0, 3 - shutdown_count.length(), ' '); CStringInput * miscSettings_shutdown_count = new CStringInput(LOCALE_MISCSETTINGS_SHUTDOWN_COUNT, &shutdown_count, 3, LOCALE_MISCSETTINGS_SHUTDOWN_COUNT_HINT1, LOCALE_MISCSETTINGS_SHUTDOWN_COUNT_HINT2, "0123456789 "); CMenuForwarder *m2 = new CMenuDForwarder(LOCALE_MISCSETTINGS_SHUTDOWN_COUNT, !g_settings.shutdown_real, shutdown_count, miscSettings_shutdown_count); m2->setHint("", LOCALE_MENU_HINT_SHUTDOWN_COUNT); COnOffNotifier * miscNotifier = new COnOffNotifier(1); miscNotifier->addItem(m1); miscNotifier->addItem(m2); CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_SHUTDOWN_REAL, &g_settings.shutdown_real, OPTIONS_OFF1_ON0_OPTIONS, OPTIONS_OFF1_ON0_OPTION_COUNT, true, miscNotifier); mc->setHint("", LOCALE_MENU_HINT_SHUTDOWN_REAL); ms_energy->addItem(mc); ms_energy->addItem(m1); ms_energy->addItem(m2); m2 = new CMenuDForwarder(LOCALE_MISCSETTINGS_SLEEPTIMER, true, NULL, new CSleepTimerWidget(true)); m2->setHint("", LOCALE_MENU_HINT_INACT_TIMER); ms_energy->addItem(m2); CMenuOptionChooser * m4 = new CMenuOptionChooser(LOCALE_MISCSETTINGS_SLEEPTIMER_MIN, &g_settings.sleeptimer_min, SLEEPTIMER_MIN_OPTIONS, SLEEPTIMER_MIN_OPTION_COUNT, true); m4->setHint("", LOCALE_MENU_HINT_SLEEPTIMER_MIN); ms_energy->addItem(m4); if (g_settings.easymenu) { CMenuOptionChooser *cec_ch = new CMenuOptionChooser(LOCALE_VIDEOMENU_HDMI_CEC, &g_settings.hdmi_cec_mode, VIDEOMENU_HDMI_CEC_MODE_OPTIONS, VIDEOMENU_HDMI_CEC_MODE_OPTION_COUNT, true, this); cec_ch->setHint("", LOCALE_MENU_HINT_CEC_MODE); ms_energy->addItem(cec_ch); } int res = ms_energy->exec(NULL, ""); g_settings.shutdown_count = atoi(shutdown_count.c_str()); delete ms_energy; delete miscNotifier; return res; }
int CZapitSetup::showMenu() { //menue init CMenuWidget *zapit = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_ZAPIT); zapit->addIntroItems(LOCALE_ZAPITSETUP_INFO); COnOffNotifier* miscZapitNotifier = new COnOffNotifier(1); //zapit CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_ZAPITSETUP_LAST_USE, &g_settings.uselastchannel, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, miscZapitNotifier, CRCInput::RC_red); mc->setHint("", LOCALE_MENU_HINT_LAST_USE); CSelectChannelWidget select; CMenuForwarder *zapit1 = new CMenuForwarder(LOCALE_ZAPITSETUP_LAST_TV , !g_settings.uselastchannel, g_settings.StartChannelTV, &select, "tv", CRCInput::RC_green); zapit1->setHint("", LOCALE_MENU_HINT_LAST_TV); CMenuForwarder *zapit2 = new CMenuForwarder(LOCALE_ZAPITSETUP_LAST_RADIO , !g_settings.uselastchannel, g_settings.StartChannelRadio, &select, "radio", CRCInput::RC_yellow); zapit2->setHint("", LOCALE_MENU_HINT_LAST_RADIO); #define CHANNEL_LIST_MODE_OPTION_COUNT 5 const CMenuOptionChooser::keyval CHANNEL_LIST_MODE_OPTIONS[CHANNEL_LIST_MODE_OPTION_COUNT] = { { -1, LOCALE_CHANNELLIST_REMEMBER } , { LIST_MODE_FAV, LOCALE_CHANNELLIST_FAVS } , { LIST_MODE_PROV, LOCALE_CHANNELLIST_PROVS } , { LIST_MODE_SAT, LOCALE_CHANNELLIST_SATS } , { LIST_MODE_ALL, LOCALE_CHANNELLIST_HEAD } }; CMenuOptionChooser *channel_mode = new CMenuOptionChooser(LOCALE_ZAPITSETUP_CHANNELMODE, &g_settings.channel_mode_initial, CHANNEL_LIST_MODE_OPTIONS, CHANNEL_LIST_MODE_OPTION_COUNT, true, NULL, CRCInput::RC_1, NULL, true); channel_mode->setHint("", LOCALE_MENU_HINT_CHANNELLIST_MODE); CMenuOptionChooser *channel_mode_radio = new CMenuOptionChooser(LOCALE_ZAPITSETUP_CHANNELMODE_RADIO, &g_settings.channel_mode_initial_radio, CHANNEL_LIST_MODE_OPTIONS, CHANNEL_LIST_MODE_OPTION_COUNT, true, NULL, CRCInput::RC_2, NULL, true); channel_mode_radio->setHint("", LOCALE_MENU_HINT_CHANNELLIST_MODE_RADIO); miscZapitNotifier->addItem(zapit1); miscZapitNotifier->addItem(zapit2); zapit->addItem(mc); zapit->addItem(GenericMenuSeparatorLine); zapit->addItem(zapit1); zapit->addItem(zapit2); zapit->addItem(GenericMenuSeparatorLine); zapit->addItem(channel_mode); zapit->addItem(channel_mode_radio); int res = zapit->exec(NULL, ""); delete miscZapitNotifier; delete zapit; return res; }
//filebrowser settings void CMiscMenue::showMiscSettingsMenuFBrowser(CMenuWidget *ms_fbrowser) { ms_fbrowser->addIntroItems(LOCALE_FILEBROWSER_HEAD); CMenuOptionChooser * mc; mc = new CMenuOptionChooser(LOCALE_FILESYSTEM_IS_UTF8 , &g_settings.filesystem_is_utf8 , MISCSETTINGS_FILESYSTEM_IS_UTF8_OPTIONS, MISCSETTINGS_FILESYSTEM_IS_UTF8_OPTION_COUNT, true ); mc->setHint("", LOCALE_MENU_HINT_FILESYSTEM_IS_UTF8); ms_fbrowser->addItem(mc); mc = new CMenuOptionChooser(LOCALE_FILEBROWSER_SHOWRIGHTS , &g_settings.filebrowser_showrights , MESSAGEBOX_NO_YES_OPTIONS , MESSAGEBOX_NO_YES_OPTION_COUNT , true ); mc->setHint("", LOCALE_MENU_HINT_FILEBROWSER_SHOWRIGHTS); ms_fbrowser->addItem(mc); mc = new CMenuOptionChooser(LOCALE_FILEBROWSER_DENYDIRECTORYLEAVE, &g_settings.filebrowser_denydirectoryleave, MESSAGEBOX_NO_YES_OPTIONS , MESSAGEBOX_NO_YES_OPTION_COUNT , true ); mc->setHint("", LOCALE_MENU_HINT_FILEBROWSER_DENYDIRECTORYLEAVE); ms_fbrowser->addItem(mc); }
void CKeybindSetup::showKeyBindChannellistSetup(CMenuWidget *bindSettings_chlist) { bindSettings_chlist->addIntroItems(LOCALE_KEYBINDINGMENU_CHANNELLIST); #if 0 CMenuOptionChooser *oj = new CMenuOptionChooser(LOCALE_KEYBINDINGMENU_BOUQUETHANDLING, &g_settings.bouquetlist_mode, KEYBINDINGMENU_BOUQUETHANDLING_OPTIONS, KEYBINDINGMENU_BOUQUETHANDLING_OPTION_COUNT, true ); bindSettings_chlist->addItem(oj); #endif for (int i = NKEY_LIST_START; i <= NKEY_CURRENT_TRANSPONDER; i++) { CMenuForwarder * mf = new CMenuForwarder(key_settings[i].keydescription, true, keychooser[i]->getKeyName(), keychooser[i]); mf->setHint("", key_settings[i].hint); bindSettings_chlist->addItem(mf); } CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_EXTRA_SMS_CHANNEL, &g_settings.sms_channel, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_KEY_CHANNEL_SMS); bindSettings_chlist->addItem(mc); }
void CVfdSetup::showBacklightSetup(CMenuWidget *mn_led_widget) { CMenuOptionChooser * mc; mn_led_widget->addIntroItems(LOCALE_LEDCONTROLER_BACKLIGHT); mc = new CMenuOptionChooser(LOCALE_LEDCONTROLER_BACKLIGHT_TV, &g_settings.backlight_tv, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this); mc->setHint("", LOCALE_MENU_HINT_LEDS_TV); mn_led_widget->addItem(mc); mc = new CMenuOptionChooser(LOCALE_LEDCONTROLER_MODE_STANDBY, &g_settings.backlight_standby, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_LEDS_STANDBY); mn_led_widget->addItem(mc); mc = new CMenuOptionChooser(LOCALE_LEDCONTROLER_MODE_DEEPSTANDBY, &g_settings.backlight_deepstandby, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_LEDS_DEEPSTANDBY); mn_led_widget->addItem(mc); }
void CAdZapMenu::ShowMenu() { bool show_monitor = monitorLifeTime.tv_sec; CMenuWidget *menu = new CMenuWidget(LOCALE_ADZAP, NEUTRINO_ICON_SETTINGS, width); //menu->addKey(CRCInput::RC_red, this, "disable"); menu->addKey(CRCInput::RC_green, this, "enable"); menu->addKey(CRCInput::RC_blue, this, "monitor"); menu->addIntroItems(); CMenuOptionChooser *oc = new CMenuOptionChooser(LOCALE_ADZAP_WRITEDATA, &g_settings.adzap_writeData, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); oc->setHint(NEUTRINO_ICON_HINT_ADZAP, LOCALE_MENU_HINT_ADZAP_WRITEDATA); menu->addItem(oc); menu->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_ADZAP_SWITCHBACK)); neutrino_locale_t minute = LOCALE_ADZAP_MINUTE; for (int shortcut = 1; shortcut < 10; shortcut++) { char actionKey[2]; actionKey[0] = '0' + shortcut; actionKey[1] = 0; bool selected = g_settings.adzap_zapBackPeriod == 60 * shortcut; forwarders[shortcut - 1] = new CMenuForwarder(minute, true, NULL, this, actionKey, CRCInput::convertDigitToKey(shortcut)); forwarders[shortcut - 1]->setMarked(selected); forwarders[shortcut - 1]->iconName_Info_right = selected ? NEUTRINO_ICON_CHECKMARK : NULL; forwarders[shortcut - 1]->setHint(NEUTRINO_ICON_HINT_ADZAP, ""); menu->addItem(forwarders[shortcut - 1], selected); minute = LOCALE_ADZAP_MINUTES; } menu->addItem(GenericMenuSeparator); int zapBackPeriod = g_settings.adzap_zapBackPeriod / 60; nc = new CMenuOptionNumberChooser(minute, &zapBackPeriod, true, 10, 120, this, CRCInput::RC_0); nc->setMarked(g_settings.adzap_zapBackPeriod / 60 > 9); nc->setHint(NEUTRINO_ICON_HINT_ADZAP, ""); menu->addItem(nc); menu->setFooter(CAdZapMenuFooterButtons, CAdZapMenuFooterButtonCount - (show_monitor ? 0 : 1)); menu->exec(NULL, ""); menu->hide(); delete menu; Update(); }
//general settings void CMiscMenue::showMiscSettingsMenuGeneral(CMenuWidget *ms_general) { ms_general->addIntroItems(LOCALE_MISCSETTINGS_GENERAL); //standby after boot CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_EXTRA_START_TOSTANDBY, &g_settings.power_standby, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_START_TOSTANDBY); ms_general->addItem(mc); mc = new CMenuOptionChooser(LOCALE_EXTRA_CACHE_TXT, (int *)&g_settings.cacheTXT, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_CACHE_TXT); ms_general->addItem(mc); //fan speed if (g_info.hw_caps->has_fan) { #if defined (BOXMODEL_IPBOX9900) || defined (BOXMODEL_IPBOX99) CMenuOptionNumberChooser * mn = new CMenuOptionNumberChooser(LOCALE_FAN_SPEED, &g_settings.fan_speed, true, 0, 1, fanNotifier, CRCInput::RC_nokey, NULL, 0, 0, LOCALE_OPTIONS_OFF); #else CMenuOptionNumberChooser * mn = new CMenuOptionNumberChooser(LOCALE_FAN_SPEED, &g_settings.fan_speed, true, 1, 14, fanNotifier, CRCInput::RC_nokey, NULL, 0, 0, LOCALE_OPTIONS_OFF); #endif mn->setHint("", LOCALE_MENU_HINT_FAN_SPEED); ms_general->addItem(mn); } ms_general->addItem(GenericMenuSeparatorLine); CMenuForwarder * mf = new CMenuForwarder(LOCALE_PLUGINS_HDD_DIR, true, g_settings.plugin_hdd_dir, this, "plugin_dir"); mf->setHint("", LOCALE_MENU_HINT_PLUGINS_HDD_DIR); ms_general->addItem(mf); mf = new CMenuForwarder(LOCALE_MPKEY_PLUGIN, true, g_settings.movieplayer_plugin, this, "movieplayer_plugin"); mf->setHint("", LOCALE_MENU_HINT_MOVIEPLAYER_PLUGIN); ms_general->addItem(mf); //set debug level ms_general->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_DEBUG)); CMenuOptionChooser * md = new CMenuOptionChooser(LOCALE_DEBUG_LEVEL, &debug, DEBUG_MODE_OPTIONS, DEBUG_MODES, true); // mc->setHint("", LOCALE_MENU_HINT_START_TOSTANDBY); ms_general->addItem(md); }
void CRecordSetup::showRecordTimerSetup(CMenuWidget *menu_timersettings) { //recording start/end correcture int pre,post; g_Timerd->getRecordingSafety(pre,post); g_settings.record_safety_time_before = pre/60; g_settings.record_safety_time_after = post/60; menu_timersettings->addIntroItems(LOCALE_TIMERSETTINGS_SEPARATOR); std::string nf = "%d "; nf += g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE); //start CMenuOptionNumberChooser *ch = new CMenuOptionNumberChooser(LOCALE_TIMERSETTINGS_RECORD_SAFETY_TIME_BEFORE, &g_settings.record_safety_time_before, true, 0, 99, this); ch->setNumberFormat(nf); ch->setHint("", LOCALE_MENU_HINT_RECORD_TIMEBEFORE); menu_timersettings->addItem(ch); //end ch = new CMenuOptionNumberChooser(LOCALE_TIMERSETTINGS_RECORD_SAFETY_TIME_AFTER, &g_settings.record_safety_time_after, true, 0, 99, this); ch->setNumberFormat(nf); ch->setHint("", LOCALE_MENU_HINT_RECORD_TIMEAFTER); menu_timersettings->addItem(ch); //announce CMenuOptionChooser* chzapAnnounce = new CMenuOptionChooser(LOCALE_RECORDINGMENU_ZAP_ON_ANNOUNCE, &g_settings.recording_zap_on_announce, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); chzapAnnounce->setHint("", LOCALE_MENU_HINT_RECORD_ZAP); menu_timersettings->addItem(chzapAnnounce); //zapto ch = new CMenuOptionNumberChooser(LOCALE_MISCSETTINGS_ZAPTO_PRE_TIME, &g_settings.zapto_pre_time, true, 0, 10); ch->setHint("", LOCALE_MENU_HINT_RECORD_ZAP_PRE_TIME); ch->setNumberFormat(nf); menu_timersettings->addItem(ch); }
void CVfdSetup::showLedSetup(CMenuWidget *mn_led_widget) { CMenuOptionChooser * mc; mn_led_widget->addIntroItems(LOCALE_LEDCONTROLER_MENU); mc = new CMenuOptionChooser(LOCALE_LEDCONTROLER_MODE_TV, &g_settings.led_tv_mode, LEDMENU_OPTIONS, LEDMENU_OPTION_COUNT, true, this); mc->setHint("", LOCALE_MENU_HINT_LEDS_TV); mn_led_widget->addItem(mc); mc = new CMenuOptionChooser(LOCALE_LEDCONTROLER_MODE_STANDBY, &g_settings.led_standby_mode, LEDMENU_OPTIONS, LEDMENU_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_LEDS_STANDBY); mn_led_widget->addItem(mc); mc = new CMenuOptionChooser(LOCALE_LEDCONTROLER_MODE_DEEPSTANDBY, &g_settings.led_deep_mode, LEDMENU_OPTIONS, LEDMENU_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_LEDS_DEEPSTANDBY); mn_led_widget->addItem(mc); mc = new CMenuOptionChooser(LOCALE_LEDCONTROLER_MODE_RECORD, &g_settings.led_rec_mode, LEDMENU_OPTIONS, LEDMENU_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_LEDS_RECORD); mn_led_widget->addItem(mc); mc = new CMenuOptionChooser(LOCALE_LEDCONTROLER_BLINK, &g_settings.led_blink, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_LEDS_BLINK); mn_led_widget->addItem(mc); }
int CProgressbarSetup::showMenu() { //menue init CMenuWidget *progress = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_PROGRESSBAR); //intros: back ande save progress->addIntroItems(LOCALE_MISCSETTINGS_PROGRESSBAR); COnOffNotifier* miscProgressNotifier = new COnOffNotifier(0); //color on/off CMenuOptionChooser *color; color = new CMenuOptionChooser(LOCALE_MISCSETTINGS_PROGRESSBAR_COLOR, &g_settings.progressbar_color, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, miscProgressNotifier); color->setHint("", LOCALE_MENU_HINT_PROGRESSBAR_COLOR); //design CMenuOptionChooser *design; design = new CMenuOptionChooser(LOCALE_MISCSETTINGS_PROGRESSBAR_DESIGN, &g_settings.progressbar_design, PROGRESSBAR_DESIGN_OPTIONS, PROGRESSBAR_DESIGN_COUNT, g_settings.progressbar_color); design->setHint("", LOCALE_MENU_HINT_PROGRESSBAR_DESIGN); //infobar position CMenuOptionChooser *infobar_position; infobar_position = new CMenuOptionChooser(LOCALE_MISCSETTINGS_PROGRESSBAR_INFOBAR_POSITION, &g_settings.infobar_progressbar, PROGRESSBAR_INFOBAR_POSITION_OPTIONS, PROGRESSBAR_INFOBAR_POSITION_COUNT, true); infobar_position->setHint("", LOCALE_MENU_HINT_PROGRESSBAR_INFOBAR_POSITION); miscProgressNotifier->addItem(design); //paint items progress->addItem(color); progress->addItem(design); progress->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_MISCSETTINGS_INFOBAR)); progress->addItem(infobar_position); int res = progress->exec (NULL, ""); delete miscProgressNotifier; delete progress; return res; }
//shows menue for prefered audio/epg languages void COsdLangSetup::showPrefMenu(CMenuWidget *prefMenu, CLangSelectNotifier *langNotifier) { prefMenu->addItem(GenericMenuSeparator); prefMenu->addItem(GenericMenuBack); prefMenu->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_AUDIOMENU_PREF_LANG_HEAD)); CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_AUDIOMENU_AUTO_LANG, &g_settings.auto_lang, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, NULL); mc->setHint("", LOCALE_MENU_HINT_AUTO_LANG); prefMenu->addItem(mc); for(int i = 0; i < 3; i++) { CMenuOptionStringChooser * langSelect = new CMenuOptionStringChooser(LOCALE_AUDIOMENU_PREF_LANG, &g_settings.pref_lang[i], true, langNotifier, CRCInput::convertDigitToKey(i+1), "", true); langSelect->setHint("", LOCALE_MENU_HINT_PREF_LANG); langSelect->addOption("none"); std::map<std::string, std::string>::const_iterator it; for(it = iso639rev.begin(); it != iso639rev.end(); ++it) langSelect->addOption(it->first.c_str()); prefMenu->addItem(langSelect); } prefMenu->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_AUDIOMENU_PREF_SUBS_HEAD)); mc = new CMenuOptionChooser(LOCALE_AUDIOMENU_AUTO_SUBS, &g_settings.auto_subs, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, NULL); mc->setHint("", LOCALE_MENU_HINT_AUTO_SUBS); prefMenu->addItem(mc); for(int i = 0; i < 3; i++) { CMenuOptionStringChooser * langSelect = new CMenuOptionStringChooser(LOCALE_AUDIOMENU_PREF_SUBS, &g_settings.pref_subs[i], true, NULL, CRCInput::convertDigitToKey(i+4), "", true); langSelect->setHint("", LOCALE_MENU_HINT_PREF_SUBS); std::map<std::string, std::string>::const_iterator it; langSelect->addOption("none"); for(it = iso639rev.begin(); it != iso639rev.end(); ++it) langSelect->addOption(it->first.c_str()); prefMenu->addItem(langSelect); } }
/*shows the picviewer setup menue*/ int CPictureViewerSetup::showPictureViewerSetup() { CMenuWidget* picviewsetup = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_PVIEWERSETUP); // intros: back ande save picviewsetup->addIntroItems(LOCALE_PICTUREVIEWER_HEAD); CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_PICTUREVIEWER_SCALING, &g_settings.picviewer_scaling, PICTUREVIEWER_SCALING_OPTIONS, PICTUREVIEWER_SCALING_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_PICTUREVIEWER_SCALING); picviewsetup->addItem(mc); CStringInput pic_timeout(LOCALE_PICTUREVIEWER_SLIDE_TIME, g_settings.picviewer_slide_time, 2, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "0123456789 "); CMenuForwarder * mf = new CMenuForwarder(LOCALE_PICTUREVIEWER_SLIDE_TIME, true, g_settings.picviewer_slide_time, &pic_timeout); mf->setHint("", LOCALE_MENU_HINT_PICTUREVIEWER_SLIDE_TIME); picviewsetup->addItem(mf); mf = new CMenuForwarder(LOCALE_PICTUREVIEWER_DEFDIR, true, g_settings.network_nfs_picturedir, this, "picturedir"); mf->setHint("", LOCALE_MENU_HINT_PICTUREVIEWER_DEFDIR); picviewsetup->addItem(mf); int res = picviewsetup->exec(NULL, ""); delete picviewsetup; return res; }
/*shows the picviewer setup menue*/ int CPictureViewerSetup::showPictureViewerSetup() { CMenuWidget* picviewsetup = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_PVIEWERSETUP); // intros: back ande save picviewsetup->addIntroItems(LOCALE_PICTUREVIEWER_HEAD); CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_PICTUREVIEWER_SCALING, &g_settings.picviewer_scaling, PICTUREVIEWER_SCALING_OPTIONS, PICTUREVIEWER_SCALING_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_PICTUREVIEWER_SCALING); picviewsetup->addItem(mc); CMenuOptionNumberChooser *cc = new CMenuOptionNumberChooser(LOCALE_PICTUREVIEWER_SLIDE_TIME, &g_settings.picviewer_slide_time, true, 0, 999); cc->setNumberFormat(std::string("%d ") + g_Locale->getText(LOCALE_UNIT_SHORT_SECOND)); cc->setHint("", LOCALE_MENU_HINT_PICTUREVIEWER_SLIDE_TIME); picviewsetup->addItem(cc); CMenuForwarder *mf = new CMenuForwarder(LOCALE_PICTUREVIEWER_DEFDIR, true, g_settings.network_nfs_picturedir, this, "picturedir"); mf->setHint("", LOCALE_MENU_HINT_PICTUREVIEWER_DEFDIR); picviewsetup->addItem(mf); int res = picviewsetup->exec(NULL, ""); delete picviewsetup; return res; }
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, ""); }
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; }
void CKeybindSetup::showKeyBindSetup(CMenuWidget *bindSettings) { int shortcut = 1; CMenuForwarder * mf; bindSettings->addIntroItems(LOCALE_KEYBINDINGMENU_HEAD); //modes CMenuWidget* bindSettings_modes = new CMenuWidget(LOCALE_KEYBINDINGMENU_HEAD, NEUTRINO_ICON_KEYBINDING, width, MN_WIDGET_ID_KEYSETUP_KEYBINDING_MODES); showKeyBindModeSetup(bindSettings_modes); mf = new CMenuDForwarder(LOCALE_KEYBINDINGMENU_MODECHANGE, true, NULL, bindSettings_modes, NULL, CRCInput::RC_red); mf->setHint("", LOCALE_MENU_HINT_KEY_MODECHANGE); bindSettings->addItem(mf); // channellist keybindings CMenuWidget* bindSettings_chlist = new CMenuWidget(LOCALE_KEYBINDINGMENU_HEAD, NEUTRINO_ICON_KEYBINDING, width, MN_WIDGET_ID_KEYSETUP_KEYBINDING_CHANNELLIST); showKeyBindChannellistSetup(bindSettings_chlist); mf = new CMenuDForwarder(LOCALE_KEYBINDINGMENU_CHANNELLIST, true, NULL, bindSettings_chlist, NULL, CRCInput::RC_green); mf->setHint("", LOCALE_MENU_HINT_KEY_CHANNELLIST); bindSettings->addItem(mf); // Zapping keys quickzap CMenuWidget* bindSettings_qzap = new CMenuWidget(LOCALE_KEYBINDINGMENU_HEAD, NEUTRINO_ICON_KEYBINDING, width, MN_WIDGET_ID_KEYSETUP_KEYBINDING_QUICKZAP); showKeyBindQuickzapSetup(bindSettings_qzap); mf = new CMenuDForwarder(LOCALE_KEYBINDINGMENU_QUICKZAP, true, NULL, bindSettings_qzap, NULL, CRCInput::RC_yellow); mf->setHint("", LOCALE_MENU_HINT_KEY_QUICKZAP); bindSettings->addItem(mf); //movieplayer CMenuWidget* bindSettings_mplayer = new CMenuWidget(LOCALE_KEYBINDINGMENU_HEAD, NEUTRINO_ICON_KEYBINDING, width, MN_WIDGET_ID_KEYSETUP_KEYBINDING_MOVIEPLAYER); showKeyBindMovieplayerSetup(bindSettings_mplayer); mf = new CMenuDForwarder(LOCALE_MAINMENU_MOVIEPLAYER, true, NULL, bindSettings_mplayer, NULL, CRCInput::RC_blue); mf->setHint("", LOCALE_MENU_HINT_KEY_MOVIEPLAYER); bindSettings->addItem(mf); //video bindSettings->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_KEYBINDINGMENU_VIDEO)); for (int i = NKEY_NEXT43MODE; i <= NKEY_SWITCHFORMAT; i++) { mf = new CMenuForwarder(key_settings[i].keydescription, true, keychooser[i]->getKeyName(), keychooser[i]); mf->setHint("", key_settings[i].hint); bindSettings->addItem(mf); } //navigation bindSettings->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_KEYBINDINGMENU_NAVIGATION)); for (int i = NKEY_PAGE_UP; i <= NKEY_PAGE_DOWN; i++) { mf = new CMenuForwarder(key_settings[i].keydescription, true, keychooser[i]->getKeyName(), keychooser[i]); mf->setHint("", key_settings[i].hint); bindSettings->addItem(mf); } CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_EXTRA_MENU_LEFT_EXIT, &g_settings.menu_left_exit, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_KEY_LEFT_EXIT); bindSettings->addItem(mc); //volume bindSettings->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_KEYBINDINGMENU_VOLUME)); for (int i = NKEY_VOLUME_UP; i <= NKEY_VOLUME_DOWN; i++) bindSettings->addItem(new CMenuForwarder(key_settings[i].keydescription, true, keychooser[i]->getKeyName(), keychooser[i])); //misc bindSettings->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_KEYBINDINGMENU_MISC)); //bindSettings->addItem(new CMenuForwarder(keydescription[NKEY_PLUGIN], true, NULL, keychooser[NKEY_PLUGIN])); //Special keys CMenuWidget* bindSettings_special = new CMenuWidget(LOCALE_KEYBINDINGMENU_HEAD, NEUTRINO_ICON_KEYBINDING, width, MN_WIDGET_ID_KEYSETUP_KEYBINDING_SPECIAL); showKeyBindSpecialSetup(bindSettings_special); mf = new CMenuDForwarder(LOCALE_KEYBINDINGMENU_SPECIAL_ACTIVE, true, NULL, bindSettings_special, NULL, CRCInput::convertDigitToKey(shortcut++)); mf->setHint("", LOCALE_MENU_HINT_KEY_SPECIAL_ACTIVE); bindSettings->addItem(mf); // unlock mf = new CMenuForwarder(key_settings[NKEY_UNLOCK].keydescription, true, keychooser[NKEY_UNLOCK]->getKeyName(), keychooser[NKEY_UNLOCK]); mf->setHint("", key_settings[NKEY_UNLOCK].hint); bindSettings->addItem(mf); // screenshot mf = new CMenuForwarder(key_settings[NKEY_SCREENSHOT].keydescription, true, keychooser[NKEY_SCREENSHOT]->getKeyName(), keychooser[NKEY_SCREENSHOT]); mf->setHint("", key_settings[NKEY_SCREENSHOT].hint); bindSettings->addItem(mf); #ifdef ENABLE_PIP // pip mf = new CMenuForwarder(key_settings[NKEY_PIP_CLOSE].keydescription, true, keychooser[NKEY_PIP_CLOSE]->getKeyName(), keychooser[NKEY_PIP_CLOSE]); mf->setHint("", key_settings[NKEY_PIP_CLOSE].hint); bindSettings->addItem(mf); mf = new CMenuForwarder(key_settings[NKEY_PIP_SETUP].keydescription, true, keychooser[NKEY_PIP_SETUP]->getKeyName(), keychooser[NKEY_PIP_SETUP]); mf->setHint("", key_settings[NKEY_PIP_SETUP].hint); bindSettings->addItem(mf); mf = new CMenuForwarder(key_settings[NKEY_PIP_SWAP].keydescription, true, keychooser[NKEY_PIP_SWAP]->getKeyName(), keychooser[NKEY_PIP_SWAP]); mf->setHint("", key_settings[NKEY_PIP_SWAP].hint); bindSettings->addItem(mf); #endif bindSettings->addItem(new CMenuForwarder(key_settings[NKEY_HELP].keydescription, true, keychooser[NKEY_HELP]->getKeyName(), keychooser[NKEY_HELP])); bindSettings->addItem(new CMenuForwarder(key_settings[NKEY_RECORD].keydescription, true, keychooser[NKEY_RECORD]->getKeyName(), keychooser[NKEY_RECORD])); // right key mc = new CMenuOptionChooser(LOCALE_KEYBINDINGMENU_MODE_LEFT_RIGHT_KEY_TV, &g_settings.mode_left_right_key_tv, KEYBINDINGMENU_MODE_LEFT_RIGHT_KEY_TV_OPTIONS, KEYBINDINGMENU_MODE_LEFT_RIGHT_KEY_TV_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_KEY_RIGHT); bindSettings->addItem(mc); }
int CKeybindSetup::showKeySetup() { #if !HAVE_SPARK_HARDWARE //save original rc hardware selection and initialize text strings int org_remote_control_hardware = g_settings.remote_control_hardware; char RC_HW_str[4][32]; snprintf(RC_HW_str[CRCInput::RC_HW_COOLSTREAM], sizeof(RC_HW_str[CRCInput::RC_HW_COOLSTREAM])-1, "%s", g_Locale->getText(LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE_COOLSTREAM)); snprintf(RC_HW_str[CRCInput::RC_HW_DBOX], sizeof(RC_HW_str[CRCInput::RC_HW_DBOX])-1, "%s", g_Locale->getText(LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE_DBOX)); snprintf(RC_HW_str[CRCInput::RC_HW_PHILIPS], sizeof(RC_HW_str[CRCInput::RC_HW_PHILIPS])-1, "%s", g_Locale->getText(LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE_PHILIPS)); snprintf(RC_HW_str[CRCInput::RC_HW_TRIPLEDRAGON], sizeof(RC_HW_str[CRCInput::RC_HW_TRIPLEDRAGON])-1, "%s", g_Locale->getText(LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE_TRIPLEDRAGON)); char RC_HW_msg[256]; snprintf(RC_HW_msg, sizeof(RC_HW_msg)-1, "%s", g_Locale->getText(LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE_MSG_PART1)); #endif //keysetup menu CMenuWidget* keySettings = new CMenuWidget(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_KEYBINDING, width, MN_WIDGET_ID_KEYSETUP); keySettings->addIntroItems(LOCALE_MAINSETTINGS_KEYBINDING, LOCALE_KEYBINDINGMENU_HEAD); //keybindings menu CMenuWidget bindSettings(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_KEYBINDING, width, MN_WIDGET_ID_KEYSETUP_KEYBINDING); //keybindings for (int i = 0; i < KEYBINDS_COUNT; i++) keychooser[i] = new CKeyChooser((unsigned int *) key_settings[i].keyvalue_p, key_settings[i].keydescription/*as head caption*/, NEUTRINO_ICON_SETTINGS); showKeyBindSetup(&bindSettings); CMenuForwarder * mf; mf = new CMenuForwarder(LOCALE_KEYBINDINGMENU_EDIT, true, NULL, &bindSettings, NULL, CRCInput::RC_red); mf->setHint("", LOCALE_MENU_HINT_KEY_BINDING); keySettings->addItem(mf); mf = new CMenuForwarder(LOCALE_EXTRA_LOADKEYS, true, NULL, this, "loadkeys", CRCInput::RC_green); mf->setHint("", LOCALE_MENU_HINT_KEY_LOAD); keySettings->addItem(mf); mf = new CMenuForwarder(LOCALE_EXTRA_SAVEKEYS, true, NULL, this, "savekeys", CRCInput::RC_yellow); mf->setHint("", LOCALE_MENU_HINT_KEY_SAVE); keySettings->addItem(mf); keySettings->addItem(GenericMenuSeparatorLine); //rc tuning std::string ms_number_format("%d "); ms_number_format += g_Locale->getText(LOCALE_UNIT_SHORT_MILLISECOND); CMenuOptionNumberChooser *cc; int shortcut = 1; cc = new CMenuOptionNumberChooser(LOCALE_KEYBINDINGMENU_LONGKEYPRESS_DURATION, &g_settings.longkeypress_duration, true, LONGKEYPRESS_OFF, 9999, NULL, CRCInput::convertDigitToKey(shortcut++), NULL, 0, LONGKEYPRESS_OFF, LOCALE_OPTIONS_OFF); cc->setNumberFormat(ms_number_format); cc->setNumericInput(true); cc->setHint("", LOCALE_MENU_HINT_LONGKEYPRESS_DURATION); keySettings->addItem(cc); #if HAVE_SPARK_HARDWARE g_settings.accept_other_remotes = access("/etc/lircd_predata_lock", R_OK) ? 1 : 0; CMenuOptionChooser *mc = new CMenuOptionChooser(LOCALE_KEYBINDINGMENU_ACCEPT_OTHER_REMOTES, &g_settings.accept_other_remotes, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this, CRCInput::convertDigitToKey(shortcut++)); mc->setHint("", LOCALE_MENU_HINT_ACCEPT_OTHER_REMOTES); keySettings->addItem(mc); #endif #if !HAVE_SPARK_HARDWARE if (RC_HW_SELECT) { CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE, &g_settings.remote_control_hardware, KEYBINDINGMENU_REMOTECONTROL_HARDWARE_OPTIONS, KEYBINDINGMENU_REMOTECONTROL_HARDWARE_OPTION_COUNT, true, NULL, CRCInput::convertDigitToKey(shortcut++)); mc->setHint("", LOCALE_MENU_HINT_KEY_HARDWARE); keySettings->addItem(mc); } #endif cc = new CMenuOptionNumberChooser(LOCALE_KEYBINDINGMENU_REPEATBLOCK, &g_settings.repeat_blocker, true, 0, 999, NULL, CRCInput::convertDigitToKey(shortcut++), NULL, 0, 0, LOCALE_OPTIONS_OFF); cc->setNumberFormat(ms_number_format); cc->setNumericInput(true); cc->setHint("", LOCALE_MENU_HINT_KEY_REPEATBLOCK); keySettings->addItem(cc); cc = new CMenuOptionNumberChooser(LOCALE_KEYBINDINGMENU_REPEATBLOCKGENERIC, &g_settings.repeat_genericblocker, true, 0, 999, NULL, CRCInput::convertDigitToKey(shortcut++), NULL, 0, 0, LOCALE_OPTIONS_OFF); cc->setNumberFormat(ms_number_format); cc->setNumericInput(true); cc->setHint("", LOCALE_MENU_HINT_KEY_REPEATBLOCKGENERIC); keySettings->addItem(cc); int res = keySettings->exec(NULL, ""); #if !HAVE_SPARK_HARDWARE //check if rc hardware selection has changed before leaving the menu if (org_remote_control_hardware != g_settings.remote_control_hardware) { g_RCInput->CRCInput::set_rc_hw(); strcat(RC_HW_msg, RC_HW_str[org_remote_control_hardware]); strcat(RC_HW_msg, g_Locale->getText(LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE_MSG_PART2)); strcat(RC_HW_msg, RC_HW_str[g_settings.remote_control_hardware]); strcat(RC_HW_msg, g_Locale->getText(LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE_MSG_PART3)); if(ShowMsg(LOCALE_MESSAGEBOX_INFO, RC_HW_msg, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_INFO, 450, 15, true) == CMessageBox::mbrNo) { g_settings.remote_control_hardware = org_remote_control_hardware; g_RCInput->CRCInput::set_rc_hw(); } } #endif delete keySettings; for (int i = 0; i < KEYBINDS_COUNT; i++) delete keychooser[i]; 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 CMenuWidget recordingTsSettings(LOCALE_MAINSETTINGS_RECORDING, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_RECORDSETUP_TIMESHIFT); showRecordTimeShiftSetup(&recordingTsSettings); CMenuWidget recordingTimerSettings(LOCALE_MAINSETTINGS_RECORDING, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_RECORDSETUP_TIMERSETTINGS); showRecordTimerSetup(&recordingTimerSettings); if (g_settings.easymenu) { //timeshift mf = new CMenuForwarder(LOCALE_RECORDINGMENU_TIMESHIFT, true, NULL, &recordingTsSettings, NULL, CRCInput::RC_red); mf->setHint("", LOCALE_MENU_HINT_RECORD_TIMESHIFT); recordingSettings->addItem(mf); //timersettings mf = new CMenuForwarder(LOCALE_TIMERSETTINGS_SEPARATOR, true, NULL, &recordingTimerSettings, NULL, CRCInput::RC_green); mf->setHint("", LOCALE_MENU_HINT_RECORD_TIMER); recordingSettings->addItem(mf); } bool recstatus = CNeutrinoApp::getInstance()->recordingstatus; //record dir CMenuForwarder* fRecDir; if (g_settings.easymenu) fRecDir = new CMenuForwarder(LOCALE_RECORDINGMENU_DEFDIR, !recstatus, g_settings.network_nfs_recordingdir, this, "recordingdir", CRCInput::RC_yellow); else 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; if (g_settings.easymenu) 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, NULL, CRCInput::RC_blue); else 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); if (!g_settings.easymenu) { 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); recordingSettings->addItem(GenericMenuSeparatorLine); if (!g_settings.easymenu) { //timeshift mf = new CMenuForwarder(LOCALE_RECORDINGMENU_TIMESHIFT, true, NULL, &recordingTsSettings, NULL, CRCInput::RC_green); mf->setHint("", LOCALE_MENU_HINT_RECORD_TIMESHIFT); recordingSettings->addItem(mf); //timersettings mf = new CMenuForwarder(LOCALE_TIMERSETTINGS_SEPARATOR, true, NULL, &recordingTimerSettings, NULL, CRCInput::RC_yellow); mf->setHint("", LOCALE_MENU_HINT_RECORD_TIMER); recordingSettings->addItem(mf); } CMenuWidget recordingaAudioSettings(LOCALE_MAINSETTINGS_RECORDING, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_RECORDSETUP_AUDIOSETTINGS); CMenuWidget recordingaDataSettings(LOCALE_MAINSETTINGS_RECORDING, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_RECORDSETUP_DATASETTINGS); if (!g_settings.easymenu) { //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 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 CStartUpWizard::exec(CMenuTarget* parent, const string & /*actionKey*/) { int res = menu_return::RETURN_REPAINT; showBackgroundLogo(); if (parent) parent->hide(); //language setup COsdLangSetup languageSettings(SNeutrinoSettings::WIZARD_START); CMenuWidget osdl_setup(LOCALE_LANGUAGESETUP_OSD, NEUTRINO_ICON_LANGUAGE, 45, MN_WIDGET_ID_LANGUAGESETUP_LOCALE); osdl_setup.setWizardMode(true); languageSettings.showLanguageSetup(&osdl_setup); osdl_setup.exec(NULL, ""); //restore backup CSettingsManager settingsManager(SNeutrinoSettings::WIZARD_START); settingsManager.exec(NULL, ""); if(ShowMsg (LOCALE_WIZARD_WELCOME_HEAD, g_Locale->getText(LOCALE_WIZARD_WELCOME_TEXT), CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbrCancel) == CMessageBox::mbrYes) { int advanced = 1; #ifdef ENABLE_FASTSCAN std::string lang = g_settings.language; if (lang == "nederlands") { advanced = 0; CMenuWidget wtype(LOCALE_WIZARD_SETUP); wtype.setWizardMode(SNeutrinoSettings::WIZARD_ON); wtype.addIntroItems(); CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_WIZARD_SETUP_TYPE, &advanced, WIZARD_SETUP_TYPE, 2, true, NULL); mc->setHint("", LOCALE_WIZARD_SETUP_TYPE_HINT); wtype.addItem(mc); wtype.exec(NULL, ""); } #endif //open video settings in wizardmode if(advanced && res != menu_return::RETURN_EXIT_ALL) { g_videoSettings->setWizardMode(SNeutrinoSettings::WIZARD_ON); res = g_videoSettings->exec(NULL, ""); g_videoSettings->setWizardMode(SNeutrinoSettings::WIZARD_OFF); } if(!g_settings.easymenu && advanced && res != menu_return::RETURN_EXIT_ALL) { COsdSetup osdSettings(SNeutrinoSettings::WIZARD_ON); res = osdSettings.exec(NULL, ""); } if(advanced && res != menu_return::RETURN_EXIT_ALL) { CNetworkSetup::getInstance()->setWizardMode(SNeutrinoSettings::WIZARD_ON); res = CNetworkSetup::getInstance()->exec(NULL, ""); CNetworkSetup::getInstance()->setWizardMode(SNeutrinoSettings::WIZARD_OFF); } bool init_settings = false; if (CFEManager::getInstance()->haveSat()) init_settings = file_exists(CONFIGDIR "/initial/"); if(advanced && init_settings && (res != menu_return::RETURN_EXIT_ALL)) { if (ShowMsg(LOCALE_WIZARD_INITIAL_SETTINGS, g_Locale->getText(LOCALE_WIZARD_INSTALL_SETTINGS), CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, false) == CMessageBox::mbrYes) { system("/bin/cp " CONFIGDIR "/initial/* " CONFIGDIR "/zapit/"); CFEManager::getInstance()->loadSettings(); CFEManager::getInstance()->saveSettings(); CZapit::getInstance()->PrepareChannels(); } } if(res != menu_return::RETURN_EXIT_ALL) { CScanSetup::getInstance()->setWizardMode(SNeutrinoSettings::WIZARD_ON); if (advanced) { res = CScanSetup::getInstance()->exec(NULL, "setup_frontend"); if(res != menu_return::RETURN_EXIT_ALL) res = CScanSetup::getInstance()->exec(NULL, ""); } else { CZapit::getInstance()->GetConfig(zapitCfg); #ifdef ENABLE_FASTSCAN if (CFEManager::getInstance()->haveSat()) { CMenuWidget fastScanMenu(LOCALE_SATSETUP_FASTSCAN_HEAD, NEUTRINO_ICON_SETTINGS, 45, MN_WIDGET_ID_SCAN_FAST_SCAN); fastScanMenu.setWizardMode(SNeutrinoSettings::WIZARD_ON); CScanSetup::getInstance()->addScanMenuFastScan(&fastScanMenu); res = fastScanMenu.exec(NULL, ""); } #endif if (CFEManager::getInstance()->haveCable()) { CMenuWidget cableScan(LOCALE_SATSETUP_CABLE, NEUTRINO_ICON_SETTINGS, 45, MN_WIDGET_ID_SCAN_CABLE_SCAN); cableScan.setWizardMode(SNeutrinoSettings::WIZARD_ON); CScanSetup::getInstance()->addScanMenuCable(&cableScan); res = cableScan.exec(NULL, ""); } } CScanSetup::getInstance()->setWizardMode(SNeutrinoSettings::WIZARD_OFF); } } killBackgroundLogo(); return res; }
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; }
int CNetworkServiceSetup::showNetworkServiceSetup() { int shortcut = 1; CMenuWidget* setup = new CMenuWidget(LOCALE_MAINSETTINGS_NETWORK, NEUTRINO_ICON_SETTINGS, width); setup->setSelected(selected); setup->addIntroItems(LOCALE_NETWORKMENU_SERVICES); CNetworkService * items[SERVICE_COUNT]; //telnetd used inetd bool useinetd = false; char *buf=NULL; size_t len = 0; FILE* fd = fopen("/etc/inetd.conf", "r"); if(fd) { while(!feof(fd)) { if(getline(&buf, &len, fd)!=-1) { if (strstr(buf, "telnetd") != NULL) { useinetd = true; break; } } } fclose(fd); if(buf) free(buf); } //set active when found bool active; for(unsigned i = 0; i < SERVICE_COUNT; i++) { items[i] = new CNetworkService(services[i].cmd, services[i].options); services[i].enabled = items[i]->Enabled(); std::string execute1 = "/bin/" + services[i].cmd; std::string execute2 = "/sbin/" + services[i].cmd; active = false; if ( !(access(execute1.c_str(), F_OK)) || !(access(execute2.c_str(), F_OK)) ) active = true; if ( (services[i].name == "Telnet") && useinetd) active = false; CMenuOptionChooser * mc = new CMenuOptionChooser(services[i].name.c_str(), &services[i].enabled, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, active, items[i], CRCInput::convertDigitToKey(shortcut), ""); if (active) shortcut++; mc->setHint(services[i].icon, services[i].hint); setup->addItem(mc); } int res = setup->exec (NULL, ""); selected = setup->getSelected(); delete setup; for(unsigned i = 0; i < SERVICE_COUNT; i++) delete items[i]; return res; }