mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-22 20:44:15 +00:00
- Allow the user to display torrent properties in finished list
This commit is contained in:
parent
5c53c457e5
commit
cd70dcc3ba
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -42,13 +42,15 @@ class FinishedTorrents : public QWidget, public Ui::seeding{
|
||||
~FinishedTorrents();
|
||||
// Methods
|
||||
QStringList getFinishedSHAs();
|
||||
QTreeView* getFinishedList();
|
||||
QStandardItemModel* getFinishedListModel();
|
||||
|
||||
public slots:
|
||||
void addFinishedSHA(QString sha);
|
||||
void updateFinishedList();
|
||||
void deleteFromFinishedList(QString hash);
|
||||
QTreeView* getFinishedList();
|
||||
QStandardItemModel* getFinishedListModel();
|
||||
void showProperties(const QModelIndex &index);
|
||||
void propertiesSelection();
|
||||
|
||||
protected slots:
|
||||
void setRowColor(int row, const QString& color);
|
||||
|
@ -1215,6 +1215,11 @@ void GUI::addUnauthenticatedTracker(QPair<torrent_handle,std::string> tracker){
|
||||
|
||||
// display properties of selected items
|
||||
void GUI::propertiesSelection(){
|
||||
if(tabs->currentIndex() > 1) return;
|
||||
if(tabs->currentIndex() == 1){
|
||||
finishedTorrentTab->propertiesSelection();
|
||||
return;
|
||||
}
|
||||
QModelIndexList selectedIndexes = downloadList->selectionModel()->selectedIndexes();
|
||||
QModelIndex index;
|
||||
foreach(index, selectedIndexes){
|
||||
|
@ -59,11 +59,13 @@ namespace fs = boost::filesystem;
|
||||
class GUI : public QMainWindow, private Ui::MainWindow{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QHash<QString, QStringList> trackerErrors;
|
||||
|
||||
private:
|
||||
// Bittorrent
|
||||
bittorrent BTSession;
|
||||
QTimer *checkConnect;
|
||||
QHash<QString, QStringList> trackerErrors;
|
||||
QList<QPair<torrent_handle,std::string> > unauthenticated_trackers;
|
||||
downloadFromURL *downloadFromURLDialog;
|
||||
// GUI related
|
||||
|
Loading…
x
Reference in New Issue
Block a user