warnings fixes, and fix for #21901, all password dialogs to have titles

if the user passes one in, or use "Password" if they pass null.
This commit is contained in:
sspitzer%netscape.com 1999-12-21 23:03:29 +00:00
Родитель 1fabe0ad70
Коммит e8a4061a40
21 изменённых файлов: 54 добавлений и 24 удалений

Просмотреть файл

@ -587,7 +587,7 @@ nsWebShell::nsWebShell() : nsDocShell()
++gNumberOfWebShells;
#endif
#ifdef NOISY_WEBSHELL_LEAKS
printf("WEBSHELL+ = %d\n", gNumberOfWebShells);
printf("WEBSHELL+ = %ld\n", gNumberOfWebShells);
#endif
NS_INIT_REFCNT();
@ -671,7 +671,7 @@ nsWebShell::~nsWebShell()
--gNumberOfWebShells;
#endif
#ifdef NOISY_WEBSHELL_LEAKS
printf("WEBSHELL- = %d\n", gNumberOfWebShells);
printf("WEBSHELL- = %ld\n", gNumberOfWebShells);
#endif
}
@ -2129,7 +2129,9 @@ nsWebShell::GoTo(PRInt32 aHistoryIndex)
}
}
#ifdef DEBUG
printf("Goto %d\n", aHistoryIndex);
#endif
mHistoryIndex = aHistoryIndex;
ShowHistory();

Просмотреть файл

