cleaned up dialogs

git-svn-id: svn://10.0.0.236/trunk@42385 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
morse%netscape.com
1999-08-06 00:29:10 +00:00
parent 10d25b3cb8
commit 992e91d2d9
21 changed files with 382 additions and 27 deletions

View File

@@ -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 );