mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-06 08:31:25 +00:00
Bug 464791 - Add ifdef MOZ_UPDATER for the app update preferences UI and Help menu. r=mconnor, approval1.9.1=mconnor
This commit is contained in:
parent
6f59dac480
commit
83ed1268e6
@ -67,6 +67,10 @@ ifneq (,$(filter windows gtk2 mac cocoa, $(MOZ_WIDGET_TOOLKIT)))
|
||||
DEFINES += -DHAVE_SHELL_SERVICE=1
|
||||
endif
|
||||
|
||||
ifdef MOZ_UPDATER
|
||||
DEFINES += -DMOZ_UPDATER=1
|
||||
endif
|
||||
|
||||
ifneq (,$(filter mac cocoa, $(MOZ_WIDGET_TOOLKIT)))
|
||||
DEFINES += -DTOOLBAR_CUSTOMIZATION_SHEET
|
||||
endif
|
||||
|
@ -98,11 +98,13 @@
|
||||
oncommand="openReleaseNotes(event)"
|
||||
onclick="checkForMiddleClick(this, event);"/>
|
||||
<menuseparator id="updateSeparator"/>
|
||||
#ifdef MOZ_UPDATER
|
||||
<menuitem id="checkForUpdates"
|
||||
accesskey="&updateCmd.accesskey;"
|
||||
label="&updateCmd.label;"
|
||||
class="menuitem-iconic"
|
||||
oncommand="checkForUpdates();"/>
|
||||
#endif
|
||||
<menuseparator id="aboutSeparator"/>
|
||||
<menuitem id="aboutName"
|
||||
accesskey="&aboutCmd.accesskey;"
|
||||
|
@ -442,7 +442,8 @@ function openReleaseNotes(event)
|
||||
|
||||
openUILink(relnotesURL, event, false, true);
|
||||
}
|
||||
|
||||
|
||||
#ifdef MOZ_UPDATER
|
||||
/**
|
||||
* Opens the update manager and checks for updates to the application.
|
||||
*/
|
||||
@ -463,6 +464,7 @@ function checkForUpdates()
|
||||
else
|
||||
prompter.checkForUpdates();
|
||||
}
|
||||
#endif
|
||||
|
||||
function buildHelpMenu()
|
||||
{
|
||||
@ -471,6 +473,7 @@ function buildHelpMenu()
|
||||
if (typeof safebrowsing != "undefined")
|
||||
safebrowsing.setReportPhishingMenu();
|
||||
|
||||
#ifdef MOZ_UPDATER
|
||||
var updates =
|
||||
Components.classes["@mozilla.org/updates/update-service;1"].
|
||||
getService(Components.interfaces.nsIApplicationUpdateService);
|
||||
@ -519,6 +522,10 @@ function buildHelpMenu()
|
||||
checkForUpdates.setAttribute("loading", "true");
|
||||
else
|
||||
checkForUpdates.removeAttribute("loading");
|
||||
#else
|
||||
// Needed by safebrowsing for inserting its menuitem so just hide it
|
||||
document.getElementById("updateSeparator").hidden = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
function isElementVisible(aElement)
|
||||
|
@ -57,3 +57,7 @@ DEFINES += \
|
||||
ifneq (,$(filter windows gtk2 mac cocoa, $(MOZ_WIDGET_TOOLKIT)))
|
||||
DEFINES += -DHAVE_SHELL_SERVICE=1
|
||||
endif
|
||||
|
||||
ifdef MOZ_UPDATER
|
||||
DEFINES += -DMOZ_UPDATER=1
|
||||
endif
|
||||
|
@ -61,9 +61,11 @@ var gAdvancedPane = {
|
||||
advancedPrefs.selectedIndex = preference.value;
|
||||
}
|
||||
|
||||
#ifdef MOZ_UPDATER
|
||||
this.updateAppUpdateItems();
|
||||
this.updateAutoItems();
|
||||
this.updateModeItems();
|
||||
#endif
|
||||
this.updateOfflineApps();
|
||||
},
|
||||
|
||||
@ -375,6 +377,7 @@ var gAdvancedPane = {
|
||||
* iii 0/1/2 t true
|
||||
*
|
||||
*/
|
||||
#ifdef MOZ_UPDATER
|
||||
updateAppUpdateItems: function ()
|
||||
{
|
||||
var aus =
|
||||
@ -421,18 +424,6 @@ var gAdvancedPane = {
|
||||
warnIncompatible.disabled = disable;
|
||||
},
|
||||
|
||||
/**
|
||||
* The Extensions checkbox and button are disabled only if the enable Addon
|
||||
* update preference is locked.
|
||||
*/
|
||||
updateAddonUpdateUI: function ()
|
||||
{
|
||||
var enabledPref = document.getElementById("extensions.update.enabled");
|
||||
var enableAddonUpdate = document.getElementById("enableAddonUpdate");
|
||||
|
||||
enableAddonUpdate.disabled = enabledPref.locked;
|
||||
},
|
||||
|
||||
/**
|
||||
* Stores the value of the app.update.mode preference, which is a tristate
|
||||
* integer preference. We store the value here so that we can properly
|
||||
@ -483,6 +474,19 @@ var gAdvancedPane = {
|
||||
.createInstance(Components.interfaces.nsIUpdatePrompt);
|
||||
prompter.showUpdateHistory(window);
|
||||
},
|
||||
#endif
|
||||
|
||||
/**
|
||||
* The Extensions checkbox and button are disabled only if the enable Addon
|
||||
* update preference is locked.
|
||||
*/
|
||||
updateAddonUpdateUI: function ()
|
||||
{
|
||||
var enabledPref = document.getElementById("extensions.update.enabled");
|
||||
var enableAddonUpdate = document.getElementById("enableAddonUpdate");
|
||||
|
||||
enableAddonUpdate.disabled = enabledPref.locked;
|
||||
},
|
||||
|
||||
// ENCRYPTION TAB
|
||||
|
||||
|
@ -85,14 +85,11 @@
|
||||
<preference id="browser.offline-apps.notify" name="browser.offline-apps.notify" type="bool"/>
|
||||
|
||||
<!-- Update tab -->
|
||||
#ifdef MOZ_UPDATER
|
||||
<preference id="app.update.enabled" name="app.update.enabled" type="bool"
|
||||
onchange="gAdvancedPane.updateAppUpdateItems();
|
||||
gAdvancedPane.updateAutoItems();
|
||||
gAdvancedPane.updateModeItems();"/>
|
||||
<preference id="extensions.update.enabled" name="extensions.update.enabled" type="bool"
|
||||
onchange="gAdvancedPane.updateAddonUpdateUI();"/>
|
||||
<preference id="browser.search.update" name="browser.search.update" type="bool"/>
|
||||
|
||||
<preference id="app.update.auto" name="app.update.auto" type="bool"
|
||||
onchange="gAdvancedPane.updateAutoItems();
|
||||
gAdvancedPane.updateModeItems();"/>
|
||||
@ -102,7 +99,11 @@
|
||||
<preference id="app.update.disable_button.showUpdateHistory"
|
||||
name="app.update.disable_button.showUpdateHistory"
|
||||
type="bool"/>
|
||||
#endif
|
||||
|
||||
<preference id="extensions.update.enabled" name="extensions.update.enabled" type="bool"
|
||||
onchange="gAdvancedPane.updateAddonUpdateUI();"/>
|
||||
<preference id="browser.search.update" name="browser.search.update" type="bool"/>
|
||||
|
||||
<!-- Encryption tab -->
|
||||
<preference id="security.enable_ssl3" name="security.enable_ssl3" type="bool"/>
|
||||
@ -267,10 +268,12 @@
|
||||
<tabpanel id="updatePanel" orient="vertical" align="start">
|
||||
<label control="autoUpdateGroup">&autoCheck.label;</label>
|
||||
<vbox class="indent" id="autoUpdateGroup" role="group">
|
||||
#ifdef MOZ_UPDATER
|
||||
<checkbox id="enableAppUpdate"
|
||||
label="&enableAppUpdate.label;"
|
||||
accesskey="&enableAppUpdate.accesskey;"
|
||||
preference="app.update.enabled"/>
|
||||
#endif
|
||||
<checkbox id="enableAddonUpdate"
|
||||
label="&enableAddonsUpdate.label;"
|
||||
accesskey="&enableAddonsUpdate.accesskey;"
|
||||
@ -281,6 +284,7 @@
|
||||
preference="browser.search.update"/>
|
||||
</vbox>
|
||||
|
||||
#ifdef MOZ_UPDATER
|
||||
<separator id="updateSeparator1"/>
|
||||
|
||||
<label id="updateModeLabel" control="updateMode">&whenUpdatesFound.label;</label>
|
||||
@ -309,6 +313,7 @@
|
||||
preference="app.update.disable_button.showUpdateHistory"
|
||||
oncommand="gAdvancedPane.showUpdates();"/>
|
||||
</hbox>
|
||||
#endif
|
||||
</tabpanel>
|
||||
|
||||
<!-- Encryption -->
|
||||
|
Loading…
Reference in New Issue
Block a user