Bug 257728 - Fix error on /quit (CEvent is not defined).

ChatZilla only.
r=silver
This commit is contained in:
gijskruitbosch%gmail.com 2006-01-22 16:41:31 +00:00
parent d98f1d4cac
commit d0645e169e
3 changed files with 25 additions and 27 deletions

View File

@ -151,7 +151,6 @@ function initCommands()
["print", cmdPrint, CMD_CONSOLE],
["query", cmdQuery, CMD_NEED_SRV | CMD_CONSOLE],
["quit", cmdQuit, CMD_CONSOLE],
["quit-mozilla", cmdQuitMozilla, CMD_CONSOLE],
["quote", cmdQuote, CMD_NEED_SRV | CMD_CONSOLE],
["reload-plugin", cmdReload, CMD_CONSOLE],
["rlist", cmdRlist, CMD_NEED_SRV | CMD_CONSOLE],
@ -202,7 +201,6 @@ function initCommands()
/* aliases */
["css", "motif", CMD_CONSOLE],
["exit", "quit", CMD_CONSOLE],
["exit-mozilla", "quit-mozilla", CMD_CONSOLE],
["j", "join", CMD_CONSOLE],
["part", "leave", CMD_CONSOLE],
["raw", "quote", CMD_CONSOLE],
@ -1451,14 +1449,7 @@ function cmdSSLServer(e)
function cmdQuit(e)
{
client.quit(e.reason);
window.close();
}
function cmdQuitMozilla(e)
{
client.quit(e.reason);
goQuitApplication();
client.wantToQuit(e.reason);
}
function cmdDisconnect(e)

View File

@ -133,23 +133,7 @@ function onClose()
}
/* otherwise, try to close out gracefully */
var close = true;
if (client.prefs["warnOnClose"])
{
const buttons = ["!yes", "!no"];
var checkState = { value: true };
var rv = confirmEx(MSG_CONFIRM_QUIT, buttons, 0, MSG_WARN_ON_EXIT,
checkState);
close = (rv == 0);
client.prefs["warnOnClose"] = checkState.value;
}
if (close)
{
client.userClose = true;
display(MSG_CLOSING);
client.quit();
}
client.wantToQuit();
return false;
}

View File

@ -4402,6 +4402,29 @@ function cli_quit (reason)
}
}
client.wantToQuit =
function cli_wantToQuit(reason)
{
var close = true;
if (client.prefs["warnOnClose"])
{
const buttons = ["!yes", "!no"];
var checkState = { value: true };
var rv = confirmEx(MSG_CONFIRM_QUIT, buttons, 0, MSG_WARN_ON_EXIT,
checkState);
close = (rv == 0);
client.prefs["warnOnClose"] = checkState.value;
}
if (close)
{
client.userClose = true;
display(MSG_CLOSING);
client.quit(reason);
}
}
/* gets a tab-complete match for the line of text specified by |line|.
* wordStart is the position within |line| that starts the word being matched,
* wordEnd marks the end position. |cursorPos| marks the position of the caret