Ejemplo n.º 1
0
BOOL CPageContactListMode::SaveSettings()
{
	UpdateData();
	
	WriteOptionInt(IDS_OFSMESSENGER,IDS_CLMODE,CLMode);
	WriteOptionInt(IDS_OFSMESSENGER,IDS_SHOWOFFLINEFILES,m_bShowOffline);
	
	return CMcSettingsPage::SaveSettings();
}
Ejemplo n.º 2
0
BOOL CPageHistorySync::SaveSettings()
{
    UpdateData();

    WriteOptionInt(IDS_HISTORY,IDS_SYNCMODE,Mode);
    WriteOptionInt(IDS_HISTORY,IDS_FROMTIME,m_FromTime.GetTime());
    WriteOptionInt(IDS_HISTORY,IDS_TOTIME, m_ToTime.GetTime());

    return CMcSettingsPage::SaveSettings();
}
Ejemplo n.º 3
0
static int  SaveConfigToStream( TidyDocImpl* doc, StreamOut* out )
{
    int rc = 0;
    const TidyOptionImpl* option;
    for ( option=option_defs+1; 0==rc && option && option->name; ++option )
    {
        const TidyOptionValue* val = &doc->config.value[ option->id ];
        if ( option->parser == NULL )
            continue;
        if ( OptionValueEqDefault( option, val ) && option->id != TidyDoctype)
            continue;

        if ( option->id == TidyDoctype )  /* Special case */
        {
          ulong dtmode = cfg( doc, TidyDoctypeMode );
          if ( dtmode == TidyDoctypeUser )
          {
            tmbstr t;
            
            /* add 2 double quotes */
            if (( t = (tmbstr)MemAlloc( tmbstrlen( val->p ) + 2 ) ))
            {
              t[0] = '\"'; t[1] = 0;
            
              tmbstrcat( t, val->p );
              tmbstrcat( t, "\"" );
              rc = WriteOptionString( option, t, out );
            
              MemFree( t );
            }
          }
          else if ( dtmode == option_defs[TidyDoctypeMode].dflt )
            continue;
          else
            rc = WriteOptionPick( option, dtmode, out );
        }
        else if ( option->pickList )
          rc = WriteOptionPick( option, val->v, out );
        else
        {
          switch ( option->type )
          {
          case TidyString:
            rc = WriteOptionString( option, val->p, out );
            break;
          case TidyInteger:
            rc = WriteOptionInt( option, val->v, out );
            break;
          case TidyBoolean:
            rc = WriteOptionBool( option, val->v ? yes : no, out );
            break;
          }
        }
    }
    return rc;
}
Ejemplo n.º 4
0
BOOL CPageMesTemplates::SaveSettings()
{
	UpdateData();

	WriteOptionInt(IDS_OFSMESSENGER,IDS_SEND_MESSAGE_TEMPLATE_AUTO,m_ShowAuto);

	CComPtr<IXMLDOMDocument>	pMTDoc	=	NULL;
	pMTDoc.CoCreateInstance(CLSID_DOMDocument40,NULL,CLSCTX_INPROC_SERVER);

	if(pMTDoc)
	{
		USES_CONVERSION;

		CComBSTR	bsRootXML	=	L"<message_templates/>";

		VARIANT_BOOL	varLoad	=	VARIANT_FALSE;
		pMTDoc->loadXML(bsRootXML,&varLoad);

		//-------------------------------------------------------------------------------------
		CComPtr<IXMLDOMNode>	pRoot;

		pMTDoc->selectSingleNode(L"message_templates",&pRoot);

		for(int Index = 0; Index<m_TemplateList.GetItemCount();Index++)
		{
			CComPtr<IXMLDOMNode>	pItem;
			insertSingleNode(pRoot,CComBSTR(L"mt"),NULL,NULL,&pItem);

			
			insertSingleNode(pItem,CComBSTR(L"name"),NULL,T2BSTR(m_TemplateList.GetItemText(Index,0)));
			insertSingleNode(pItem,CComBSTR(L"text"),NULL,T2BSTR(m_TemplateList.GetItemText(Index,1)));
		}

		//-------------------------------------------------------------------------------------

		CString strSection;
		strSection.Format(_T("%s\\%s\\%d"),GetString(IDS_INFO),m_UserRole,m_UserId);

		CComBSTR bsOutXML;
		pMTDoc->get_xml(&bsOutXML);

		//-------------------------------------------------------------------------------------

		CString strMessageTemplateXML = W2CT(bsOutXML);
			
		SetRegFileText(strSection,GetString(IDS_MESSAGE_TEMPLATES_REG),strMessageTemplateXML);
	}

	return CMcSettingsPage::SaveSettings();
}
Ejemplo n.º 5
0
void CFileExplore::OnClose() 
{
	FileListDeleteAllItem();

	CString strSection = GetString(IDS_OFSMESSENGER);
	CString strEntry = GetString(IDS_COLUMN_WIDTH);
	
	AfxGetApp()->WriteProfileInt(strSection, strEntry+_T("30"), m_FileList.GetColumnWidth(0));
	AfxGetApp()->WriteProfileInt(strSection, strEntry+_T("31"), m_FileList.GetColumnWidth(1));
	AfxGetApp()->WriteProfileInt(strSection, strEntry+_T("32"), m_FileList.GetColumnWidth(2));
	AfxGetApp()->WriteProfileInt(strSection, strEntry+_T("33"), m_FileList.GetColumnWidth(3));

	WriteOptionInt(IDS_OFSMESSENGER,IDS_FILEL,m_iSortingMode);
	
	CResizableDialog::OnClose();
}
Ejemplo n.º 6
0
void CLoginDlg::OnClickButtonNetoption()
{
//#ifdef _DEBUG
//	CWebWindow *pNewWindow = new CWebWindow;
//	pNewWindow->CreateAutoKiller(_T("/Browser/Common/skin.xml"), this, GetDesktopWindow(), 100, 100, 500, 300, NULL, _T("d:\\humor\\a.htm"), FALSE, FALSE, TRUE, 0, TRUE);
//	CMainDlg dlg;
//	CChatDlg *pdlg = new CChatDlg((CMainDlg*)AfxGetMainWnd(), GetDesktopWindow());
//	pdlg->Create(GetDesktopWindow());
//	pdlg->SetWindowPos(NULL,0,0,300,200,SWP_NOZORDER|SWP_SHOWWINDOW);
//	CChatCreateDlg dlg((CMainDlg*)AfxGetMainWnd());
//	dlg.DoModal();
//#else
    WriteOptionInt(IDS_NETOPTIONS, IDS_USESSL, m_btnSSL.GetPressed());

    CDlgNetOptions2 dlg;
    dlg.DoModal();

    m_btnSSL.SetPressed(GetOptionInt(IDS_NETOPTIONS, IDS_USESSL, FALSE));
//#endif
}
Ejemplo n.º 7
0
void CLoginDlg::OnClickButtonLogin()
{
    UpdateData();

    m_LoginStr.TrimLeft();
    m_LoginStr.TrimRight();

    CString LoginStr = m_LoginStr;

    int StartPortPos = -1;
    if((StartPortPos = LoginStr.Find(_T(":")))!=-1)
    {
        CString strPort = LoginStr.Mid(StartPortPos+1);

        LoginStr = LoginStr.Left(StartPortPos);

        int lPort = _ttol(strPort);
    }


    // Check: Login is E-Mail [9/2/2002]
    if(CheckEmailString(LoginStr))
    {
        if(GetDllVersion(_T("comctl32.dll")) >= PACKVERSION(5,8))
        {
            ShowLoginTooltip(FALSE);
        }

        WriteOptionInt(IDS_NETOPTIONS, IDS_USESSL, m_btnSSL.GetPressed());

        if(!m_btnSavePassword.GetPressed())
        {
            WriteOptionString(IDS_LOGIN, IDS_NICKNAME, _T(""));
            //WriteOptionString(IDS_LOGIN,IDS_PASSWORD,"");
            WriteOptionInt(IDS_LOGIN,IDS_REMEMBER,FALSE);
        }
        else
        {
#ifndef RADIUS
#define		CRYPT_PROV_CONTAINER_NAME	_T("Mediachase")
#else
#define		CRYPT_PROV_CONTAINER_NAME	_T("Radius-Soft")
#endif

#define		CRYPT_KEYLENGTH				0x00280000L

#define		ENCRYPT_ALGORITHM			CALG_RC4
#define		ENCRYPT_BLOCK_SIZE			1

            //CString strHashData;

            CCryptProv				m_hCryptProv;
            CCryptDerivedKey		m_hKey;

            HRESULT m_CryptInitErrorCode = m_hCryptProv.Initialize(PROV_RSA_FULL,CRYPT_PROV_CONTAINER_NAME,MS_DEF_PROV,NULL);
            if(m_CryptInitErrorCode==0x80090016)
            {
                m_CryptInitErrorCode = m_hCryptProv.Initialize(PROV_RSA_FULL,CRYPT_PROV_CONTAINER_NAME,MS_DEF_PROV,CRYPT_NEWKEYSET);
            }

            if(m_CryptInitErrorCode==S_OK)
            {
                // Create Key [9/12/2002]
                CCryptMD5Hash hMD5Hash;

                m_CryptInitErrorCode = hMD5Hash.Initialize(m_hCryptProv,CRYPT_PROV_CONTAINER_NAME);
                if(m_CryptInitErrorCode==S_OK)
                {
                    m_CryptInitErrorCode = m_hKey.Initialize(m_hCryptProv,hMD5Hash,ENCRYPT_ALGORITHM,CRYPT_KEYLENGTH);

                    if(m_CryptInitErrorCode==S_OK)
                    {
                        LPTSTR strHashData	=	NULL;
                        if(LoginPassword2HexSTR(m_hKey,m_LoginStr,m_PasswordStr,&strHashData)==S_OK)
                        {
                            WriteOptionString(IDS_LOGIN,IDS_NICKNAME,strHashData);

                            delete [] strHashData;
                            strHashData = NULL;
                        }
                    }
                }
            }

            //WriteOptionString(IDS_LOGIN,IDS_NICKNAME,m_LoginStr);
            //Pack(m_PasswordStr,CString("vTsfO"));
            //WriteOptionString(IDS_LOGIN,IDS_PASSWORD,m_PasswordStr);
            //UnPack(m_PasswordStr,CString("vTsfO"));
            WriteOptionInt(IDS_LOGIN,IDS_REMEMBER,TRUE);
        }


        if(::IsWindow(GetParent()->GetSafeHwnd()))
            GetParent()->PostMessage(WM_INETLOGIN,0,0);
    }
    else
    {
        // Error; Onvalide Login [9/2/2002]

        // Show Ballon Tooltip [9/9/2004]
        if(GetDllVersion(_T("comctl32.dll")) >= PACKVERSION(5,8))
        {
            ShowLoginTooltip(TRUE);
        }
        else
        {
            _SHOW_IBN_ERROR_DLG_OK(IDS_INVALID_LOGIN_OR_PASSWORD);
        }
    }
    //  [9/2/2002]
}
Ejemplo n.º 8
0
BOOL CPageGeneral::SaveSettings()
{
	UpdateData();
	
	WriteOptionInt(IDS_OFSMESSENGER,IDS_MESSSAGEMODE,MessageMode);
	WriteOptionInt(IDS_OFSMESSENGER,IDS_SHOWNEW,m_ShowNew);
	WriteOptionInt(IDS_OFSMESSENGER,IDS_ANIMATION,m_AnimationClose);
	WriteOptionInt(IDS_OFSMESSENGER,IDS_HIDEINTRAY,m_HideMpa);
	WriteOptionInt(IDS_OFSMESSENGER,IDS_REMOVE_FROM_TASK_BAR,m_bRemoveTaskBar);
	WriteOptionInt(IDS_OFSMESSENGER,IDS_KEEPTOP,m_bKeepTop);

	WriteOptionInt(IDS_OFSMESSENGER,IDS_SHOWOFFLINEFILES,m_bShowOffline);
	m_bShowSendTo ? CreateSendToLink() : DeleteSendToLink();
	
	WriteOptionInt(IDS_OFSMESSENGER,IDS_CLMODE,m_bCreateOfflineFolder?2:1);

	WriteOptionInt(IDS_OFSMESSENGER,IDS_VIEWMODE,m_lDefaultView);
	
	WriteOptionInt(IDS_OFSMESSENGER,IDS_IBNACTIONBROWSER,m_lIBNActionBrowser);

	WriteOptionInt(IDS_OFSMESSENGER,IDS_OPENINMAXIMAZE, m_bOpenInMaximaze);

	WriteOptionInt(IDS_OFSMESSENGER,IDS_MINIMIZE_ONCLOSE,m_bMinimizeOnClose);

	WriteOptionInt(IDS_OFSMESSENGER,IDS_GET_DEFAULT_BROWSER_FROM_REGISTRY,m_bGetDefBrowserFromRegistry);

	WriteOptionInt(IDS_OFSMESSENGER,IDS_CONTACTLIST_SORT_BY_FIRSTNAME,m_bContactListSortByFirstName);

	WriteOptionInt(IDS_OFSMESSENGER,IDS_UPDATE_AUTOCHECK,m_bUpdateAutoCheck);
	

	return CMcSettingsPage::SaveSettings();
}