зеркало из https://github.com/mozilla/gecko-dev.git
Bug 88593 Make Ctrl+click on thread icon augment entire thread r=mscott sr=bienvenu
This commit is contained in:
Родитель
3d365a7700
Коммит
43971718ba
|
@ -319,6 +319,7 @@ interface nsIMsgDBView : nsISupports
|
||||||
readonly attribute boolean removeRowOnMoveOrDelete;
|
readonly attribute boolean removeRowOnMoveOrDelete;
|
||||||
|
|
||||||
nsMsgViewIndex findIndexFromKey(in nsMsgKey aMsgKey, in boolean aExpand);
|
nsMsgViewIndex findIndexFromKey(in nsMsgKey aMsgKey, in boolean aExpand);
|
||||||
|
void ExpandAndSelectThreadByIndex(in nsMsgViewIndex aIndex, in boolean aAugment);
|
||||||
};
|
};
|
||||||
|
|
||||||
/* this interface is rapidly morphing from a command updater interface into a more generic
|
/* this interface is rapidly morphing from a command updater interface into a more generic
|
||||||
|
|
|
@ -82,6 +82,11 @@ function ThreadPaneOnClick(event)
|
||||||
else if (col.value.id == "junkStatusCol") {
|
else if (col.value.id == "junkStatusCol") {
|
||||||
MsgJunkMailInfo(true);
|
MsgJunkMailInfo(true);
|
||||||
}
|
}
|
||||||
|
else if (col.value.id == "threadCol" && !event.shiftKey &&
|
||||||
|
(event.ctrlKey || event.metaKey)) {
|
||||||
|
gDBView.ExpandAndSelectThreadByIndex(row.value, true);
|
||||||
|
event.preventBubble();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1646,7 +1646,7 @@ NS_IMETHODIMP nsMsgDBView::CycleCell(PRInt32 row, nsITreeColumn* col)
|
||||||
case 't': // threaded cell or total cell
|
case 't': // threaded cell or total cell
|
||||||
if (colID[1] == 'h')
|
if (colID[1] == 'h')
|
||||||
{
|
{
|
||||||
ExpandAndSelectThreadByIndex(row);
|
ExpandAndSelectThreadByIndex(row, PR_FALSE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'f': // flagged column
|
case 'f': // flagged column
|
||||||
|
@ -3873,12 +3873,12 @@ nsresult nsMsgDBView::ExpandAndSelectThread()
|
||||||
rv = mTreeSelection->GetCurrentIndex(&index);
|
rv = mTreeSelection->GetCurrentIndex(&index);
|
||||||
NS_ENSURE_SUCCESS(rv,rv);
|
NS_ENSURE_SUCCESS(rv,rv);
|
||||||
|
|
||||||
rv = ExpandAndSelectThreadByIndex(index);
|
rv = ExpandAndSelectThreadByIndex(index, PR_FALSE);
|
||||||
NS_ENSURE_SUCCESS(rv,rv);
|
NS_ENSURE_SUCCESS(rv,rv);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult nsMsgDBView::ExpandAndSelectThreadByIndex(nsMsgViewIndex index)
|
nsresult nsMsgDBView::ExpandAndSelectThreadByIndex(nsMsgViewIndex index, PRBool augment)
|
||||||
{
|
{
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
|
|
||||||
|
@ -3921,26 +3921,9 @@ nsresult nsMsgDBView::ExpandAndSelectThreadByIndex(nsMsgViewIndex index)
|
||||||
NS_ASSERTION(mTreeSelection, "no tree selection");
|
NS_ASSERTION(mTreeSelection, "no tree selection");
|
||||||
if (!mTreeSelection) return NS_ERROR_UNEXPECTED;
|
if (!mTreeSelection) return NS_ERROR_UNEXPECTED;
|
||||||
|
|
||||||
// clear the existing selection.
|
|
||||||
mTreeSelection->ClearSelection();
|
|
||||||
|
|
||||||
// is this correct when we are selecting multiple items?
|
|
||||||
mTreeSelection->SetCurrentIndex(threadIndex);
|
|
||||||
|
|
||||||
// the count should be 1 or greater. if there was only one message in the thread, we just select it.
|
// the count should be 1 or greater. if there was only one message in the thread, we just select it.
|
||||||
// if more, we select all of them.
|
// if more, we select all of them.
|
||||||
mTreeSelection->RangedSelect(threadIndex, threadIndex + count - 1, PR_TRUE /* augment */);
|
mTreeSelection->RangedSelect(threadIndex + count - 1, threadIndex, augment);
|
||||||
|
|
||||||
if (count == 1) {
|
|
||||||
// if we ended up selecting on message, this will cause us to load it.
|
|
||||||
SelectionChanged();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
//XXX todo, should multiple selection clear the thread pane? see bug #xxxxx
|
|
||||||
//do we want to do something like this to clear the message pane
|
|
||||||
//when the user selects a thread?
|
|
||||||
//NoteChange(?, ?, nsMsgViewNotificationCode::clearMessagePane);
|
|
||||||
}
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -200,7 +200,6 @@ protected:
|
||||||
nsresult CollapseByIndex(nsMsgViewIndex index, PRUint32 *pNumCollapsed);
|
nsresult CollapseByIndex(nsMsgViewIndex index, PRUint32 *pNumCollapsed);
|
||||||
nsresult ExpandAll();
|
nsresult ExpandAll();
|
||||||
nsresult CollapseAll();
|
nsresult CollapseAll();
|
||||||
nsresult ExpandAndSelectThreadByIndex(nsMsgViewIndex index);
|
|
||||||
nsresult ExpandAndSelectThread();
|
nsresult ExpandAndSelectThread();
|
||||||
|
|
||||||
// helper routines for thread expanding and collapsing.
|
// helper routines for thread expanding and collapsing.
|
||||||
|
|
Загрузка…
Ссылка в новой задаче