зеркало из https://github.com/mozilla/gecko-dev.git
Commit new file with updated nsIPrompt calls.
This commit is contained in:
Родитель
c2e603eb00
Коммит
7f36f9492d
|
@ -154,8 +154,7 @@ Wallet_Confirm(PRUnichar * szMessage)
|
||||||
|
|
||||||
const nsAutoString message = szMessage;
|
const nsAutoString message = szMessage;
|
||||||
retval = PR_FALSE; /* in case user exits dialog by clicking X */
|
retval = PR_FALSE; /* in case user exits dialog by clicking X */
|
||||||
/* res = dialog->Confirm(nsnull, message.GetUnicode(), &retval); */
|
res = dialog->Confirm(nsnull, message.GetUnicode(), &retval);
|
||||||
res = dialog->Confirm(message.GetUnicode(), &retval);
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -311,6 +310,30 @@ SI_SetCharPref(const char * prefname, const char * prefvalue) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PRBool
|
||||||
|
SI_GetBoolPref(const char * prefname, PRBool defaultvalue) {
|
||||||
|
nsresult ret;
|
||||||
|
PRBool prefvalue = defaultvalue;
|
||||||
|
nsCOMPtr<nsIPref> pPrefService = do_GetService(kPrefServiceCID, &ret);
|
||||||
|
if (!NS_FAILED(ret)) {
|
||||||
|
ret = pPrefService->GetBoolPref(prefname, &prefvalue);
|
||||||
|
}
|
||||||
|
return prefvalue;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SI_SetBoolPref(const char * prefname, PRBool prefvalue) {
|
||||||
|
nsresult ret;
|
||||||
|
nsCOMPtr<nsIPref> pPrefService = do_GetService(kPrefServiceCID, &ret);
|
||||||
|
if (!NS_FAILED(ret)) {
|
||||||
|
ret = pPrefService->SetBoolPref(prefname, prefvalue);
|
||||||
|
if (!NS_FAILED(ret)) {
|
||||||
|
ret = pPrefService->SavePrefFile();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/************************ UTILITIES *****************************************/
|
/************************ UTILITIES *****************************************/
|
||||||
|
|
||||||
nsresult Wallet_ProfileDirectory(nsFileSpec& dirSpec) {
|
nsresult Wallet_ProfileDirectory(nsFileSpec& dirSpec) {
|
||||||
|
@ -970,12 +993,32 @@ ChangePassword()
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* obscure the data if it is encrypted */
|
||||||
|
|
||||||
|
PRBool encrypted = SI_GetBoolPref("wallet.crypto", PR_TRUE);
|
||||||
|
if (encrypted) {
|
||||||
|
SI_SetBoolPref("wallet.crypto", PR_FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
/* force the user to supply old database key, for security */
|
/* force the user to supply old database key, for security */
|
||||||
|
nsresult rv = NS_OK;
|
||||||
WLLT_ExpirePassword();
|
WLLT_ExpirePassword();
|
||||||
|
Wallet_InitKeySet(PR_FALSE);
|
||||||
|
if (!Wallet_SetKey(PR_FALSE)) {
|
||||||
|
rv = NS_ERROR_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
/* establish new key */
|
/* establish new key */
|
||||||
Wallet_SetKey(PR_TRUE);
|
if (!Wallet_SetKey(PR_TRUE)) {
|
||||||
return NS_OK;
|
rv = NS_ERROR_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (encrypted) {
|
||||||
|
SI_SetBoolPref("wallet.crypto", PR_TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* void logout(); */
|
/* void logout(); */
|
||||||
|
|
Загрузка…
Ссылка в новой задаче