replace pref "mail.identity.<idn>.send_html" by "mail.identity.id1.compose_html".

This commit is contained in:
ducarroz%netscape.com 1999-06-25 21:47:43 +00:00
parent 300ee85ec5
commit 8d7f41b9f3
8 changed files with 29 additions and 34 deletions

View File

@ -30,12 +30,11 @@ interface nsIMsgIdentity : nsISupports {
attribute string email;
attribute string replyTo;
attribute string organization;
attribute boolean useHtml;
attribute boolean composeHtml;
attribute boolean attachSignature;
attribute boolean attachVCard;
attribute nsIMsgSignature signature;
attribute nsIMsgVCard vCard;
attribute string smtpHostname;
attribute string smtpUsername;
attribute long wrapColumn;
};

View File

@ -787,9 +787,9 @@ nsMsgAccountManager::upgradePrefs()
PR_Free(oldstr);
}
rv = m_prefs->GetBoolPref("mail.send_html", &oldbool);
rv = m_prefs->GetBoolPref("mail.compose_html", &oldbool);
if (NS_SUCCEEDED(rv)) {
identity->SetUseHtml(oldbool);
identity->SetComposeHtml(oldbool);
}
rv = m_prefs->CopyCharPref("mail.smtp_server", &oldstr);
@ -804,11 +804,6 @@ nsMsgAccountManager::upgradePrefs()
PR_Free(oldstr);
}
rv = m_prefs->GetIntPref("mail.wrap_column", &oldint);
if (NS_SUCCEEDED(rv)) {
identity->SetWrapColumn(oldint);
}
// generic server stuff
// pop stuff

View File

@ -147,9 +147,8 @@ NS_IMPL_IDPREF_STR(FullName, "fullName");
NS_IMPL_IDPREF_STR(Email, "useremail");
NS_IMPL_IDPREF_STR(ReplyTo, "reply_to");
NS_IMPL_IDPREF_STR(Organization, "organization");
NS_IMPL_IDPREF_BOOL(UseHtml, "send_html");
NS_IMPL_IDPREF_BOOL(ComposeHtml, "compose_html");
NS_IMPL_IDPREF_STR(SmtpHostname, "smtp_server");
NS_IMPL_IDPREF_STR(SmtpUsername, "smtp_name");
NS_IMPL_IDPREF_BOOL(AttachVCard, "attach_vcard");
NS_IMPL_IDPREF_BOOL(AttachSignature, "attach_signature");
NS_IMPL_IDPREF_INT(WrapColumn, "wrap_column");

View File

@ -64,8 +64,8 @@ public:
NS_IMETHOD SetOrganization(char * aOrganization);
/* attribute boolean useHtml; */
NS_IMETHOD GetUseHtml(PRBool *aUseHtml);
NS_IMETHOD SetUseHtml(PRBool aUseHtml);
NS_IMETHOD GetComposeHtml(PRBool *aComposeHtml);
NS_IMETHOD SetComposeHtml(PRBool aComposeHtml);
/* attribute boolean attachSignature */
NS_IMETHOD GetAttachSignature(PRBool *aAttachSignature);
@ -91,10 +91,6 @@ public:
NS_IMETHOD GetSmtpUsername(char * *aSmtpUsername);
NS_IMETHOD SetSmtpUsername(char * aSmtpUsername);
/* attribute long WrapColumn; */
NS_IMETHOD GetWrapColumn(PRInt32 *aWrapColumn);
NS_IMETHOD SetWrapColumn(PRInt32 aWrapColumn);
private:
nsIMsgSignature* m_signature;
nsIMsgVCard* m_vCard;

View File

@ -20,8 +20,10 @@
#include "nsIMsgIdentity.h"
#include "nsMsgCompPrefs.h"
#include "nsMsgBaseCID.h"
#include "nsIPref.h"
static NS_DEFINE_CID(kCMsgMailSessionCID, NS_MSGMAILSESSION_CID);
static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);
nsMsgCompPrefs::nsMsgCompPrefs()
{
@ -31,7 +33,7 @@ nsMsgCompPrefs::nsMsgCompPrefs()
m_userFullName = nsnull;
m_userEmail = nsnull;
m_replyTo = nsnull;
m_useHTML = PR_TRUE;
m_composeHTML = PR_TRUE;
m_wrapColumn = 72;
// get the current identity from the mail session....
@ -50,8 +52,12 @@ nsMsgCompPrefs::nsMsgCompPrefs()
identity->GetReplyTo(&m_replyTo);
identity->GetUseHtml(&m_useHTML);
identity->GetWrapColumn(&m_wrapColumn);
identity->GetComposeHtml(&m_composeHTML);
NS_WITH_SERVICE(nsIPref, prefs, kPrefCID, &res);
if (NS_SUCCEEDED(res) && prefs)
{
res = prefs->GetIntPref("mail.wraplength", &m_wrapColumn);
}
}
else
NS_ASSERTION(0, "no current identity found for this user (a)....");

View File

@ -31,7 +31,7 @@ public:
const char * GetUserFullName() {return m_userFullName;}
const char * GetUserEmail() {return m_userEmail;}
const char * GetReplyTo() {return m_replyTo;}
const PRBool GetUseHtml() {return m_useHTML;}
const PRBool GetComposeHtml() {return m_composeHTML;}
const PRInt32 GetWrapColumn() {return m_wrapColumn;}
private:
@ -39,7 +39,7 @@ private:
char * m_userFullName;
char * m_userEmail;
char * m_replyTo;
PRBool m_useHTML;
PRBool m_composeHTML;
PRInt32 m_wrapColumn;
};

View File

@ -66,7 +66,7 @@ nsMsgCompose::nsMsgCompose()
PR_Free(default_mail_charset);
}
m_composeHTML = prefs.GetUseHtml();
m_composeHTML = prefs.GetComposeHtml();
NS_INIT_REFCNT();
}
@ -116,7 +116,7 @@ nsresult nsMsgCompose::Initialize(nsIDOMWindow *aWindow, const PRUnichar *origin
{
case MSGCOMP_FORMAT_HTML : m_composeHTML = PR_TRUE; break;
case MSGCOMP_FORMAT_PlainText : m_composeHTML = PR_FALSE; break;
default : m_composeHTML = prefs.GetUseHtml(); break;
default : m_composeHTML = prefs.GetComposeHtml(); break;
}

View File

@ -318,8 +318,7 @@ nsresult nsPref::useDefaultPrefFile()
SetCharPref("mail.identity.id1.smtp_name", currProfileName);
SetCharPref("mail.identity.id1.smtp_server", "nsmail-2");
SetCharPref("mail.identity.id1.useremail", emailStr);
SetBoolPref("mail.identity.id1.send_html", PR_TRUE);
SetIntPref("mail.identity.id1.wrap_column", 72);
SetBoolPref("mail.identity.id1.compose_html", PR_TRUE);
SetCharPref("mail.server.server0.directory", imapDirStr);
SetCharPref("mail.server.server0.hostname", "nsmail-2");
SetCharPref("mail.server.server0.password", "clear text password");
@ -328,6 +327,7 @@ nsresult nsPref::useDefaultPrefFile()
SetCharPref("mail.server.server1.directory", newsDirStr);
SetCharPref("mail.server.server1.hostname", "news.mozilla.org");
SetCharPref("mail.server.server1.type", "nntp");
SetIntPref("mail.wraplength", 72);
SetIntPref("news.max_articles",50);
SetBoolPref("news.mark_old_read",PR_FALSE);
PR_FREEIF(imapDirStr);