Exemplo n.º 1
0
void CNamePage::DoFinish()
{
	if (!m_pParent->m_pFullName.IsEmpty())
		PREF_SetCharPref("mail.identity.username",m_pParent->m_pFullName);
	if (!m_pParent->m_pUserAddr.IsEmpty())
		PREF_SetCharPref("mail.identity.useremail",m_pParent->m_pUserAddr);
}
Exemplo n.º 2
0
BOOL
CPublishPrefs::ApplyChanges()
{
    PREF_SetBoolPref("editor.publish_keep_links",(XP_Bool)m_bAutoAdjustLinks);
    PREF_SetBoolPref("editor.publish_keep_images",(XP_Bool)m_bKeepImagesWithDoc);
    PREF_SetCharPref("editor.publish_location",LPCSTR(m_strPublishLocation));
	PREF_SetCharPref("editor.publish_browse_location",LPCSTR(m_strBrowseLocation));
	return TRUE;
}
Exemplo n.º 3
0
BOOL
CEditorPrefs::ApplyChanges()
{
    // TODO: Need TrimLeft() and TrimRight() or just Trim() functions for CString
    PREF_SetCharPref("editor.author",LPCSTR(m_strAuthor));
	PREF_SetCharPref("editor.html_editor",LPCSTR(m_strHTML_Editor));
	PREF_SetCharPref("editor.image_editor",LPCSTR(m_strImageEditor));
    
    if ( m_bAutoSave ){
		PREF_SetIntPref("editor.auto_save_delay",m_iAutoSaveMinutes);
    } else {
		PREF_SetIntPref("editor.auto_save_delay",0);
    }
    PREF_SetIntPref("editor.fontsize_mode", (int32)m_iFontSizeMode);
    return TRUE;
}
Exemplo n.º 4
0
BOOL CProfileNamePage::OnInitDialog()
{
	BOOL ret;
	char * pString = NULL;
	
	ret = CNetscapePropertyPage::OnInitDialog();

	CString csUserAddrShort;
	CString csUserDirectory;
	
	csUserDirectory.Empty();

	int iAtSign = m_pParent->m_pUserAddr.Find('@');
	
	if (iAtSign != -1) 
		csUserAddrShort = m_pParent->m_pUserAddr.Left(iAtSign);
	else
		csUserAddrShort = m_pParent->m_pUserAddr;

	if (csUserAddrShort.IsEmpty()) 
		csUserAddrShort = "default";

	CUserProfileDB::AssignProfileDirectoryName(csUserAddrShort,csUserDirectory);

    SetDlgItemText(IDC_PROFILE_DIR, csUserDirectory);
	SetDlgItemText(IDC_PROFILE_NAME, csUserAddrShort);
	PREF_SetCharPref("mail.pop_name",csUserAddrShort);
	return ret;
}
Exemplo n.º 5
0
void CNamePage::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	if (pDX->m_bSaveAndValidate) {
		char name[BUFSZ];
	    if (GetDlgItemText(IDC_EMAIL_ADDR, name, BUFSZ)) 
			m_pParent->m_pUserAddr = name;
		if (GetDlgItemText(IDC_USER_NAME, name, BUFSZ))
			m_pParent->m_pFullName = name;

		// Set the preference now so that future pages (like the mail/news pages) will be able
		// to access it.
		if (!m_pParent->m_pFullName.IsEmpty())
			PREF_SetCharPref("mail.identity.username",m_pParent->m_pFullName);
		if (!m_pParent->m_pUserAddr.IsEmpty())
			PREF_SetCharPref("mail.identity.useremail",m_pParent->m_pUserAddr);

	}
}
Exemplo n.º 6
0
NS_IMETHODIMP nsPrefBranch::SetCharPref(const char *aPrefName, const char *aValue)
{
  const char *pref;
  nsresult   rv;

  NS_ENSURE_ARG_POINTER(aValue);
  rv = getValidatedPrefName(aPrefName, &pref);
  if (NS_SUCCEEDED(rv)) {
    rv = PREF_SetCharPref(pref, aValue, mIsDefault);
  }
  return rv;
}
Exemplo n.º 7
0
void CCustomHeadersDlg::OnOK() 
{
	// TODO: Add extra validation here
	if (m_lbHeaderList.GetCount() != 0)
	{
		int nListCount = m_lbHeaderList.GetCount();
		CString strTemp;
		m_lbHeaderList.GetText(0,strTemp);
		CString strHeaderPrefList = strTemp; 

		for (int i = 1; i < nListCount; i++)
		{
			m_lbHeaderList.GetText(i,strTemp);
			strHeaderPrefList += ": " + strTemp; 
		}
		PREF_SetCharPref("mailnews.customHeaders", strHeaderPrefList);
	}
	else
	{
		PREF_SetCharPref("mailnews.customHeaders","");
	}
	m_nReturnCode = IDOK;
	OnClose();
}
Exemplo n.º 8
0
nsresult
pref_SetPrefTuple(const PrefTuple &aPref, bool set_default)
{
    switch (aPref.type) {
        case PrefTuple::PREF_STRING:
            return PREF_SetCharPref(aPref.key.get(), aPref.stringVal.get(), set_default);

        case PrefTuple::PREF_INT:
            return PREF_SetIntPref(aPref.key.get(), aPref.intVal, set_default);

        case PrefTuple::PREF_BOOL:
            return PREF_SetBoolPref(aPref.key.get(), aPref.boolVal, set_default);
    }

    NS_NOTREACHED("Unknown type");
    return NS_ERROR_INVALID_ARG;
}