示例#1
0
bool CAddToAntidialExcludes::OnOk()
{
	if( !CDialogBindingT<>::OnOk() )
		return false;

	CProfile * pProfile = g_pProduct->GetProfile(AVP_PROFILE_ANTIDIAL);
	if( !pProfile || !pProfile->settings() || !pProfile->settings()->isBasedOn(cAntiDialSettings::eIID) )
		return false;

	((cAntiDialSettings *)pProfile->settings())->m_vAllowPhoneNumbersList.push_back(m_ExclItem);
	if( PR_FAIL(pProfile->SaveSettings()) )
		return false;

	m_pAskAction->m_nResultAction = m_pAskAction->m_nExcludeAction;
	((CDialogItem *)Item()->m_pParent)->Close();
	return true;
}
示例#2
0
bool CMailWasherDlg::OnOk()
{
	m_MwSett = *(cGuiMailwasherSettings*)&m_Mw;
	if( !m_MwSett.m_bShowMailwasher )
	{
		CProfile *pAs = g_pProduct->GetProfile(AVP_PROFILE_ANTISPAM);
		if( pAs )
		{
			cAsBwList *pAsUserSett = (cAsBwList *)pAs->settings_user(NULL, cAsBwList::eIID);
			if( pAsUserSett )
			{
				pAsUserSett->m_bShowMailwasher = cFALSE;
				pAs->SaveSettings();
			}
		}
	}
	
	return OnCanClose(true);
}