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 "FinishedTorrents.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "GUI.h"
|
#include "GUI.h"
|
||||||
|
#include "properties_imp.h"
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
|
||||||
FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession){
|
FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession){
|
||||||
@ -147,3 +148,25 @@ QTreeView* FinishedTorrents::getFinishedList(){
|
|||||||
QStandardItemModel* FinishedTorrents::getFinishedListModel(){
|
QStandardItemModel* FinishedTorrents::getFinishedListModel(){
|
||||||
return finishedListModel;
|
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();
|
~FinishedTorrents();
|
||||||
// Methods
|
// Methods
|
||||||
QStringList getFinishedSHAs();
|
QStringList getFinishedSHAs();
|
||||||
|
QTreeView* getFinishedList();
|
||||||
|
QStandardItemModel* getFinishedListModel();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void addFinishedSHA(QString sha);
|
void addFinishedSHA(QString sha);
|
||||||
void updateFinishedList();
|
void updateFinishedList();
|
||||||
void deleteFromFinishedList(QString hash);
|
void deleteFromFinishedList(QString hash);
|
||||||
QTreeView* getFinishedList();
|
void showProperties(const QModelIndex &index);
|
||||||
QStandardItemModel* getFinishedListModel();
|
void propertiesSelection();
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void setRowColor(int row, const QString& color);
|
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
|
// display properties of selected items
|
||||||
void GUI::propertiesSelection(){
|
void GUI::propertiesSelection(){
|
||||||
|
if(tabs->currentIndex() > 1) return;
|
||||||
|
if(tabs->currentIndex() == 1){
|
||||||
|
finishedTorrentTab->propertiesSelection();
|
||||||
|
return;
|
||||||
|
}
|
||||||
QModelIndexList selectedIndexes = downloadList->selectionModel()->selectedIndexes();
|
QModelIndexList selectedIndexes = downloadList->selectionModel()->selectedIndexes();
|
||||||
QModelIndex index;
|
QModelIndex index;
|
||||||
foreach(index, selectedIndexes){
|
foreach(index, selectedIndexes){
|
||||||
|
@ -59,11 +59,13 @@ namespace fs = boost::filesystem;
|
|||||||
class GUI : public QMainWindow, private Ui::MainWindow{
|
class GUI : public QMainWindow, private Ui::MainWindow{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
QHash<QString, QStringList> trackerErrors;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Bittorrent
|
// Bittorrent
|
||||||
bittorrent BTSession;
|
bittorrent BTSession;
|
||||||
QTimer *checkConnect;
|
QTimer *checkConnect;
|
||||||
QHash<QString, QStringList> trackerErrors;
|
|
||||||
QList<QPair<torrent_handle,std::string> > unauthenticated_trackers;
|
QList<QPair<torrent_handle,std::string> > unauthenticated_trackers;
|
||||||
downloadFromURL *downloadFromURLDialog;
|
downloadFromURL *downloadFromURLDialog;
|
||||||
// GUI related
|
// GUI related
|
||||||
|
Loading…
x
Reference in New Issue
Block a user