mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-20 17:20:54 +00:00
8673 ShutDown() should try to close all open windows.
This commit is contained in:
parent
48d3aeccb5
commit
1f0a7ff024
@ -1427,15 +1427,15 @@ nsEditorShell::SaveAs()
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEditorShell::CloseWindow()
|
||||
nsEditorShell::CloseWindow( PRBool *_retval )
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
PRBool result;
|
||||
rv = CheckAndSaveDocument(GetString("BeforeClosing").GetUnicode(),&result);
|
||||
|
||||
rv = CheckAndSaveDocument(GetString("BeforeClosing").GetUnicode(),_retval);
|
||||
|
||||
// Don't close the window if there was an error saving file or
|
||||
// user canceled an action along the way
|
||||
if (NS_SUCCEEDED(rv) && result)
|
||||
if (NS_SUCCEEDED(rv) && *_retval)
|
||||
mWebShellWin->Close();
|
||||
|
||||
return rv;
|
||||
|
@ -1427,15 +1427,15 @@ nsEditorShell::SaveAs()
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEditorShell::CloseWindow()
|
||||
nsEditorShell::CloseWindow( PRBool *_retval )
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
PRBool result;
|
||||
rv = CheckAndSaveDocument(GetString("BeforeClosing").GetUnicode(),&result);
|
||||
|
||||
rv = CheckAndSaveDocument(GetString("BeforeClosing").GetUnicode(),_retval);
|
||||
|
||||
// Don't close the window if there was an error saving file or
|
||||
// user canceled an action along the way
|
||||
if (NS_SUCCEEDED(rv) && result)
|
||||
if (NS_SUCCEEDED(rv) && *_retval)
|
||||
mWebShellWin->Close();
|
||||
|
||||
return rv;
|
||||
|
@ -120,7 +120,7 @@ interface nsIEditorShell : nsISupports
|
||||
*/
|
||||
boolean CheckAndSaveDocument(in wstring reasonToSave);
|
||||
|
||||
void CloseWindow();
|
||||
boolean CloseWindow();
|
||||
void Print();
|
||||
void Exit();
|
||||
|
||||
|
@ -47,6 +47,7 @@ function EditorOnLoad() {
|
||||
}
|
||||
// Continue with normal startup.
|
||||
EditorStartup( 'html', document.getElementById("content-frame"));
|
||||
window.tryToClose = EditorClose;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -251,7 +252,7 @@ function EditorPrint()
|
||||
function EditorClose()
|
||||
{
|
||||
dump("In EditorClose...\n");
|
||||
editorShell.CloseWindow();
|
||||
return editorShell.CloseWindow();
|
||||
// This doesn't work, but we can close
|
||||
// the window in the EditorAppShell, so we don't need it
|
||||
//window.close();
|
||||
@ -1251,7 +1252,8 @@ function EditorUnitTests()
|
||||
function EditorExit()
|
||||
{
|
||||
dump("Exiting\n");
|
||||
editorShell.Exit();
|
||||
// editorShell.Exit();
|
||||
goQuitApplication();
|
||||
}
|
||||
|
||||
function EditorTestDocument()
|
||||
|
Loading…
x
Reference in New Issue
Block a user