зеркало из https://github.com/mozilla/gecko-dev.git
Bug 277079 - "Close other tabs" should always warn about closing multiple tabs. r=ttaubert
This commit is contained in:
Родитель
4f9d14de94
Коммит
82e2e4380e
|
@ -1410,14 +1410,17 @@
|
|||
this.tabs.length - this._removingTabs.length :
|
||||
this.visibleTabs.length - 1)
|
||||
- gBrowser._numPinnedTabs;
|
||||
var alwaysPrompt = !aAll;
|
||||
const pref = "browser.tabs.warnOnClose";
|
||||
|
||||
if (!alwaysPrompt) {
|
||||
if (tabsToClose <= 1)
|
||||
return true;
|
||||
|
||||
const pref = "browser.tabs.warnOnClose";
|
||||
var shouldPrompt = Services.prefs.getBoolPref(pref);
|
||||
|
||||
if (!shouldPrompt)
|
||||
return true;
|
||||
}
|
||||
|
||||
var ps = Services.prompt;
|
||||
|
||||
|
@ -1440,11 +1443,13 @@
|
|||
+ (ps.BUTTON_TITLE_CANCEL * ps.BUTTON_POS_1),
|
||||
bundle.getString("tabs.closeButtonMultiple"),
|
||||
null, null,
|
||||
alwaysPrompt ? null :
|
||||
bundle.getString('tabs.closeWarningPromptMe'),
|
||||
warnOnClose);
|
||||
var reallyClose = (buttonPressed == 0);
|
||||
|
||||
// don't set the pref unless they press OK and it's false
|
||||
if (reallyClose && !warnOnClose.value)
|
||||
if (!alwaysPrompt && reallyClose && !warnOnClose.value)
|
||||
Services.prefs.setBoolPref(pref, false);
|
||||
|
||||
return reallyClose;
|
||||
|
|
Загрузка…
Ссылка в новой задаче