- Updated changelog

- Made sorting work in the finished torrents list
This commit is contained in:
Christophe Dumez 2007-04-11 13:19:58 +00:00
parent 762df4b914
commit cfe979c8dd
4 changed files with 88 additions and 2 deletions

View file

@ -1,19 +1,28 @@
* Unknown - Christophe Dumez <chris@qbittorrent.org> - v0.10.0
- FEATURE: Added UPnP / NAT-PMP port forwarding support
- FEATURE: Added RSS support
- FEATURE: Finished torrents are moved to another tab
- FEATURE: Finished torrents are now moved to another tab for seeding
- FEATURE: Display more infos about the torrent in its properties
- FEATURE: Allow the user to edit torrents' trackers
- FEATURE: Allow user to change qBT's style (Plastique, Cleanlooks, Motif, CDE, MacOSX, WinXP)
- FEATURE: Allow the user to disable system tray integration
- FEATURE: Search engine is now using one thread per website for faster results
- FEATURE: Improved a lot the torrent creation module
- FEATURE: Allow to set upload/download limit per torrent (right click)
- FEATURE: Ask for exit confirmation only if download list is not empty
- BUGFIX: Window can now stay maximized on exit
- COSMETIC: Redesigned torrent properties a little
- COSMETIC: Redesigned options a little
- COSMETIC: Display more logs messages concerning features
* Tue Apr 10 2007 - Christophe Dumez <chris@qbittorrent.org> - v0.9.2
- BUGFIX: Window can now stay maximized on exit
- BUGFIX: Use PKGCONFIG again for configuring libtorrent
- BUGFIX: Allow to compile with libtorrent v0.11
- BUGFIX: Disabled main window context menu (annoying)
- I18N: Added Japanese translation
- I18N: Updated Turkish translation
* Wed Apr 04 2007 - Christophe Dumez <chris@qbittorrent.org> - v0.9.1
- BUGFIX: A lot of fixes in configure file

3
TODO
View file

@ -47,4 +47,5 @@
- Improve ratio display / calculation / saving / per torrent...
- Use buttonboxes when possible
- Display the sum of the size of the selected files in the torrent instead of the whole torrent size in download list
- Support column sorting in finished list
- Support column sorting in finished list
- Sorting in Download Status column should be smarter than just an alphabetical sort

View file

@ -47,6 +47,10 @@ FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession){
if(!loadColWidthFinishedList()){
finishedList->header()->resizeSection(0, 200);
}
// Make download list header clickable for sorting
finishedList->header()->setClickable(true);
finishedList->header()->setSortIndicatorShown(true);
connect(finishedList->header(), SIGNAL(sectionPressed(int)), this, SLOT(sortFinishedList(int)));
finishedListDelegate = new DLListDelegate();
finishedList->setItemDelegate(finishedListDelegate);
connect(finishedList, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(displayFinishedListMenu(const QPoint&)));
@ -111,6 +115,75 @@ void FinishedTorrents::setRowColor(int row, const QString& color){
}
}
void FinishedTorrents::sortFinishedList(int index){
static Qt::SortOrder sortOrder = Qt::AscendingOrder;
if(finishedList->header()->sortIndicatorSection() == index){
if(sortOrder == Qt::AscendingOrder){
sortOrder = Qt::DescendingOrder;
}else{
sortOrder = Qt::AscendingOrder;
}
}
finishedList->header()->setSortIndicator(index, sortOrder);
switch(index){
case SIZE:
case ETA:
case UPSPEED:
case DLSPEED:
case PROGRESS:
sortFinishedListFloat(index, sortOrder);
break;
default:
sortFinishedListString(index, sortOrder);
}
}
void FinishedTorrents::sortFinishedListFloat(int index, Qt::SortOrder sortOrder){
QList<QPair<int, double> > lines;
// insertion sorting
unsigned int nbRows = finishedListModel->rowCount();
for(unsigned int i=0; i<nbRows; ++i){
misc::insertSort(lines, QPair<int,double>(i, finishedListModel->data(finishedListModel->index(i, index)).toDouble()), sortOrder);
}
// Insert items in new model, in correct order
unsigned int nbRows_old = lines.size();
for(unsigned int row=0; row<nbRows_old; ++row){
finishedListModel->insertRow(finishedListModel->rowCount());
unsigned int sourceRow = lines[row].first;
unsigned int nbColumns = finishedListModel->columnCount();
for(unsigned int col=0; col<nbColumns; ++col){
finishedListModel->setData(finishedListModel->index(nbRows_old+row, col), finishedListModel->data(finishedListModel->index(sourceRow, col)));
finishedListModel->setData(finishedListModel->index(nbRows_old+row, col), finishedListModel->data(finishedListModel->index(sourceRow, col), Qt::DecorationRole), Qt::DecorationRole);
finishedListModel->setData(finishedListModel->index(nbRows_old+row, col), finishedListModel->data(finishedListModel->index(sourceRow, col), Qt::TextColorRole), Qt::TextColorRole);
}
}
// Remove old rows
finishedListModel->removeRows(0, nbRows_old);
}
void FinishedTorrents::sortFinishedListString(int index, Qt::SortOrder sortOrder){
QList<QPair<int, QString> > lines;
// Insertion sorting
unsigned int nbRows = finishedListModel->rowCount();
for(unsigned int i=0; i<nbRows; ++i){
misc::insertSortString(lines, QPair<int, QString>(i, finishedListModel->data(finishedListModel->index(i, index)).toString()), sortOrder);
}
// Insert items in new model, in correct order
unsigned int nbRows_old = lines.size();
for(unsigned int row=0; row<nbRows_old; ++row){
finishedListModel->insertRow(finishedListModel->rowCount());
unsigned int sourceRow = lines[row].first;
unsigned int nbColumns = finishedListModel->columnCount();
for(unsigned int col=0; col<nbColumns; ++col){
finishedListModel->setData(finishedListModel->index(nbRows_old+row, col), finishedListModel->data(finishedListModel->index(sourceRow, col)));
finishedListModel->setData(finishedListModel->index(nbRows_old+row, col), finishedListModel->data(finishedListModel->index(sourceRow, col), Qt::DecorationRole), Qt::DecorationRole);
finishedListModel->setData(finishedListModel->index(nbRows_old+row, col), finishedListModel->data(finishedListModel->index(sourceRow, col), Qt::TextColorRole), Qt::TextColorRole);
}
}
// Remove old rows
finishedListModel->removeRows(0, nbRows_old);
}
// Load columns width in a file that were saved previously
// (finished list)
bool FinishedTorrents::loadColWidthFinishedList(){

View file

@ -55,6 +55,9 @@ class FinishedTorrents : public QWidget, public Ui::seeding{
void displayFinishedListMenu(const QPoint&);
void setRowColor(int row, const QString& color);
void saveColWidthFinishedList() const;
void sortFinishedList(int index);
void sortFinishedListFloat(int index, Qt::SortOrder sortOrder);
void sortFinishedListString(int index, Qt::SortOrder sortOrder);
protected slots:
void on_actionSet_upload_limit_triggered();