Exemplo n.º 1
0
void FEpicSurvey::SetActiveSurvey( const TSharedPtr< FSurvey >& Survey, bool AutoPrompted )
{
	ActiveSurvey = NULL;
	bool HasBeenCompleted = true;

	if ( Survey.IsValid() )
	{
		HasBeenCompleted = GetDefault<UEditorSettings>()->CompletedSurveys.Contains( Survey->GetIdentifier() );

		if ( !HasBeenCompleted )
		{
			ActiveSurvey = Survey;

			if ( ActiveSurvey.IsValid() && ( !NotificationDelegate.IsBound() || !AutoPrompted ) )
			{
				DisplayNotification();
			}
		}
	}

	if ( HasBeenCompleted && bIsShowingToolbarNotification )
	{
		FLevelEditorModule& LevelEditorModule = FModuleManager::LoadModuleChecked<FLevelEditorModule>("LevelEditor");
		LevelEditorModule.GetNotificationBarExtensibilityManager()->RemoveExtender( NotificationBarExtender );
		bIsShowingToolbarNotification = false;

		LevelEditorModule.BroadcastNotificationBarChanged();
	}
}
Exemplo n.º 2
0
//************************************************************************
// Called when an event is received
//************************************************************************
void CNotificationScreen::OnEventReceived(CEvent *pEvent)
{
	// check wether this events needs notification
	if(!pEvent->bNotification)
		return;

	CNotificationEntry *pEntry = new CNotificationEntry();
	pEntry->eType = pEvent->eType;
	pEntry->strTitle = pEvent->strSummary;
	if(pEvent->eType == EVENT_MSG_RECEIVED ||
		(pEvent->eType == EVENT_IRC_RECEIVED && (pEvent->iValue == GC_EVENT_MESSAGE || pEvent->iValue == GC_EVENT_NOTICE)))
	{
		pEntry->bMessage = true;
		tstring strUser = CAppletManager::GetContactDisplayname(pEvent->hContact);

		if(CConfig::GetIntSetting(NOTIFY_TITLE) == NOTIFY_TITLE_INFO)
			pEntry->strText = pEvent->strValue;
		else
			pEntry->strText = strUser + (pEvent->eType == EVENT_IRC_RECEIVED?_T(" - "):_T(": "))+ pEvent->strValue;
	}
	else
	{
		pEntry->bMessage = false;
		if(CConfig::GetIntSetting(NOTIFY_TITLE) == NOTIFY_TITLE_INFO && pEvent->eType == EVENT_IRC_RECEIVED )
			pEntry->strText = pEvent->strValue;
		else
			pEntry->strText = pEvent->strDescription;
	}

	pEntry->hContact = pEvent->hContact;
	pEntry->Time = pEvent->Time;
	
	if(m_pEntry)
	{
		m_LNotifications.push_back(pEntry);
		SetButtonBitmap(2,IDB_NEXT);
	}
	else
	{
		DisplayNotification(pEntry);
		SetButtonBitmap(2,NULL);
	}
}
Exemplo n.º 3
0
//************************************************************************
// Called when an LCD-button is pressed
//************************************************************************
void CNotificationScreen::OnLCDButtonDown(int iButton)
{
	CScreen::OnLCDButtonDown(iButton);	

	if(m_MessageText.IsVisible() &&
		( iButton <= 1 || iButton >=4))
	{
		if(iButton== 1 || iButton == 5)
			m_MessageText.ScrollDown();
		else
			m_MessageText.ScrollUp();

		SetExpiration(CConfig::GetIntSetting(NOTIFY_DURATION)*1000);
	}
	else if(iButton == 2 && m_LNotifications.size() >= 1)
	{
		CNotificationEntry *pEntry = *(m_LNotifications.begin());
		m_LNotifications.pop_front();
		
		if(m_LNotifications.size() >= 1)
			SetButtonBitmap(2,IDB_NEXT);
		else
			SetButtonBitmap(2,NULL);

		DisplayNotification(pEntry);
		SetExpiration(CConfig::GetIntSetting(NOTIFY_DURATION)*1000);
	}
	else if(iButton == 3 && m_pEntry && m_pEntry->pContact)
	{
		SetExpiration(0);

		CLCDConnection *pLCDCon =  CAppletManager::GetInstance()->GetLCDConnection();
		pLCDCon->SetAsForeground(1);
		pLCDCon->SetAsForeground(0);
		CAppletManager::GetInstance()->ActivateChatScreen(m_pEntry->pContact,m_pEntry->iConnectionID);
	}
	else
		SetExpiration(0);
}
Exemplo n.º 4
0
//************************************************************************
// Called when an event is received
//************************************************************************
void CNotificationScreen::OnEventReceived(CEvent *pEvent)
{
	// check wether this events needs notification
	if(!pEvent->bNotification)
		return;

	CNotificationEntry *pEntry = new CNotificationEntry();
	if(pEvent->eType == EVENT_MSG_RECEIVED)
	{
		pEntry->bMessage = true;
		//tstring strUser = toTstring((char*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)pEvent->hContact, NULL));

		//if(CConfig::GetIntSetting(NOTIFY_TITLE) == NOTIFY_TITLE_INFO)
		//	pEntry->strText = pEvent->strValue;
		//else
		pEntry->strText = pEvent->pContact->strDisplayName + _T(": ") + pEvent->strValue;
	}
	else
	{
		pEntry->bMessage = false;
		pEntry->strText = pEvent->strDescription;
	}
	pEntry->strSection = pEvent->strSection;
	pEntry->Time = pEvent->Time;
	pEntry->pContact = pEvent->pContact;
	pEntry->iConnectionID = pEvent->iConnectionID;
	pEntry->eType = pEvent->eType;

	if(m_pEntry)
	{
		m_LNotifications.push_back(pEntry);
		SetButtonBitmap(2,IDB_NEXT);
	}
	else
	{
		DisplayNotification(pEntry);
		SetButtonBitmap(2,NULL);
	}
}
Exemplo n.º 5
0
//************************************************************************
// Called when an LCD-button is pressed
//************************************************************************
void CNotificationScreen::OnLCDButtonDown(int iButton)
{
	CScreen::OnLCDButtonDown(iButton);	

	if((iButton == LGLCDBUTTON_BUTTON2 || iButton == LGLCDBUTTON_RIGHT) && m_LNotifications.size() >= 1)
	{
		CNotificationEntry *pEntry = *(m_LNotifications.begin());
		m_LNotifications.pop_front();
		
		if(m_LNotifications.size() >= 1)
			SetButtonBitmap(2,IDB_NEXT);
		else
			SetButtonBitmap(2,NULL);

		DisplayNotification(pEntry);
		SetExpiration(CConfig::GetIntSetting(NOTIFY_DURATION)*1000);
	}
	else if((iButton == LGLCDBUTTON_BUTTON3 || iButton == LGLCDBUTTON_OK) && m_pEntry && m_pEntry->hContact)
	{
		SetExpiration(0);

		CLCDConnection *pLCDCon =  CAppletManager::GetInstance()->GetLCDConnection();
		pLCDCon->SetAsForeground(1);
		pLCDCon->SetAsForeground(0);
		CAppletManager::GetInstance()->ActivateChatScreen(m_pEntry->hContact);
	} else if(!m_MessageText.IsVisible()) {
		SetExpiration(0);
	} else {
		if(iButton == LGLCDBUTTON_BUTTON1 || iButton == LGLCDBUTTON_DOWN) {
			m_MessageText.ScrollDown();
		} else if(iButton == LGLCDBUTTON_BUTTON0 || iButton == LGLCDBUTTON_UP) {
			m_MessageText.ScrollUp();
		}
		SetExpiration(CConfig::GetIntSetting(NOTIFY_DURATION)*1000);
	}	
}