mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-22 07:41:20 -04:00
scroll to previously selected item(s) at next redisplay
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1533 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
04db41a45c
commit
98eb6b835d
1 changed files with 10 additions and 1 deletions
|
@ -588,6 +588,8 @@ void TransfersDialog::insertTransfers()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* view will be scrolled to first selected index */
|
||||||
|
QModelIndex firstSelIdx;
|
||||||
|
|
||||||
/* get expanded donwload items */
|
/* get expanded donwload items */
|
||||||
std::list<std::string> expandedIds;
|
std::list<std::string> expandedIds;
|
||||||
|
@ -673,6 +675,8 @@ void TransfersDialog::insertTransfers()
|
||||||
if (selectedIds.end() != std::find(selectedIds.begin(), selectedIds.end(), info.hash)) {
|
if (selectedIds.end() != std::find(selectedIds.begin(), selectedIds.end(), info.hash)) {
|
||||||
selection->select(DLListModel->index(dlCount, NAME),
|
selection->select(DLListModel->index(dlCount, NAME),
|
||||||
QItemSelectionModel::Rows | QItemSelectionModel::SelectCurrent);
|
QItemSelectionModel::Rows | QItemSelectionModel::SelectCurrent);
|
||||||
|
if (!firstSelIdx.isValid())
|
||||||
|
firstSelIdx = DLListModel->index(dlCount, NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* expand last expanded items */
|
/* expand last expanded items */
|
||||||
|
@ -705,7 +709,7 @@ void TransfersDialog::insertTransfers()
|
||||||
sources = QString("rShare v") + QString::fromStdString(vit->second);
|
sources = QString("rShare v") + QString::fromStdString(vit->second);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info.downloadStatus == FT_STATE_COMPLETE) {
|
if (pit->status == FT_STATE_COMPLETE) {
|
||||||
status = tr("Complete");
|
status = tr("Complete");
|
||||||
} else {
|
} else {
|
||||||
status = tr("Unknown");
|
status = tr("Unknown");
|
||||||
|
@ -781,11 +785,16 @@ void TransfersDialog::insertTransfers()
|
||||||
if (selectedIds.end() != std::find(selectedIds.begin(), selectedIds.end(), dit->hash)) {
|
if (selectedIds.end() != std::find(selectedIds.begin(), selectedIds.end(), dit->hash)) {
|
||||||
selection->select(DLListModel->index(dlCount, NAME),
|
selection->select(DLListModel->index(dlCount, NAME),
|
||||||
QItemSelectionModel::Rows | QItemSelectionModel::SelectCurrent);
|
QItemSelectionModel::Rows | QItemSelectionModel::SelectCurrent);
|
||||||
|
if (!firstSelIdx.isValid())
|
||||||
|
firstSelIdx = DLListModel->index(dlCount, NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
dlCount++;
|
dlCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* scroll to first selected index if any */
|
||||||
|
if (firstSelIdx.isValid())
|
||||||
|
ui.downloadList->scrollTo(firstSelIdx);
|
||||||
|
|
||||||
for(it = upHashes.begin(); it != upHashes.end(); it++)
|
for(it = upHashes.begin(); it != upHashes.end(); it++)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue