int CUserMenuSetup::showSetup()
{
	CMenuWidget * ums = new CMenuWidget(LOCALE_PERSONALIZE_HEAD, NEUTRINO_ICON_PROTECTING, width);
	ums->setPreselected(selected);

	CStringInputSMS name(LOCALE_USERMENU_NAME, &g_settings.usermenu_text[button], 11, true, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "abcdefghijklmnopqrstuvwxyz\xE4\xF6\xFC\xDF/- ");
	CMenuForwarder *mf = new CMenuForwarder(LOCALE_USERMENU_NAME, true, g_settings.usermenu_text[button], &name);

	//-------------------------------------
	ums->addIntroItems(local);
	//-------------------------------------
	ums->addItem(mf);
	ums->addItem(GenericMenuSeparatorLine);
	//-------------------------------------
	char text[10];
	for(int item = 0; item < SNeutrinoSettings::ITEM_MAX && item <13; item++) // Do not show more than 13 items
	{
		snprintf(text,10,"%d:",item+1);
		text[9]=0;// terminate for sure
		ums->addItem( new CMenuOptionChooser(text, &g_settings.usermenu[button][item], USERMENU_ITEM_OPTIONS, USERMENU_ITEM_OPTION_COUNT, true, NULL, CRCInput::RC_nokey, "", true ));
	}

	int res = ums->exec(NULL, "");
	selected = ums->getSelected();
	delete ums;

	return res;
}
/* shows entries for proxy settings */
void CProxySetup::showProxySetup()
{
	//init
	CMenuWidget * mn = new CMenuWidget(menue_title, menue_icon, width);
	mn->setPreselected(selected);

	if (menue_title != NONEXISTANT_LOCALE)
	{
		CMenuSeparator * proxy_subhead = new CMenuSeparator(CMenuSeparator::ALIGN_LEFT | CMenuSeparator::SUB_HEAD | CMenuSeparator::STRING, LOCALE_FLASHUPDATE_PROXYSERVER_SEP);
		mn->addItem(proxy_subhead);
	}

	mn->addItem(GenericMenuSeparator);
	mn->addItem(GenericMenuBack);
	mn->addItem(GenericMenuSeparatorLine);

	CStringInputSMS softUpdate_proxy(LOCALE_FLASHUPDATE_PROXYSERVER, g_settings.softupdate_proxyserver, 23, LOCALE_FLASHUPDATE_PROXYSERVER_HINT1, LOCALE_FLASHUPDATE_PROXYSERVER_HINT2, "abcdefghijklmnopqrstuvwxyz0123456789-.: ");
	mn->addItem(new CMenuForwarder(LOCALE_FLASHUPDATE_PROXYSERVER, true, g_settings.softupdate_proxyserver, &softUpdate_proxy, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED));

	CStringInputSMS softUpdate_proxyuser(LOCALE_FLASHUPDATE_PROXYUSERNAME, g_settings.softupdate_proxyusername, 23, LOCALE_FLASHUPDATE_PROXYUSERNAME_HINT1, LOCALE_FLASHUPDATE_PROXYUSERNAME_HINT2, "abcdefghijklmnopqrstuvwxyz0123456789!""§$%&/()=?-. ");
	mn->addItem(new CMenuForwarder(LOCALE_FLASHUPDATE_PROXYUSERNAME, true, g_settings.softupdate_proxyusername, &softUpdate_proxyuser, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN));

	CStringInputSMS softUpdate_proxypass(LOCALE_FLASHUPDATE_PROXYPASSWORD, g_settings.softupdate_proxypassword, 20, LOCALE_FLASHUPDATE_PROXYPASSWORD_HINT1, LOCALE_FLASHUPDATE_PROXYPASSWORD_HINT2, "abcdefghijklmnopqrstuvwxyz0123456789!""§$%&/()=?-. ");
	mn->addItem(new CMenuForwarder(LOCALE_FLASHUPDATE_PROXYPASSWORD, true, g_settings.softupdate_proxypassword, &softUpdate_proxypass, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW));

	mn->exec(NULL, "");
	mn->hide();
	selected = mn->getSelected();
	delete mn;
}
Example #3
0
void CZapitSetup::showMenu()
{
	//menue init
	CMenuWidget * zapit = new CMenuWidget(LOCALE_MISCSETTINGS_ZAPIT, NEUTRINO_ICON_SETTINGS);
	
	zapit->setSelected(selected);
	
	// intros
	zapit->addItem(new CMenuForwarder(LOCALE_MENU_BACK, true, NULL, NULL, NULL, CRCInput::RC_nokey, NEUTRINO_ICON_BUTTON_LEFT));
	zapit->addItem(new CMenuSeparator(CMenuSeparator::LINE));
	
	// save settings
	zapit->addItem(new CMenuForwarder(LOCALE_MAINSETTINGS_SAVESETTINGSNOW, true, NULL, this, "save", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED));
	zapit->addItem(new CMenuSeparator(CMenuSeparator::LINE));
	
	int shortcut = 1;

	//zapit
	zapit->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_ZAPIT, &g_settings.uselastchannel, OPTIONS_OFF1_ON0_OPTIONS, OPTIONS_OFF1_ON0_OPTION_COUNT, true, this, CRCInput::convertDigitToKey(shortcut++) ));
	zapit->addItem(zapit1 = new CMenuOptionChooser(LOCALE_ZAPITSETUP_LAST_MODE, &g_settings.lastChannelMode, OPTIONS_LASTMODE_OPTIONS, OPTIONS_LASTMODE_OPTION_COUNT, !g_settings.uselastchannel, this, CRCInput::convertDigitToKey(shortcut++) ));
	zapit->addItem(zapit2 = new CMenuForwarder(LOCALE_ZAPITSETUP_LAST_TV, !g_settings.uselastchannel, g_settings.StartChannelTV, /*new CSelectChannelWidget(CZapitClient::MODE_TV)*/ this, "tv", CRCInput::convertDigitToKey(shortcut++) ));
	zapit->addItem(zapit3 = new CMenuForwarder(LOCALE_ZAPITSETUP_LAST_RADIO, !g_settings.uselastchannel, g_settings.StartChannelRadio, /*new CSelectChannelWidget(CZapitClient::MODE_RADIO)*/ this, "radio", CRCInput::convertDigitToKey(shortcut++) ));

	zapit->exec(NULL, "");
	zapit->hide();
	selected = zapit->getSelected();
	
	delete zapit;
}
Example #4
0
/* audio settings menu */
void CAudioSetup::showAudioSetup()
{
	CAudioSetupNotifier audioSetupNotifier;

	//menue init
	CMenuWidget* audioSettings = new CMenuWidget(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width);
	audioSettings->setPreselected(selected);

	//subhead
	audioSettings->addItem( new CMenuSeparator(CMenuSeparator::ALIGN_LEFT | CMenuSeparator::SUB_HEAD | CMenuSeparator::STRING, LOCALE_MAINSETTINGS_AUDIO));

	// intros
	audioSettings->addItem(GenericMenuSeparator);
	audioSettings->addItem(GenericMenuBack);
	audioSettings->addItem(GenericMenuSeparatorLine);

	CMenuOptionChooser* oj = new CMenuOptionChooser(LOCALE_AUDIOMENU_ANALOGOUT, &g_settings.audio_AnalogMode, AUDIOMENU_ANALOGOUT_OPTIONS, AUDIOMENU_ANALOGOUT_OPTION_COUNT, true, &audioSetupNotifier);
	audioSettings->addItem( oj );

	oj = new CMenuOptionChooser(LOCALE_AUDIOMENU_AUDIO_LEFT_RIGHT_SELECTABLE, &g_settings.audio_left_right_selectable, AUDIOMENU_LEFT_RIGHT_SELECTABEL_OPTIONS, AUDIOMENU_LEFT_RIGHT_SELECTABLE_OPTION_COUNT, true, &audioSetupNotifier);
	audioSettings->addItem( oj );

	audioSettings->addItem(GenericMenuSeparatorLine);

	oj = new CMenuOptionChooser(LOCALE_AUDIOMENU_AUDIOCHANNEL_UP_DOWN_ENABLE, &g_settings.audiochannel_up_down_enable, AUDIOMENU_AUDIOCHANNEL_UP_DOWN_ENABLE_OPTIONS, AUDIOMENU_AUDIOCHANNEL_UP_DOWN_ENABLE_COUNT, true, &audioSetupNotifier);
	audioSettings->addItem( oj );

	oj = new CMenuOptionChooser(LOCALE_AUDIOMENU_DOLBYDIGITAL, &g_settings.audio_DolbyDigital, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, &audioSetupNotifier);
	audioSettings->addItem(oj);
	
	audioSettings->addItem(GenericMenuSeparatorLine);

#ifdef HAVE_DBOX_HARDWARE
	CStringInput audio_PCMOffset(LOCALE_AUDIOMENU_PCMOFFSET, g_settings.audio_PCMOffset, 2, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "0123456789 ", &audioSetupNotifier);
	CMenuForwarder *mf = new CMenuForwarder(LOCALE_AUDIOMENU_PCMOFFSET, (g_settings.audio_avs_Control == CControld::TYPE_LIRC), g_settings.audio_PCMOffset, &audio_PCMOffset);
	CAudioSetupNotifier2 audioSetupNotifier2(mf);

	oj = new CMenuOptionChooser(LOCALE_AUDIOMENU_AVS_CONTROL, &g_settings.audio_avs_Control, AUDIOMENU_AVS_CONTROL_OPTIONS, AUDIOMENU_AVS_CONTROL_OPTION_COUNT, true, &audioSetupNotifier2);
	audioSettings->addItem(oj);
	audioSettings->addItem(mf);
#endif
#ifdef HAVE_TRIPLEDRAGON
	CAudioSetupNotifier2 audioSetupNotifier2(NULL);
	oj = new CMenuOptionChooser(LOCALE_AUDIOMENU_AVS_CONTROL, &g_settings.audio_avs_Control, AUDIOMENU_AVS_CONTROL_OPTIONS, AUDIOMENU_AVS_CONTROL_OPTION_COUNT, true, &audioSetupNotifier2);
	audioSettings->addItem(oj);
#endif
	
	// volume bar steps
	CStringInput audio_step(LOCALE_AUDIOMENU_VOLUMEBAR_AUDIOSTEPS,g_settings.audio_step, 2, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "0123456789 ", &audioSetupNotifier);
	CMenuForwarder *as = new CMenuForwarder(LOCALE_AUDIOMENU_VOLUMEBAR_AUDIOSTEPS, true, g_settings.audio_step, &audio_step);
	audioSettings->addItem(as);


	audioSettings->exec(NULL, "");
	audioSettings->hide();
	selected = audioSettings->getSelected();
	delete audioSettings;
}
Example #5
0
/* audio settings menu */
int CAudioSetup::showAudioSetup()
{
	CAudioSetupNotifier audioSetupNotifier;

	//menue init
	CMenuWidget* audioSettings = new CMenuWidget(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_AUDIO, width);
	audioSettings->setPreselected(selected);

	// intros
	audioSettings->addIntroItems(LOCALE_MAINSETTINGS_AUDIO);

	CMenuOptionChooser* oj = new CMenuOptionChooser(LOCALE_AUDIOMENU_ANALOGOUT, &g_settings.audio_AnalogMode, AUDIOMENU_ANALOGOUT_OPTIONS, AUDIOMENU_ANALOGOUT_OPTION_COUNT, true, &audioSetupNotifier);
	audioSettings->addItem( oj );

	oj = new CMenuOptionChooser(LOCALE_AUDIOMENU_AUDIO_LEFT_RIGHT_SELECTABLE, &g_settings.audio_left_right_selectable, AUDIOMENU_LEFT_RIGHT_SELECTABEL_OPTIONS, AUDIOMENU_LEFT_RIGHT_SELECTABLE_OPTION_COUNT, true);
	audioSettings->addItem( oj );

	audioSettings->addItem(GenericMenuSeparatorLine);

	oj = new CMenuOptionChooser(LOCALE_AUDIOMENU_AUDIOCHANNEL_UP_DOWN_ENABLE, &g_settings.audiochannel_up_down_enable, AUDIOMENU_AUDIOCHANNEL_UP_DOWN_ENABLE_OPTIONS, AUDIOMENU_AUDIOCHANNEL_UP_DOWN_ENABLE_COUNT, true);
	audioSettings->addItem( oj );

	oj = new CMenuOptionChooser(LOCALE_AUDIOMENU_DOLBYDIGITAL, &g_settings.audio_DolbyDigital, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true);
	audioSettings->addItem(oj);
	
	audioSettings->addItem(GenericMenuSeparatorLine);

#ifdef HAVE_DBOX_HARDWARE
	CMenuOptionNumberChooser *mf = new CMenuOptionNumberChooser(LOCALE_AUDIOMENU_PCMOFFSET, &g_settings.audio_PCMOffset, (g_settings.audio_avs_Control == CControld::TYPE_LIRC), 0, 99, 0, 0, NONEXISTANT_LOCALE, NULL, &audioSetupNotifier, CRCInput::RC_nokey, "", true);
	CAudioSetupNotifier2 audioSetupNotifier2(mf);

	oj = new CMenuOptionChooser(LOCALE_AUDIOMENU_AVS_CONTROL, &g_settings.audio_avs_Control, AUDIOMENU_AVS_CONTROL_OPTIONS, AUDIOMENU_AVS_CONTROL_OPTION_COUNT, true, &audioSetupNotifier2);
	audioSettings->addItem(oj);
	audioSettings->addItem(mf);
#endif
#ifdef HAVE_TRIPLEDRAGON
	CAudioSetupNotifier2 audioSetupNotifier2(NULL);
	oj = new CMenuOptionChooser(LOCALE_AUDIOMENU_AVS_CONTROL, &g_settings.audio_avs_Control, AUDIOMENU_AVS_CONTROL_OPTIONS, AUDIOMENU_AVS_CONTROL_OPTION_COUNT, true, &audioSetupNotifier2);
	audioSettings->addItem(oj);
#endif
	
	// volume bar steps
	CMenuOptionNumberChooser *as = new CMenuOptionNumberChooser(LOCALE_AUDIOMENU_VOLUMEBAR_AUDIOSTEPS, &g_settings.audio_step, true, 0, 25, 0, 0, NONEXISTANT_LOCALE, NULL, NULL, CRCInput::RC_nokey, "", true);
	audioSettings->addItem(as);

	// initial volume
	CMenuOptionNumberChooser *iv = new CMenuOptionNumberChooser(LOCALE_AUDIOMENU_INITIAL_VOLUME, &g_settings.audio_initial_volume, true, 0, 100, 0, 0, LOCALE_AUDIOMENU_INITIAL_VOLUME_RESTORE, NULL, NULL, CRCInput::RC_nokey, "", true);
	iv->setNumberFormat("%d%%");
	audioSettings->addItem(iv);

	int res = audioSettings->exec(NULL, "");
	selected = audioSettings->getSelected();
	delete audioSettings;

	return res;
}
Example #6
0
int CVideoSetup::showVideoSetup()
{
	//init
	CMenuWidget * videosetup = new CMenuWidget(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_VIDEO, width);
	videosetup->setPreselected(selected);

	//video signal type
	CMenuOptionChooser * scart = new CMenuOptionChooser(LOCALE_VIDEOMENU_VIDEOSIGNAL, &video_out_signal, VIDEOMENU_VIDEOSIGNAL_OPTIONS, VIDEOMENU_VIDEOSIGNAL_OPTION_COUNT, true, this);

	//intros
	videosetup->addIntroItems(LOCALE_VIDEOMENU_HEAD, LOCALE_VIDEOMENU_TV_SCART);

	videosetup->addItem(scart); 	//video signal type
	
	//video format
	CMenuOptionChooser * oj1 = new CMenuOptionChooser(LOCALE_VIDEOMENU_VIDEOFORMAT, &g_settings.video_Format, VIDEOMENU_VIDEOFORMAT_OPTIONS, VIDEOMENU_VIDEOFORMAT_OPTION_COUNT, true, this);
	//video format background
	CMenuOptionChooser * oj2 = new CMenuOptionChooser(LOCALE_VIDEOMENU_VIDEOFORMAT_BG, &g_settings.video_backgroundFormat, VIDEOMENU_VIDEOFORMAT_OPTIONS, VIDEOMENU_VIDEOFORMAT_OPTION_COUNT-1, true, this);

#ifdef HAVE_DBOX_HARDWARE
	//rgb centering
	CRGBCSyncControler * RGBCSyncControler = new CRGBCSyncControler(LOCALE_VIDEOMENU_RGB_CENTERING, &g_settings.video_csync);
	bool sc_active = ((video_out_signal == CControldClient::VIDEOOUTPUT_RGB) || (video_out_signal == CControldClient::VIDEOOUTPUT_YUV_VBS) || (video_out_signal ==  CControldClient::VIDEOOUTPUT_YUV_CVBS));
	SyncControlerForwarder = new CMenuForwarder(LOCALE_VIDEOMENU_RGB_CENTERING, sc_active, NULL, RGBCSyncControler, NULL, CRCInput::RC_red);
#endif

	videosetup->addItem(oj1);	//video format
	videosetup->addItem(oj2);	//video format background
#ifdef HAVE_DBOX_HARDWARE
	/* only the dbox can change the RGB centering */
	videosetup->addItem(SyncControlerForwarder);	//rgb centering
#endif
	videosetup->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_VIDEOMENU_VCR_SCART));

	// Switching VCR Output presently does not work on the Philips and on non-dboxes
	if (g_info.box_Type == CControld::TUXBOX_MAKER_SAGEM || g_info.box_Type == CControld::TUXBOX_MAKER_NOKIA)
	{
		bool vo_active = ((video_out_signal == CControldClient::VIDEOOUTPUT_COMPOSITE) || (video_out_signal == CControldClient::VIDEOOUTPUT_SVIDEO));
		VcrVideoOutSignalOptionChooser = new CMenuOptionChooser(LOCALE_VIDEOMENU_VCRSIGNAL, &vcr_video_out_signal, VIDEOMENU_VCRSIGNAL_OPTIONS, VIDEOMENU_VCRSIGNAL_OPTION_COUNT, vo_active, this);
		videosetup->addItem(VcrVideoOutSignalOptionChooser);
	}

	//video vcr switch
	videosetup->addItem(new CMenuOptionChooser(LOCALE_VIDEOMENU_VCRSWITCH, &g_settings.vcr_AutoSwitch, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); //video vcr switch

	int res = videosetup->exec(NULL, "");
	selected = videosetup->getSelected();
	delete videosetup;

#ifdef HAVE_DBOX_HARDWARE
	delete RGBCSyncControler;
#endif

	return res;
}
/* shows entries for samba settings */
void CSambaSetup::showSambaSetup()
{
	//init
	CMenuWidget * sm = new CMenuWidget(menue_title, menue_icon, width);
	sm->setPreselected(selected);

	if (menue_title != NONEXISTANT_LOCALE)
	{
		CMenuSeparator * sm_subhead = new CMenuSeparator(CMenuSeparator::ALIGN_LEFT | CMenuSeparator::SUB_HEAD | CMenuSeparator::STRING, LOCALE_SAMBASERVER_SETUP);
		sm->addItem(sm_subhead);
	}

	//start/stop sambaserver, set real server status
	if (getPidof(NMBD).empty() || getPidof(SMBD).empty())
	{
		g_settings.smb_setup_samba_on_off = OFF;
		remove(SAMBA_MARKER);
	}
	else
		g_settings.smb_setup_samba_on_off = ON;

	CSambaOnOffNotifier smb_notifier(SAMBA_MARKER);
	CMenuOptionChooser * sm_start = new CMenuOptionChooser(LOCALE_SAMBASERVER_SETUP_STAT, &g_settings.smb_setup_samba_on_off, SMB_YES_NO_OPTIONS, SMB_YES_NO_OPTION_COUNT, true, &smb_notifier, CRCInput::RC_standby, NEUTRINO_ICON_BUTTON_POWER);

	//workroup, domainname
	CStringInputSMS sm_input_domain(LOCALE_SAMBASERVER_SETUP_WORKGROUP, &g_settings.smb_setup_samba_workgroup,15, LOCALE_SAMBASERVER_SETUP_WORKGROUP_HINT1, LOCALE_SAMBASERVER_SETUP_WORKGROUP_HINT2, "abcdefghijklmnopqrstuvwxyz0123456789_ ");
	CMenuForwarder * sm_fw_domain = new CMenuForwarder(LOCALE_SAMBASERVER_SETUP_WORKGROUP, true, g_settings.smb_setup_samba_workgroup, &sm_input_domain, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN);

	//address,interface
	CMenuForwarder * sm_fw_interface = new CMenuForwarder(LOCALE_SAMBASERVER_SETUP_INTERFACE, false, interface);

	//add items
	sm->addItem(GenericMenuSeparator);
	sm->addItem(GenericMenuBack);
	sm->addItem(GenericMenuSeparatorLine);
	//-----------------------------------
	sm->addItem(sm_start);			//server stat
	sm->addItem(GenericMenuSeparatorLine);
	//-----------------------------------
	sm->addItem(sm_fw_domain);		//workgroup/domain input
	sm->addItem(sm_fw_interface);		//interface

	sm->exec(NULL, "");
	sm->hide();
	selected = sm->getSelected();
	delete sm;
}
Example #8
0
void CEsdSetup::showEsdSetup()
/*shows the esd setup menue*/
{
	CMenuWidget* esdSetup = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width);
	esdSetup->setPreselected(selected);

	esdSetup->addItem( new CMenuSeparator(CMenuSeparator::ALIGN_LEFT | CMenuSeparator::SUB_HEAD | CMenuSeparator::STRING, LOCALE_ESOUND_NAME));

	// intros
	esdSetup->addItem(GenericMenuSeparator);
	esdSetup->addItem(GenericMenuBack);
	esdSetup->addItem(GenericMenuSeparatorLine);

	// entry
	CStringInput setup_EsoundPort(LOCALE_ESOUND_PORT, g_settings.esound_port, 5, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "0123456789 ");
	esdSetup->addItem(new CMenuForwarder(LOCALE_ESOUND_PORT, true, g_settings.esound_port, &setup_EsoundPort));

	esdSetup->exec(NULL, "");
	esdSetup->hide();
	selected = esdSetup->getSelected();
	delete esdSetup;
}
Example #9
0
int CSoftwareUpdate::showSoftwareUpdate()
/* shows the menue and options for software update */
{
	CMenuWidget* softUpdate = new CMenuWidget(LOCALE_SERVICEMENU_HEAD, NEUTRINO_ICON_UPDATE, width);
	softUpdate->setPreselected(selected);

	// intros
	softUpdate->addIntroItems(LOCALE_SERVICEMENU_UPDATE);

	// experts-functions 
	softUpdate->addItem(new CMenuForwarder(LOCALE_FLASHUPDATE_EXPERTFUNCTIONS, true, NULL, this, "experts", CRCInput::RC_red));

#ifndef DISABLE_INTERNET_UPDATE
#ifndef HAVE_DREAMBOX_HARDWARE
	softUpdate->addItem(GenericMenuSeparatorLine);
	CMenuOptionChooser *oj = new CMenuOptionChooser(LOCALE_FLASHUPDATE_UPDATEMODE, &g_settings.softupdate_mode, FLASHUPDATE_UPDATEMODE_OPTIONS, FLASHUPDATE_UPDATEMODE_OPTION_COUNT, true);
	softUpdate->addItem( oj );
#endif
#endif
	
 	/* show current version */
	showSoftwareUpdateImageinfo(softUpdate);

	// update check
	CFlashUpdate* flashUpdate = new CFlashUpdate();
	softUpdate->addItem(GenericMenuSeparatorLine);
	softUpdate->addItem(new CMenuForwarder(LOCALE_FLASHUPDATE_CHECKUPDATE, true, NULL, flashUpdate, NULL, CRCInput::RC_green));

	int res = softUpdate->exec (NULL, "");
	selected = softUpdate->getSelected();
	delete softUpdate;

	delete flashUpdate;

	return res;
}
Example #10
0
/* audio settings menu */
int CAudioSetup::showAudioSetup()
{
	//menue init
	CMenuWidget* audioSettings = new CMenuWidget(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width);
	audioSettings->setSelected(selected);
	audioSettings->setWizardMode(is_wizard);

	//analog modes (stereo, mono l/r...)
	CMenuOptionChooser * as_oj_analogmode 	= new CMenuOptionChooser(LOCALE_AUDIOMENU_ANALOG_MODE, &g_settings.audio_AnalogMode, AUDIOMENU_ANALOGOUT_OPTIONS, AUDIOMENU_ANALOGOUT_OPTION_COUNT, true, audioSetupNotifier);
	as_oj_analogmode->setHint("", LOCALE_MENU_HINT_AUDIO_ANALOG_MODE);

	//dd subchannel auto on/off
	CMenuOptionChooser * as_oj_ddsubchn = new CMenuOptionChooser(LOCALE_AUDIOMENU_DOLBYDIGITAL, &g_settings.audio_DolbyDigital, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, audioSetupNotifier);
	as_oj_ddsubchn->setHint("", LOCALE_MENU_HINT_AUDIO_DD);

	//dd via hdmi
	CMenuOptionChooser * as_oj_dd_hdmi = NULL;
	if (g_info.hw_caps->has_HDMI) {
		as_oj_dd_hdmi = new CMenuOptionChooser(LOCALE_AUDIOMENU_HDMI_DD, &g_settings.hdmi_dd, AUDIOMENU_HDMI_DD_OPTIONS, AUDIOMENU_HDMI_DD_OPTION_COUNT, true, audioSetupNotifier);
		as_oj_dd_hdmi->setHint("", LOCALE_MENU_HINT_AUDIO_HDMI_DD);
	}

	//dd via spdif
	CMenuOptionChooser * as_oj_dd_spdif 	= new CMenuOptionChooser(LOCALE_AUDIOMENU_SPDIF_DD, &g_settings.spdif_dd, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, audioSetupNotifier);
	as_oj_dd_spdif->setHint("", LOCALE_MENU_HINT_AUDIO_SPDIF_DD);

	CMenuOptionChooser * as_oj_avsync = NULL;
	CMenuOptionNumberChooser * as_oj_vsteps = NULL;
	CMenuOptionNumberChooser * st = NULL;

	//av synch
	as_oj_avsync = new CMenuOptionChooser(LOCALE_AUDIOMENU_AVSYNC, &g_settings.avsync, AUDIOMENU_AVSYNC_OPTIONS, AUDIOMENU_AVSYNC_OPTION_COUNT, true, audioSetupNotifier);
	as_oj_avsync->setHint("", LOCALE_MENU_HINT_AUDIO_AVSYNC);

	//volume steps
	as_oj_vsteps = new CMenuOptionNumberChooser(LOCALE_AUDIOMENU_VOLUME_STEP, (int *)&g_settings.current_volume_step, true, 1, 25, NULL);
	as_oj_vsteps->setHint("", LOCALE_MENU_HINT_AUDIO_VOLSTEP);

	st = new CMenuOptionNumberChooser(LOCALE_AUDIOMENU_VOLUME_START, &g_settings.start_volume, true, -1, 100, NULL, CRCInput::RC_nokey, NULL, 0, -1, LOCALE_OPTIONS_OFF);
	st->setHint("", LOCALE_MENU_HINT_AUDIO_VOLSTART);
	//clock rec
	//CMenuOptionChooser * as_oj_clockrec new CMenuOptionChooser(LOCALE_AUDIOMENU_CLOCKREC, &g_settings.clockrec, AUDIOMENU_CLOCKREC_OPTIONS, AUDIOMENU_CLOCKREC_OPTION_COUNT, true, audioSetupNotifier);

#if HAVE_COOL_HARDWARE
	/* only coolstream has SRS stuff, so only compile it there */
	//SRS
	//SRS algo
	CMenuOptionChooser * as_oj_algo 	= new CMenuOptionChooser(LOCALE_AUDIO_SRS_ALGO, &g_settings.srs_algo, AUDIOMENU_SRS_OPTIONS, AUDIOMENU_SRS_OPTION_COUNT, g_settings.srs_enable, audioSetupNotifier);
	as_oj_algo->setHint("", LOCALE_MENU_HINT_AUDIO_SRS_ALGO);

	//SRS noise manage
	CMenuOptionChooser * as_oj_noise 	= new CMenuOptionChooser(LOCALE_AUDIO_SRS_NMGR, &g_settings.srs_nmgr_enable, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.srs_enable, audioSetupNotifier);
	as_oj_noise->setHint("", LOCALE_MENU_HINT_AUDIO_SRS_NMGR);

	//SRS reverence volume
	CMenuOptionNumberChooser * as_oj_volrev = new CMenuOptionNumberChooser(LOCALE_AUDIO_SRS_VOLUME, &g_settings.srs_ref_volume, g_settings.srs_enable, 1, 100, audioSetupNotifier);
	as_oj_volrev->setHint("", LOCALE_MENU_HINT_AUDIO_SRS_VOLUME);

	//SRS on/off
	CTruVolumeNotifier truevolSetupNotifier(as_oj_algo, as_oj_noise, as_oj_volrev);
	CMenuOptionChooser * as_oj_srsonoff 	= new CMenuOptionChooser(LOCALE_AUDIO_SRS_IQ, &g_settings.srs_enable, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, &truevolSetupNotifier);
	as_oj_srsonoff->setHint("", LOCALE_MENU_HINT_AUDIO_SRS);
#endif

	// ac3,pcm and clear volume adjustment
	CMenuOptionNumberChooser *adj_ac3 = NULL, *adj_pcm = NULL;
	CMenuForwarder *adj_clear = NULL;
	adj_ac3 = new CMenuOptionNumberChooser(LOCALE_AUDIOMENU_VOLUME_ADJUSTMENT_AC3,
	(int *)&g_settings.audio_volume_percent_ac3, true, 0, 100, audioSetupNotifier);
	adj_ac3->setNumberFormat("%d%%");
	adj_ac3->setHint("", LOCALE_MENU_HINT_AUDIO_ADJUST_VOL_AC3);

	adj_pcm  = new CMenuOptionNumberChooser(LOCALE_AUDIOMENU_VOLUME_ADJUSTMENT_PCM,
	(int *)&g_settings.audio_volume_percent_pcm, true, 0, 100, audioSetupNotifier);
	adj_pcm->setNumberFormat("%d%%");
	adj_pcm->setHint("", LOCALE_MENU_HINT_AUDIO_ADJUST_VOL_PCM);

	adj_clear = new CMenuForwarder(LOCALE_AUDIOMENU_VOLUME_ADJUSTMENT_CLEAR, true, NULL, this, "clear_vol_map");
	adj_clear->setHint("", LOCALE_MENU_HINT_AUDIO_ADJUST_VOL_CLEAR);
	//paint items
	audioSettings->addIntroItems(LOCALE_MAINSETTINGS_AUDIO);
	//---------------------------------------------------------
	audioSettings->addItem(as_oj_analogmode);
	audioSettings->addItem(GenericMenuSeparatorLine);
	//---------------------------------------------------------
	if (g_info.hw_caps->has_HDMI)
		audioSettings->addItem(as_oj_dd_hdmi);
	audioSettings->addItem(as_oj_dd_spdif);
	audioSettings->addItem(as_oj_ddsubchn);
	//---------------------------------------------------------
	audioSettings->addItem(GenericMenuSeparatorLine);
	audioSettings->addItem(as_oj_avsync);
	audioSettings->addItem(as_oj_vsteps);
	audioSettings->addItem(st);
	//audioSettings->addItem(as_clockrec);
	//---------------------------------------------------------
#if HAVE_COOL_HARDWARE
	/* only coolstream has SRS stuff, so only compile it there */
	audioSettings->addItem(GenericMenuSeparatorLine);
	audioSettings->addItem(as_oj_srsonoff);
	audioSettings->addItem(as_oj_algo);
#ifndef BOXMODEL_APOLLO
	audioSettings->addItem(as_oj_noise);
#endif
	audioSettings->addItem(as_oj_volrev);
#endif
#if 0
	audioSettings->addItem(mf);
#endif
#if HAVE_SPARK_HARDWARE || HAVE_DUCKBOX_HARDWARE
	CMenuOptionNumberChooser *ch;
	audioSettings->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_AUDIOMENU_MIXER_VOLUME));
	ch = new CMenuOptionNumberChooser(LOCALE_AUDIOMENU_MIXER_VOLUME_ANALOG,
		(int *)&g_settings.audio_mixer_volume_analog, true, 0, 100, audioSetupNotifier);
	ch->setNumberFormat("%d%%");
	audioSettings->addItem(ch);
	ch = new CMenuOptionNumberChooser(LOCALE_AUDIOMENU_MIXER_VOLUME_HDMI,
		(int *)&g_settings.audio_mixer_volume_hdmi, true, 0, 100, audioSetupNotifier);
	ch->setNumberFormat("%d%%");
	audioSettings->addItem(ch);
	ch = new CMenuOptionNumberChooser(LOCALE_AUDIOMENU_MIXER_VOLUME_SPDIF,
		(int *)&g_settings.audio_mixer_volume_spdif, true, 0, 100, audioSetupNotifier);
	ch->setNumberFormat("%d%%");
	audioSettings->addItem(ch);
#endif
	audioSettings->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_AUDIOMENU_VOLUME_ADJUSTMENT));
	audioSettings->addItem(adj_ac3);
	audioSettings->addItem(adj_pcm);
	audioSettings->addItem(adj_clear);

	int res = audioSettings->exec(NULL, "");
	selected = audioSettings->getSelected();
	delete audioSettings;
#ifdef BOXMODEL_APOLLO
	delete as_oj_noise;
#endif
	CZapit::getInstance()->SetVolumePercent(g_settings.audio_volume_percent_ac3, g_settings.audio_volume_percent_pcm);

	return res;
}
/*shows media setup menue entries*/
int CMediaPlayerSetup::showMediaPlayerSetup()
{
	CMenuWidget* mediaSetup = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width);
	mediaSetup->setSelected(selected);

	// intros
	mediaSetup->addIntroItems(LOCALE_MAINMENU_MEDIA);

	CMenuForwarder *mf;

	CAudioPlayerSetup asetup;
	mf = new CMenuForwarder(LOCALE_AUDIOPLAYER_NAME, true, NULL, &asetup, "", CRCInput::RC_red);
	mf->setHint(NEUTRINO_ICON_HINT_APLAY, LOCALE_MENU_HINT_APLAY_SETUP);
	mediaSetup->addItem(mf);

	CPictureViewerSetup psetup;
	mf = new CMenuForwarder(LOCALE_PICTUREVIEWER_HEAD, true, NULL, &psetup, "", CRCInput::RC_green);
	mf->setHint(NEUTRINO_ICON_HINT_PICVIEW, LOCALE_MENU_HINT_PICTUREVIEWER_SETUP);
	mediaSetup->addItem(mf);

	CWebTVSetup wsetup;
	mf = new CMenuForwarder(LOCALE_WEBTV_HEAD, true, NULL, &wsetup, "show_menu", CRCInput::RC_yellow);
	mf->setHint(NEUTRINO_ICON_HINT_TVMODE /* FIXME */, LOCALE_MENU_HINT_WEBTV_SETUP);
	mediaSetup->addItem(mf);

	mediaSetup->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_MAINMENU_MOVIEPLAYER));

	CMovieBrowser msetup;
	int shortcut = 1;
	mf = new CMenuForwarder(LOCALE_MOVIEBROWSER_HEAD, true, NULL, &msetup, "show_menu", CRCInput::convertDigitToKey(shortcut++));
	mf->setHint(NEUTRINO_ICON_HINT_MB, LOCALE_MENU_HINT_MOVIEBROWSER_SETUP);
	mediaSetup->addItem(mf);

	mf = new CMenuForwarder(LOCALE_MOVIEPLAYER_YTPLAYBACK, true, NULL, &msetup, "show_ytmenu", CRCInput::convertDigitToKey(shortcut++));
	mf->setHint(NEUTRINO_ICON_HINT_YTPLAY, LOCALE_MENU_HINT_YTPLAY_SETUP);
	mediaSetup->addItem(mf);


	int res = mediaSetup->exec (NULL, "");
	selected = mediaSetup->getSelected();
	delete mediaSetup;
	return res;

#if 0
	CMenuWidget* mediaSetup = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width);
	mediaSetup->setSelected(selected);

	// intros
	mediaSetup->addIntroItems(LOCALE_MAINSETTINGS_MULTIMEDIA);

	CPictureViewerSetup psetup;
	mediaSetup->addItem(new CMenuForwarder(LOCALE_PICTUREVIEWER_HEAD, true, NULL, &psetup, "", CRCInput::RC_red));
	CAudioPlayerSetup asetup;
	mediaSetup->addItem(new CMenuForwarder(LOCALE_AUDIOPLAYER_NAME, true, NULL, &asetup, "", CRCInput::RC_green));

	CWebTVSetup wsetup;
	CMenuForwarder *mf;
	mf = new CMenuForwarder(LOCALE_WEBTV_HEAD, true, NULL, &wsetup, "show_menu", CRCInput::RC_yellow);
	mf->setHint(NEUTRINO_ICON_HINT_TVMODE /* FIXME */, LOCALE_MENU_HINT_WEBTV_SETUP);
	mediaSetup->addItem(mf);

	int res = mediaSetup->exec (NULL, "");
	selected = mediaSetup->getSelected();
	delete mediaSetup;
	return res;
#endif
}
Example #12
0
int CNetworkSetup::showNetworkSetup()
{
	bool loop = true;
	int res = menu_return::RETURN_REPAINT;

	while (loop)
	{		
		//menue init
		CMenuWidget* networkSettings = new CMenuWidget(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width);
		networkSettings->setPreselected(selected);

		//apply button
		CMenuForwarder *m0 = new CMenuForwarder(LOCALE_NETWORKMENU_SETUPNOW, true, NULL, this, "networkapply", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED);
	
		//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);
		CIPInput networkSettings_Broadcast  (LOCALE_NETWORKMENU_BROADCAST , network_broadcast , LOCALE_IPSETUP_HINT_1, LOCALE_IPSETUP_HINT_2);
		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);
	

		//auto start
		CMenuOptionChooser* o1 = new CMenuOptionChooser(LOCALE_NETWORKMENU_SETUPONSTARTUP, &network_automatic_start, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true);

		//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   );
		CMenuForwarder *m3 = new CMenuForwarder(LOCALE_NETWORKMENU_BROADCAST , networkConfig->inet_static, network_broadcast , &networkSettings_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);
		
		CDHCPNotifier dhcpNotifier(m1,m2,m3,m4,m5);
		CMenuOptionChooser* o2 = new CMenuOptionChooser(LOCALE_NETWORKMENU_DHCP, &network_dhcp, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, &dhcpNotifier);
		
		//paint menu items
		//intros
		networkSettings->addIntroItems(LOCALE_MAINSETTINGS_NETWORK);
	
		networkSettings->addItem( m0 );
	
		networkSettings->addItem(new CMenuForwarder(LOCALE_NETWORKMENU_TEST, true, NULL, this, "networktest", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN));
		networkSettings->addItem(new CMenuForwarder(LOCALE_NETWORKMENU_SHOW, true, NULL, this, "networkshow", CRCInput::RC_help, NEUTRINO_ICON_BUTTON_HELP));
		networkSettings->addItem(GenericMenuSeparatorLine);
	
		networkSettings->addItem(o1);
		networkSettings->addItem(GenericMenuSeparatorLine);
		networkSettings->addItem(o2);
		networkSettings->addItem(GenericMenuSeparatorLine);
	
		networkSettings->addItem( m1);
		networkSettings->addItem( m2);
		networkSettings->addItem( m3);
	
		networkSettings->addItem(GenericMenuSeparatorLine);
		networkSettings->addItem( m4);
		networkSettings->addItem( m5);
		networkSettings->addItem(GenericMenuSeparatorLine);
		
		//ntp
		//prepare ntp input
		CStringInputSMS networkSettings_NtpServer(LOCALE_NETWORKMENU_NTPSERVER, &g_settings.network_ntpserver, 30, false, LOCALE_NETWORKMENU_NTPSERVER_HINT1, LOCALE_NETWORKMENU_NTPSERVER_HINT2, "abcdefghijklmnopqrstuvwxyz0123456789-. ", this);
	
		CStringInput networkSettings_NtpRefresh(LOCALE_NETWORKMENU_NTPREFRESH, &g_settings.network_ntprefresh, 3, false, LOCALE_NETWORKMENU_NTPREFRESH_HINT1, LOCALE_NETWORKMENU_NTPREFRESH_HINT2 , "0123456789 ", this);

		CMenuWidget* ntp = new CMenuWidget(LOCALE_MAINSETTINGS_NETWORK, NEUTRINO_ICON_SETTINGS, width);
		networkSettings->addItem(new CMenuForwarder(LOCALE_NETWORKMENU_NTPTITLE, true, NULL, ntp, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW));
		ntp->addIntroItems(LOCALE_NETWORKMENU_NTPTITLE);
		CMenuOptionChooser *ntp1 = new CMenuOptionChooser(LOCALE_NETWORKMENU_NTPENABLE, &g_settings.network_ntpenable, OPTIONS_NTPENABLE_OPTIONS, OPTIONS_NTPENABLE_OPTION_COUNT, true, this);
		CMenuForwarder *ntp2 = new CMenuForwarder(LOCALE_NETWORKMENU_NTPSERVER, true, g_settings.network_ntpserver, &networkSettings_NtpServer);
		CMenuForwarder *ntp3 = new CMenuForwarder(LOCALE_NETWORKMENU_NTPREFRESH, true, g_settings.network_ntprefresh, &networkSettings_NtpRefresh);
		
		ntp->addItem( ntp1);
		ntp->addItem( ntp2);
		ntp->addItem( ntp3);
	

	#ifdef ENABLE_GUI_MOUNT
		CMenuWidget* networkmounts = new CMenuWidget(LOCALE_MAINSETTINGS_NETWORK, NEUTRINO_ICON_SETTINGS, width);
		networkSettings->addItem(new CMenuForwarder(LOCALE_NETWORKMENU_MOUNT, true, NULL, networkmounts, NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE));
		networkmounts->addIntroItems(LOCALE_NETWORKMENU_MOUNT);

		CNFSMountGui* nfsMountGui = new CNFSMountGui();
		networkmounts->addItem(new CMenuForwarder(LOCALE_NFS_MOUNT , true, NULL, nfsMountGui, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED));

		CNFSUmountGui* nfsUmountGui = new CNFSUmountGui();
		networkmounts->addItem(new CMenuForwarder(LOCALE_NFS_UMOUNT, true, NULL, nfsUmountGui, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN));
	#endif

	#ifndef DISABLE_INTERNET_UPDATE
	#ifndef HAVE_DREAMBOX_HARDWARE
		//proxyserver
		CProxySetup* proxySetup = new CProxySetup(LOCALE_MAINSETTINGS_NETWORK);
		networkSettings->addItem(new CMenuForwarder(LOCALE_FLASHUPDATE_PROXYSERVER_SEP, true, NULL, proxySetup, NULL, CRCInput::RC_0, NEUTRINO_ICON_BUTTON_0));
 	#endif 
	#endif

	#if defined ENABLE_DRIVE_GUI && defined ENABLE_SAMBASERVER
		CSambaSetup* sambaSetup = new CSambaSetup(LOCALE_MAINSETTINGS_NETWORK);
		networkSettings->addItem(new CMenuForwarder(LOCALE_NETWORKMENU_SAMBA, true, NULL, sambaSetup, NULL, CRCInput::RC_1, NEUTRINO_ICON_BUTTON_1));
	#endif

		res = networkSettings->exec(NULL, "");
		selected = networkSettings->getSelected();
		delete networkSettings;

		delete ntp;
	#ifdef ENABLE_GUI_MOUNT
		delete networkmounts;
		delete nfsMountGui;
		delete nfsUmountGui;
	#endif
	#ifndef DISABLE_INTERNET_UPDATE
	#ifndef HAVE_DREAMBOX_HARDWARE
		delete proxySetup;
 	#endif 
	#endif
	#if defined ENABLE_DRIVE_GUI && defined ENABLE_SAMBASERVER
		delete sambaSetup;
	#endif

		// Check for changes
 		loop = settingsChanged();
 	}

	return res;
}
Example #13
0
void CScanSetup::showScanService()
{
	dprintf(DEBUG_DEBUG, "init scansettings\n");
	initScanSettings();
	
	//menue init
	CMenuWidget* scansetup = new CMenuWidget(LOCALE_SERVICEMENU_HEAD, NEUTRINO_ICON_SETTINGS, width);
	scansetup->setPreselected(selected);

	//subhead
	scansetup->addItem( new CMenuSeparator(CMenuSeparator::ALIGN_LEFT | CMenuSeparator::SUB_HEAD | CMenuSeparator::STRING, LOCALE_SERVICEMENU_SCANTS));

	//prepare scantype green
	CMenuOptionChooser* ojScantype = new CMenuOptionChooser(LOCALE_ZAPIT_SCANTYPE, (int *)&scanSettings.scanType, SCANTS_ZAPIT_SCANTYPE, SCANTS_ZAPIT_SCANTYPE_COUNT, true, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN);

	//prepare bouquet mode yellow
	CMenuOptionChooser* ojBouquets = new CMenuOptionChooser(LOCALE_SCANTS_BOUQUET, (int *)&scanSettings.bouquetMode, SCANTS_BOUQUET_OPTIONS, SCANTS_BOUQUET_OPTION_COUNT, true, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW);

	// intros
	scansetup->addItem(GenericMenuSeparator);
	scansetup->addItem(GenericMenuBack);
	scansetup->addItem(GenericMenuSeparatorLine);

	//save button red
	scansetup->addItem(new CMenuForwarder(LOCALE_MAINSETTINGS_SAVESETTINGSNOW, true, NULL, this, "save_action", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED));
	scansetup->addItem(GenericMenuSeparatorLine);

	//prepare sat-lnb-settings
	CMenuWidget* extSatSettings = NULL;
	CMenuWidget* extMotorSettings = NULL;
	CStringInput* toff_lat = NULL;
	CStringInput* toff_long = NULL;
	CSatDiseqcNotifier* satDiseqcNotifier = NULL;
	CScanSettingsSatManNotifier* scanSettingsSatManNotifier = NULL;

	//sat-lnb-settings
	if(g_info.delivery_system == DVB_S)
	{
 		g_Zapit->getScanSatelliteList(satList);

		//prepare diseqc
		CMenuOptionStringChooser* ojSat = new CMenuOptionStringChooser(LOCALE_SATSETUP_SATELLITE, scanSettings.satNameNoDiseqc, ((scanSettings.diseqcMode == DISEQC_1_2) || (scanSettings.diseqcMode == NO_DISEQC)));

		for (uint i=0; i < sat_list_size; i++)
		{
			ojSat->addOption(satList[i].satName);
			dprintf(DEBUG_DEBUG, "got scanprovider (sat): %s\n", satList[i].satName );
		}

		//prepare diseqc repeats
		CMenuOptionNumberChooser * ojDiseqcRepeats = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQCREPEAT, (int *)&scanSettings.diseqcRepeat, (scanSettings.diseqcMode != NO_DISEQC) && (scanSettings.diseqcMode != DISEQC_1_0), 0, 2);

		//extended sat settings
		extSatSettings = new CMenuWidget(LOCALE_SATSETUP_EXTENDED, NEUTRINO_ICON_SETTINGS);

		//intros ext sat settings
		extSatSettings->addItem(GenericMenuSeparator);
		extSatSettings->addItem(GenericMenuBack);
		extSatSettings->addItem(GenericMenuSeparatorLine);

		//prepare diseqc mode
		CMenuForwarder* ojExtSatSettings = new CMenuForwarder(LOCALE_SATSETUP_EXTENDED, (scanSettings.diseqcMode != NO_DISEQC), NULL, extSatSettings, NULL, CRCInput::RC_1);

		//make sat list
		for( uint i=0; i < sat_list_size; i++)
		{
			CMenuOptionNumberChooser * oj = new CMenuOptionNumberChooser(NONEXISTANT_LOCALE, scanSettings.diseqscOfSat(satList[i].satName), true, -1, sat_list_size - 1, 1, -1, LOCALE_OPTIONS_OFF, satList[i].satName);

			extSatSettings->addItem(oj);
		}

		//motor settings
		extMotorSettings = new CMenuWidget(LOCALE_SATSETUP_EXTENDED_MOTOR, NEUTRINO_ICON_SETTINGS);
		
		//intros motor settings
		extMotorSettings->addItem(GenericMenuSeparator);
		extMotorSettings->addItem(GenericMenuBack);
		extMotorSettings->addItem(GenericMenuSeparatorLine);
		
		//save motorsettings red
		extMotorSettings->addItem(new CMenuForwarder(LOCALE_SATSETUP_SAVESETTINGSNOW, true, NULL, this, "save_action", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED));
		extMotorSettings->addItem(GenericMenuSeparatorLine);

		//motorspeed (how long to set wait timer for dish to travel to correct position) 
		extMotorSettings->addItem(new CMenuOptionNumberChooser(LOCALE_SATSETUP_MOTORSPEED, (int *)&scanSettings.motorRotationSpeed, true, 0, 64)) ;
		extMotorSettings->addItem(GenericMenuSeparatorLine);

		//gotoxx settings
		extMotorSettings->addItem(new CMenuOptionChooser(LOCALE_SATSETUP_USEGOTOXX,  (int *)&scanSettings.useGotoXX, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));

		sprintf(zapit_lat, "%02.6f", scanSettings.gotoXXLatitude);
		sprintf(zapit_long, "%02.6f", scanSettings.gotoXXLongitude);

		extMotorSettings->addItem(new CMenuOptionChooser(LOCALE_SATSETUP_LADIR,  (int *)&scanSettings.gotoXXLaDirection, OPTIONS_SOUTH0_NORTH1_OPTIONS, OPTIONS_SOUTH0_NORTH1_OPTION_COUNT, true));
		toff_lat = new CStringInput(LOCALE_SATSETUP_LAT, (char *) zapit_lat, 10, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "0123456789.");
		extMotorSettings->addItem(new CMenuForwarder(LOCALE_SATSETUP_LAT, true, zapit_lat, toff_lat));

		extMotorSettings->addItem(new CMenuOptionChooser(LOCALE_SATSETUP_LODIR,  (int *)&scanSettings.gotoXXLoDirection, OPTIONS_EAST0_WEST1_OPTIONS, OPTIONS_EAST0_WEST1_OPTION_COUNT, true));
		toff_long = new CStringInput(LOCALE_SATSETUP_LONG, (char *) zapit_long, 10, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "0123456789.");
		extMotorSettings->addItem(new CMenuForwarder(LOCALE_SATSETUP_LONG, true, zapit_long, toff_long));

		extMotorSettings->addItem(GenericMenuSeparatorLine);
		
		//manual motor control
		extMotorSettings->addItem(new CMenuForwarder(LOCALE_SATSETUP_MOTORCONTROL, true, NULL, new CMotorControl(), NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN));
		extMotorSettings->addItem(GenericMenuSeparatorLine);

		//prepare motor control
		CMenuForwarder* ojExtMotorSettings = new CMenuForwarder(LOCALE_SATSETUP_EXTENDED_MOTOR, (scanSettings.diseqcMode == DISEQC_1_2), NULL, extMotorSettings, NULL, CRCInput::RC_2);

		//prepare/show sat list with options
		for( uint i=0; i < sat_list_size; i++)
		{
			CMenuOptionNumberChooser * oj = new CMenuOptionNumberChooser(NONEXISTANT_LOCALE, scanSettings.motorPosOfSat(satList[i].satName), true, 0, 64/*sat_list_size*/, 0, 0, LOCALE_OPTIONS_OFF, satList[i].satName);

			extMotorSettings->addItem(oj);
		}

		//prepare sat list with diseqc options
		satDiseqcNotifier = new CSatDiseqcNotifier(ojSat, ojExtSatSettings, ojExtMotorSettings, ojDiseqcRepeats);
		CMenuOptionChooser* ojDiseqc = new CMenuOptionChooser(LOCALE_SATSETUP_DISEQC, (int *)&scanSettings.diseqcMode, SATSETUP_DISEQC_OPTIONS, SATSETUP_DISEQC_OPTION_COUNT, true, satDiseqcNotifier);

		//show entries
		scansetup->addItem( ojScantype );
		scansetup->addItem( ojBouquets );
		scansetup->addItem(GenericMenuSeparatorLine);
		scansetup->addItem( ojDiseqc );
		scansetup->addItem( ojSat );
		scansetup->addItem( ojDiseqcRepeats );

		scansetup->addItem( ojExtSatSettings );
		scansetup->addItem( ojExtMotorSettings );
	}
	else
	{//cable

		CZapitClient::SatelliteList providerList;
		g_Zapit->getScanSatelliteList(providerList);
		
		//prepare/show providers
		CMenuOptionStringChooser* oj = new CMenuOptionStringChooser(LOCALE_CABLESETUP_PROVIDER, (char*)&scanSettings.satNameNoDiseqc, true);

		for( uint i=0; i< provider_list_size; i++)
		{
			oj->addOption(providerList[i].satName);
			dprintf(DEBUG_DEBUG, "got scanprovider (cable): %s\n", providerList[i].satName );
		}

		//show general entries
		scansetup->addItem( ojScantype );
		scansetup->addItem( ojBouquets );
		
		//show cable provider
		scansetup->addItem( oj);
	}

	//prepare scan mode (fast->on/off)
	CMenuOptionChooser* onoff_mode = ( new CMenuOptionChooser(LOCALE_SCANTP_SCANMODE, (int *)&scanSettings.scan_mode, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
	scansetup->addItem(GenericMenuSeparatorLine);

	if(scanSettings.TP_fec == 0) {
		scanSettings.TP_fec = 1;
	}

	//sub menue scanmode
	std::string scan_mode = getScanModeString(scanSettings.TP_scan);
	CMenuForwarder* fw_scanmode = new CMenuForwarder(LOCALE_SERVICEMENU_SCANMODES, true, scan_mode, this, "show_scanmodes", (g_info.delivery_system == DVB_S) ? CRCInput::RC_3 : CRCInput::RC_1);
	scansetup->addItem(fw_scanmode); 

	//show scan mode (fast->on/off)
	scansetup->addItem(onoff_mode);

	//prepare auto scan
	CSectionsdConfigNotifier sectionsdConfigNotifier;
	CMenuOptionChooser* onoffscanSectionsd = ( new CMenuOptionChooser(LOCALE_SECTIONSD_SCANMODE, (int *)&scanSettings.scanSectionsd, SECTIONSD_SCAN_OPTIONS, SECTIONSD_SCAN_OPTIONS_COUNT, true, &sectionsdConfigNotifier));

	//sat-lnb-settings
	if(g_info.delivery_system == DVB_S)
	{
		uint i;
		int satfound = -1;
		int firstentry = -1;

		scanSettingsSatManNotifier = new CScanSettingsSatManNotifier();
		scanSettings.TP_SatSelectMenu = new CMenuOptionStringChooser(LOCALE_SATSETUP_SATELLITE, scanSettings.TP_satname, ((scanSettings.diseqcMode != NO_DISEQC) && scanSettings.TP_scan), scanSettingsSatManNotifier);

		// add the sats which are configured (diseqc or motorpos) to the list of available sats */
		for (i = 0; i < sat_list_size; i++)
		{
			if ((((scanSettings.diseqcMode != DISEQC_1_2)) && (0 <= (*scanSettings.diseqscOfSat(satList[i].satName) ))) ||
			    (((scanSettings.diseqcMode == DISEQC_1_2)) && (0 <= (*scanSettings.motorPosOfSat(satList[i].satName)))))
			{
				if (firstentry == -1) firstentry = i;
				if (strcmp(scanSettings.TP_satname, satList[i].satName) == 0)
					satfound = i;
				scanSettings.TP_SatSelectMenu->addOption(satList[i].satName);
				dprintf(DEBUG_DEBUG, "satName = %s, diseqscOfSat(%d) = %d, motorPosOfSat(%d) = %d\n", satList[i].satName, i, *scanSettings.diseqscOfSat(satList[i].satName), i, *scanSettings.motorPosOfSat(satList[i].satName));
			}
		}
		// if scanSettings.TP_satname cannot be found in the list of available sats use 1st in list
		if ((satfound == -1) && (sat_list_size)) {
//			strcpy(scanSettings.TP_satname, satList[firstentry].satName);
			strcpy(scanSettings.TP_satname, scanSettings.satNameNoDiseqc);
		}
	} else {
		scanSettings.TP_SatSelectMenu = NULL;
	}

	//show auto scan
	scansetup->addItem(onoffscanSectionsd);
	scansetup->addItem(GenericMenuSeparatorLine);

	CScanTs* scanTs = new CScanTs();
	scansetup->addItem(new CMenuForwarder(LOCALE_SCANTS_STARTNOW, true, NULL, scanTs, NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE));

	scansetup->exec(NULL, "");
	scansetup->hide();
	selected = scansetup->getSelected();
	delete scansetup;

	delete extSatSettings;
	delete extMotorSettings;
	delete toff_lat;
	delete toff_long;
	delete satDiseqcNotifier;
	delete scanSettingsSatManNotifier;
	delete scanTs;
}
Example #14
0
void CRecordSetup::showRecordSetup()
{
	// dynamic created objects
	std::vector<CMenuTarget*> toDelete;

	//menue init
	CMenuWidget* recordingSettings = new CMenuWidget(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width);
	recordingSettings->setPreselected(selected);

	//subhead
	recordingSettings->addItem( new CMenuSeparator(CMenuSeparator::ALIGN_LEFT | CMenuSeparator::SUB_HEAD | CMenuSeparator::STRING, LOCALE_MAINSETTINGS_RECORDING));	

	//prepare input record server ip
	CIPInput recordingSettings_server_ip(LOCALE_RECORDINGMENU_SERVER_IP, g_settings.recording_server_ip, LOCALE_IPSETUP_HINT_1, LOCALE_IPSETUP_HINT_2);
	//input record server ip
	CMenuForwarder * mf1 = new CMenuForwarder(LOCALE_RECORDINGMENU_SERVER_IP, (g_settings.recording_type == RECORDING_SERVER), g_settings.recording_server_ip, &recordingSettings_server_ip);

	//prepare input record server port
	CStringInput recordingSettings_server_port(LOCALE_RECORDINGMENU_SERVER_PORT, g_settings.recording_server_port, 6, LOCALE_IPSETUP_HINT_1, LOCALE_IPSETUP_HINT_2, "0123456789 ");
	//input record server port
	CMenuForwarder * mf2 = new CMenuForwarder(LOCALE_RECORDINGMENU_SERVER_PORT, (g_settings.recording_type == RECORDING_SERVER), g_settings.recording_server_port, &recordingSettings_server_port);

	//prepare input record server mac address
	CMACInput recordingSettings_server_mac(LOCALE_RECORDINGMENU_SERVER_MAC,  g_settings.recording_server_mac, LOCALE_IPSETUP_HINT_1, LOCALE_IPSETUP_HINT_2);
	//input record server mac address
	CMenuForwarder * mf3 = new CMenuForwarder(LOCALE_RECORDINGMENU_SERVER_MAC, ((g_settings.recording_type == RECORDING_SERVER) && g_settings.recording_server_wakeup==1), g_settings.recording_server_mac, &recordingSettings_server_mac);

	CRecordingNotifier2 RecordingNotifier2(mf3);

	//prepare choose wol
	CMenuOptionChooser * oj2 = new CMenuOptionChooser(LOCALE_RECORDINGMENU_SERVER_WAKEUP, &g_settings.recording_server_wakeup, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, (g_settings.recording_type == RECORDING_SERVER), &RecordingNotifier2);

	//prepare playback stop
	CMenuOptionChooser* oj3 = new CMenuOptionChooser(LOCALE_RECORDINGMENU_STOPPLAYBACK, &g_settings.recording_stopplayback, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, (g_settings.recording_type == RECORDING_SERVER || g_settings.recording_type == RECORDING_FILE));

	//prepare epg stop
	CMenuOptionChooser* oj4 = new CMenuOptionChooser(LOCALE_RECORDINGMENU_SECTIONSD, &g_settings.recording_stopsectionsd, RECORDINGMENU_STOPSECTIONSD_OPTIONS, RECORDINGMENU_STOPSECTIONSD_OPTION_COUNT, (g_settings.recording_type == RECORDING_SERVER || g_settings.recording_type == RECORDING_FILE));

	//prepare zap on announce
	CMenuOptionChooser* oj4b = new CMenuOptionChooser(LOCALE_RECORDINGMENU_ZAP_ON_ANNOUNCE, &g_settings.recording_zap_on_announce, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true);

	//prepare no scart switch
	CMenuOptionChooser* oj5 = new CMenuOptionChooser(LOCALE_RECORDINGMENU_NO_SCART, &g_settings.recording_vcr_no_scart, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, (g_settings.recording_type == RECORDING_VCR));

	//prepare record in spts mode
	CMenuOptionChooser* oj12 = new CMenuOptionChooser(LOCALE_RECORDINGMENU_RECORD_IN_SPTS_MODE, &g_settings.recording_in_spts_mode, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT,(g_settings.recording_type == RECORDING_SERVER || g_settings.recording_type == RECORDING_FILE) );

	//prepare record correcture
	int rec_pre,rec_post;
	g_Timerd->getRecordingSafety(rec_pre,rec_post);
	sprintf(g_settings.record_safety_time_before, "%02d", rec_pre/60);
	sprintf(g_settings.record_safety_time_after, "%02d", rec_post/60);
	CRecordingSafetyNotifier RecordingSafetyNotifier;

	//timersettings submenue
	CMenuWidget *timerRecordingSettings = new CMenuWidget(LOCALE_MAINSETTINGS_RECORDING, NEUTRINO_ICON_TIMER, width);
	toDelete.push_back(timerRecordingSettings);
	CMenuForwarder* mf15 = new CMenuForwarder(LOCALE_TIMERSETTINGS_SEPARATOR ,true, NULL, timerRecordingSettings, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW);

	//prepare time before
	CStringInput timerSettings_record_safety_time_before(LOCALE_TIMERSETTINGS_RECORD_SAFETY_TIME_BEFORE, g_settings.record_safety_time_before, 2, LOCALE_TIMERSETTINGS_RECORD_SAFETY_TIME_BEFORE_HINT_1, LOCALE_TIMERSETTINGS_RECORD_SAFETY_TIME_BEFORE_HINT_2,"0123456789 ", &RecordingSafetyNotifier);
	CMenuForwarder *mf5 = new CMenuForwarder(LOCALE_TIMERSETTINGS_RECORD_SAFETY_TIME_BEFORE, true, g_settings.record_safety_time_before, &timerSettings_record_safety_time_before);

	//prepare time after
	CStringInput timerSettings_record_safety_time_after(LOCALE_TIMERSETTINGS_RECORD_SAFETY_TIME_AFTER, g_settings.record_safety_time_after, 2, LOCALE_TIMERSETTINGS_RECORD_SAFETY_TIME_AFTER_HINT_1, LOCALE_TIMERSETTINGS_RECORD_SAFETY_TIME_AFTER_HINT_2,"0123456789 ", &RecordingSafetyNotifier);
	CMenuForwarder *mf6 = new CMenuForwarder(LOCALE_TIMERSETTINGS_RECORD_SAFETY_TIME_AFTER, true, g_settings.record_safety_time_after, &timerSettings_record_safety_time_after);

	//prepare zap to before
	int zapto_pre;
	g_Timerd->getZaptoSafety(zapto_pre);
	sprintf(g_settings.zapto_safety_time_before, "%02d", zapto_pre/60);
	CZaptoSafetyNotifier ZaptoSafetyNotifier;
	CStringInput timerSettings_zapto_safety_time_before(LOCALE_TIMERSETTINGS_ZAPTO_SAFETY_TIME_BEFORE, g_settings.zapto_safety_time_before, 2, LOCALE_TIMERSETTINGS_ZAPTO_SAFETY_TIME_BEFORE_HINT_1, LOCALE_TIMERSETTINGS_ZAPTO_SAFETY_TIME_BEFORE_HINT_2,"0123456789 ", &ZaptoSafetyNotifier);
	CMenuForwarder *mf14 = new CMenuForwarder(LOCALE_TIMERSETTINGS_ZAPTO_SAFETY_TIME_BEFORE, true, g_settings.zapto_safety_time_before, &timerSettings_zapto_safety_time_before);

	// default recording audio pids
	CMenuWidget *apidRecordingSettings = new CMenuWidget(LOCALE_MAINSETTINGS_RECORDING, NEUTRINO_ICON_AUDIO, width);
	toDelete.push_back(apidRecordingSettings);
	CMenuForwarder* mf13 = new CMenuForwarder(LOCALE_RECORDINGMENU_APIDS ,true, NULL, apidRecordingSettings, NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE);

	g_settings.recording_audio_pids_std = ( g_settings.recording_audio_pids_default & TIMERD_APIDS_STD ) ? 1 : 0 ;
	g_settings.recording_audio_pids_alt = ( g_settings.recording_audio_pids_default & TIMERD_APIDS_ALT ) ? 1 : 0 ;
	g_settings.recording_audio_pids_ac3 = ( g_settings.recording_audio_pids_default & TIMERD_APIDS_AC3 ) ? 1 : 0 ;

	CRecAPIDSettingsNotifier an;
	//prepare audio pids default
	CMenuOptionChooser* aoj1 = new CMenuOptionChooser(LOCALE_RECORDINGMENU_APIDS_STD, &g_settings.recording_audio_pids_std, MESSAGEBOX_NO_YES_OPTIONS, MESSAGEBOX_NO_YES_OPTION_COUNT, true, &an);
	//prepare audio pids alternate
	CMenuOptionChooser* aoj2 = new CMenuOptionChooser(LOCALE_RECORDINGMENU_APIDS_ALT, &g_settings.recording_audio_pids_alt, MESSAGEBOX_NO_YES_OPTIONS, MESSAGEBOX_NO_YES_OPTION_COUNT, true, &an);
	//prepare audio pids ac3
	CMenuOptionChooser* aoj3 = new CMenuOptionChooser(LOCALE_RECORDINGMENU_APIDS_AC3, &g_settings.recording_audio_pids_ac3, MESSAGEBOX_NO_YES_OPTIONS, MESSAGEBOX_NO_YES_OPTION_COUNT, true, &an);
	//subhead
	apidRecordingSettings->addItem( new CMenuSeparator(CMenuSeparator::ALIGN_LEFT | CMenuSeparator::SUB_HEAD | CMenuSeparator::STRING, LOCALE_RECORDINGMENU_APIDS));

	apidRecordingSettings->addItem(GenericMenuSeparator);
	apidRecordingSettings->addItem(GenericMenuBack);
	apidRecordingSettings->addItem(GenericMenuSeparatorLine);
	apidRecordingSettings->addItem(aoj1);
	apidRecordingSettings->addItem(aoj2);
	apidRecordingSettings->addItem(aoj3);

	// directory menue for direct recording settings
	CMenuWidget *dirMenu = new CMenuWidget(LOCALE_RECORDINGMENU_FILESETTINGS, NEUTRINO_ICON_RECORDING, width);
	toDelete.push_back(dirMenu);
	dirMenu->addItem(new CMenuSeparator(CMenuSeparator::ALIGN_LEFT | CMenuSeparator::SUB_HEAD | CMenuSeparator::STRING, LOCALE_RECORDINGMENU_DEFDIR));
	dirMenu->addItem(GenericMenuSeparator);
	dirMenu->addItem(GenericMenuBack);
	dirMenu->addItem(GenericMenuSeparatorLine);
	char temp[10];
	for(int i=0 ; i < MAX_RECORDING_DIR ; i++)
	{
		// directory menu item
		snprintf(temp, 10, "%d:", i + 1);
		temp[9] = 0; // terminate for sure
		CMenuWidget* dirRecordingSettings = new CMenuWidget(LOCALE_RECORDINGMENU_FILESETTINGS, NEUTRINO_ICON_RECORDING, width);
		toDelete.push_back(dirRecordingSettings);
		dirMenu->addItem(new CMenuForwarderNonLocalized(temp, true, g_settings.recording_dir[i], dirRecordingSettings));

		// subhead
		snprintf(temp, 10, " %d", i + 1);
		temp[9] = 0; // terminate for sure
		CMenuSeparator* dirRecordingSettings_subhead = new CMenuSeparator(CMenuSeparator::ALIGN_LEFT | CMenuSeparator::SUB_HEAD | CMenuSeparator::STRING);
		dirRecordingSettings_subhead->setString(std::string(g_Locale->getText(LOCALE_RECORDINGMENU_DEFDIR)) + temp);
		dirRecordingSettings->addItem(dirRecordingSettings_subhead);

		// intro items
		dirRecordingSettings->addItem(GenericMenuSeparator);
		dirRecordingSettings->addItem(GenericMenuBack);
		dirRecordingSettings->addItem(GenericMenuSeparatorLine);

		// directory
		CDirChooser* dirRecordingSettings_dirChooser = new CDirChooser(&g_settings.recording_dir[i]);
		toDelete.push_back(dirRecordingSettings_dirChooser);
		dirRecordingSettings->addItem(new CMenuForwarder(LOCALE_RECORDINGMENU_DIR, true, g_settings.recording_dir[i], dirRecordingSettings_dirChooser));

		// filename template
		CStringInput* dirRecordingSettings_filenameTemplate = new CStringInput(LOCALE_RECORDINGMENU_FILENAME_TEMPLATE, &g_settings.recording_filename_template[i], 21, LOCALE_RECORDINGMENU_FILENAME_TEMPLATE_HINT, LOCALE_IPSETUP_HINT_2, "%/-_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ");
		toDelete.push_back(dirRecordingSettings_filenameTemplate);
		dirRecordingSettings->addItem(new CMenuForwarder(LOCALE_RECORDINGMENU_FILENAME_TEMPLATE, true, g_settings.recording_filename_template[i], dirRecordingSettings_filenameTemplate));

		// maximum file size
		CStringInput* dirRecordingSettings_splitsize = new CStringInput(LOCALE_RECORDINGMENU_SPLITSIZE, g_settings.recording_splitsize[i], 6, LOCALE_IPSETUP_HINT_1, LOCALE_IPSETUP_HINT_2, "0123456789 ");
		toDelete.push_back(dirRecordingSettings_splitsize);
		dirRecordingSettings->addItem(new CMenuForwarder(LOCALE_RECORDINGMENU_SPLITSIZE, true, g_settings.recording_splitsize[i], dirRecordingSettings_splitsize));
	}
	dirMenu->addItem(GenericMenuSeparator);

	// for direct recording
	CMenuWidget *directRecordingSettings = new CMenuWidget(LOCALE_MAINSETTINGS_RECORDING, NEUTRINO_ICON_RECORDING, width);
	toDelete.push_back(directRecordingSettings);
	CMenuForwarder* mf7 = new CMenuForwarder(LOCALE_RECORDINGMENU_FILESETTINGS,(g_settings.recording_type == RECORDING_FILE), NULL, directRecordingSettings, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN);

	CStringInput recordingSettings_splitsize(LOCALE_RECORDINGMENU_SPLITSIZE, g_settings.recording_splitsize_default, 6, LOCALE_IPSETUP_HINT_1, LOCALE_IPSETUP_HINT_2, "0123456789 ");
	CMenuForwarder* mf9 = new CMenuForwarder(LOCALE_RECORDINGMENU_SPLITSIZE, true, g_settings.recording_splitsize_default, &recordingSettings_splitsize);

	CMenuOptionChooser* oj6 = new CMenuOptionChooser(LOCALE_RECORDINGMENU_USE_O_SYNC, &g_settings.recording_use_o_sync, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true);

	CMenuOptionChooser* oj7 = new CMenuOptionChooser(LOCALE_RECORDINGMENU_USE_FDATASYNC, &g_settings.recording_use_fdatasync, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true);

	CMenuOptionChooser* oj8 = new CMenuOptionChooser(LOCALE_RECORDINGMENU_STREAM_VTXT_PID, &g_settings.recording_stream_vtxt_pid, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true);

	CMenuOptionChooser* oj9 = new CMenuOptionChooser(LOCALE_RECORDINGMENU_STREAM_SUBTITLE_PID, &g_settings.recording_stream_subtitle_pid, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true);

	CMenuOptionChooser* oj13 = new CMenuOptionChooser(LOCALE_RECORDINGMENU_RINGBUFFERS, &g_settings.recording_ringbuffers, RECORDINGMENU_RINGBUFFER_SIZES, RECORDINGMENU_RINGBUFFER_SIZE_COUNT, true);

	CMenuOptionChooser* oj10 = new CMenuOptionChooser(LOCALE_RECORDINGMENU_CHOOSE_DIRECT_REC_DIR, &g_settings.recording_choose_direct_rec_dir, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true);

	CMenuOptionChooser* oj14 = new CMenuOptionChooser(LOCALE_RECORDINGMENU_GEN_PSI, &g_settings.recording_gen_psi, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true);

	CStringInput recordingSettings_filenameTemplate(LOCALE_RECORDINGMENU_FILENAME_TEMPLATE, &g_settings.recording_filename_template_default, 21, LOCALE_RECORDINGMENU_FILENAME_TEMPLATE_HINT, LOCALE_IPSETUP_HINT_2, "%/-_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ");
	CMenuForwarder* mf11 = new CMenuForwarder(LOCALE_RECORDINGMENU_FILENAME_TEMPLATE, true, g_settings.recording_filename_template_default, &recordingSettings_filenameTemplate);

	CStringInput recordingSettings_dirPermissions(LOCALE_RECORDINGMENU_DIR_PERMISSIONS, g_settings.recording_dir_permissions, 3, LOCALE_RECORDINGMENU_DIR_PERMISSIONS_HINT, LOCALE_IPSETUP_HINT_2, "01234567");
	CMenuForwarder* mf12 = new CMenuForwarder(LOCALE_RECORDINGMENU_DIR_PERMISSIONS, true, g_settings.recording_dir_permissions, &recordingSettings_dirPermissions);

	CRecordingNotifier RecordingNotifier(mf1,mf2,oj2,mf3,oj3,oj4,oj5,mf7,oj12);

	//recording type
	CMenuOptionChooser* oj1 = new CMenuOptionChooser(LOCALE_RECORDINGMENU_RECORDING_TYPE, &g_settings.recording_type, RECORDINGMENU_RECORDING_TYPE_OPTIONS, RECORDINGMENU_RECORDING_TYPE_OPTION_COUNT, true, &RecordingNotifier);

	//paint menue entries
	//intros
	recordingSettings->addItem(GenericMenuSeparator);
	recordingSettings->addItem(GenericMenuBack);
	recordingSettings->addItem(GenericMenuSeparatorLine);

	recordingSettings->addItem(new CMenuForwarder(LOCALE_RECORDINGMENU_SETUPNOW, true, NULL, this, "recording", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED));
	recordingSettings->addItem(new CMenuForwarder(LOCALE_SETTINGS_HELP, true, NULL, this, "help_recording", CRCInput::RC_help, NEUTRINO_ICON_BUTTON_HELP));
	recordingSettings->addItem(GenericMenuSeparatorLine);
	recordingSettings->addItem( oj1); //recording type (off, server, vcr, direct) 
	recordingSettings->addItem(GenericMenuSeparatorLine);
	recordingSettings->addItem( mf7); //direct record settings
#ifndef HAVE_TRIPLEDRAGON
	/* on the TD, we just do not display those items */
	recordingSettings->addItem( mf1); //server ip
	recordingSettings->addItem( mf2); //server port
	recordingSettings->addItem( oj2); //wol
	recordingSettings->addItem( mf3); //mac
#endif
	recordingSettings->addItem( oj3); //stop playback
	recordingSettings->addItem( oj4); //stop epg
	recordingSettings->addItem( oj4b);//switch on announcement
	recordingSettings->addItem( oj5); //suppress scart switch
#ifdef HAVE_DBOX_HARDWARE
	recordingSettings->addItem(oj12); //use spts
#endif
	recordingSettings->addItem(GenericMenuSeparatorLine);
	recordingSettings->addItem( mf15);//timersettings
		//subhead
		timerRecordingSettings->addItem( new CMenuSeparator(CMenuSeparator::ALIGN_LEFT | CMenuSeparator::SUB_HEAD | CMenuSeparator::STRING, LOCALE_TIMERSETTINGS_SEPARATOR));
		timerRecordingSettings->addItem(GenericMenuSeparator);
		timerRecordingSettings->addItem(GenericMenuBack);
		timerRecordingSettings->addItem(GenericMenuSeparatorLine);
		timerRecordingSettings->addItem( mf5); //start record correcture
		timerRecordingSettings->addItem( mf6); //end record correcture
		timerRecordingSettings->addItem( mf14);//switch correcture
	recordingSettings->addItem( mf13);//audio pid settings
		//subhead
		directRecordingSettings->addItem(new CMenuSeparator(CMenuSeparator::ALIGN_LEFT | CMenuSeparator::SUB_HEAD | CMenuSeparator::STRING, LOCALE_RECORDINGMENU_FILESETTINGS));
		directRecordingSettings->addItem(GenericMenuSeparator);
		directRecordingSettings->addItem(GenericMenuBack);
		directRecordingSettings->addItem(GenericMenuSeparatorLine);
		directRecordingSettings->addItem(new CMenuForwarder(LOCALE_RECORDINGMENU_DEFDIR, true, NULL, dirMenu, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED));
		directRecordingSettings->addItem(oj10);
		directRecordingSettings->addItem(mf11);
		directRecordingSettings->addItem(mf9);
		directRecordingSettings->addItem(mf12);
		directRecordingSettings->addItem(GenericMenuSeparatorLine);
		directRecordingSettings->addItem(oj13); //ringbuffer
		directRecordingSettings->addItem(oj6);
		directRecordingSettings->addItem(oj7);
		directRecordingSettings->addItem(oj8);
		directRecordingSettings->addItem(oj9);
		directRecordingSettings->addItem(oj14); //gen_psi


	recordingSettings->exec(NULL, "");
	recordingSettings->hide();
	selected = recordingSettings->getSelected();
	delete recordingSettings;

	// delete dynamic created objects
	unsigned int toDeleteSize = toDelete.size();
	for (unsigned int i = 0; i < toDeleteSize; i++)
		delete toDelete[i];
	toDelete.clear();
}
Example #15
0
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;
}
bool CUserMenu::showUserMenu(neutrino_msg_t msg)
{
	int button = -1;
	int dummy = 0;
	unsigned ums = g_settings.usermenu.size();
	for (unsigned int i = 0; i < ums; i++)
		if (g_settings.usermenu[i]->key == msg) {
			button = i;
			break;
		}

	if (button < 0)
		return false;

	int pers = -1;
	switch(msg) {
		case CRCInput::RC_red:
			pers = SNeutrinoSettings::P_MAIN_RED_BUTTON;
			button = SNeutrinoSettings::BUTTON_RED;
			break;
		case CRCInput::RC_green:
			pers = SNeutrinoSettings::P_MAIN_GREEN_BUTTON;
			button = SNeutrinoSettings::BUTTON_GREEN;
			break;
		case CRCInput::RC_yellow:
			pers = SNeutrinoSettings::P_MAIN_YELLOW_BUTTON;
			button = SNeutrinoSettings::BUTTON_YELLOW;
			break;
		case CRCInput::RC_blue:
			pers = SNeutrinoSettings::P_MAIN_BLUE_BUTTON;
			button = SNeutrinoSettings::BUTTON_BLUE;
			break;
	}

	CNeutrinoApp::getInstance()->StopSubtitles();

	if (pers > -1 && (g_settings.personalize[pers] != CPersonalizeGui::PERSONALIZE_ACTIVE_MODE_ENABLED)) {
		ShowHint(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_PERSONALIZE_MENUDISABLEDHINT),450, 10);
		CNeutrinoApp::getInstance()->StartSubtitles();
		return true;
	}

	width = 40;

	CMenuItem* menu_item = NULL;
	CMenuItem* last_menu_item = NULL;
	CColorKeyHelper keyhelper;
	
	//set default feature key
	neutrino_msg_t key = feat_key[CPersonalizeGui::PERSONALIZE_FEAT_KEY_AUTO].key; //CRCInput::RC_nokey

	const char * icon = NULL;
	int menu_items = 0;

	// define classes
	CSubChannelSelectMenu subchanselect;
	CNeutrinoApp * neutrino	= CNeutrinoApp::getInstance();
	
	std::string txt = g_settings.usermenu[button]->title;
	if (button < COL_BUTTONMAX && txt.empty())
		txt = g_Locale->getText(user_menu[button].caption);

	CMenuWidget *menu = new CMenuWidget(txt, (button < COL_BUTTONMAX) ? user_menu[button].menu_icon_def : "", width);
	if (menu == NULL)
		return true;

	if (button < COL_BUTTONMAX)	
		menu->setSelected(user_menu[button].selected);
	
	//show cancel button if configured
	if (g_settings.personalize[SNeutrinoSettings::P_UMENU_SHOW_CANCEL])
		menu->addIntroItems(NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, CMenuWidget::BTN_TYPE_CANCEL);
	else
		menu->addItem(GenericMenuSeparator);
	
	std::string itemstr_last("1");

	std::vector<std::string> items = ::split(g_settings.usermenu[button]->items, ',');
	for (std::vector<std::string>::iterator it = items.begin(); it != items.end(); ++it) {
		if (it->empty())
			continue;
		if (*it == itemstr_last)
			continue;
		int item = -1;
		if (it->find_first_not_of("0123456789") == std::string::npos)
			item = atoi(*it);
		menu_item = NULL;
		switch (item) {
		case SNeutrinoSettings::ITEM_NONE:
			continue;
		case SNeutrinoSettings::ITEM_BAR:
			menu->addItem(GenericMenuSeparatorLine);
			break;
		case SNeutrinoSettings::ITEM_FAVORITS:
			keyhelper.get(&key,&icon,feat_key[g_settings.personalize[SNeutrinoSettings::P_FEAT_KEY_FAVORIT]].key); //CRCInput::RC_green
			menu_item = new CMenuDForwarder(LOCALE_FAVORITES_MENUEADD, true, NULL, new CFavorites, "-1", key, icon);
			// FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
			break;
		case SNeutrinoSettings::ITEM_RECORD:
			if (g_settings.recording_type == RECORDING_OFF)
				break;
			keyhelper.get(&key,&icon,CRCInput::RC_red);
			menu_item = new CMenuForwarder(LOCALE_MAINMENU_RECORDING, true, NULL, CRecordManager::getInstance(), "-1", key, icon);
			// FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
			break;
		case SNeutrinoSettings::ITEM_MOVIEPLAYER_MB:
			if (g_settings.recording_type == RECORDING_OFF)
				break;
			keyhelper.get(&key,&icon,CRCInput::RC_green);
			menu_item = new CMenuForwarder(LOCALE_MOVIEBROWSER_HEAD, true, NULL, neutrino, "tsmoviebrowser", key, icon);
			menu_item->setHint(NEUTRINO_ICON_HINT_MB, LOCALE_MENU_HINT_MB);
			break;
		case SNeutrinoSettings::ITEM_TIMERLIST:
			keyhelper.get(&key,&icon,feat_key[g_settings.personalize[SNeutrinoSettings::P_FEAT_KEY_TIMERLIST]].key); //CRCInput::RC_yellow
			menu_item = new CMenuDForwarder(LOCALE_TIMERLIST_NAME, true, NULL, new CTimerList, "-1", key, icon);
			menu_item->setHint(NEUTRINO_ICON_HINT_TIMERS, LOCALE_MENU_HINT_TIMERS);
			break;
		case SNeutrinoSettings::ITEM_REMOTE:
			keyhelper.get(&key,&icon,feat_key[g_settings.personalize[SNeutrinoSettings::P_FEAT_KEY_RC_LOCK]].key); //CRCInput::RC_nokey);
			menu_item = new CMenuDForwarder(LOCALE_RCLOCK_MENUEADD, true, NULL, new CRCLock, "-1" , key, icon );
			// FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
			break;
		case SNeutrinoSettings::ITEM_EPG_SUPER:
			keyhelper.get(&key,&icon,CRCInput::RC_green);
			menu_item = new CMenuDForwarder(LOCALE_EPGMENU_EPGPLUS   , true, NULL, new CEPGplusHandler,  "-1", key, icon);
			// FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
			break;
		case SNeutrinoSettings::ITEM_EPG_LIST:
			keyhelper.get(&key,&icon,CRCInput::RC_red);
			menu_item = new CMenuDForwarder(LOCALE_EPGMENU_EVENTLIST , true, NULL, new CEventListHandler,  "-1", key, icon);
			// FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
			break;
		case SNeutrinoSettings::ITEM_EPG_INFO:
			keyhelper.get(&key,&icon,CRCInput::RC_yellow);
			menu_item = new CMenuDForwarder(LOCALE_EPGMENU_EVENTINFO , true, NULL, new CEPGDataHandler,  "-1", key, icon);
			// FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
			break;
		case SNeutrinoSettings::ITEM_EPG_MISC:
		{
			dummy = g_Sectionsd->getIsScanningActive();
			keyhelper.get(&key,&icon);
			//          new CMenuOptionChooser(LOCALE_VIDEOMENU_VIDEOMODE, &g_settings.video_Mode, VIDEOMENU_VIDEOMODE_OPTIONS, VIDEOMENU_VIDEOMODE_OPTION_COUNT, true, this, CRCInput::RC_nokey, "", true);
			menu_item = new CMenuOptionChooser(LOCALE_MAINMENU_PAUSESECTIONSD, &dummy, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this , key, icon );
			menu->addItem(menu_item, false);

			keyhelper.get(&key,&icon);
			menu_item = new CMenuForwarder(LOCALE_MAINMENU_CLEARSECTIONSD, true, NULL, neutrino, "clearSectionsd", key,icon);
			// FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
			break;
		}
		case SNeutrinoSettings::ITEM_AUDIO_SELECT:
			keyhelper.get(&key,&icon);
			menu_item = new CMenuDForwarder(LOCALE_AUDIOSELECTMENUE_HEAD, true, NULL, new CAudioSelectMenuHandler, "-1", key,icon);
			// FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
			break;
		case SNeutrinoSettings::ITEM_SUBCHANNEL:
		{
			if (g_RemoteControl->subChannels.empty())
				break;
			// NVOD/SubService- Kanal!
			CMenuWidget *tmpNVODSelector = new CMenuWidget(g_RemoteControl->are_subchannels ? LOCALE_NVODSELECTOR_SUBSERVICE : LOCALE_NVODSELECTOR_HEAD, NEUTRINO_ICON_VIDEO);
			if (!subchanselect.getNVODMenu(tmpNVODSelector)) {
				delete tmpNVODSelector;
				break;
			}
			keyhelper.get(&key,&icon);
			menu_item = new CMenuDForwarder(g_RemoteControl->are_subchannels ? LOCALE_NVODSELECTOR_SUBSERVICE : LOCALE_NVODSELECTOR_HEAD, true, NULL, tmpNVODSelector, "-1", key,icon);
			// FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
			break;
		}
		case SNeutrinoSettings::ITEM_TECHINFO:
			keyhelper.get(&key,&icon,CRCInput::RC_blue);
			menu_item = new CMenuDForwarder(LOCALE_EPGMENU_STREAMINFO, !neutrino->channelList->isEmpty(), NULL, new CStreamInfo2, "-1", key, icon );
			menu_item->setHint(NEUTRINO_ICON_HINT_STREAMINFO, LOCALE_MENU_HINT_STREAMINFO);
			break;
		case SNeutrinoSettings::ITEM_GAMES:
			keyhelper.get(&key,&icon);
			menu_item = new CMenuDForwarder(LOCALE_MAINMENU_GAMES, g_PluginList->hasPlugin(CPlugins::P_TYPE_GAME), NULL, new CPluginList(LOCALE_MAINMENU_GAMES,CPlugins::P_TYPE_GAME), "-1", key, icon );
			menu_item->setHint(NEUTRINO_ICON_HINT_GAMES, LOCALE_MENU_HINT_GAMES);
			break;
                case SNeutrinoSettings::ITEM_TOOLS:
			keyhelper.get(&key,&icon);
                        menu_item = new CMenuDForwarder(LOCALE_MAINMENU_TOOLS, g_PluginList->hasPlugin(CPlugins::P_TYPE_TOOL), NULL, new CPluginList(LOCALE_MAINMENU_TOOLS,CPlugins::P_TYPE_TOOL), "-1", key, icon );
			// FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
                        break;
		case SNeutrinoSettings::ITEM_SCRIPTS:
			keyhelper.get(&key,&icon);
			menu_item = new CMenuDForwarder(LOCALE_MAINMENU_SCRIPTS, g_PluginList->hasPlugin(CPlugins::P_TYPE_SCRIPT), NULL, new CPluginList(LOCALE_MAINMENU_SCRIPTS,CPlugins::P_TYPE_SCRIPT), "-1", key, icon );
			menu_item->setHint(NEUTRINO_ICON_HINT_SCRIPTS, LOCALE_MENU_HINT_SCRIPTS);
			break;
		case SNeutrinoSettings::ITEM_LUA:
			keyhelper.get(&key,&icon);
			menu_item = new CMenuDForwarder(LOCALE_MAINMENU_LUA, g_PluginList->hasPlugin(CPlugins::P_TYPE_LUA), NULL, new CPluginList(LOCALE_MAINMENU_LUA,CPlugins::P_TYPE_LUA), "-1", key, icon );
			// FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
			break;
		case SNeutrinoSettings::ITEM_PLUGIN_TYPES:
		{
			unsigned int number_of_plugins = (unsigned int) g_PluginList->getNumberOfPlugins();
			if (!number_of_plugins)
				continue;
			for (unsigned int count = 0; count < number_of_plugins; count++)
			{
#if 0
				bool show = g_PluginList->getType(count) == CPlugins::P_TYPE_TOOL ||
					g_PluginList->getType(count) == CPlugins::P_TYPE_LUA;
#endif
				bool show = false;
				if (g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE_GAMES])
					show = show || g_PluginList->getType(count) == CPlugins::P_TYPE_GAME;
				if (g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE_TOOLS])
					show = show || g_PluginList->getType(count) == CPlugins::P_TYPE_TOOL;
				if (g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE_SCRIPTS])
					show = show || g_PluginList->getType(count) == CPlugins::P_TYPE_SCRIPT;
				if (g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE_LUA])
					show = show || g_PluginList->getType(count) == CPlugins::P_TYPE_LUA;

				if (show && !g_PluginList->isHidden(count) && (g_PluginList->getIntegration(count) == CPlugins::I_TYPE_DISABLED))
				{
					menu_items++;
					neutrino_msg_t d_key = g_PluginList->getKey(count);
					//printf("[neutrino usermenu] plugin %d, set key %d...\n", count, g_PluginList->getKey(count));
					keyhelper.get(&key,&icon, d_key);
					menu_item = new CMenuForwarder(g_PluginList->getName(count), true, NULL, CPluginsExec::getInstance(), to_string(count).c_str(), key, icon);
					menu_item->setHint(g_PluginList->getHintIcon(count), g_PluginList->getDescription(count));

					menu->addItem(menu_item, false);
				}
			}
			menu_item = NULL;
			break;
		}
		case SNeutrinoSettings::ITEM_VTXT:
			keyhelper.get(&key,&icon, feat_key[g_settings.personalize[SNeutrinoSettings::P_FEAT_KEY_VTXT]].key); //CRCInput::RC_blue
			menu_item = new CMenuForwarder(LOCALE_USERMENU_ITEM_VTXT, true, NULL, CPluginsExec::getInstance(), "teletext", key, icon);
			// FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
			break;
		case SNeutrinoSettings::ITEM_IMAGEINFO:
			keyhelper.get(&key,&icon);
			menu_item = new CMenuDForwarder(LOCALE_SERVICEMENU_IMAGEINFO,  true, NULL, new CImageInfo, NULL, key, icon);
			menu_item->setHint(NEUTRINO_ICON_HINT_IMAGEINFO, LOCALE_MENU_HINT_IMAGEINFO);
			break;
		case SNeutrinoSettings::ITEM_BOXINFO:
			keyhelper.get(&key,&icon);
			menu_item = new CMenuDForwarder(LOCALE_EXTRA_DBOXINFO, true, NULL, new CDBoxInfoWidget, NULL, key, icon);
			menu_item->setHint(NEUTRINO_ICON_HINT_DBOXINFO, LOCALE_MENU_HINT_DBOXINFO);
			break;
#if !HAVE_SPARK_HARDWARE
		case SNeutrinoSettings::ITEM_CAM:
			//if(cs_get_revision() == 10) continue;
			keyhelper.get(&key,&icon);
			menu_item = new CMenuForwarder(LOCALE_CI_SETTINGS, true, NULL, g_CamHandler, NULL, key, icon);
			break;
#endif
		case SNeutrinoSettings::ITEM_CLOCK:
			keyhelper.get(&key,&icon); 
			menu_item = new CMenuForwarder(!g_settings.mode_clock ? LOCALE_CLOCK_SWITCH_ON:LOCALE_CLOCK_SWITCH_OFF, true, NULL, neutrino, "clock_switch", key, icon);
			menu_item->setHint("", LOCALE_MENU_HINT_CLOCK_MODE);
			break;
#if 0
		case SNeutrinoSettings::ITEM_ADZAP:
			keyhelper.get(&key,&icon,CRCInput::RC_blue);
			menu_item = new CMenuForwarder(LOCALE_USERMENU_ITEM_ADZAP, true, NULL, neutrino, "adzap", key, icon);
			menu_item->setHint("", LOCALE_MENU_HINT_ADZAP);
			break;
		case SNeutrinoSettings::ITEM_TUNER_RESTART:
			keyhelper.get(&key,&icon);
			menu_item = new CMenuForwarder(LOCALE_SERVICEMENU_RESTART_TUNER, true, NULL, neutrino, "restarttuner", key, icon);
			menu_item->setHint(NEUTRINO_ICON_HINT_RELOAD_CHANNELS, LOCALE_MENU_HINT_RESTART_TUNER);
			break;
		case SNeutrinoSettings::ITEM_RASS:
			if (!(neutrino->getMode() == CNeutrinoApp::mode_radio && g_Radiotext && g_Radiotext->haveRASS()))
				continue;
			keyhelper.get(&key,&icon);
			menu_item = new CMenuForwarder(LOCALE_RASS_HEAD, true, NULL, neutrino, "rass", key, icon);
			menu_item->setHint(NEUTRINO_ICON_HINT_RASS, LOCALE_MENU_HINT_RASS);
			break;
		case SNeutrinoSettings::ITEM_NETZKINO:
			keyhelper.get(&key,&icon);
			menu_item = new CMenuForwarder(LOCALE_MOVIEPLAYER_NKPLAYBACK, true, NULL, neutrino, "nkplayback", key, icon);
			menu_item->setHint(NEUTRINO_ICON_HINT_NKPLAY, LOCALE_MENU_HINT_NKPLAY);
			break;
#endif
#if HAVE_SPARK_HARDWARE
		case SNeutrinoSettings::ITEM_THREE_D_MODE:
			keyhelper.get(&key,&icon);
			menu_item = new CMenuForwarder(LOCALE_THREE_D_SETTINGS, true, NULL, neutrino, "3dmode", key, icon);
			menu_item->setHint("", LOCALE_MENU_HINT_VIDEO_THREE_D);
			break;
#endif
		case SNeutrinoSettings::ITEM_YOUTUBE:
			keyhelper.get(&key,&icon);
			menu_item = new CMenuForwarder(LOCALE_MOVIEPLAYER_YTPLAYBACK, true, NULL, neutrino, "ytplayback", key, icon);
			menu_item->setHint(NEUTRINO_ICON_HINT_YTPLAY, LOCALE_MENU_HINT_YTPLAY);
			break;
		case SNeutrinoSettings::ITEM_FILEPLAY:
			keyhelper.get(&key,&icon);
			menu_item = new CMenuForwarder(LOCALE_MOVIEPLAYER_FILEPLAYBACK, true, NULL, neutrino, "fileplayback", key, icon);
			menu_item->setHint(NEUTRINO_ICON_HINT_FILEPLAY, LOCALE_MENU_HINT_FILEPLAY);
			break;
		case SNeutrinoSettings::ITEM_AUDIOPLAY:
			keyhelper.get(&key,&icon);
			menu_item = new CMenuForwarder(LOCALE_AUDIOPLAYER_NAME, true, NULL, neutrino, "audioplayer", key, icon);
			menu_item->setHint(NEUTRINO_ICON_HINT_APLAY, LOCALE_MENU_HINT_APLAY);
			break;
		case SNeutrinoSettings::ITEM_INETPLAY:
			keyhelper.get(&key,&icon);
			menu_item = new CMenuForwarder(LOCALE_INETRADIO_NAME, true, NULL, neutrino, "inetplayer", key, icon);
			menu_item->setHint(NEUTRINO_ICON_HINT_INET_RADIO, LOCALE_MENU_HINT_INET_RADIO);
			break;
		case SNeutrinoSettings::ITEM_HDDMENU:
			keyhelper.get(&key,&icon);
			menu_item = new CMenuForwarder(LOCALE_HDD_SETTINGS, true, NULL, CHDDMenuHandler::getInstance(), NULL, key, icon);
			menu_item->setHint(NEUTRINO_ICON_HINT_HDD, LOCALE_MENU_HINT_HDD);
			break;
		case SNeutrinoSettings::ITEM_NETSETTINGS:
			keyhelper.get(&key,&icon);
			menu_item = new CMenuForwarder(LOCALE_MAINSETTINGS_NETWORK, true, NULL, CNetworkSetup::getInstance(), NULL, key, icon);
			menu_item->setHint(NEUTRINO_ICON_HINT_NETWORK, LOCALE_MENU_HINT_NETWORK);
			break;
		case SNeutrinoSettings::ITEM_SWUPDATE:
			keyhelper.get(&key,&icon);
			menu_item = new CMenuDForwarder(LOCALE_SERVICEMENU_UPDATE, true, NULL, new CSoftwareUpdate(), NULL, key, icon);
			menu_item->setHint(NEUTRINO_ICON_HINT_SW_UPDATE, LOCALE_MENU_HINT_SW_UPDATE);
			break;
		case -1: // plugin
		    {
			int number_of_plugins = g_PluginList->getNumberOfPlugins();
			if (!number_of_plugins)
				continue;
			int count = 0;
			for(; count < number_of_plugins; count++) {
				const char *pname = g_PluginList->getFileName(count);
				if (pname && (std::string(pname) == *it) && !g_PluginList->isHidden(count)) {
					neutrino_msg_t d_key = g_PluginList->getKey(count);
					keyhelper.get(&key,&icon, d_key);
					menu_item = new CMenuForwarder(g_PluginList->getName(count), true, NULL, CPluginsExec::getInstance(), to_string(count).c_str(), key, icon);
					menu_item->setHint(g_PluginList->getHintIcon(count), g_PluginList->getDescription(count));
					break;
				}
			}
			if (count == number_of_plugins)
				continue;
		    }
		}
			
		itemstr_last = *it;
		if (menu_item) {
			menu_items++;
			menu->addItem(menu_item, false);
			last_menu_item = menu_item;
		}
	}

	extern CInfoClock *InfoClock;
	InfoClock->enableInfoClock(false);

	// show menu if there are more than 2 items only
	// otherwise, we start the item directly (must be the last one)
	if (menu_items > 1 )
		menu->exec(NULL, "");
	else if (last_menu_item)
		last_menu_item->exec( NULL );
	
	InfoClock->enableInfoClock(true);
	CNeutrinoApp::getInstance()->StartSubtitles();

	if (button < COL_BUTTONMAX)
		user_menu[button].selected = menu->getSelected();

	delete menu;

	return true;
}
Example #17
0
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);
	
	hddmenu->addItem(new CMenuForwarder(LOCALE_HDD_ACTIVATE, true, "", new CHDDDestExec(), NULL, CRCInput::RC_red,NEUTRINO_ICON_BUTTON_RED));

	hddmenu->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_HDD_EXTENDED_SETTINGS));
	
	hddmenu->addItem( new CMenuOptionChooser(LOCALE_HDD_SLEEP, &g_settings.hdd_sleep, HDD_SLEEP_OPTIONS, HDD_SLEEP_OPTION_COUNT, true));
	hddmenu->addItem( new CMenuOptionChooser(LOCALE_HDD_NOISE, &g_settings.hdd_noise, HDD_NOISE_OPTIONS, HDD_NOISE_OPTION_COUNT, true));

	//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++) {
		char str[256];
		char sstr[256];
		char vendor[128], model[128];
		int64_t bytes;
		int64_t megabytes;
		int removable = 0;
		bool oldkernel = false;
		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;
				printf("-> root device is on this disk, skipping\n");
			}
		}
		close(fd);

		megabytes = bytes/1000000;

		snprintf(str, sizeof(str), "/sys/block/%s/device/vendor", namelist[i]->d_name);
		f = fopen(str, "r");
		if(!f) {
			oldkernel = true;
			strcpy(vendor, "");
		} else {
			fscanf(f, "%s", vendor);
			fclose(f);
			strcat(vendor, "-");
		}

		/* the Tripledragon only has kernel 2.6.12 available.... :-( */
		if (oldkernel)
			snprintf(str, sizeof(str), "/proc/ide/%s/model", namelist[i]->d_name);
		else
			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);

 		snprintf(str, sizeof(str), "%s %s %lld %s", vendor, model, 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));
		tempMenu[i]->addItem(new CMenuForwarder(LOCALE_HDD_FORMAT, true, "", new CHDDFmtExec, namelist[i]->d_name));
		tempMenu[i]->addItem(new CMenuForwarder(LOCALE_HDD_CHECK, true, "", new CHDDChkExec, namelist[i]->d_name));
		
		snprintf(sstr, sizeof(sstr), "%s (%s)", g_Locale->getText(LOCALE_HDD_REMOVABLE_DEVICE),  namelist[i]->d_name);	
		hddmenu->addItem(new CMenuForwarderNonLocalized((removable ? sstr : namelist[i]->d_name), (removable || isroot) ? false : true, tmp_str[i], tempMenu[i]));
		
		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;
}
Example #18
0
/* audio settings menu */
int CAudioSetup::showAudioSetup()
{
	//menue init
	CMenuWidget* audioSettings = new CMenuWidget(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width);
	audioSettings->setSelected(selected);
	audioSettings->setWizardMode(is_wizard);

	//analog modes (stereo, mono l/r...)
	CMenuOptionChooser * as_oj_analogmode 	= new CMenuOptionChooser(LOCALE_AUDIOMENU_ANALOG_MODE, &g_settings.audio_AnalogMode, AUDIOMENU_ANALOGOUT_OPTIONS, AUDIOMENU_ANALOGOUT_OPTION_COUNT, true, audioSetupNotifier);
	as_oj_analogmode->setHint("", LOCALE_MENU_HINT_AUDIO_ANALOG_MODE);

	//dd subchannel auto on/off
	CMenuOptionChooser * as_oj_ddsubchn 	= new CMenuOptionChooser(LOCALE_AUDIOMENU_DOLBYDIGITAL, &g_settings.audio_DolbyDigital, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, audioSetupNotifier);
	as_oj_ddsubchn->setHint("", LOCALE_MENU_HINT_AUDIO_DD);

	//dd via hdmi
	CMenuOptionChooser * as_oj_dd_hdmi 	= new CMenuOptionChooser(LOCALE_AUDIOMENU_HDMI_DD, &g_settings.hdmi_dd, AUDIOMENU_HDMI_DD_OPTIONS, AUDIOMENU_HDMI_DD_OPTION_COUNT, true, audioSetupNotifier);
	as_oj_dd_hdmi->setHint("", LOCALE_MENU_HINT_AUDIO_HDMI_DD);

	//dd via spdif
	CMenuOptionChooser * as_oj_dd_spdif 	= new CMenuOptionChooser(LOCALE_AUDIOMENU_SPDIF_DD, &g_settings.spdif_dd, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, audioSetupNotifier);
	as_oj_dd_spdif->setHint("", LOCALE_MENU_HINT_AUDIO_SPDIF_DD);

	CMenuOptionChooser * as_oj_avsync = NULL;
	CMenuOptionNumberChooser * as_oj_vsteps = NULL;
	if (!g_settings.easymenu) {
		//av synch
		as_oj_avsync	= new CMenuOptionChooser(LOCALE_AUDIOMENU_AVSYNC, &g_settings.avsync, AUDIOMENU_AVSYNC_OPTIONS, AUDIOMENU_AVSYNC_OPTION_COUNT, true, audioSetupNotifier);
		as_oj_avsync->setHint("", LOCALE_MENU_HINT_AUDIO_AVSYNC);

		//volume steps
		as_oj_vsteps = new CMenuOptionNumberChooser(LOCALE_AUDIOMENU_VOLUME_STEP, (int *)&g_settings.current_volume_step, true, 1, 25, NULL);
		as_oj_vsteps->setHint("", LOCALE_MENU_HINT_AUDIO_VOLSTEP);
		//clock rec
		//CMenuOptionChooser * as_oj_clockrec new CMenuOptionChooser(LOCALE_AUDIOMENU_CLOCKREC, &g_settings.clockrec, AUDIOMENU_CLOCKREC_OPTIONS, AUDIOMENU_CLOCKREC_OPTION_COUNT, true, audioSetupNotifier);
	}

	//SRS
	//SRS algo
	CMenuOptionChooser * as_oj_algo 	= new CMenuOptionChooser(LOCALE_AUDIO_SRS_ALGO, &g_settings.srs_algo, AUDIOMENU_SRS_OPTIONS, AUDIOMENU_SRS_OPTION_COUNT, g_settings.srs_enable, audioSetupNotifier);
	as_oj_algo->setHint("", LOCALE_MENU_HINT_AUDIO_SRS_ALGO);

	//SRS noise manage
	CMenuOptionChooser * as_oj_noise 	= new CMenuOptionChooser(LOCALE_AUDIO_SRS_NMGR, &g_settings.srs_nmgr_enable, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.srs_enable, audioSetupNotifier);
	as_oj_noise->setHint("", LOCALE_MENU_HINT_AUDIO_SRS_NMGR);

	//SRS reverence volume
	CMenuOptionNumberChooser * as_oj_volrev = new CMenuOptionNumberChooser(LOCALE_AUDIO_SRS_VOLUME, &g_settings.srs_ref_volume, g_settings.srs_enable, 1, 100, audioSetupNotifier);
	as_oj_volrev->setHint("", LOCALE_MENU_HINT_AUDIO_SRS_VOLUME);

	//SRS on/off
	CTruVolumeNotifier truevolSetupNotifier(as_oj_algo, as_oj_noise, as_oj_volrev);
	CMenuOptionChooser * as_oj_srsonoff 	= new CMenuOptionChooser(LOCALE_AUDIO_SRS_IQ, &g_settings.srs_enable, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, &truevolSetupNotifier);
	as_oj_srsonoff->setHint("", LOCALE_MENU_HINT_AUDIO_SRS);

	//paint items
	audioSettings->addIntroItems(LOCALE_MAINSETTINGS_AUDIO);
	//---------------------------------------------------------
	audioSettings->addItem(as_oj_analogmode);
	audioSettings->addItem(GenericMenuSeparatorLine);
	//---------------------------------------------------------
	audioSettings->addItem(as_oj_dd_hdmi);
	audioSettings->addItem(as_oj_dd_spdif);
	audioSettings->addItem(as_oj_ddsubchn);
	//---------------------------------------------------------
	if (!g_settings.easymenu) {
		audioSettings->addItem(GenericMenuSeparatorLine);
		audioSettings->addItem(as_oj_avsync);
		audioSettings->addItem(as_oj_vsteps);
		//audioSettings->addItem(as_clockrec);
	}
	//---------------------------------------------------------
	audioSettings->addItem(GenericMenuSeparatorLine);
	audioSettings->addItem(as_oj_srsonoff);
	audioSettings->addItem(as_oj_algo);
#ifndef BOXMODEL_APOLLO
	audioSettings->addItem(as_oj_noise);
#endif
	audioSettings->addItem(as_oj_volrev);
#if 0
	audioSettings->addItem(mf);
#endif

	int res = audioSettings->exec(NULL, "");
	selected = audioSettings->getSelected();
	delete audioSettings;
#ifdef BOXMODEL_APOLLO
	delete as_oj_noise;
#endif
	return res;
}
int CMoviePlayerMenue::showMoviePlayerMenue()
{
	CMenuTarget* 	moviePlayerGui = new CMoviePlayerGui();

	//init
	CMenuWidget * mpmenue = new CMenuWidget(LOCALE_MAINMENU_MOVIEPLAYER, NEUTRINO_ICON_EPGINFO, width);
	mpmenue->setPreselected(selected);

	//intros
	mpmenue->addIntroItems();

	//ts playback 
	mpmenue->addItem(new CMenuForwarder(LOCALE_MOVIEPLAYER_TSPLAYBACK, true, NULL, moviePlayerGui, "tsplayback", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN));
	//ts playback pin 
	mpmenue->addItem(new CMenuForwarder(LOCALE_MOVIEPLAYER_TSPLAYBACK_PC, true, NULL, moviePlayerGui, "tsplayback_pc", CRCInput::RC_1));

	neutrino_msg_t rc_msg;
#ifdef ENABLE_MOVIEBROWSER
#ifndef ENABLE_MOVIEPLAYER2
	//moviebrowser init via movieplayer 1
	mpmenue->addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_HEAD, true, NULL, moviePlayerGui, "tsmoviebrowser", CRCInput::RC_2));
#else
	//moviebrowser init
	mpmenue->addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_HEAD, true, NULL, CMovieBrowser::getInstance(), "run", CRCInput::RC_2));
#endif /* ENABLE_MOVIEPLAYER2 */
	rc_msg = CRCInput::RC_3;
#else
	rc_msg = CRCInput::RC_2;
#endif /* ENABLE_MOVIEBROWSER */

	//bookmark
	mpmenue->addItem(new CMenuForwarder(LOCALE_MOVIEPLAYER_BOOKMARK, true, NULL, moviePlayerGui, "bookmarkplayback", rc_msg));

	mpmenue->addItem(GenericMenuSeparatorLine);

	//vlc file play
	toNotify.push_back(new CMenuForwarder(LOCALE_MOVIEPLAYER_FILEPLAYBACK, g_settings.streaming_type == 1, NULL, moviePlayerGui, "fileplayback", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED));
	mpmenue->addItem(toNotify.back());
	//vlc dvd play
	toNotify.push_back(new CMenuForwarder(LOCALE_MOVIEPLAYER_DVDPLAYBACK, g_settings.streaming_type == 1, NULL, moviePlayerGui, "dvdplayback", CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW));
	mpmenue->addItem(toNotify.back());
	//vlc vcd play
	toNotify.push_back(new CMenuForwarder(LOCALE_MOVIEPLAYER_VCDPLAYBACK, g_settings.streaming_type == 1, NULL, moviePlayerGui, "vcdplayback", CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE));
	mpmenue->addItem(toNotify.back());

	mpmenue->addItem(GenericMenuSeparatorLine);

	//settings
	mpmenue->addItem(new CMenuForwarder(LOCALE_MAINMENU_SETTINGS, true, NULL, moviePlayerSetup, NULL, CRCInput::RC_help, NEUTRINO_ICON_BUTTON_HELP));

