зеркало из https://github.com/mozilla/gecko-dev.git
Bug 595744 - Remove the "Check for Updates Automatically" menu item from the Add-ons Manager; r=Mossop a=blocking-betaN+
This commit is contained in:
Родитель
f66874219e
Коммит
9f50a37e79
|
@ -40,8 +40,6 @@
|
|||
<!ENTITY updates.updateAddonsNow.accesskey "U">
|
||||
<!ENTITY updates.viewUpdates.label "View Recent Updates">
|
||||
<!ENTITY updates.viewUpdates.accesskey "V">
|
||||
<!ENTITY updates.backgroudUpdateCheck.label "Check for Updates Automatically">
|
||||
<!ENTITY updates.backgroudUpdateCheck.accesskey "C">
|
||||
<!ENTITY updates.updateAddonsAutomatically.label "Update Add-ons Automatically">
|
||||
<!ENTITY updates.updateAddonsAutomatically.accesskey "A">
|
||||
<!ENTITY updates.resetUpdatesToAutomatic.label "Reset All Add-ons to Update Automatically">
|
||||
|
|
|
@ -592,14 +592,6 @@ var gViewController = {
|
|||
}
|
||||
},
|
||||
|
||||
cmd_toggleBackgroundUpdateCheck: {
|
||||
isEnabled: function() true,
|
||||
doCommand: function() {
|
||||
var enabled = !Services.prefs.getBoolPref(PREF_BACKGROUND_UPDATE);
|
||||
Services.prefs.setBoolPref(PREF_BACKGROUND_UPDATE, enabled);
|
||||
}
|
||||
},
|
||||
|
||||
cmd_showItemDetails: {
|
||||
isEnabled: function(aAddon) {
|
||||
return !!aAddon;
|
||||
|
@ -2120,7 +2112,6 @@ var gUpdatesView = {
|
|||
_sorters: null,
|
||||
_updateSelected: null,
|
||||
_updatePrefs: null,
|
||||
_backgroundUpdateCheck: null,
|
||||
_categoryItem: null,
|
||||
_numManualUpdaters: 0,
|
||||
|
||||
|
@ -2131,7 +2122,6 @@ var gUpdatesView = {
|
|||
this._sorters = document.getElementById("updates-sorters");
|
||||
this._sorters.handler = this;
|
||||
|
||||
this._backgroundUpdateCheck = document.getElementById("utils-backgroudUpdateCheck");
|
||||
this._categoryItem = gCategories.get("addons://updates/available");
|
||||
|
||||
this._updateSelected = document.getElementById("update-selected");
|
||||
|
@ -2142,7 +2132,6 @@ var gUpdatesView = {
|
|||
this._updatePrefs = Services.prefs.getBranch("extensions.update.");
|
||||
this._updatePrefs.QueryInterface(Ci.nsIPrefBranch2);
|
||||
this._updatePrefs.addObserver("", this, false);
|
||||
this.updateBackgroundCheck();
|
||||
this.updateManualUpdatersCount(true);
|
||||
this.updateAvailableCount(true);
|
||||
|
||||
|
@ -2260,17 +2249,10 @@ var gUpdatesView = {
|
|||
observe: function(aSubject, aTopic, aData) {
|
||||
if (aTopic != "nsPref:changed")
|
||||
return;
|
||||
if (aData == "enabled")
|
||||
this.updateBackgroundCheck();
|
||||
else if (aData == "autoUpdateDefault")
|
||||
if (aData == "autoUpdateDefault")
|
||||
this.updateManualUpdatersCount();
|
||||
},
|
||||
|
||||
updateBackgroundCheck: function() {
|
||||
let isEnabled = this._updatePrefs.getBoolPref("enabled");
|
||||
this._backgroundUpdateCheck.setAttribute("checked", isEnabled);
|
||||
},
|
||||
|
||||
maybeRefresh: function() {
|
||||
if (gViewController.currentViewId == "addons://updates/available") {
|
||||
this._showAvailableUpdates(true);
|
||||
|
|
|
@ -112,7 +112,6 @@
|
|||
<command id="cmd_goToDiscoverPane"/>
|
||||
<command id="cmd_goToRecentUpdates"/>
|
||||
<command id="cmd_goToAvailableUpdates"/>
|
||||
<command id="cmd_toggleBackgroundUpdateCheck"/>
|
||||
<command id="cmd_installFromFile"/>
|
||||
<command id="cmd_back"/>
|
||||
<command id="cmd_forward"/>
|
||||
|
@ -185,11 +184,6 @@
|
|||
accesskey="&installFromFile.accesskey;"
|
||||
command="cmd_installFromFile"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="utils-backgroudUpdateCheck"
|
||||
label="&updates.backgroudUpdateCheck.label;"
|
||||
accesskey="&updates.backgroudUpdateCheck.accesskey;"
|
||||
type="checkbox" autocheck="false"
|
||||
command="cmd_toggleBackgroundUpdateCheck"/>
|
||||
<menuitem id="utils-autoUpdateDefault"
|
||||
label="&updates.updateAddonsAutomatically.label;"
|
||||
accesskey="&updates.updateAddonsAutomatically.accesskey;"
|
||||
|
|
|
@ -76,7 +76,6 @@ _TEST_FILES = \
|
|||
browser_updatessl.js \
|
||||
browser_updatessl.rdf \
|
||||
browser_installssl.js \
|
||||
browser_backgroundupdate_menuitem.js \
|
||||
browser_recentupdates.js \
|
||||
browser_manualupdates.js \
|
||||
browser_globalwarnings.js \
|
||||
|
|
|
@ -1,58 +0,0 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||
*/
|
||||
|
||||
// Tests the menuitem for the background update check
|
||||
|
||||
var gManagerWindow;
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
open_manager("addons://list/extension", function(aWindow) {
|
||||
gManagerWindow = aWindow;
|
||||
run_next_test();
|
||||
});
|
||||
}
|
||||
|
||||
function end_test() {
|
||||
close_manager(gManagerWindow, function() {
|
||||
finish();
|
||||
});
|
||||
}
|
||||
|
||||
add_test(function() {
|
||||
var menuitem = gManagerWindow.document.getElementById("utils-backgroudUpdateCheck");
|
||||
|
||||
function is_backgroundcheck_insync(aExpected) {
|
||||
var enabled = Services.prefs.getBoolPref("extensions.update.enabled");
|
||||
var checked = menuitem.getAttribute("checked") == "true";
|
||||
is(enabled, aExpected, "Background check should be " + (aExpected ? "enabled" : "disabled"));
|
||||
is(checked, enabled, "Background check menuitem should be in sync with preference");
|
||||
}
|
||||
|
||||
is_backgroundcheck_insync(true);
|
||||
info("Setting background check pref to true");
|
||||
Services.prefs.setBoolPref("extensions.update.enabled", false);
|
||||
is_backgroundcheck_insync(false);
|
||||
info("Setting background check pref to false");
|
||||
Services.prefs.setBoolPref("extensions.update.enabled", true);
|
||||
is_backgroundcheck_insync(true);
|
||||
run_next_test();
|
||||
/* XXX This is failing on OSX - need to investigate why
|
||||
|
||||
info("Clicking on background check menuitem - setting to unchecked");
|
||||
var utilsBtn = gManagerWindow.document.getElementById("header-utils-btn");
|
||||
utilsBtn.addEventListener("popupshown", function() {
|
||||
EventUtils.synthesizeMouse(menuitem, 2, 2, { }, gManagerWindow);
|
||||
executeSoon(function() {
|
||||
is_backgroundcheck_insync(false);
|
||||
info("Manually invoking command to toggle background update check on");
|
||||
gManagerWindow.gViewController.doCommand("cmd_toggleBackgroundUpdateCheck");
|
||||
is_backgroundcheck_insync(true);
|
||||
run_next_test();
|
||||
});
|
||||
}, false);
|
||||
EventUtils.synthesizeMouse(utilsBtn, 2, 2, { }, gManagerWindow);
|
||||
*/
|
||||
});
|
Загрузка…
Ссылка в новой задаче