mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 12:35:58 +00:00
Disable XUL progress dialog and fix print progress listener. b=168510 r=rods@netscape.com sr=rpotts@netscape.com
This commit is contained in:
parent
6a8aae7f71
commit
494355d131
@ -1489,9 +1489,12 @@ HRESULT CMozillaBrowser::PrintDocument(BOOL promptUser)
|
|||||||
printSettings->SetPrintSilent(promptUser ? PR_FALSE : PR_TRUE);
|
printSettings->SetPrintSilent(promptUser ? PR_FALSE : PR_TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Disable print progress dialog (XUL)
|
||||||
|
mPrefs->SetBoolPref("print.show_print_progress", PR_FALSE);
|
||||||
|
|
||||||
PrintListener *listener = new PrintListener;
|
PrintListener *listener = new PrintListener;
|
||||||
nsCOMPtr<nsIWebProgressListener> printListener = do_QueryInterface(listener);
|
nsCOMPtr<nsIWebProgressListener> printListener = do_QueryInterface(listener);
|
||||||
browserAsPrint->Print(printSettings, nsnull);
|
browserAsPrint->Print(printSettings, printListener);
|
||||||
listener->WaitForComplete();
|
listener->WaitForComplete();
|
||||||
|
|
||||||
if (printSettings)
|
if (printSettings)
|
||||||
@ -3341,10 +3344,12 @@ void PrintListener::WaitForComplete()
|
|||||||
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aStateFlags, in nsresult aStatus); */
|
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aStateFlags, in nsresult aStatus); */
|
||||||
NS_IMETHODIMP PrintListener::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aStateFlags, nsresult aStatus)
|
NS_IMETHODIMP PrintListener::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aStateFlags, nsresult aStatus)
|
||||||
{
|
{
|
||||||
if (aStatus == nsIWebProgressListener::STATE_STOP) {
|
if (aStateFlags & nsIWebProgressListener::STATE_STOP &&
|
||||||
mComplete = PR_TRUE;
|
aStateFlags & nsIWebProgressListener::STATE_IS_DOCUMENT)
|
||||||
}
|
{
|
||||||
return NS_OK;
|
mComplete = PR_TRUE;
|
||||||
|
}
|
||||||
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* void onProgressChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aCurSelfProgress, in long aMaxSelfProgress, in long aCurTotalProgress, in long aMaxTotalProgress); */
|
/* void onProgressChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aCurSelfProgress, in long aMaxSelfProgress, in long aCurTotalProgress, in long aMaxTotalProgress); */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user