Bug #220656 --> store the mail view state as a per folder property instead of as a global setting that applies to all folders.

sr=bienvenu


git-svn-id: svn://10.0.0.236/trunk@164594 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
scott%scott-macgregor.org 2004-10-29 07:11:18 +00:00
parent efd6332188
commit a86969e97a
4 changed files with 49 additions and 20 deletions

View File

@ -263,18 +263,32 @@ var folderListener = {
viewDebug("selected folder is virtual\n");
gDefaultSearchViewTerms = null;
}
else if (gDefaultSearchViewTerms)
{
viewDebug("searching gDefaultSearchViewTerms and rerootingFolder\n");
Search("");
}
else
{
viewDebug("changing view by value\n");
ViewChangeByValue(pref.getIntPref("mailnews.view.last"));
{
// get the view value from the folder
var msgFolder = folder.QueryInterface(Components.interfaces.nsIMsgFolder);
if (msgFolder)
{
var msgDatabase = msgFolder.getMsgDatabase(msgWindow);
var dbFolderInfo = msgDatabase.dBFolderInfo;
var result = dbFolderInfo.getUint32Property("current-view", 0);
// if our new view is the same as the old view and we already have the list of search terms built up
// for the old view, just re-use it
if (gCurrentViewValue == result && gDefaultSearchViewTerms)
{
viewDebug("searching gDefaultSearchViewTerms and rerootingFolder\n");
Search("");
}
else
{
viewDebug("changing view by value\n");
ViewChangeByValue(result);
}
}
}
}
}
}
}
else if (eventType == "ImapHdrDownloaded") {
if (folder) {

View File

@ -271,15 +271,29 @@ var folderListener = {
gDefaultSearchViewTerms = null;
ViewChangeByValue(-1); // override current view
}
else if (gDefaultSearchViewTerms)
{
viewDebug("searching gDefaultSearchViewTerms and rerootingFolder\n");
Search("");
}
else
{
viewDebug("changing view by value\n");
ViewChangeByValue(pref.getIntPref("mailnews.view.last"));
{
// get the view value from the folder
var msgFolder = folder.QueryInterface(Components.interfaces.nsIMsgFolder);
if (msgFolder)
{
var msgDatabase = msgFolder.getMsgDatabase(msgWindow);
var dbFolderInfo = msgDatabase.dBFolderInfo;
var result = dbFolderInfo.getUint32Property("current-view", 0);
// if our new view is the same as the old view and we already have the list of search terms built up
// for the old view, just re-use it
if (gCurrentViewValue == result && gDefaultSearchViewTerms)
{
viewDebug("searching gDefaultSearchViewTerms and rerootingFolder\n");
Search("");
}
else
{
viewDebug("changing view by value\n");
ViewChangeByValue(result);
}
}
}
}
}

View File

@ -100,7 +100,10 @@ function viewChange(aMenuList, val)
{
if (aMenuList.selectedItem)
gCurrentViewLabel = aMenuList.selectedItem.label;
gPrefBranch.setIntPref("mailnews.view.last", parseInt(val));
var msgDatabase = GetFirstSelectedMsgFolder().getMsgDatabase(msgWindow);
var dbFolderInfo = msgDatabase.dBFolderInfo;
dbFolderInfo.setUint32Property("current-view", parseInt(val));
}
// if we're switching to -1 (virtual folder), don't do a search
if (val != "-1" && val != -1)

View File

@ -596,8 +596,6 @@ pref("mail.password_protect_local_cache", false);
// overridden by stand alone mail
pref("mail.standalone", false);
pref("mailnews.view.last",0); // 0 == "all" view
#ifdef XP_WIN
// Unread mail count timer. Value to be specified in seconds
// default is 5 minutes, i.e., 5 * 60 seconds = 300