bug 856241 - Remove closing multiple tabs dialog r=mbrubeck

--HG--
extra : rebase_source : e53aa69ccac48e784c1947f8544c68c313ccbf2c
This commit is contained in:
Rodrigo Silveira 2013-04-03 13:19:34 -07:00
parent 123c7df9d5
commit 90620f3cc4
4 changed files with 1 additions and 51 deletions

View File

@ -214,46 +214,7 @@ var Browser = {
}
},
_waitingToClose: false,
closing: function closing() {
// If we are already waiting for the close prompt, don't show another
if (this._waitingToClose)
return false;
// Prompt if we have multiple tabs before closing window
let numTabs = this._tabs.length;
if (numTabs > 1) {
let shouldPrompt = Services.prefs.getBoolPref("browser.tabs.warnOnClose");
if (shouldPrompt) {
let prompt = Services.prompt;
// Default to true: if it were false, we wouldn't get this far
let warnOnClose = { value: true };
let messageBase = Strings.browser.GetStringFromName("tabs.closeWarning");
let message = PluralForm.get(numTabs, messageBase).replace("#1", numTabs);
let title = Strings.browser.GetStringFromName("tabs.closeWarningTitle");
let closeText = Strings.browser.GetStringFromName("tabs.closeButton");
let checkText = Strings.browser.GetStringFromName("tabs.closeWarningPromptMe");
let buttons = (prompt.BUTTON_TITLE_IS_STRING * prompt.BUTTON_POS_0) +
(prompt.BUTTON_TITLE_CANCEL * prompt.BUTTON_POS_1);
this._waitingToClose = true;
let pressed = prompt.confirmEx(window, title, message, buttons, closeText, null, null, checkText, warnOnClose);
this._waitingToClose = false;
// Don't set the pref unless they press OK and it's false
let reallyClose = (pressed == 0);
if (reallyClose && !warnOnClose.value)
Services.prefs.setBoolPref("browser.tabs.warnOnClose", false);
// If we don't want to close, return now. If we are closing, continue with other housekeeping.
if (!reallyClose)
return false;
}
}
// Figure out if there's at least one other browser window around.
let lastBrowser = true;
let e = Services.wm.getEnumerator("navigator:browser");

View File

@ -218,7 +218,7 @@ Prompt.prototype = {
if (aCheck && aCheck.msg) {
aDoc.getElementById("prompt-" + aType + "-checkbox").checked = aCheck.value;
this.setLabelForNode(aDoc.getElementById("prompt-" + aType + "-checkbox-label"), aCheck.msg);
this.setLabelForNode(aDoc.getElementById("prompt-" + aType + "-checkbox"), aCheck.msg);
aDoc.getElementById("prompt-" + aType + "-checkbox").removeAttribute("collapsed");
}
},

View File

@ -73,16 +73,6 @@ offlineApps.wantsTo=%S wants to store data on your device for offline use.
indexedDBQuota.allow=Allow
indexedDBQuota.wantsTo=%S wants to store a lot of data on your device for offline use.
# Closing Tabs
tabs.closeWarningTitle=Confirm close
# LOCALIZATION NOTE (tabs.closeWarning): Semi-colon list of plural forms.
# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals
# #1 number of tabs (must be greater than 1)
tabs.closeWarning=NOT USED;You are about to close #1 tabs. Continue?
tabs.closeButton=Close tabs
tabs.closeWarningPromptMe=Warn me when I attempt to close multiple tabs
tabs.emptyTabTitle=New Tab
# Open Search

View File

@ -67,7 +67,6 @@ pref("browser.chromeURL", "chrome://browser/content/");
// When true, always show the tab strip and use desktop-style tabs (no thumbnails)
pref("browser.tabs.tabsOnly", false);
pref("browser.tabs.warnOnClose", true);
pref("browser.tabs.remote", false);
// Telemetry