Bug 392362 - Make a pref to control the number of days for which we display download history. Patch by Edward Lee <edilee@mozilla.com>. r=sdwilsh

This commit is contained in:
sdwilsh@shawnwilsher.com 2007-08-17 15:19:08 -07:00
Родитель 0a283480db
Коммит a72b5a46eb
2 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -213,6 +213,7 @@ pref("browser.download.manager.closeWhenDone", false);
pref("browser.download.manager.openDelay", 0);
pref("browser.download.manager.focusWhenStarting", false);
pref("browser.download.manager.flashCount", 2);
pref("browser.download.manager.displayedHistoryDays", 7);
// search engines URL
pref("browser.search.searchEnginesURL", "https://%LOCALE%.add-ons.mozilla.com/%LOCALE%/firefox/%VERSION%/search-engines/");

Просмотреть файл

@ -47,6 +47,8 @@
const PREF_BDM_CLOSEWHENDONE = "browser.download.manager.closeWhenDone";
const PREF_BDM_ALERTONEXEOPEN = "browser.download.manager.alertOnEXEOpen";
const PREF_BDM_RETENTION = "browser.download.manager.retention";
const PREF_BDM_DISPLAYEDHISTORYDAYS =
"browser.download.manager.displayedHistoryDays";
const nsLocalFile = Components.Constructor("@mozilla.org/file/local;1",
"nsILocalFile", "initWithPath");
@ -606,7 +608,11 @@ function openExternal(aFile)
function buildDefaultView()
{
buildActiveDownloadsList();
buildDownloadListWithTime(Date.now() - 24 * 3600 * 1000 * 7); // One week
let pref = Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefBranch);
let days = pref.getIntPref(PREF_BDM_DISPLAYEDHISTORYDAYS);
buildDownloadListWithTime(Date.now() - days * 24 * 60 * 60 * 1000);
// select the first visible download item, if any
var children = gDownloadsView.children;