зеркало из https://github.com/mozilla/gecko-dev.git
Bug 362990: asynchronous message view list manipulation; r=neil, sr=mscott
This commit is contained in:
Родитель
ac8b462aaf
Коммит
872912d232
|
@ -22,6 +22,10 @@
|
|||
*
|
||||
* Contributor(s):
|
||||
* Scott MacGregor <mscott@netscape.com>
|
||||
* Seth Spitzer <sspitzer@netscape.com>
|
||||
* Stefan Borggraefe <borggraefe@despammed.com>
|
||||
* Gervase Markham <gerv@gerv.net>
|
||||
* Karsten Düsterloh <mnyromyr@tprac.de>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
|
@ -40,7 +44,6 @@
|
|||
|
||||
var gMailListView;
|
||||
var gListBox;
|
||||
var gCloseCallback = null;
|
||||
var gEditButton;
|
||||
var gDeleteButton;
|
||||
|
||||
|
@ -49,13 +52,6 @@ function mailViewListOnLoad()
|
|||
gMailListView = Components.classes["@mozilla.org/messenger/mailviewlist;1"].getService(Components.interfaces.nsIMsgMailViewList);;
|
||||
gListBox = document.getElementById('mailViewList');
|
||||
|
||||
if ("arguments" in window && window.arguments[0])
|
||||
{
|
||||
var args = window.arguments[0];
|
||||
if ("onCloseCallback" in args)
|
||||
gCloseCallback = window.arguments[0].onCloseCallback;
|
||||
}
|
||||
|
||||
// Construct list view based on current mail view list data
|
||||
refreshListView(null);
|
||||
gEditButton = document.getElementById('editButton');
|
||||
|
@ -64,19 +60,11 @@ function mailViewListOnLoad()
|
|||
updateButtons();
|
||||
}
|
||||
|
||||
function mailViewListOnUnload()
|
||||
{
|
||||
if (gCloseCallback)
|
||||
gCloseCallback(gListBox.selectedIndex);
|
||||
}
|
||||
|
||||
function refreshListView(aSelectedMailView)
|
||||
{
|
||||
// remove any existing items in the view...
|
||||
for (var index = gListBox.getRowCount(); index > 0; index--)
|
||||
{
|
||||
gListBox.removeChild(gListBox.getItemAtIndex(index - 1));
|
||||
}
|
||||
|
||||
var numItems = gMailListView.mailViewCount;
|
||||
var mailView;
|
||||
|
@ -153,5 +141,3 @@ function updateButtons()
|
|||
gEditButton.disabled = selectedIndex < 0;
|
||||
gDeleteButton.disabled = selectedIndex < 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -22,6 +22,14 @@
|
|||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Scott MacGregor <mscott@netscape.com>
|
||||
Seth Spitzer <sspitzer@netscape.com>
|
||||
Neil Rashbrook <neil@parkwaycc.co.uk>
|
||||
<riceman+bmo@mail.rit.edu>
|
||||
Gervase Markham <gerv@gerv.net>
|
||||
Stefan Borggraefe <Stefan.Borggraefe@gmx.de>
|
||||
Paul Tomlin <paul@wavebreaks.com>
|
||||
Karsten Düsterloh <mnyromyr@tprac.de>
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms of
|
||||
either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
|
@ -49,7 +57,6 @@
|
|||
<dialog id="mailViewListDialog"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="mailViewListOnLoad();"
|
||||
onunload="mailViewListOnUnload()"
|
||||
windowtype="mailnews:mailviewlist"
|
||||
title="&mailViewListTitle.label;"
|
||||
width="400" height="340"
|
||||
|
@ -64,7 +71,6 @@
|
|||
<listcols>
|
||||
<listcol flex="1" width="0"/>
|
||||
</listcols>
|
||||
|
||||
<listhead>
|
||||
<listheader label="&viewName.label;"/>
|
||||
</listhead>
|
||||
|
@ -78,7 +84,3 @@
|
|||
</hbox>
|
||||
</vbox>
|
||||
</dialog>
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -143,12 +143,6 @@ function ViewChangeByValue(aValue)
|
|||
}
|
||||
|
||||
|
||||
function ViewChangeByCustomValue(aCustomValue)
|
||||
{
|
||||
ViewChangeByValue(aCustomValue + kViewItemFirstCustom);
|
||||
}
|
||||
|
||||
|
||||
function UpdateViewPicker(aValue, aLabel)
|
||||
{
|
||||
var viewPicker = document.getElementById("viewPicker");
|
||||
|
@ -200,7 +194,7 @@ function SetMailViewForFolder(aFolder, aValue)
|
|||
if (folderInfo)
|
||||
{
|
||||
// we can't map tags back to labels in general,
|
||||
// so set view to none for backwards compatibility in this case
|
||||
// so set view to all for backwards compatibility in this case
|
||||
folderInfo.setUint32Property (kViewCurrent, isNaN(aValue) ? kViewItemAll : aValue);
|
||||
folderInfo.setCharPtrProperty(kViewCurrentTag, aValue);
|
||||
}
|
||||
|
@ -209,11 +203,7 @@ function SetMailViewForFolder(aFolder, aValue)
|
|||
|
||||
function LaunchCustomizeDialog()
|
||||
{
|
||||
// made it modal, see bug #191188
|
||||
window.openDialog("chrome://messenger/content/mailViewList.xul",
|
||||
"mailnews:mailviewlist",
|
||||
"chrome,modal,titlebar,resizable,centerscreen",
|
||||
{onCloseCallback: ViewChangeByCustomValue});
|
||||
OpenOrFocusWindow({}, "mailnews:mailviewlist", "chrome://messenger/content/mailViewList.xul");
|
||||
}
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче