From 04666c2c63c4373e8fdf8b76e227de9ae10f2d62 Mon Sep 17 00:00:00 2001 From: "doronr%us.ibm.com" Date: Mon, 16 Jan 2006 16:11:34 +0000 Subject: [PATCH] Bug 264282 - PFS never tells what type of plugin is needed if no plugin is found. r/a=mconnor git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@187686 18797224-902f-48f8-a5cc-f745e15eee43 --- .../chrome/mozapps/plugins/plugins.properties | 2 +- .../plugins/content/pluginInstallerWizard.js | 31 +++++++++++++------ .../plugins/content/pluginInstallerWizard.xul | 2 ++ 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/mozilla/toolkit/locales/en-US/chrome/mozapps/plugins/plugins.properties b/mozilla/toolkit/locales/en-US/chrome/mozapps/plugins/plugins.properties index 6229ae487f0..7c1ffcad63b 100644 --- a/mozilla/toolkit/locales/en-US/chrome/mozapps/plugins/plugins.properties +++ b/mozilla/toolkit/locales/en-US/chrome/mozapps/plugins/plugins.properties @@ -18,7 +18,7 @@ pluginInstallationSummary.manualInstall.tooltip=Manually install the plugin. pluginInstallation.noPluginsFound=No suitable plugins were found. pluginInstallation.noPluginsInstalled=No plugins were installed. -pluginInstallation.unknownPlugin=Unknown Plugin +pluginInstallation.unknownPlugin=Unknown Plugin (%S) missingPlugin.label=Click here to download plugin. diff --git a/mozilla/toolkit/mozapps/plugins/content/pluginInstallerWizard.js b/mozilla/toolkit/mozapps/plugins/content/pluginInstallerWizard.js index aed51730579..8a3ee90777a 100644 --- a/mozilla/toolkit/mozapps/plugins/content/pluginInstallerWizard.js +++ b/mozilla/toolkit/mozapps/plugins/content/pluginInstallerWizard.js @@ -55,6 +55,9 @@ function nsPluginInstallerWizard(){ // array holding pids of plugins that require a license this.mPluginLicenseArray = new Array(); + // how many plugins are to be installed + this.pluginsToInstallNum = 0; + this.mTab = null; this.mSuccessfullPluginInstallation = 0; @@ -163,14 +166,14 @@ nsPluginInstallerWizard.prototype.showPluginList = function (){ nsPluginInstallerWizard.prototype.toggleInstallPlugin = function (aPid, aCheckbox) { this.mPluginInfoArray[aPid].toBeInstalled = aCheckbox.checked; - // if no plugins are checked, don't allow to advance - var pluginsToInstallNum = 0; + // if no plugins are checked, don't allow to advance + this.pluginsToInstallNum = 0; for (pluginInfoItem in this.mPluginInfoArray){ if (this.mPluginInfoArray[pluginInfoItem].toBeInstalled) - pluginsToInstallNum++; + this.pluginsToInstallNum++; } - if (pluginsToInstallNum > 0) + if (this.pluginsToInstallNum > 0) this.canAdvance(true); else this.canAdvance(false); @@ -218,7 +221,11 @@ nsPluginInstallerWizard.prototype.showLicenses = function (){ } nsPluginInstallerWizard.prototype.enableNext = function (){ - gPluginInstaller.canAdvance(true); + // if only one plugin exists, don't enable the next button until + // the license is accepted + if (gPluginInstaller.pluginsToInstallNum > 1) + gPluginInstaller.canAdvance(true); + document.getElementById("licenseRadioGroup1").disabled = false; document.getElementById("licenseRadioGroup2").disabled = false; } @@ -306,6 +313,12 @@ nsPluginInstallerWizard.prototype.storeLicenseRadioGroup = function (){ pluginInfo.licenseAccepted = !document.getElementById("licenseRadioGroup").selectedIndex; } +nsPluginInstallerWizard.prototype.licenseRadioGroupChange = function(aAccepted) { + // only if one plugin is to be installed should selection change the next button + if (this.pluginsToInstallNum == 1) + this.canAdvance(aAccepted); +} + nsPluginInstallerWizard.prototype.advancePage = function (aPageId, aCanAdvance, aCanRewind, aCanCancel){ this.canAdvance(true); document.getElementById("plugin-installer-wizard").advance(aPageId); @@ -503,14 +516,14 @@ nsPluginInstallerWizard.prototype.showPluginResults = function (){ var pluginRequest = this.mPluginRequestArray[pluginInfoItem]; // if there is a pluginspage, show UI - if (pluginRequest && pluginRequest.pluginsPage) { + if (pluginRequest) { this.addPluginResultRow( "", - this.getString("pluginInstallation.unknownPlugin"), - pluginInfoItem, + this.getFormattedString("pluginInstallation.unknownPlugin", [pluginInfoItem]), null, null, - this.mPluginRequestArray[pluginInfoItem].pluginsPage); + null, + pluginRequest.pluginsPage); } notInstalledList += "&mimetype=" + pluginInfoItem; diff --git a/mozilla/toolkit/mozapps/plugins/content/pluginInstallerWizard.xul b/mozilla/toolkit/mozapps/plugins/content/pluginInstallerWizard.xul index ccc935a9c1b..8083f9e9998 100644 --- a/mozilla/toolkit/mozapps/plugins/content/pluginInstallerWizard.xul +++ b/mozilla/toolkit/mozapps/plugins/content/pluginInstallerWizard.xul @@ -98,8 +98,10 @@