diff --git a/extensions/irc/xul/content/commands.js b/extensions/irc/xul/content/commands.js index e247dbd1978a..31e47fc6c16b 100644 --- a/extensions/irc/xul/content/commands.js +++ b/extensions/irc/xul/content/commands.js @@ -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) diff --git a/extensions/irc/xul/content/handlers.js b/extensions/irc/xul/content/handlers.js index 3d48fbbb56b1..8bf28fc2235f 100644 --- a/extensions/irc/xul/content/handlers.js +++ b/extensions/irc/xul/content/handlers.js @@ -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; } diff --git a/extensions/irc/xul/content/static.js b/extensions/irc/xul/content/static.js index a90e521b60cc..2e26ec3d5718 100644 --- a/extensions/irc/xul/content/static.js +++ b/extensions/irc/xul/content/static.js @@ -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