48 Components.utils.import(
"resource://app/jsmodules/AddOnUtils.jsm");
49 Components.utils.import(
"resource://app/jsmodules/StringUtils.jsm");
59 if (typeof(
Cc) ==
"undefined")
60 var
Cc = Components.classes;
61 if (typeof(
Ci) ==
"undefined")
62 var
Ci = Components.interfaces;
63 if (typeof(
Cr) ==
"undefined")
64 var
Cr = Components.results;
65 if (typeof(
Cu) ==
"undefined")
66 var
Cu = Components.utils;
88 _dialogParameterBlock:
null,
90 _domEventListenerSet:
null,
92 _addOnBundleInstallerElem:
null,
93 _restartRequired:
false,
106 doLoad:
function recommendedAddOnsWizard_doLoad() {
116 doUnload:
function recommendedAddOnsWizard_doUnload() {
118 if (this._dialogParameterBlock) {
119 if (this._restartRequired)
120 this._dialogParameterBlock.SetString(0,
"true");
122 this._dialogParameterBlock.SetString(0,
"false");
134 doFinish:
function recommendedAddOnsWizard_doFinish() {
136 if (this._addOnBundle) {
137 var extensionCount = this._addOnBundle.bundleExtensionCount;
138 for (var
i = 0;
i < extensionCount;
i++) {
140 var addOnID = this._addOnBundle.getExtensionAttribute(
i,
"id");
153 doShowAddOnBundleInstallPage:
154 function recommendedAddOnsWizard_doShowAddOnBundleInstallPage() {
156 var installRequired =
false;
157 var extensionCount = this._addOnBundle.bundleExtensionCount;
158 for (var
i = 0;
i < extensionCount;
i++) {
159 if (this._addOnBundle.getExtensionInstallFlag(
i)) {
160 installRequired =
true;
166 if (installRequired) {
167 this._addOnBundleInstallerElem.install(this._addOnBundle);
169 this._wizardElem.canAdvance =
true;
170 this._wizardElem.advance();
182 function recommendedAddOnsWizard__doInstallComplete(aEvent) {
184 this._restartRequired = this._addOnBundleInstallerElem.restartRequired;
188 if (this._addOnBundleInstallerElem.errorCount == 0) {
190 this._wizardElem.canAdvance =
true;
191 this._wizardElem.advance();
194 var okButton = this._wizardElem.getButton(
"next");
195 okButton.label =
SBString(
"recommended_add_ons.ok.label");
196 okButton.accessKey =
SBString(
"recommended_add_ons.ok.accesskey");
200 document.getElementById(
"recommended_add_ons_installation_page");
201 wizardPageElem.setAttribute(
"hidecancel",
"true");
202 wizardPageElem.setAttribute(
"shownext",
"true");
217 _initialize:
function recommendedAddOnsWizard__initialize() {
220 this._dialogParameterBlock =
221 window.arguments[0].QueryInterface(Ci.nsIDialogParamBlock);
223 this._dialogParameterBlock.objects.queryElementAt(0, Ci.sbIBundle);
226 (
"Recommended add-ons wizard opened with invalid parameters.");
232 var addOnCount = this._addOnBundle.bundleExtensionCount;
235 var addOnBundleElem = document.getElementById(
"recommended_add_on_bundle");
236 addOnBundleElem.addOnBundle = this._addOnBundle;
239 var headerElem = document.getElementById(
"recommended_add_ons_header");
241 (
"recommended_add_ons.header.label", addOnCount);
244 var descriptionText =
246 var descriptionTextNode = document.createTextNode(descriptionText);
247 var descriptionElem =
248 document.getElementById(
"recommended_add_ons_description");
249 descriptionElem.appendChild(descriptionTextNode);
252 this._wizardElem = document.getElementById
253 (
"recommended_add_ons_update_wizard");
260 var func =
function(aEvent) {
return _this._doInstallComplete(aEvent); };
261 this._addOnBundleInstallerElem = document.getElementById
262 (
"add_on_bundle_installer");
263 this._domEventListenerSet.add(this._addOnBundleInstallerElem,
274 _finalize:
function recommendedAddOnsWizard__finalize() {
276 if (this._domEventListenerSet)
277 this._domEventListenerSet.removeAll();
278 this._domEventListenerSet =
null;
281 this._dialogParameterBlock =
null;
282 this._addOnBundle =
null;
283 this._wizardElem =
null;
284 this._addOnBundleInstallerElem =
null;
function onExit(skipSave)
onExit handler, saves window size and position before closing the window.
function DOMEventListenerSet()
function SBString(aKey, aDefault, aStringBundle)
function SBFormattedCountString(aKeyBase, aCount, aParams, aDefault, aStringBundle)
_getSelectedPageStyle s i
function AddOnBundleLoader()
var recommendedAddOnsWizard