mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 01:33:07 -07:00
- Allow the user to display torrent properties in finished list
This commit is contained in:
parent
5c53c457e5
commit
cd70dcc3ba
4 changed files with 35 additions and 3 deletions
|
@ -21,6 +21,7 @@
|
|||
#include "FinishedTorrents.h"
|
||||
#include "misc.h"
|
||||
#include "GUI.h"
|
||||
#include "properties_imp.h"
|
||||
#include <QFile>
|
||||
|
||||
FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession){
|
||||
|
@ -147,3 +148,25 @@ QTreeView* FinishedTorrents::getFinishedList(){
|
|||
QStandardItemModel* FinishedTorrents::getFinishedListModel(){
|
||||
return finishedListModel;
|
||||
}
|
||||
|
||||
// Show torrent properties dialog
|
||||
void FinishedTorrents::showProperties(const QModelIndex &index){
|
||||
int row = index.row();
|
||||
QString fileHash = finishedListModel->data(finishedListModel->index(row, HASH)).toString();
|
||||
torrent_handle h = BTSession->getTorrentHandle(fileHash);
|
||||
QStringList errors = ((GUI*)parent)->trackerErrors.value(fileHash, QStringList(tr("None", "i.e: No error message")));
|
||||
properties *prop = new properties(this, h, errors);
|
||||
connect(prop, SIGNAL(changedFilteredFiles(torrent_handle, bool)), BTSession, SLOT(reloadTorrent(torrent_handle, bool)));
|
||||
prop->show();
|
||||
}
|
||||
|
||||
// display properties of selected items
|
||||
void FinishedTorrents::propertiesSelection(){
|
||||
QModelIndexList selectedIndexes = finishedList->selectionModel()->selectedIndexes();
|
||||
QModelIndex index;
|
||||
foreach(index, selectedIndexes){
|
||||
if(index.column() == NAME){
|
||||
showProperties(index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue