# HG changeset patch # User Frank-Rainer Grahl # Date 1623162001 14400 # Parent 59f0345e963d28e73a2505c4858042381ac0999c Bug 888915 - Part 6. Remove obsolete download prefs. diff --git a/suite/browser/browser-prefs.js b/suite/browser/browser-prefs.js --- a/suite/browser/browser-prefs.js +++ b/suite/browser/browser-prefs.js @@ -56,27 +56,20 @@ pref("browser.send_pings", false); pref("browser.chrome.site_icons", true); pref("browser.chrome.favicons", true); pref("browser.download.finished_download_sound", false); pref("browser.download.finished_sound_url", ""); pref("browser.download.useDownloadDir", false); pref("browser.download.folderList", 1); -pref("browser.download.manager.showAlertOnComplete", true); -pref("browser.download.manager.showAlertInterval", 2000); -pref("browser.download.manager.retention", 2); -pref("browser.download.manager.quitBehavior", 0); pref("browser.download.manager.addToRecentDocs", true); -pref("browser.download.manager.scanWhenDone", true); pref("browser.download.manager.resumeOnWakeDelay", 10000); pref("browser.download.manager.flashCount", 2); -pref("browser.download.manager.showWhenStarting", true); pref("browser.download.manager.focusWhenStarting", false); -pref("browser.download.manager.closeWhenDone", false); pref("browser.download.progress.closeWhenDone", false); // Number of milliseconds to wait for the http headers (and thus // the Content-Disposition filename) before giving up and falling back to // picking a filename without that info in hand so that the user sees some // feedback from their action. pref("browser.download.saveLinkAsFilenameTimeout", 4000); @@ -845,20 +838,16 @@ pref("services.sync.prefs.sync.accessibi pref("services.sync.prefs.sync.accessibility.typeaheadfind.usefindbar", true); pref("services.sync.prefs.sync.addons.ignoreUserEnabledChanges", true); // The addons prefs related to repository verification are intentionally // not synced for security reasons. If a system is compromised, a user // could weaken the pref locally, install an add-on from an untrusted // source, and this would propagate automatically to other, // uncompromised Sync-connected devices. pref("services.sync.prefs.sync.browser.download.manager.behavior", true); -pref("services.sync.prefs.sync.browser.download.manager.closeWhenDone", true); -pref("services.sync.prefs.sync.browser.download.manager.retention", true); -pref("services.sync.prefs.sync.browser.download.manager.showWhenStarting", true); -pref("services.sync.prefs.sync.browser.download.manager.scanWhenDone", true); pref("services.sync.prefs.sync.browser.formfill.enable", true); pref("services.sync.prefs.sync.browser.link.open_external", true); pref("services.sync.prefs.sync.browser.link.open_newwindow", true); pref("services.sync.prefs.sync.browser.offline-apps.notify", true); pref("services.sync.prefs.sync.browser.safebrowsing.malware.enabled", true); pref("services.sync.prefs.sync.browser.safebrowsing.phishing.enabled", true); pref("services.sync.prefs.sync.browser.search.update", true); pref("services.sync.prefs.sync.browser.sessionstore.max_concurrent_tabs", true); diff --git a/suite/components/nsSuiteGlue.js b/suite/components/nsSuiteGlue.js --- a/suite/components/nsSuiteGlue.js +++ b/suite/components/nsSuiteGlue.js @@ -372,17 +372,17 @@ SuiteGlue.prototype = { var timer = Components.classes["@mozilla.org/timer;1"] .createInstance(Components.interfaces.nsITimer); timer.init(this, 3000, timer.TYPE_ONE_SHOT); }, _migrateUI: function() { - const UI_VERSION = 2; + const UI_VERSION = 4; // If the pref is not set this is a new or pre SeaMonkey 2.49 profile. // We can't tell so we just run migration with version 0. let currentUIVersion = 0; if (Services.prefs.prefHasUserValue("suite.migration.version")) { currentUIVersion = Services.prefs.getIntPref("suite.migration.version"); } @@ -446,16 +446,45 @@ SuiteGlue.prototype = { try { if (!Services.prefs.getBoolPref("browser.safebrowsing.enabled")) { Services.prefs.setBoolPref("browser.safebrowsing.phishing.enabled", false); Services.prefs.clearUserPref("browser.safebrowsing.enabled"); } } catch (ex) {} } + // Pretend currentUIVersion 3 never happend (used in 2.57 for a time and became 5). + + // Remove obsolete download preferences set by user. + if (currentUIVersion < 4) { + try { + if (Services.prefs.prefHasUserValue("browser.download.manager.showAlertOnComplete")) { + Services.prefs.clearUserPref("browser.download.manager.showAlertOnComplete"); + } + if (Services.prefs.prefHasUserValue("browser.download.manager.showAlertInterval")) { + Services.prefs.clearUserPref("browser.download.manager.showAlertInterval"); + } + if (Services.prefs.prefHasUserValue("browser.download.manager.retention")) { + Services.prefs.clearUserPref("browser.download.manager.retention"); + } + if (Services.prefs.prefHasUserValue("browser.download.manager.quitBehavior")) { + Services.prefs.clearUserPref("browser.download.manager.quitBehavior"); + } + if (Services.prefs.prefHasUserValue("browser.download.manager.scanWhenDone")) { + Services.prefs.clearUserPref("browser.download.manager.scanWhenDone"); + } + if (Services.prefs.prefHasUserValue("browser.download.manager.showWhenStarting")) { + Services.prefs.clearUserPref("browser.download.manager.showWhenStarting"); + } + if (Services.prefs.prefHasUserValue("browser.download.manager.closeWhenDone")) { + Services.prefs.clearUserPref("browser.download.manager.closeWhenDone"); + } + } catch (ex) {} + } + // Update the migration version. Services.prefs.setIntPref("suite.migration.version", UI_VERSION); }, // Copies additional profile files from the default profile tho the current profile. // Only files not covered by the regular profile creation process. // Currently only the userchrome examples. _copyDefaultProfileFiles: function() diff --git a/suite/components/pref/content/pref-download.js b/suite/components/pref/content/pref-download.js --- a/suite/components/pref/content/pref-download.js +++ b/suite/components/pref/content/pref-download.js @@ -18,22 +18,16 @@ var gSoundUrlPref; function Startup() { // Define globals gFPHandler = Services.io.getProtocolHandler("file") .QueryInterface(Ci.nsIFileProtocolHandler); gSoundUrlPref = document.getElementById("browser.download.finished_sound_url"); setSoundEnabled(document.getElementById("browser.download.finished_download_sound").value); - - // if we don't have the alert service, hide the pref UI for using alerts to - // notify on download completion - // see bug #158711 - var downloadDoneNotificationAlertUI = document.getElementById("finishedNotificationAlert"); - downloadDoneNotificationAlertUI.hidden = !("@mozilla.org/alerts-service;1" in Cc); } /** * Enables/disables the folder field and Browse button based on whether a * default download directory is being used. */ function readUseDownloadDir() { diff --git a/suite/components/pref/content/pref-download.xul b/suite/components/pref/content/pref-download.xul --- a/suite/components/pref/content/pref-download.xul +++ b/suite/components/pref/content/pref-download.xul @@ -27,26 +27,20 @@ type="bool"/> - - - - - - - - - diff --git a/suite/locales/en-US/chrome/common/pref/pref-download.dtd b/suite/locales/en-US/chrome/common/pref/pref-download.dtd --- a/suite/locales/en-US/chrome/common/pref/pref-download.dtd +++ b/suite/locales/en-US/chrome/common/pref/pref-download.dtd @@ -17,24 +17,15 @@ - - - - - - - - -