int CCAMMenuHandler::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data)
{
//printf("CCAMMenuHandler::handleMsg: msg 0x%x data 0x%x\n", msg, data);
	int msgret;
	handleCamMsg(msg, data, msgret);
	return msgret;
}
Пример #2
0
int CCAMMenuHandler::handleMsg (const neutrino_msg_t msg, neutrino_msg_data_t data)
{
	int ret = messages_return::handled;
//printf("CCAMMenuHandler::handleMsg: msg 0x%x data 0x%x\n", msg, data);
	int camret = handleCamMsg(msg, data);
	if(camret < 0) {
		ret = messages_return::unhandled;
	}
	return ret;
}
Пример #3
0
int CCAMMenuHandler::doMenu (int slot)
{
	int res = menu_return::RETURN_REPAINT;
	neutrino_msg_t msg;
	neutrino_msg_data_t data;
	bool doexit = false;

	while(!doexit) 
	{
		dprintf(DEBUG_NORMAL, "CCAMMenuHandler::doMenu: slot %d\n", slot);

		timeoutEnd = CRCInput::calcTimeoutEnd(10);

		ci->CI_EnterMenu(slot);

		while(true) 
		{
			if(hintBox)
			{
				delete hintBox;
				hintBox = NULL;
			}
			
			hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_CAM_WAITING));
			hintBox->paint();
			g_RCInput->getMsgAbsoluteTimeout (&msg, &data, &timeoutEnd);
			
			dprintf(DEBUG_NORMAL, "CCAMMenuHandler::doMenu: msg %x data %x\n", msg, data);
			
			if (msg == CRCInput::RC_timeout) 
			{
				if(hintBox)
				{
					delete hintBox;
					hintBox = NULL;
				}

				hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_CAM_TIMEOUT));
				hintBox->paint();

				dprintf(DEBUG_NORMAL, "CCAMMenuHandler::doMenu: menu timeout\n");
				
				sleep(5);
				delete hintBox;
				hintBox = NULL;

				ci->CI_CloseMMI(slot);

				return menu_return::RETURN_REPAINT;
			} 
			
			/* -1 = not our event, 0 = back to top menu, 1 = continue loop, 2 = quit */
			int ret = handleCamMsg(msg, data, true);
			if(ret < 0 && (msg > CRCInput::RC_Messages)) 
			{
				if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & ( messages_return::cancel_all | messages_return::cancel_info ) )
				{
					doexit = true;
					res = menu_return::RETURN_EXIT_ALL;
				}
			} 
			else if (ret == 1) 
			{
				timeoutEnd = CRCInput::calcTimeoutEnd(10);
				continue;
			} 
			else if (ret == 2) 
			{
				doexit = true;
				break;
			} 
			else 
			{
				break;
			}
		}
	}

	ci->CI_CloseMMI(slot);

	if(hintBox) 
	{
		delete hintBox;
		hintBox = NULL;
	}
	
	dprintf(DEBUG_NORMAL, "CCAMMenuHandler::doMenu: return\n");
	
	return res; 
}
int CCAMMenuHandler::doMenu(int slot, CA_SLOT_TYPE slotType)
{
	int res = menu_return::RETURN_REPAINT;
	neutrino_msg_t msg;
	neutrino_msg_data_t data;
	bool doexit = false;

	menu_slot = slot;
	menu_type = slotType;
	while(!doexit) {
		printf("CCAMMenuHandler::doMenu: enter menu for slot %d\n", slot);

		timeoutEnd = CRCInput::calcTimeoutEnd(10);

		ca->MenuEnter(slotType, slot);
		while(true) {
			showHintBox(LOCALE_MESSAGEBOX_INFO, 
				g_Locale->getText(slotType == CA_SLOT_TYPE_CI ? LOCALE_CI_WAITING : LOCALE_SC_WAITING));

			g_RCInput->getMsgAbsoluteTimeout (&msg, &data, &timeoutEnd);
			printf("CCAMMenuHandler::doMenu: msg %x data %x\n", msg, data);
			if (msg == CRCInput::RC_timeout) {
				printf("CCAMMenuHandler::doMenu: menu timeout\n");
				hideHintBox();
				ShowHint(LOCALE_MESSAGEBOX_INFO,
					g_Locale->getText(slotType == CA_SLOT_TYPE_CI ? LOCALE_CI_TIMEOUT : LOCALE_SC_TIMEOUT), 450, 3);
				ca->MenuClose(slotType, slot);
				return menu_return::RETURN_REPAINT;
			}
			/* -1 = not our event, 0 = back to top menu, 1 = continue loop, 2 = quit , 3 = quit all*/
			int msgret;
			int ret = handleCamMsg(msg, data, msgret, true);
			printf("CCAMMenuHandler::doMenu: handleCamMsg ret: %d\n", ret);
			if((msgret & messages_return::unhandled) && (msg > CRCInput::RC_Events)) {
				if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & (messages_return::cancel_all | messages_return::cancel_info))
				{
					doexit = true;
					res = menu_return::RETURN_EXIT_ALL;
					break;
				}
			}
			if (ret == 1) {
				/* workaround: dont cycle here on timers */
				if (msg != NeutrinoMessages::EVT_TIMER)
					timeoutEnd = CRCInput::calcTimeoutEnd(10);
				continue;
			} else if (ret == 2) {
				doexit = true;
				break;
			} else if (ret == 3) {
				res = menu_return::RETURN_EXIT_ALL;
				doexit = true;
				break;
			} else { // ret == 0
				break;
			}
		}
	}
	ca->MenuClose(slotType, slot);
	hideHintBox();
	menu_type = menu_slot = -1;
	printf("CCAMMenuHandler::doMenu: return\n");
	return res;
}