bug 474701, back out virtual folder changes that affect the UI. bustage fix.
This commit is contained in:
Родитель
d5113ef829
Коммит
fdea8809fd
|
@ -37,8 +37,6 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
Component.utils.import("resource://app/modules/virtualFolderWrapper.js");
|
||||
|
||||
var gPickedFolder;
|
||||
var gMailView = null;
|
||||
var msgWindow; // important, don't change the name of this variable. it's really a global used by commandglue.js
|
||||
|
@ -232,9 +230,7 @@ function onOK()
|
|||
}
|
||||
|
||||
saveSearchTerms(gSearchTermSession.searchTerms, gSearchTermSession);
|
||||
VirtualFolderHelper.createVirtualFolder(
|
||||
name, parentFolder, gSearchFolderURIs, gSearchTermSession.searchTerms,
|
||||
searchOnline);
|
||||
CreateVirtualFolder(name, parentFolder, gSearchFolderURIs, gSearchTermSession.searchTerms, searchOnline);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -1012,6 +1012,40 @@ function getSearchTermString(searchTerms)
|
|||
return condition;
|
||||
}
|
||||
|
||||
function CreateVirtualFolder(newName, parentFolder, searchFolderURIs, searchTerms, searchOnline)
|
||||
{
|
||||
// ### need to make sure view/folder doesn't exist.
|
||||
if (searchFolderURIs && (searchFolderURIs != "") && newName && (newName != ""))
|
||||
{
|
||||
try
|
||||
{
|
||||
var newFolder = parentFolder.addSubfolder(newName);
|
||||
newFolder.setFlag(Components.interfaces.nsMsgFolderFlags.Virtual);
|
||||
var vfdb = newFolder.msgDatabase;
|
||||
var searchTermString = getSearchTermString(searchTerms);
|
||||
var dbFolderInfo = vfdb.dBFolderInfo;
|
||||
// set the view string as a property of the db folder info
|
||||
// set the original folder name as well.
|
||||
dbFolderInfo.setCharProperty("searchStr", searchTermString);
|
||||
dbFolderInfo.setCharProperty("searchFolderUri", searchFolderURIs);
|
||||
dbFolderInfo.setBooleanProperty("searchOnline", searchOnline);
|
||||
vfdb.summaryValid = true;
|
||||
vfdb.Close(true);
|
||||
parentFolder.NotifyItemAdded(newFolder);
|
||||
var accountManager = Components.classes["@mozilla.org/messenger/account-manager;1"].getService(Components.interfaces.nsIMsgAccountManager);
|
||||
accountManager.saveVirtualFolders();
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
throw(e); // so that the dialog does not automatically close
|
||||
dump ("Exception : creating virtual folder \n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dump("no name or nothing selected\n");
|
||||
}
|
||||
}
|
||||
|
||||
var searchSessionContractID = "@mozilla.org/messenger/searchSession;1";
|
||||
var gSearchView;
|
||||
|
|
Загрузка…
Ссылка в новой задаче