#ifdef ENABLE_GUI_MOUNT
	//neutrino mount
	CNFSSmallMenu* nfsSmallMenu = new CNFSSmallMenu();
	mpmenue->addItem(new CMenuForwarder(LOCALE_NETWORKMENU_MOUNT, true, NULL, nfsSmallMenu, NULL, CRCInput::RC_setup, NEUTRINO_ICON_BUTTON_DBOX));
#endif

	int res = mpmenue->exec(NULL, "");
	selected = mpmenue->getSelected();
	delete mpmenue;

	delete moviePlayerGui;
#ifdef ENABLE_GUI_MOUNT
	delete nfsSmallMenu;
#endif
	toNotify.clear();

	return res;
}
Example #20
0
int CDriverBootSetup::showSetup()
{
	// dynamic created objects
	std::vector<CChangeObserver*> toDelete;

	CMenuWidget * dbs = new CMenuWidget(menue_title, menue_icon, width);
	dbs->setPreselected(selected);

	int misc_option[DRIVER_SETTING_FILES_COUNT];
	bool item_enabled[DRIVER_SETTING_FILES_COUNT];

#ifdef HAVE_DBOX_HARDWARE
	CMenuOptionChooser * oj_spts = new CMenuOptionChooser(LOCALE_DRIVERSETTINGS_SPTSMODE, &g_settings.misc_spts, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this);
#endif

	CMenuOptionChooser * oj_switches[DRIVER_SETTING_FILES_COUNT];

	for (int i = 0; i < DRIVER_SETTING_FILES_COUNT; i++)
	{
		FILE * fd = fopen(driver_setting_files[i].filename, "r");
		if (fd)
		{
			fclose(fd);
			misc_option[i] = 1;
		}
		else
			misc_option[i] = 0;
		
		if (!strcmp(driver_setting_files[i].filename, "/var/etc/.philips_rc_patch") && (g_info.box_Type == CControld::TUXBOX_MAKER_NOKIA)) // useful for Philips RC and sometimes for Sagem RC
			item_enabled[i] = false;
		else if (!strcmp(driver_setting_files[i].filename, "/var/etc/.no_enxwatchdog") && (g_info.box_Type == CControld::TUXBOX_MAKER_NOKIA)) // not for Nokia
			item_enabled[i] = false;
		else if (!strcmp(driver_setting_files[i].filename, "/var/etc/.sptsfix") && (g_info.avia_chip != CControld::TUXBOX_AVIACHIP_AVIA500)) // only Avia500
			item_enabled[i] = false;
		else
			item_enabled[i] = true;

		if (item_enabled[i])
		{
			CTouchFileNotifier * touchFileNotifier = new CTouchFileNotifier(driver_setting_files[i].filename);
			toDelete.push_back(touchFileNotifier);
			oj_switches[i] = new CMenuOptionChooser(driver_setting_files[i].name, &(misc_option[i]), driver_setting_files[i].options, 2, true, touchFileNotifier);
		}
	}

#ifdef HAVE_DBOX_HARDWARE
	CMenuOptionChooser * oj_boot_console = new CMenuOptionChooser(LOCALE_DRIVERSETTINGS_FB_DESTINATION, &g_settings.uboot_console, DRIVERSETTINGS_FB_DESTINATION_OPTIONS, DRIVERSETTINGS_FB_DESTINATION_OPTION_COUNT, true);
	CMenuOptionChooser * oj_dbox_duplex = new CMenuOptionChooser(LOCALE_DRIVERSETTINGS_FDX_LOAD, &g_settings.uboot_dbox_duplex, DRIVERSETTINGS_FDX_OPTIONS, DRIVERSETTINGS_FDX_OPTION_COUNT, true);
#endif

	//paint items
	dbs->addIntroItems(menue_title != LOCALE_DRIVERSETTINGS_DRIVER_BOOT ? LOCALE_DRIVERSETTINGS_DRIVER_BOOT : NONEXISTANT_LOCALE);
	//-----------------------------------------
#ifdef HAVE_DBOX_HARDWARE
	dbs->addItem(oj_spts);
#endif
	//-----------------------------------------
	for (int i = 0; i < DRIVER_SETTING_FILES_COUNT; i++)
		if (item_enabled[i])
			dbs->addItem(oj_switches[i]);
#ifdef HAVE_DBOX_HARDWARE
	dbs->addItem(GenericMenuSeparatorLine);
	//-----------------------------------------
	dbs->addItem(oj_boot_console);
	dbs->addItem(oj_dbox_duplex);
#endif

	int res = dbs->exec(NULL, "");
	selected = dbs->getSelected();
	delete dbs;

	// delete dynamic created objects
	unsigned int toDeleteSize = toDelete.size();
	for (unsigned int i = 0; i < toDeleteSize; i++)
		delete toDelete[i];

	return res;
}
Example #21
0
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;
}