@ -2282,7 +2282,7 @@ SINGSIGN_PromptPassword
/* do only the dialog if signon preference is not enabled */
if (!si_GetSignonRememberingPref()){
return dialog->PromptPassword(text, pwd, returnValue);
return dialog->PromptPassword(text, nsnull /* window title */, pwd, returnValue);
}
/* convert to a uri so we can parse out the username and hostname */
@ -2327,7 +2327,7 @@ SINGSIGN_PromptPassword
}
/* if no password found, get new password from user */
res = dialog->PromptPassword(text, pwd, returnValue);
res = dialog->PromptPassword(text, nsnull /* window title */, pwd, returnValue);
if (NS_FAILED(res) || !(*returnValue)) {
/* user pressed Cancel */
if (colon) {

Просмотреть файл

@ -832,7 +832,7 @@ char * wallet_GetString(PRUnichar * szMessage)
const nsString message = szMessage;
PRUnichar* pwd;
retval = PR_FALSE; /* in case user exits dialog by clicking X */
res = dialog->PromptPassword(message.GetUnicode(), &pwd, &retval);
res = dialog->PromptPassword(message.GetUnicode(), nsnull /* window title */, &pwd, &retval);
if (NS_FAILED(res)) {
return NULL;
}
@ -867,7 +867,7 @@ char * wallet_GetDoubleString(PRUnichar * szMessage, PRUnichar * szMessage2, PRB
res = dialog->PromptDoublePassword
(message.GetUnicode(), message2.GetUnicode(), &pwd, &pwd2, &retval);
#else
res = dialog->PromptPassword(message.GetUnicode(), &pwd, &retval);
res = dialog->PromptPassword(message.GetUnicode(), nsnull /* window title */, &pwd, &retval);
if (NS_FAILED(res)) {
return NULL;
}
@ -875,7 +875,7 @@ char * wallet_GetDoubleString(PRUnichar * szMessage, PRUnichar * szMessage2, PRB
delete[] pwd;
return NULL; /* user pressed cancel */
}
res = dialog->PromptPassword(message2.GetUnicode(), &pwd2, &retval);
res = dialog->PromptPassword(message2.GetUnicode(), nsnull /* window title */, &pwd2, &retval);
#endif
if (NS_FAILED(res)) {
return NULL;

Просмотреть файл

@ -79,7 +79,7 @@ interface nsIMsgIncomingServer : nsISupports {
attribute string password;
/* prompt the user for a password */
string getPasswordWithUI(in wstring aPromptString);
string getPasswordWithUI(in wstring aPromptString, in wstring aPromptTitle);
/* should we download whole messages when biff goes off? */
attribute boolean downloadOnBiff;

Просмотреть файл

@ -557,7 +557,7 @@ NS_IMETHODIMP nsMsgIncomingServer::GetPassword(char ** aPassword)
}
NS_IMETHODIMP
nsMsgIncomingServer::GetPasswordWithUI(const PRUnichar * aPromptMessage, char **aPassword)
nsMsgIncomingServer::GetPasswordWithUI(const PRUnichar * aPromptMessage, const PRUnichar *aPromptTitle, char **aPassword)
{
nsXPIDLCString prefvalue;
@ -571,7 +571,7 @@ nsMsgIncomingServer::GetPasswordWithUI(const PRUnichar * aPromptMessage, char **
{
PRUnichar * uniPassword;
PRBool okayValue = PR_TRUE;
dialog->PromptPassword(aPromptMessage, &uniPassword, &okayValue);
dialog->PromptPassword(aPromptMessage, aPromptTitle, &uniPassword, &okayValue);
if (!okayValue) // if the user pressed cancel, just return NULL;
{

Просмотреть файл

@ -246,3 +246,7 @@
## @loc None
5050=Document: Done
## @name IMAP_ENTER_PASSWORD_PROMPT_TITLE
## @loc None
5051=Enter your password

Просмотреть файл

@ -1282,6 +1282,7 @@ nsresult nsImapIncomingServer::GetUnverifiedSubFolders(nsIFolder *parentFolder,
NS_IMETHODIMP nsImapIncomingServer::PromptForPassword(char ** aPassword)
{
PRUnichar *passwordTemplate = IMAPGetStringByID(IMAP_ENTER_PASSWORD_PROMPT);
PRUnichar *passwordTitle = IMAPGetStringByID(IMAP_ENTER_PASSWORD_PROMPT_TITLE);
PRUnichar *passwordText = nsnull;
nsXPIDLCString hostName;
nsXPIDLCString userName;
@ -1290,9 +1291,10 @@ NS_IMETHODIMP nsImapIncomingServer::PromptForPassword(char ** aPassword)
GetUsername(getter_Copies(userName));
passwordText = nsTextFormater::smprintf(passwordTemplate, (const char *) userName, (const char *) hostName);
nsresult rv = GetPasswordWithUI(passwordText, aPassword);
nsresult rv = GetPasswordWithUI(passwordText, passwordTitle, aPassword);
nsTextFormater::smprintf_free(passwordText);
nsCRT::free(passwordTemplate);
nsCRT::free(passwordTitle);
return rv;
}

Просмотреть файл

@ -337,7 +337,7 @@ nsresult nsImapMailFolder::CreateSubFolders(nsFileSpec &path)
{
nsCAutoString leafName (currentFolderNameStr);
nsCOMPtr <nsIFileSpec> msfFileSpec;
nsresult rv = NS_NewFileSpecWithSpec(currentFolderPath, getter_AddRefs(msfFileSpec));
rv = NS_NewFileSpecWithSpec(currentFolderPath, getter_AddRefs(msfFileSpec));
if (NS_SUCCEEDED(rv) && msfFileSpec)
{
// leaf name is the db name w/o .msf (nsShouldIgnoreFile strips it off)

Просмотреть файл

@ -82,4 +82,5 @@ NS_END_EXTERN_C
#define IMAP_SERVER_NOT_IMAP4 5048
#define IMAP_SERVER_SAID 5049
#define IMAP_DONE 5050
#define IMAP_ENTER_PASSWORD_PROMPT_TITLE 5051
#endif /* _nsImapStringBundle_H__ */

Просмотреть файл

@ -123,3 +123,8 @@
## @name POP3_NO_ANSWER
## @loc None
4019=No Answer
## @name POP3_ENTER_PASSWORD_PROMPT_TITLE
## @loc None
4020=Enter your password

Просмотреть файл

@ -49,5 +49,6 @@ NS_END_EXTERN_C
#define POP3_ENTER_PASSWORD_PROMPT 4017
#define POP3_PREVIOUSLY_ENTERED_PASSWORD_IS_INVALID_ETC 4018
#define POP3_NO_ANSWER 4019
#define POP3_ENTER_PASSWORD_PROMPT_TITLE 4020
#endif /* _nsImapStringBundle_H__ */

Просмотреть файл

@ -372,10 +372,10 @@ net_pop3_free_state(Pop3UidlHost* host)
nsPop3Protocol::nsPop3Protocol(nsIURI* aURL)
: nsMsgProtocol(aURL, aURL),
nsMsgLineBuffer(NULL, PR_FALSE),
m_totalBytesReceived(0),
m_bytesInMsgReceived(0),
m_totalFolderSize(0),
m_totalDownloadSize(0),
m_totalBytesReceived(0),
m_lineStreamBuffer(nsnull),
m_pop3ConData(nsnull)
{
@ -516,7 +516,9 @@ nsresult nsPop3Protocol::GetPassword(char ** aPassword)
}
// now go get the password!!!!
rv = server->GetPasswordWithUI(passwordPromptString, aPassword);
PRUnichar * passwordTitle = LocalGetStringByID(POP3_ENTER_PASSWORD_PROMPT_TITLE);
rv = server->GetPasswordWithUI(passwordPromptString, passwordTitle, aPassword);
nsCRT::free(passwordTitle);
nsTextFormater::smprintf_free(passwordPromptString);
ClearFlag(POP3_PASSWORD_FAILED);

Просмотреть файл

@ -261,7 +261,6 @@ public:
private:
nsCString m_username;
Pop3ConData* m_pop3ConData;
nsCString m_senderInfo;
nsCString m_commandResponse;
nsCOMPtr<nsIMsgStatusFeedback> m_statusFeedback;
@ -288,6 +287,7 @@ private:
nsCOMPtr<nsIPop3IncomingServer> m_pop3Server;
nsMsgLineStreamBuffer * m_lineStreamBuffer; // used to efficiently extract lines from the incoming data stream
Pop3ConData* m_pop3ConData;
void FreeMsgInfo();
//////////////////////////////////////////////////////////////////////////////////////////

Просмотреть файл

@ -80,7 +80,7 @@ interface nsIPrompt : nsISupports
* Puts up a password dialog with OK and Cancel buttons.
* @return true for OK, false for Cancel
*/
boolean promptPassword(in wstring text,
boolean promptPassword(in wstring text, in wstring title,
out wstring pwd);
/*

Просмотреть файл

@ -246,3 +246,7 @@
## @loc None
5050=Document: Done
## @name IMAP_ENTER_PASSWORD_PROMPT_TITLE
## @loc None
5051=Enter your password

Просмотреть файл

@ -123,3 +123,8 @@
## @name POP3_NO_ANSWER
## @loc None
4019=No Answer
## @name POP3_ENTER_PASSWORD_PROMPT_TITLE
## @loc None
4020=Enter your password

Просмотреть файл

@ -587,7 +587,7 @@ nsWebShell::nsWebShell() : nsDocShell()
++gNumberOfWebShells;
#endif
#ifdef NOISY_WEBSHELL_LEAKS
printf("WEBSHELL+ = %d\n", gNumberOfWebShells);
printf("WEBSHELL+ = %ld\n", gNumberOfWebShells);
#endif
NS_INIT_REFCNT();
@ -671,7 +671,7 @@ nsWebShell::~nsWebShell()
--gNumberOfWebShells;
#endif
#ifdef NOISY_WEBSHELL_LEAKS
printf("WEBSHELL- = %d\n", gNumberOfWebShells);
printf("WEBSHELL- = %ld\n", gNumberOfWebShells);
#endif
}
@ -2129,7 +2129,9 @@ nsWebShell::GoTo(PRInt32 aHistoryIndex)
}
}
#ifdef DEBUG
printf("Goto %d\n", aHistoryIndex);
#endif
mHistoryIndex = aHistoryIndex;
ShowHistory();

Просмотреть файл

@ -2273,6 +2273,7 @@ nsBrowserWindow::PromptUsernameAndPassword(const PRUnichar *text,
NS_IMETHODIMP
nsBrowserWindow::PromptPassword(const PRUnichar *text,
const PRUnichar *title,
PRUnichar **pwd,
PRBool *_retval)
{

Просмотреть файл

@ -104,4 +104,4 @@ enum { eButtonPressed = 0, eCheckboxState = 1, eNumberButtons = 2, eNumberEditfi
%{C++
extern nsresult NS_NewCommonDialogsFactory(nsIFactory** aResult);
%}
%}

Просмотреть файл

@ -518,7 +518,8 @@ NS_IMETHODIMP nsNetSupportDialog::PromptUsernameAndPassword(const PRUnichar *tex
#endif
}
NS_IMETHODIMP nsNetSupportDialog::PromptPassword(const PRUnichar *text,
NS_IMETHODIMP nsNetSupportDialog::PromptPassword(const PRUnichar *text,
const PRUnichar *windowTitle,
PRUnichar **pwd,
PRBool *returnValue)
{
@ -532,7 +533,7 @@ NS_IMETHODIMP nsNetSupportDialog::PromptPassword(const PRUnichar *text,
rv = nsComponentManager::CreateInstance( kCommonDialogsCID,0, nsICommonDialogs::GetIID(),
(void**)&dialogService );
if( NS_SUCCEEDED ( rv ) )
rv = dialogService->PromptPassword( window, NULL,text, pwd, returnValue );
rv = dialogService->PromptPassword( window, windowTitle,text, pwd, returnValue );
}
return rv;

Просмотреть файл

@ -3005,7 +3005,7 @@ NS_IMETHODIMP nsWebShellWindow::PromptUsernameAndPassword(const PRUnichar *text,
return rv;
}
NS_IMETHODIMP nsWebShellWindow::PromptPassword(const PRUnichar *text, PRUnichar **pwd, PRBool *_retval)
NS_IMETHODIMP nsWebShellWindow::PromptPassword(const PRUnichar *text, const PRUnichar *title, PRUnichar **pwd, PRBool *_retval)
{
nsresult rv;
nsCOMPtr<nsIDOMWindow> domWindow;
@ -3020,7 +3020,7 @@ NS_IMETHODIMP nsWebShellWindow::PromptPassword(const PRUnichar *text, PRUnichar
NS_WITH_SERVICE(nsICommonDialogs, dialog, kCommonDialogsCID, &rv);
if ( NS_SUCCEEDED( rv ) )
rv = dialog->PromptPassword( domWindow, NULL, text, pwd, _retval );
rv = dialog->PromptPassword( domWindow, title, text, pwd, _retval );
return rv;
}
@ -3080,7 +3080,7 @@ NS_IMETHODIMP nsWebShellWindow::PromptPassword(const char *url, const PRUnichar
nsresult res;
NS_WITH_SERVICE(nsIWalletService, wallet, kWalletServiceCID, &res);
if (NS_FAILED(res)) {
return PromptPassword(text, pwd, _retval);
return PromptPassword(text, title, pwd, _retval);
}
nsCOMPtr<nsIPrompt> prompter = this;
return wallet->PromptPasswordURL(text, pwd, url, prompter, _retval);