Exemplo n.º 1
0
void CSitesWnd::OnSitesAdd() 
{
	fsSiteInfoPtr site; site.CreateInstance ();

	site->dwFtpFlags = 0;
	site->bTemp = FALSE;
	site->cMaxConns = UINT_MAX;
	site->strName = NULL;
	site->strPassword = NULL;
	site->strUser = NULL;
	site->cConnsNow = 0;
	site->dwValidFor = SITE_VALIDFOR_HTTP | SITE_VALIDFOR_HTTPS | SITE_VALIDFOR_FTP | SITE_VALIDFOR_SUBDOMAINS;

	CSitesSheet sheet (LS (L_ADDSITE), this);
	sheet.SetMode(true);
	_DlgMgr.OnDoModal (&sheet);
	sheet.Init (site);
	UINT nRet = sheet.DoModal ();
	_DlgMgr.OnEndDialog (&sheet);

	if (nRet == IDOK)
	{
		_SitesMgr.AddSite (site);
	}

	SetFocus ();
}
Exemplo n.º 2
0
void CSitesWnd::OnSitesProperties() 
{
	POSITION pos = GetFirstSelectedItemPosition ();
	if (pos == NULL) return;
	int iItem = GetNextSelectedItem (pos);
	fsSiteInfo *pSite = (fsSiteInfo*) GetItemData (iItem);

	CSitesSheet sheet (LS (L_SITEPROP), this);
	sheet.SetMode(false);
	_DlgMgr.OnDoModal (&sheet);
	sheet.Init (pSite);
	UINT nRet = sheet.DoModal ();
	_DlgMgr.OnEndDialog (&sheet);

	SetFocus ();

	if (nRet == IDOK)
		UpdateSite (pSite);
}