Exemplo n.º 1
0
int CAdZapMenu::exec(CMenuTarget * parent, const std::string & actionKey)
{
    int res = menu_return::RETURN_EXIT_ALL;

    if (parent)
	parent->hide();

    if (actionKey == "enable") {
	if (!monitor)
	    armed = true;
	alerted = false;
	Update();
	return res;
    }
    if (actionKey == "disable") {
	armed = false;
	monitor = false;
	alerted = false;
	Update();
	return res;
    }
    if (actionKey == "monitor") {
	azm->armed = false;
	azm->monitor = true;
	alerted = false;
	Update();
	return res;
    }

    if (actionKey == "adzap") {
	if (armed || monitor) {
	    armed = false;
	    monitor = false;
	    alerted = false;
	    Update();
	    ShowLocalizedHint(LOCALE_ADZAP, LOCALE_ADZAP_CANCEL, 450, 1);
	    return res;
	}
    }
    if (actionKey.length() == 1) {
	g_settings.adzap_zapBackPeriod = actionKey[0] - '0';
	g_settings.adzap_zapBackPeriod *= 60;
	if (!monitor)
	    armed = true;
	return menu_return::RETURN_REPAINT;
    }

    Settings();

    return res;
}
Exemplo n.º 2
0
//saves settings without apply, reboot is required 
void CNetworkSetup::saveNetworkSettings(bool show_message)
{
	printf("[network setup] saving current network settings...\n");

	prepareSettings();

  	networkConfig->commitConfig();

	if (show_message)
		ShowLocalizedHint(LOCALE_MESSAGEBOX_INFO,
				  LOCALE_NETWORKMENU_SETUPSAVED,
				  width,
				  g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR],
				  NEUTRINO_ICON_INFO);
}
Exemplo n.º 3
0
int CEsoundGui::show()
{
	neutrino_msg_t      msg;
	neutrino_msg_data_t data;

	int res = -1;

	CLCD::getInstance()->setMode(CLCD::MODE_AUDIO);

	bool loop = true;

	ShowLocalizedHint(LOCALE_MESSAGEBOX_INFO, LOCALE_ESOUND_INFO);
	while(loop)
	{
		if(CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_audio)
		{
			// stop if mode was changed in another thread
			loop = false;
		}

		g_RCInput->getMsg(&msg, &data, 1);

		if( msg == CRCInput::RC_timeout)
		{
			// nothing
		}
		else if( msg == CRCInput::RC_home || msg == NeutrinoMessages::ESOUND_OFF)
		{ 
			loop=false;
		}
		else if(msg == NeutrinoMessages::CHANGEMODE)
		{
			if((data & NeutrinoMessages::mode_mask) != NeutrinoMessages::mode_audio)
			{
				loop = false;
				m_LastMode=data;
			}
		}
		else if(msg == NeutrinoMessages::RECORD_START ||
				msg == NeutrinoMessages::ZAPTO ||
				msg == NeutrinoMessages::STANDBY_ON ||
				msg == NeutrinoMessages::SHUTDOWN ||
				msg == NeutrinoMessages::SLEEPTIMER)
		{
			// Exit for Record/Zapto Timers
			loop = false;
			g_RCInput->postMsg(msg, data);
		}
		else if(msg == NeutrinoMessages::EVT_TIMER)
		{
			CNeutrinoApp::getInstance()->handleMsg( msg, data );
		}
		else
		{
			if( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all )
			{
				loop = false;
			}
		}
	}
	hide();

	return(res);
}