diff --git a/browser/base/content/aboutDialog.css b/browser/base/content/aboutDialog.css index f34522ea464..47340666a06 100644 --- a/browser/base/content/aboutDialog.css +++ b/browser/base/content/aboutDialog.css @@ -3,7 +3,7 @@ -moz-padding-end: 0; padding-bottom: 10px; -moz-padding-start: 0; - width: 600px; + width: 620px; } #clientBox { @@ -58,10 +58,6 @@ -moz-padding-start: 0; } -#updateBox { - margin-bottom: 10px; -} - #updateButton, #updateDeck > hbox > label { -moz-margin-start: 0; @@ -99,3 +95,36 @@ color: #999999; margin-top: 10px; } + +#currentChannel { + margin: 0; + padding: 0; + font-weight: bold; +} + +#channelSelector { + margin-top: 10px; +} + +#channelMenulist { + margin: 0; +} + +.channel-description { + margin: 10px 0; + text-align: center; +} + +#detailsBox, +#channelSelector, +.channel-description { + -moz-transition: opacity 250ms; +} + +#contentDeck:not([selectedIndex="0"]) > #detailsBox, +#contentDeck:not([selectedIndex="1"]) > #channelSelector, +#channelDescriptionDeck:not([selectedIndex="0"]) > #releaseDescription, +#channelDescriptionDeck:not([selectedIndex="1"]) > #betaDescription, +#channelDescriptionDeck:not([selectedIndex="2"]) > #auroraDescription { + opacity: 0; +} diff --git a/browser/base/content/aboutDialog.js b/browser/base/content/aboutDialog.js index bcfbc94f91e..4d00acca6be 100644 --- a/browser/base/content/aboutDialog.js +++ b/browser/base/content/aboutDialog.js @@ -88,6 +88,8 @@ function init(aEvent) gAppUpdater = new appUpdater(); #endif + gChannelSelector.init(); + #ifdef XP_MACOSX // it may not be sized at this point, and we need its width to calculate its position window.sizeToContent(); @@ -572,3 +574,68 @@ appUpdater.prototype = } }; #endif + +var gChannelSelector = { + validChannels: { release: 1, beta: 1, aurora: 1 }, + + init: function() { + try { + this.channelValue = Services.prefs.getCharPref("app.update.desiredChannel"); + } catch (e) { + let defaults = Services.prefs.getDefaultBranch(""); + this.channelValue = defaults.getCharPref("app.update.channel"); + } + + // Only show channel selector UI on valid update channels. + if (this.channelValue in this.validChannels) { + document.getElementById("currentChannelText").hidden = false; + this.setChannelLabel(this.channelValue); + this.setChannelMenuitem(this.channelValue); + } + }, + + selectChannel: function(aSelectedItem) { + document.getElementById("channelDescriptionDeck").selectedPanel = + document.getElementById(aSelectedItem.value + "Description"); + }, + + cancel: function() { + this.setChannelMenuitem(this.channelValue); + this.hide(); + }, + + apply: function() { + this.channelValue = document.getElementById("channelMenulist").selectedItem.value; + this.setChannelLabel(this.channelValue); + + // Change app update channel. + Services.prefs.setCharPref("app.update.desiredChannel", this.channelValue); + + // App updater will look at app.update.desiredChannel for new channel value + // and will clear it when the update is complete. + gAppUpdater.isChecking = true; + gAppUpdater.checker.checkForUpdates(gAppUpdater.updateCheckListener, true); + + this.hide(); + }, + + show: function() { + document.getElementById("contentDeck").selectedPanel = + document.getElementById("channelSelector"); + }, + + hide: function() { + document.getElementById("contentDeck").selectedPanel = + document.getElementById("detailsBox"); + }, + + setChannelLabel: function(aValue) { + let channelLabel = document.getElementById("currentChannel"); + channelLabel.value = document.getElementById(aValue + "Menuitem").label; + }, + + setChannelMenuitem: function(aValue) { + document.getElementById("channelMenulist").selectedItem = + document.getElementById(aValue + "Menuitem"); + } +} diff --git a/browser/base/content/aboutDialog.xul b/browser/base/content/aboutDialog.xul index 9348ee6b4be..5a351971cec 100644 --- a/browser/base/content/aboutDialog.xul +++ b/browser/base/content/aboutDialog.xul @@ -77,44 +77,81 @@ #expand