mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-11 16:32:59 +00:00
cleaned up dialogs
This commit is contained in:
parent
ba808883a8
commit
e3092f3888
@ -381,6 +381,8 @@ public:
|
||||
NS_IMETHOD Alert(const PRUnichar *text);
|
||||
NS_IMETHOD Confirm(const PRUnichar *text, PRBool *_retval);
|
||||
NS_IMETHOD ConfirmCheck(const PRUnichar *text, const PRUnichar *checkMsg, PRBool *checkValue, PRBool *_retval);
|
||||
NS_IMETHOD ConfirmYN(const PRUnichar *text, PRBool *_retval);
|
||||
NS_IMETHOD ConfirmCheckYN(const PRUnichar *text, const PRUnichar *checkMsg, PRBool *checkValue, PRBool *_retval);
|
||||
NS_IMETHOD Prompt(const PRUnichar *text, const PRUnichar *defaultText, PRUnichar **result, PRBool *_retval);
|
||||
NS_IMETHOD PromptUsernameAndPassword(const PRUnichar *text, PRUnichar **user, PRUnichar **pwd, PRBool *_retval);
|
||||
NS_IMETHOD PromptPassword(const PRUnichar *text, PRUnichar **pwd, PRBool *_retval);
|
||||
@ -388,6 +390,7 @@ public:
|
||||
// nsINetSupport interface methods
|
||||
NS_IMETHOD_(void) Alert(const nsString &aText);
|
||||
NS_IMETHOD_(PRBool) Confirm(const nsString &aText);
|
||||
NS_IMETHOD_(PRBool) ConfirmYN(const nsString &aText);
|
||||
NS_IMETHOD_(PRBool) Prompt(const nsString &aText,
|
||||
const nsString &aDefault,
|
||||
nsString &aResult);
|
||||
@ -3671,6 +3674,29 @@ nsWebShell::Confirm(const nsString &aText)
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef NECKO
|
||||
NS_IMETHODIMP
|
||||
nsWebShell::ConfirmYN(const PRUnichar *text,
|
||||
PRBool *result)
|
||||
#else
|
||||
NS_IMETHODIMP_(PRBool)
|
||||
nsWebShell::ConfirmYN(const nsString &aText)
|
||||
#endif
|
||||
{
|
||||
#ifdef NECKO
|
||||
if (mPrompter == nsnull)
|
||||
return NS_OK;
|
||||
return mPrompter->ConfirmYN(text, result);
|
||||
#else
|
||||
PRBool bResult = PR_FALSE;
|
||||
|
||||
if (nsnull != mNetSupport) {
|
||||
bResult = mNetSupport->ConfirmYN(aText);
|
||||
}
|
||||
return bResult;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef NECKO
|
||||
NS_IMETHODIMP
|
||||
nsWebShell::ConfirmCheck(const PRUnichar *text,
|
||||
@ -3684,6 +3710,19 @@ nsWebShell::ConfirmCheck(const PRUnichar *text,
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef NECKO
|
||||
NS_IMETHODIMP
|
||||
nsWebShell::ConfirmCheckYN(const PRUnichar *text,
|
||||
const PRUnichar *checkMsg,
|
||||
PRBool *checkValue,
|
||||
PRBool *result)
|
||||
{
|
||||
if (mPrompter == nsnull)
|
||||
return NS_OK;
|
||||
return mPrompter->ConfirmCheckYN(text, checkMsg, checkValue, result);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef NECKO
|
||||
NS_IMETHODIMP
|
||||
nsWebShell::Prompt(const PRUnichar *text,
|
||||
|
@ -121,7 +121,7 @@ static int cookie_deferLockCount = 0;
|
||||
//#define REAL_DIALOG 1
|
||||
|
||||
PRBool
|
||||
cookie_CheckConfirm(char * szMessage, char * szCheckMessage, PRBool* checkValue) {
|
||||
cookie_CheckConfirmYN(char * szMessage, char * szCheckMessage, PRBool* checkValue) {
|
||||
#ifdef REAL_DIALOG
|
||||
PRBool retval = PR_TRUE; /* default value */
|
||||
nsresult res;
|
||||
@ -133,7 +133,7 @@ cookie_CheckConfirm(char * szMessage, char * szCheckMessage, PRBool* checkValue)
|
||||
const nsString message = szMessage;
|
||||
const nsString checkMessage = szCheckMessage;
|
||||
retval = PR_FALSE; /* in case user exits dialog by clicking X */
|
||||
res = dialog->ConfirmCheck(message.GetUnicode(), checkMessage.GetUnicode(), checkValue, &retval);
|
||||
res = dialog->ConfirmCheckYN(message.GetUnicode(), checkMessage.GetUnicode(), checkValue, &retval);
|
||||
if (NS_FAILED(res)) {
|
||||
*checkValue = 0;
|
||||
}
|
||||
@ -1258,7 +1258,7 @@ cookie_SetCookieString(char * curURL, char * setCookieHeader, time_t timeToExpir
|
||||
{
|
||||
PRBool rememberChecked = cookie_rememberChecked;
|
||||
PRBool userHasAccepted =
|
||||
cookie_CheckConfirm(new_string, remember_string, &cookie_rememberChecked);
|
||||
cookie_CheckConfirmYN(new_string, remember_string, &cookie_rememberChecked);
|
||||
PR_FREEIF(new_string);
|
||||
PR_FREEIF(remember_string);
|
||||
if (cookie_rememberChecked) {
|
||||
|
@ -81,6 +81,7 @@ struct LO_FormSubmitData_struct {
|
||||
|
||||
extern nsresult Wallet_ProfileDirectory(nsFileSpec& dirSpec);
|
||||
extern PRBool Wallet_Confirm(char * szMessage);
|
||||
extern PRBool Wallet_ConfirmYN(char * szMessage);
|
||||
extern void Wallet_Alert(char * szMessage);
|
||||
|
||||
/* StrAllocCopy and StrAllocCat should really be defined elsewhere */
|
||||
@ -345,7 +346,7 @@ si_SelectDialog(const char* szMessage, char** pList, PRInt32* pCount)
|
||||
nsString msg = "user = ";
|
||||
msg += pList[i];
|
||||
msg += "?";
|
||||
res = dialog->Confirm(msg.GetUnicode(), &retval);
|
||||
res = dialog->ConfirmYN(msg.GetUnicode(), &retval);
|
||||
if (NS_SUCCEEDED(res) && retval) {
|
||||
*pCount = i;
|
||||
break;
|
||||
@ -370,7 +371,7 @@ si_SelectDialog(const char* szMessage, char** pList, PRInt32* pCount)
|
||||
nsString msg = "user = ";
|
||||
msg += pList[i];
|
||||
msg += "?";
|
||||
dialog->Confirm(msg, &retval);
|
||||
dialog->ConfirmYN(msg, &retval);
|
||||
if (retval) {
|
||||
*pCount = i;
|
||||
break;
|
||||
@ -1217,7 +1218,7 @@ si_OkToSave(char *URLName, char *userName) {
|
||||
StrAllocCat(notification, message);
|
||||
PR_FREEIF(message);
|
||||
si_SetNotificationPref(PR_TRUE);
|
||||
if (!Wallet_Confirm(notification)) {
|
||||
if (!Wallet_ConfirmYN(notification)) {
|
||||
XP_FREE (notification);
|
||||
SI_SetBoolPref(pref_rememberSignons, PR_FALSE);
|
||||
return PR_FALSE;
|
||||
@ -1233,7 +1234,7 @@ si_OkToSave(char *URLName, char *userName) {
|
||||
}
|
||||
|
||||
char * message = Wallet_Localize("WantToSavePassword?");
|
||||
if (!Wallet_Confirm(message)) {
|
||||
if (!Wallet_ConfirmYN(message)) {
|
||||
si_PutReject(strippedURLName, userName, PR_TRUE);
|
||||
XP_FREE(strippedURLName);
|
||||
PR_FREEIF(message);
|
||||
@ -1851,7 +1852,7 @@ SI_LoadSignonData(PRBool fullLoad) {
|
||||
si_RestartKey();
|
||||
char * message = Wallet_Localize("IncorrectKey_TryAgain?");
|
||||
while (!si_SetKey()) {
|
||||
if (!Wallet_Confirm(message)) {
|
||||
if (!Wallet_ConfirmYN(message)) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -2163,7 +2164,7 @@ si_SaveSignonDataLocked(PRBool fullSave) {
|
||||
si_RestartKey();
|
||||
char * message = Wallet_Localize("IncorrectKey_TryAgain?");
|
||||
while (!si_SetKey()) {
|
||||
if (!Wallet_Confirm(message)) {
|
||||
if (!Wallet_ConfirmYN(message)) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
@ -148,6 +148,7 @@ NS_IMPL_ISUPPORTS(InputConsumer,nsCOMTypeInfo<nsIStreamListener>::GetIID());
|
||||
NS_IMETHODIMP
|
||||
InputConsumer::OnStartRequest(nsIChannel* channel, nsISupports* context)
|
||||
{
|
||||
fprintf(stdout,"<<OnStartRequest>>");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -158,6 +159,7 @@ InputConsumer::OnDataAvailable(nsIChannel* channel,
|
||||
PRUint32 aSourceOffset,
|
||||
PRUint32 aLength)
|
||||
{
|
||||
fprintf(stdout,"<<OnDataAvailable>>");
|
||||
char buf[1001];
|
||||
PRUint32 amt;
|
||||
nsresult rv;
|
||||
@ -178,6 +180,7 @@ InputConsumer::OnStopRequest(nsIChannel* channel,
|
||||
nsresult aStatus,
|
||||
const PRUnichar* aMsg)
|
||||
{
|
||||
fprintf(stdout,"<<OnStopAvailable>>");
|
||||
outFile->flush();
|
||||
outFile->close();
|
||||
gKeepRunning -= 1;
|
||||
@ -590,6 +593,44 @@ Wallet_Confirm(char * szMessage)
|
||||
#endif
|
||||
}
|
||||
|
||||
PUBLIC PRBool
|
||||
Wallet_ConfirmYN(char * szMessage)
|
||||
{
|
||||
#ifdef NECKO
|
||||
PRBool retval = PR_TRUE; /* default value */
|
||||
|
||||
nsresult res;
|
||||
NS_WITH_SERVICE(nsIPrompt, dialog, kNetSupportDialogCID, &res);
|
||||
if (NS_FAILED(res)) {
|
||||
return retval;
|
||||
}
|
||||
|
||||
const nsString message = szMessage;
|
||||
retval = PR_FALSE; /* in case user exits dialog by clicking X */
|
||||
res = dialog->ConfirmYN(message.GetUnicode(), &retval);
|
||||
if (NS_FAILED(res)) {
|
||||
return retval;
|
||||
}
|
||||
|
||||
return retval;
|
||||
#else
|
||||
PRBool retval = PR_TRUE; /* default value */
|
||||
nsINetSupportDialogService* dialog = NULL;
|
||||
nsresult res = nsServiceManager::GetService(kNetSupportDialogCID,
|
||||
nsINetSupportDialogService::GetIID(), (nsISupports**)&dialog);
|
||||
if (NS_FAILED(res)) {
|
||||
return retval;
|
||||
}
|
||||
if (dialog) {
|
||||
const nsString message = szMessage;
|
||||
retval = PR_FALSE; /* in case user exits dialog by clicking X */
|
||||
dialog->ConfirmYN(message, &retval);
|
||||
}
|
||||
nsServiceManager::ReleaseService(kNetSupportDialogCID, dialog);
|
||||
return retval;
|
||||
#endif
|
||||
}
|
||||
|
||||
PUBLIC void
|
||||
Wallet_Alert(char * szMessage)
|
||||
{
|
||||
@ -620,7 +661,7 @@ Wallet_Alert(char * szMessage)
|
||||
}
|
||||
|
||||
PUBLIC PRBool
|
||||
Wallet_CheckConfirm(char * szMessage, char * szCheckMessage, PRBool* checkValue)
|
||||
Wallet_CheckConfirmYN(char * szMessage, char * szCheckMessage, PRBool* checkValue)
|
||||
{
|
||||
#ifdef NECKO
|
||||
PRBool retval = PR_TRUE; /* default value */
|
||||
@ -635,7 +676,7 @@ Wallet_CheckConfirm(char * szMessage, char * szCheckMessage, PRBool* checkValue)
|
||||
const nsString message = szMessage;
|
||||
const nsString checkMessage = szCheckMessage;
|
||||
retval = PR_FALSE; /* in case user exits dialog by clicking X */
|
||||
res = dialog->ConfirmCheck(message.GetUnicode(), checkMessage.GetUnicode(), checkValue, &retval);
|
||||
res = dialog->ConfirmCheckYN(message.GetUnicode(), checkMessage.GetUnicode(), checkValue, &retval);
|
||||
if (NS_FAILED(res)) {
|
||||
*checkValue = 0;
|
||||
}
|
||||
@ -655,7 +696,7 @@ Wallet_CheckConfirm(char * szMessage, char * szCheckMessage, PRBool* checkValue)
|
||||
const nsString message = szMessage;
|
||||
const nsString checkMessage = szCheckMessage;
|
||||
retval = PR_FALSE; /* in case user exits dialog by clicking X */
|
||||
dialog->ConfirmCheck(message, checkMessage, &retval, checkValue);
|
||||
dialog->ConfirmCheckYN(message, checkMessage, &retval, checkValue);
|
||||
if (*checkValue!=0 && *checkValue!=1) {
|
||||
*checkValue = 0; /* this should never happen but it is happening!!! */
|
||||
}
|
||||
@ -2139,7 +2180,7 @@ wallet_OKToCapture(char* urlName) {
|
||||
char * message = Wallet_Localize("WantToCaptureForm?");
|
||||
char * checkMessage = Wallet_Localize("NeverSave");
|
||||
PRBool checkValue;
|
||||
PRBool result = Wallet_CheckConfirm(message, checkMessage, &checkValue);
|
||||
PRBool result = Wallet_CheckConfirmYN(message, checkMessage, &checkValue);
|
||||
if (!result) {
|
||||
if (checkValue) {
|
||||
/* add URL to list with NO_CAPTURE indicator set */
|
||||
|
@ -41,6 +41,21 @@ interface nsIPrompt : nsISupports
|
||||
in wstring checkMsg,
|
||||
out boolean checkValue);
|
||||
|
||||
/**
|
||||
* Puts up a dialog with Yes and No buttons.
|
||||
* @return true for OK, false for Cancel
|
||||
*/
|
||||
boolean ConfirmYN(in wstring text);
|
||||
|
||||
/**
|
||||
* Puts up a dialog with Yes and No buttons, and
|
||||
* a message with a single checkbox.
|
||||
* @return true for OK, false for Cancel
|
||||
*/
|
||||
boolean ConfirmCheckYN(in wstring text,
|
||||
in wstring checkMsg,
|
||||
out boolean checkValue);
|
||||
|
||||
/**
|
||||
* Puts up a text input dialog with OK and Cancel buttons.
|
||||
* @return true for OK, false for Cancel
|
||||
|
@ -381,6 +381,8 @@ public:
|
||||
NS_IMETHOD Alert(const PRUnichar *text);
|
||||
NS_IMETHOD Confirm(const PRUnichar *text, PRBool *_retval);
|
||||
NS_IMETHOD ConfirmCheck(const PRUnichar *text, const PRUnichar *checkMsg, PRBool *checkValue, PRBool *_retval);
|
||||
NS_IMETHOD ConfirmYN(const PRUnichar *text, PRBool *_retval);
|
||||
NS_IMETHOD ConfirmCheckYN(const PRUnichar *text, const PRUnichar *checkMsg, PRBool *checkValue, PRBool *_retval);
|
||||
NS_IMETHOD Prompt(const PRUnichar *text, const PRUnichar *defaultText, PRUnichar **result, PRBool *_retval);
|
||||
NS_IMETHOD PromptUsernameAndPassword(const PRUnichar *text, PRUnichar **user, PRUnichar **pwd, PRBool *_retval);
|
||||
NS_IMETHOD PromptPassword(const PRUnichar *text, PRUnichar **pwd, PRBool *_retval);
|
||||
@ -388,6 +390,7 @@ public:
|
||||
// nsINetSupport interface methods
|
||||
NS_IMETHOD_(void) Alert(const nsString &aText);
|
||||
NS_IMETHOD_(PRBool) Confirm(const nsString &aText);
|
||||
NS_IMETHOD_(PRBool) ConfirmYN(const nsString &aText);
|
||||
NS_IMETHOD_(PRBool) Prompt(const nsString &aText,
|
||||
const nsString &aDefault,
|
||||
nsString &aResult);
|
||||
@ -3671,6 +3674,29 @@ nsWebShell::Confirm(const nsString &aText)
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef NECKO
|
||||
NS_IMETHODIMP
|
||||
nsWebShell::ConfirmYN(const PRUnichar *text,
|
||||
PRBool *result)
|
||||
#else
|
||||
NS_IMETHODIMP_(PRBool)
|
||||
nsWebShell::ConfirmYN(const nsString &aText)
|
||||
#endif
|
||||
{
|
||||
#ifdef NECKO
|
||||
if (mPrompter == nsnull)
|
||||
return NS_OK;
|
||||
return mPrompter->ConfirmYN(text, result);
|
||||
#else
|
||||
PRBool bResult = PR_FALSE;
|
||||
|
||||
if (nsnull != mNetSupport) {
|
||||
bResult = mNetSupport->ConfirmYN(aText);
|
||||
}
|
||||
return bResult;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef NECKO
|
||||
NS_IMETHODIMP
|
||||
nsWebShell::ConfirmCheck(const PRUnichar *text,
|
||||
@ -3684,6 +3710,19 @@ nsWebShell::ConfirmCheck(const PRUnichar *text,
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef NECKO
|
||||
NS_IMETHODIMP
|
||||
nsWebShell::ConfirmCheckYN(const PRUnichar *text,
|
||||
const PRUnichar *checkMsg,
|
||||
PRBool *checkValue,
|
||||
PRBool *result)
|
||||
{
|
||||
if (mPrompter == nsnull)
|
||||
return NS_OK;
|
||||
return mPrompter->ConfirmCheckYN(text, checkMsg, checkValue, result);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef NECKO
|
||||
NS_IMETHODIMP
|
||||
nsWebShell::Prompt(const PRUnichar *text,
|
||||
|
@ -1860,6 +1860,16 @@ nsBrowserAppCore::Confirm(const PRUnichar *text,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBrowserAppCore::ConfirmYN(const PRUnichar *text,
|
||||
PRBool *result)
|
||||
{
|
||||
PRBool bResult = PR_FALSE;
|
||||
if (APP_DEBUG) printf("ConfirmYN\n");
|
||||
*result = bResult;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBrowserAppCore::ConfirmCheck(const PRUnichar *text,
|
||||
const PRUnichar *checkMsg,
|
||||
@ -1872,6 +1882,18 @@ nsBrowserAppCore::ConfirmCheck(const PRUnichar *text,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBrowserAppCore::ConfirmCheckYN(const PRUnichar *text,
|
||||
const PRUnichar *checkMsg,
|
||||
PRBool *checkValue,
|
||||
PRBool *result)
|
||||
{
|
||||
PRBool bResult = PR_FALSE;
|
||||
if (APP_DEBUG) printf("ConfirmCheckYN\n");
|
||||
*result = bResult;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBrowserAppCore::Prompt(const PRUnichar *text,
|
||||
const PRUnichar *defaultText,
|
||||
|
@ -136,6 +136,8 @@ class nsBrowserAppCore : public nsBaseAppCore,
|
||||
NS_IMETHOD Alert(const PRUnichar *text);
|
||||
NS_IMETHOD Confirm(const PRUnichar *text, PRBool *_retval);
|
||||
NS_IMETHOD ConfirmCheck(const PRUnichar *text, const PRUnichar *checkMsg, PRBool *checkValue, PRBool *_retval);
|
||||
NS_IMETHOD ConfirmYN(const PRUnichar *text, PRBool *_retval);
|
||||
NS_IMETHOD ConfirmCheckYN(const PRUnichar *text, const PRUnichar *checkMsg, PRBool *checkValue, PRBool *_retval);
|
||||
NS_IMETHOD Prompt(const PRUnichar *text, const PRUnichar *defaultText, PRUnichar **result, PRBool *_retval);
|
||||
NS_IMETHOD PromptUsernameAndPassword(const PRUnichar *text, PRUnichar **user, PRUnichar **pwd, PRBool *_retval);
|
||||
NS_IMETHOD PromptPassword(const PRUnichar *text, PRUnichar **pwd, PRBool *_retval);
|
||||
@ -146,6 +148,9 @@ class nsBrowserAppCore : public nsBaseAppCore,
|
||||
NS_IMETHOD_(PRBool) Confirm(const nsString &aText);
|
||||
|
||||
|
||||
NS_IMETHOD_(PRBool) ConfirmYN(const nsString &aText);
|
||||
|
||||
|
||||
NS_IMETHOD_(PRBool) Prompt(const nsString &aText,
|
||||
const nsString &aDefault,
|
||||
nsString &aResult);
|
||||
|
@ -38,7 +38,9 @@ public:
|
||||
|
||||
NS_IMETHOD Alert( const nsString &aText ) =0 ;
|
||||
NS_IMETHOD Confirm( const nsString &aText, PRInt32* returnValue ) =0;
|
||||
NS_IMETHOD ConfirmYN( const nsString &aText, PRInt32* returnValue ) =0;
|
||||
NS_IMETHOD ConfirmCheck( const nsString &aText, const nsString& aCheckMsg, PRInt32* returnValue, PRBool* checkValue ) =0;
|
||||
NS_IMETHOD ConfirmCheckYN( const nsString &aText, const nsString& aCheckMsg, PRInt32* returnValue, PRBool* checkValue ) =0;
|
||||
NS_IMETHOD Prompt( const nsString &aText,
|
||||
const nsString &aDefault,
|
||||
nsString &aResult
|
||||
|
@ -55,7 +55,6 @@ static NS_DEFINE_IID(kIDOMEventReceiverIID, NS_IDOMEVENTRECEIVER_IID);
|
||||
static NS_DEFINE_IID(kINetSupportDialogIID, NS_INETSUPPORTDIALOGSERVICE_IID);
|
||||
#endif
|
||||
static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
|
||||
|
||||
// Copy and paste
|
||||
#define APP_DEBUG 1
|
||||
static nsresult setAttribute( nsIWebShell *shell,
|
||||
@ -384,6 +383,46 @@ NS_IMETHODIMP nsNetSupportDialog::ConfirmCheck( const nsString &aText, const nsS
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef NECKO
|
||||
NS_IMETHODIMP nsNetSupportDialog::ConfirmYN(const PRUnichar *text, PRBool *returnValue)
|
||||
#else
|
||||
NS_IMETHODIMP nsNetSupportDialog::ConfirmYN( const nsString &aText, PRInt32* returnValue )
|
||||
#endif
|
||||
{
|
||||
Init();
|
||||
#ifdef NECKO
|
||||
nsAutoString aText(text);
|
||||
#endif
|
||||
mMsg = &aText;
|
||||
mReturnValue = returnValue;
|
||||
nsString url( "chrome://navigator/content/NetSupportConfirmYN.xul") ;
|
||||
DoDialog( url );
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef NECKO
|
||||
NS_IMETHODIMP nsNetSupportDialog::ConfirmCheckYN(const PRUnichar *text,
|
||||
const PRUnichar *checkMsg,
|
||||
PRBool *checkValue,
|
||||
PRBool *returnValue)
|
||||
#else
|
||||
NS_IMETHODIMP nsNetSupportDialog::ConfirmCheckYN( const nsString &aText, const nsString& aCheckMsg, PRInt32* returnValue, PRBool* checkValue )
|
||||
#endif
|
||||
{
|
||||
Init();
|
||||
#ifdef NECKO
|
||||
nsAutoString aText(text);
|
||||
nsAutoString aCheckMsg(checkMsg);
|
||||
#endif
|
||||
mMsg = &aText;
|
||||
mReturnValue = returnValue;
|
||||
mCheckValue = checkValue;
|
||||
mCheckMsg = &aCheckMsg;
|
||||
nsString url( "chrome://navigator/content/NetSupportConfirmCheckYN.xul") ;
|
||||
DoDialog( url );
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef NECKO
|
||||
NS_IMETHODIMP nsNetSupportDialog::Prompt(const PRUnichar *text,
|
||||
const PRUnichar *defaultText,
|
||||
@ -521,8 +560,6 @@ nsresult nsNetSupportDialog::DoDialog( nsString& inXULURL )
|
||||
return result;
|
||||
}
|
||||
|
||||
appShellService->PushThreadEventQueue();
|
||||
|
||||
result = appShellService->CreateTopLevelWindow(nsnull, dialogURL, PR_TRUE,
|
||||
NS_CHROME_ALL_CHROME | NS_CHROME_OPEN_AS_DIALOG,
|
||||
this, 300, 200, &dialogWindow);
|
||||
@ -533,8 +570,6 @@ nsresult nsNetSupportDialog::DoDialog( nsString& inXULURL )
|
||||
NS_CHROME_ALL_CHROME | NS_CHROME_OPEN_AS_DIALOG,
|
||||
this, 300, 200);
|
||||
|
||||
appShellService->PopThreadEventQueue();
|
||||
|
||||
// cleanup
|
||||
if ( mOKButton )
|
||||
RemoveEventListener( mOKButton );
|
||||
|
@ -41,6 +41,8 @@ public:
|
||||
NS_IMETHOD Alert(const PRUnichar *text);
|
||||
NS_IMETHOD Confirm(const PRUnichar *text, PRBool *_retval);
|
||||
NS_IMETHOD ConfirmCheck(const PRUnichar *text, const PRUnichar *checkMsg, PRBool *checkValue, PRBool *_retval);
|
||||
NS_IMETHOD ConfirmYN(const PRUnichar *text, PRBool *_retval);
|
||||
NS_IMETHOD ConfirmCheckYN(const PRUnichar *text, const PRUnichar *checkMsg, PRBool *checkValue, PRBool *_retval);
|
||||
NS_IMETHOD Prompt(const PRUnichar *text, const PRUnichar *defaultText, PRUnichar **result, PRBool *_retval);
|
||||
NS_IMETHOD PromptUsernameAndPassword(const PRUnichar *text, PRUnichar **user, PRUnichar **pwd, PRBool *_retval);
|
||||
NS_IMETHOD PromptPassword(const PRUnichar *text, PRUnichar **pwd, PRBool *_retval);
|
||||
|
@ -36,12 +36,14 @@ EXPORT_RESOURCE_CONTENT = \
|
||||
$(srcdir)/navigator.js \
|
||||
$(srcdir)/openLocation.xul \
|
||||
$(srcdir)/viewSource.xul \
|
||||
$(srcdir)/NetsupportConfirm.xul \
|
||||
$(srcdir)/NetSupportConfirm.xul \
|
||||
$(srcdir)/NetSupportConfirmYN.xul \
|
||||
$(srcdir)/NetSupportAlert.xul \
|
||||
$(srcdir)/NetSupportConfirmCheck.xul \
|
||||
$(srcdir)/NetSupportConfirmCheckYN.xul \
|
||||
$(srcdir)/NetSupportPassword.xul \
|
||||
$(srcdir)/NetSupportPrompt.xul \
|
||||
$(srcdir)/NetSupportUserPAssword.xul \
|
||||
$(srcdir)/NetSupportUserPassword.xul \
|
||||
$(NULL)
|
||||
|
||||
install::
|
||||
|
@ -7,8 +7,11 @@ navigator.js
|
||||
openLocation.xul
|
||||
viewSource.xul
|
||||
NetSupportConfirm.xul
|
||||
NetSupportConfirmYN.xul
|
||||
NetSupportAlert.xul
|
||||
NetSupportConfirmCheck.xul
|
||||
NetSupportConfirmCheckYN.xul
|
||||
NetSupportPassword.xul
|
||||
NetSupportUserPassword.xul
|
||||
NetSupportPassword.xul
|
||||
tooltip.js
|
@ -76,8 +76,9 @@
|
||||
<html:td>
|
||||
</html:td>
|
||||
<html:td html:align="justify">
|
||||
<html:button id="OKButton"> OK </html:button>
|
||||
<html:button id ="CancelButton"> Cancel </html:button>
|
||||
<html:button id="OKButton"> OK </html:button> </html:td>
|
||||
</html:td>
|
||||
</html:tr>
|
||||
</html:table>
|
||||
</window>
|
||||
|
84
xpfe/browser/resources/content/NetSupportConfirmCheckYN.xul
Normal file
84
xpfe/browser/resources/content/NetSupportConfirmCheckYN.xul
Normal file
@ -0,0 +1,84 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
|
||||
<window xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||
xmlns:xul ="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
>
|
||||
<data>
|
||||
<broadcaster id="NetDialog:Message"/>
|
||||
<broadcaster id="NetDialog:CheckMessage"/>
|
||||
</data>
|
||||
<dialog>
|
||||
<observes element="NetDialog:Message" attribute="text" onchange="onUpdate()"/>
|
||||
<observes element="NetDialog:CheckMessage" attribute="text" onchange="onUpdate()"/>
|
||||
</dialog>
|
||||
|
||||
<html:script>
|
||||
function onUpdate()
|
||||
{
|
||||
dump("onUpate \n");
|
||||
var msg = document.getElementById("NetDialog:Message");
|
||||
if ( msg)
|
||||
{
|
||||
var text = msg.getAttribute("text");
|
||||
dump( text +"\n" );
|
||||
var prompt = (document.getElementById("message"));
|
||||
if ( prompt )
|
||||
{
|
||||
dump(" setting message \n" );
|
||||
prompt.childNodes[0].nodeValue = text;
|
||||
}
|
||||
}
|
||||
|
||||
var msg = document.getElementById("NetDialog:CheckMessage");
|
||||
if ( msg)
|
||||
{
|
||||
var text = msg.getAttribute("text");
|
||||
dump( text +"\n" );
|
||||
var prompt = (document.getElementById("checkboxLabel"));
|
||||
if ( prompt )
|
||||
{
|
||||
dump(" setting message \n" );
|
||||
prompt.childNodes[1].nodeValue = text;
|
||||
}
|
||||
}
|
||||
}
|
||||
</html:script>
|
||||
|
||||
|
||||
|
||||
<html:table>
|
||||
<html:tr >
|
||||
<html:td>
|
||||
<html:img html:src="resource:/res/samples/questionl.gif"></html:img>
|
||||
</html:td>
|
||||
|
||||
<html:td>
|
||||
<html:span id="message">m</html:span>
|
||||
</html:td>
|
||||
|
||||
|
||||
</html:tr>
|
||||
|
||||
|
||||
<html:tr>
|
||||
<html:td>
|
||||
<html:label id="checkboxLabel">
|
||||
<html:input type="checkbox" id="checkbox"/>
|
||||
Backwards
|
||||
</html:label>
|
||||
</html:td>
|
||||
<html:td>
|
||||
</html:td>
|
||||
</html:tr>
|
||||
|
||||
<html:tr>
|
||||
<html:td>
|
||||
</html:td>
|
||||
<html:td html:align="justify">
|
||||
<html:button id="OKButton"> Yes </html:button>
|
||||
<html:button id ="CancelButton"> No </html:button>
|
||||
</html:td>
|
||||
</html:tr>
|
||||
</html:table>
|
||||
</window>
|
56
xpfe/browser/resources/content/NetSupportConfirmYN.xul
Normal file
56
xpfe/browser/resources/content/NetSupportConfirmYN.xul
Normal file
@ -0,0 +1,56 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
|
||||
<window xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||
xmlns:xul ="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
>
|
||||
<data>
|
||||
<broadcaster id="NetDialog:Message"/>
|
||||
</data>
|
||||
<dialog>
|
||||
<observes element="NetDialog:Message" attribute="text" onchange="onUpdate()"/>
|
||||
</dialog>
|
||||
<html:script>
|
||||
function onUpdate()
|
||||
{
|
||||
dump("onUpate \n");
|
||||
var msg = document.getElementById("NetDialog:Message");
|
||||
if ( msg)
|
||||
{
|
||||
var text = msg.getAttribute("text");
|
||||
dump( text +"\n" );
|
||||
var prompt = (document.getElementById("message"));
|
||||
if ( prompt )
|
||||
{
|
||||
dump(" setting message \n" );
|
||||
prompt.childNodes[0].nodeValue = text;
|
||||
}
|
||||
}
|
||||
}
|
||||
</html:script>
|
||||
|
||||
|
||||
|
||||
<html:table>
|
||||
<html:tr >
|
||||
<html:td>
|
||||
<html:img html:src="resource:/res/samples/questionl.gif"></html:img>
|
||||
</html:td>
|
||||
|
||||
<html:td>
|
||||
<html:span id="message">m</html:span>
|
||||
</html:td>
|
||||
|
||||
|
||||
</html:tr>
|
||||
|
||||
|
||||
<html:tr>
|
||||
<html:td></html:td>
|
||||
<html:td html:align="justify">
|
||||
<html:button id="OKButton"> Yes </html:button>
|
||||
<html:button id ="CancelButton"> No </html:button>
|
||||
</html:td>
|
||||
</html:tr>
|
||||
</html:table>
|
||||
</window>
|
@ -49,8 +49,9 @@
|
||||
<html:tr>
|
||||
<html:td></html:td>
|
||||
<html:td html:align="justify">
|
||||
<html:button id="OKButton"> OK </html:button>
|
||||
<html:button id ="CancelButton"> Cancel </html:button>
|
||||
<html:button id="OKButton"> OK </html:button> </html:td>
|
||||
</html:td>
|
||||
</html:tr>
|
||||
</html:table>
|
||||
</window>
|
||||
|
@ -48,8 +48,9 @@
|
||||
<html:tr>
|
||||
<html:td></html:td>
|
||||
<html:td html:align="justify">
|
||||
<html:button id="OKButton"> OK </html:button>
|
||||
<html:button id ="CancelButton"> Cancel </html:button>
|
||||
<html:button id="OKButton"> OK </html:button> </html:td>
|
||||
</html:td>
|
||||
</html:tr>
|
||||
</html:table>
|
||||
</window>
|
||||
|
@ -54,8 +54,9 @@
|
||||
<html:tr>
|
||||
<html:td></html:td>
|
||||
<html:td html:align="justify">
|
||||
<html:button id="OKButton"> OK </html:button>
|
||||
<html:button id ="CancelButton"> Cancel </html:button>
|
||||
<html:button id="OKButton"> OK </html:button> </html:td>
|
||||
</html:td>
|
||||
</html:tr>
|
||||
</html:table>
|
||||
</window>
|
||||
|
@ -48,8 +48,9 @@
|
||||
<html:tr>
|
||||
<html:td></html:td>
|
||||
<html:td html:align="justify">
|
||||
<html:button id="OKButton"> OK </html:button>
|
||||
<html:button id ="CancelButton"> Cancel </html:button>
|
||||
<html:button id="OKButton"> OK </html:button> </html:td>
|
||||
</html:td>
|
||||
</html:tr>
|
||||
</html:table>
|
||||
</window>
|
||||
|
@ -31,8 +31,10 @@ install::
|
||||
$(MAKE_INSTALL) navigator.xul $(DISTBROWSWER)
|
||||
$(MAKE_INSTALL) navigator.js $(DISTBROWSWER)
|
||||
$(MAKE_INSTALL) NetSupportConfirm.xul $(DISTBROWSWER)
|
||||
$(MAKE_INSTALL) NetSupportConfirmYN.xul $(DISTBROWSWER)
|
||||
$(MAKE_INSTALL) NetSupportAlert.xul $(DISTBROWSWER)
|
||||
$(MAKE_INSTALL) NetSupportConfirmCheck.xul $(DISTBROWSWER)
|
||||
$(MAKE_INSTALL) NetSupportConfirmCheckYN.xul $(DISTBROWSWER)
|
||||
$(MAKE_INSTALL) NetSupportPassword.xul $(DISTBROWSWER)
|
||||
$(MAKE_INSTALL) NetSupportPrompt.xul $(DISTBROWSWER)
|
||||
$(MAKE_INSTALL) NetSupportUserPassword.xul $(DISTBROWSWER)
|
||||
@ -49,8 +51,10 @@ clobber::
|
||||
rm -f $(DISTBROWSER)\navigator.xul
|
||||
rm -f $(DISTBROWSER)\navigator.js
|
||||
rm -f $(DISTBROWSER)\NetSupportConfirm.xul
|
||||
rm -f $(DISTBROWSER)\NetSupportConfirmYN.xul
|
||||
rm -f $(DISTBROWSER)\NetSupportAlert.xul
|
||||
rm -f $(DISTBROWSER)\NetSupportConfirmCheck.xul
|
||||
rm -f $(DISTBROWSER)\NetSupportConfirmCheckYN.xul
|
||||
rm -f $(DISTBROWSER)\NetSupportPassword.xul
|
||||
rm -f $(DISTBROWSER)\NetSupportPrompt.xul
|
||||
rm -f $(DISTBROWSER)\NetSupportUserPassword.xul
|
||||
|
Loading…
Reference in New Issue
Block a user