Bug 480702 - Add ifdef MOZ_UPDATER for the app update preferences UI and Help menu. r=mschroeder
This commit is contained in:
Родитель
c07b0dc8d7
Коммит
d1835d480e
|
@ -59,9 +59,11 @@ var gAdvancedPane = {
|
|||
}
|
||||
advancedPrefs.selectedIndex = preference.value;
|
||||
|
||||
#ifdef MOZ_UPDATER
|
||||
this.updateAppUpdateItems();
|
||||
this.updateAutoItems();
|
||||
this.updateModeItems();
|
||||
#endif
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -261,6 +263,7 @@ var gAdvancedPane = {
|
|||
* true iii 0/1/2 t
|
||||
*
|
||||
*/
|
||||
#ifdef MOZ_UPDATER
|
||||
updateAppUpdateItems: function advPaneUpdateAppUpdateItems() {
|
||||
var aus = Components.classes["@mozilla.org/updates/update-service;1"]
|
||||
.getService(Components.interfaces.nsIApplicationUpdateService);
|
||||
|
@ -306,17 +309,6 @@ var gAdvancedPane = {
|
|||
warnIncompatible.disabled = disable;
|
||||
},
|
||||
|
||||
/**
|
||||
* The Add-ons checkbox and button are disabled only if the enable
|
||||
* add-on update preference is locked.
|
||||
*/
|
||||
updateAddonUpdateUI: function advPaneUpdateAddonUpdateUI() {
|
||||
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
|
||||
|
@ -365,6 +357,19 @@ var gAdvancedPane = {
|
|||
.createInstance(Components.interfaces.nsIUpdatePrompt);
|
||||
prompter.showUpdateHistory(window);
|
||||
},
|
||||
#endif
|
||||
|
||||
/**
|
||||
* The Add-ons checkbox and button are disabled only if the enable
|
||||
* add-on update preference is locked.
|
||||
*/
|
||||
updateAddonUpdateUI: function advPaneUpdateAddonUpdateUI() {
|
||||
var enabledPref = document.getElementById("extensions.update.enabled");
|
||||
var enableAddonUpdate = document.getElementById("enableAddonUpdate");
|
||||
|
||||
enableAddonUpdate.disabled = enabledPref.locked;
|
||||
},
|
||||
|
||||
|
||||
// ENCRYPTION TAB
|
||||
|
||||
|
|
|
@ -67,16 +67,13 @@
|
|||
type="bool"/>
|
||||
|
||||
<!-- Advanced 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="app.update.auto"
|
||||
name="app.update.auto"
|
||||
type="bool"
|
||||
|
@ -89,6 +86,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();"/>
|
||||
<!-- Encryption tab -->
|
||||
<preference id="security.enable_ssl3" name="security.enable_ssl3" type="bool"/>
|
||||
<preference id="security.enable_tls" name="security.enable_tls" type="bool"/>
|
||||
|
@ -175,16 +177,19 @@
|
|||
<tabpanel id="updatePanel" orient="vertical" align="start">
|
||||
<label control="autoUpdateGroup">&pref.calendar.advanced.update.autoCheck.label;</label>
|
||||
<vbox id="autoUpdateGroup" class="indent">
|
||||
#ifdef MOZ_UPDATER
|
||||
<checkbox id="enableAppUpdate"
|
||||
label="&pref.calendar.advanced.update.enableAppUpdate.label;"
|
||||
accesskey="&pref.calendar.advanced.update.enableAppUpdate.accesskey;"
|
||||
preference="app.update.enabled"/>
|
||||
#endif
|
||||
<checkbox id="enableAddonUpdate"
|
||||
label="&pref.calendar.advanced.update.enableAddonsUpdate.label;"
|
||||
accesskey="&pref.calendar.advanced.update.enableAddonsUpdate.accesskey;"
|
||||
preference="extensions.update.enabled"/>
|
||||
</vbox>
|
||||
|
||||
#ifdef MOZ_UPDATER
|
||||
<separator id="updateSeparator1"/>
|
||||
|
||||
<label id="updateModeLabel"
|
||||
|
@ -219,6 +224,7 @@
|
|||
preference="app.update.disable_button.showUpdateHistory"
|
||||
oncommand="gAdvancedPane.showUpdates();"/>
|
||||
</hbox>
|
||||
#endif
|
||||
</tabpanel>
|
||||
|
||||
<!-- Encryption -->
|
||||
|
|
|
@ -13,7 +13,7 @@ calendar.jar:
|
|||
content/calendar/sound.wav (content/sound.wav)
|
||||
content/calendar/datetimepickers/datetimepickers.css (content/datetimepickers/datetimepickers.css)
|
||||
* content/calendar/datetimepickers/datetimepickers.xml (content/datetimepickers/datetimepickers.xml)
|
||||
content/calendar/preferences/advanced.js (/calendar/base/content/preferences/advanced.js)
|
||||
* content/calendar/preferences/advanced.js (/calendar/base/content/preferences/advanced.js)
|
||||
* content/calendar/preferences/advanced.xul (/calendar/base/content/preferences/advanced.xul)
|
||||
* content/calendar/preferences/connection.xul (/calendar/base/content/preferences/connection.xul)
|
||||
content/calendar/preferences/connection.js (/calendar/base/content/preferences/connection.js)
|
||||
|
|
|
@ -59,6 +59,10 @@ DEFINES += \
|
|||
-DTHEME=$(THEME) \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_UPDATER
|
||||
DEFINES += -DMOZ_UPDATER=1
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -140,6 +140,7 @@ function sbOnViewToolbarCommand(aEvent)
|
|||
document.persist(toolbar.id, "collapsed");
|
||||
}
|
||||
|
||||
#ifdef MOZ_UPDATER
|
||||
/**
|
||||
* Checks for available updates using AUS
|
||||
*/
|
||||
|
@ -159,12 +160,14 @@ function sbCheckForUpdates()
|
|||
prompter.checkForUpdates();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Controls the update check menu item
|
||||
*/
|
||||
function sbUpdateItem()
|
||||
{
|
||||
#ifdef MOZ_UPDATER
|
||||
var updateService = Components.classes["@mozilla.org/updates/update-service;1"]
|
||||
.getService(Components.interfaces.nsIApplicationUpdateService);
|
||||
var updateManager = Components.classes["@mozilla.org/updates/update-manager;1"]
|
||||
|
@ -213,4 +216,17 @@ function sbUpdateItem()
|
|||
else {
|
||||
checkForUpdates.removeAttribute("loading");
|
||||
}
|
||||
#else
|
||||
#ifndef XP_MACOSX
|
||||
// Some extensions may rely on these being present so only hide the updates
|
||||
// separator when there are no elements besides the check for updates menuitem
|
||||
// in between the about separator and the updates separator.
|
||||
var updatesSeparator = document.getElementById("menu_HelpUpdatesSeparator");
|
||||
var aboutSeparator = document.getElementById("menu_HelpAboutSeparator");
|
||||
var checkForUpdates = document.getElementById("checkForUpdates");
|
||||
if (updatesSeparator.nextSibling === checkForUpdates &&
|
||||
checkForUpdates.nextSibling === aboutSeparator)
|
||||
updatesSeparator.hidden = true;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -480,7 +480,11 @@
|
|||
class="menuitem-iconic"
|
||||
label="&updateCmd.label;"
|
||||
accesskey="&updateCmd.accesskey;"
|
||||
#ifdef MOZ_UPDATER
|
||||
oncommand="sbCheckForUpdates();"/>
|
||||
#else
|
||||
hidden="true"/>
|
||||
#endif
|
||||
|
||||
# On Mac OS X, the "About Sunbird" menuitem belongs under the "Sunbird" menu.
|
||||
# We hide it (and its separator) here, but we don't ifdef the entire menuitem
|
||||
|
|
|
@ -7,7 +7,7 @@ sunbird.jar:
|
|||
* content/sunbird/aboutDialog.css (content/aboutDialog.css)
|
||||
content/sunbird/aboutDialog.js (content/aboutDialog.js)
|
||||
* content/sunbird/aboutDialog.xul (content/aboutDialog.xul)
|
||||
content/sunbird/applicationUtil.js (content/applicationUtil.js)
|
||||
* content/sunbird/applicationUtil.js (content/applicationUtil.js)
|
||||
* content/sunbird/calendar.xul (content/calendar.xul)
|
||||
content/sunbird/calendar-gotodate-dialog.xul (content/calendar-gotodate-dialog.xul)
|
||||
content/sunbird/calendar-offline.js (content/calendar-offline.js)
|
||||
|
|
Загрузка…
Ссылка в новой задаче