|
|
@ -36,7 +36,6 @@ |
|
|
|
#include <QSplitter> |
|
|
|
#include <QSplitter> |
|
|
|
#include <QStackedWidget> |
|
|
|
#include <QStackedWidget> |
|
|
|
#include <QThread> |
|
|
|
#include <QThread> |
|
|
|
#include <QTimer> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "base/bittorrent/filepriority.h" |
|
|
|
#include "base/bittorrent/filepriority.h" |
|
|
|
#include "base/bittorrent/session.h" |
|
|
|
#include "base/bittorrent/session.h" |
|
|
@ -49,7 +48,6 @@ |
|
|
|
#include "downloadedpiecesbar.h" |
|
|
|
#include "downloadedpiecesbar.h" |
|
|
|
#include "guiiconprovider.h" |
|
|
|
#include "guiiconprovider.h" |
|
|
|
#include "lineedit.h" |
|
|
|
#include "lineedit.h" |
|
|
|
#include "mainwindow.h" |
|
|
|
|
|
|
|
#include "peerlistwidget.h" |
|
|
|
#include "peerlistwidget.h" |
|
|
|
#include "pieceavailabilitybar.h" |
|
|
|
#include "pieceavailabilitybar.h" |
|
|
|
#include "proplistdelegate.h" |
|
|
|
#include "proplistdelegate.h" |
|
|
@ -59,7 +57,6 @@ |
|
|
|
#include "torrentcontentfiltermodel.h" |
|
|
|
#include "torrentcontentfiltermodel.h" |
|
|
|
#include "torrentcontentmodel.h" |
|
|
|
#include "torrentcontentmodel.h" |
|
|
|
#include "trackerlistwidget.h" |
|
|
|
#include "trackerlistwidget.h" |
|
|
|
#include "transferlistwidget.h" |
|
|
|
|
|
|
|
#include "utils.h" |
|
|
|
#include "utils.h" |
|
|
|
|
|
|
|
|
|
|
|
#include "ui_propertieswidget.h" |
|
|
|
#include "ui_propertieswidget.h" |
|
|
@ -68,11 +65,9 @@ |
|
|
|
#include "macutilities.h" |
|
|
|
#include "macutilities.h" |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
PropertiesWidget::PropertiesWidget(QWidget *parent, MainWindow *mainWindow, TransferListWidget *transferList) |
|
|
|
PropertiesWidget::PropertiesWidget(QWidget *parent) |
|
|
|
: QWidget(parent) |
|
|
|
: QWidget(parent) |
|
|
|
, m_ui(new Ui::PropertiesWidget()) |
|
|
|
, m_ui(new Ui::PropertiesWidget()) |
|
|
|
, m_transferList(transferList) |
|
|
|
|
|
|
|
, m_mainWindow(mainWindow) |
|
|
|
|
|
|
|
, m_torrent(nullptr) |
|
|
|
, m_torrent(nullptr) |
|
|
|
{ |
|
|
|
{ |
|
|
|
m_ui->setupUi(this); |
|
|
|
m_ui->setupUi(this); |
|
|
@ -103,7 +98,6 @@ PropertiesWidget::PropertiesWidget(QWidget *parent, MainWindow *mainWindow, Tran |
|
|
|
connect(m_ui->filesList, &QAbstractItemView::doubleClicked, this, &PropertiesWidget::openDoubleClickedFile); |
|
|
|
connect(m_ui->filesList, &QAbstractItemView::doubleClicked, this, &PropertiesWidget::openDoubleClickedFile); |
|
|
|
connect(m_propListModel, &TorrentContentFilterModel::filteredFilesChanged, this, &PropertiesWidget::filteredFilesChanged); |
|
|
|
connect(m_propListModel, &TorrentContentFilterModel::filteredFilesChanged, this, &PropertiesWidget::filteredFilesChanged); |
|
|
|
connect(m_ui->listWebSeeds, &QWidget::customContextMenuRequested, this, &PropertiesWidget::displayWebSeedListMenu); |
|
|
|
connect(m_ui->listWebSeeds, &QWidget::customContextMenuRequested, this, &PropertiesWidget::displayWebSeedListMenu); |
|
|
|
connect(transferList, &TransferListWidget::currentTorrentChanged, this, &PropertiesWidget::loadTorrentInfos); |
|
|
|
|
|
|
|
connect(m_propListDelegate, &PropListDelegate::filteredFilesChanged, this, &PropertiesWidget::filteredFilesChanged); |
|
|
|
connect(m_propListDelegate, &PropListDelegate::filteredFilesChanged, this, &PropertiesWidget::filteredFilesChanged); |
|
|
|
connect(m_ui->stackedProperties, &QStackedWidget::currentChanged, this, &PropertiesWidget::loadDynamicData); |
|
|
|
connect(m_ui->stackedProperties, &QStackedWidget::currentChanged, this, &PropertiesWidget::loadDynamicData); |
|
|
|
connect(BitTorrent::Session::instance(), &BitTorrent::Session::torrentSavePathChanged, this, &PropertiesWidget::updateSavePath); |
|
|
|
connect(BitTorrent::Session::instance(), &BitTorrent::Session::torrentSavePathChanged, this, &PropertiesWidget::updateSavePath); |
|
|
@ -149,10 +143,7 @@ PropertiesWidget::PropertiesWidget(QWidget *parent, MainWindow *mainWindow, Tran |
|
|
|
connect(m_tabBar, &PropTabBar::tabChanged, this, &PropertiesWidget::saveSettings); |
|
|
|
connect(m_tabBar, &PropTabBar::tabChanged, this, &PropertiesWidget::saveSettings); |
|
|
|
connect(m_tabBar, &PropTabBar::visibilityToggled, this, &PropertiesWidget::setVisibility); |
|
|
|
connect(m_tabBar, &PropTabBar::visibilityToggled, this, &PropertiesWidget::setVisibility); |
|
|
|
connect(m_tabBar, &PropTabBar::visibilityToggled, this, &PropertiesWidget::saveSettings); |
|
|
|
connect(m_tabBar, &PropTabBar::visibilityToggled, this, &PropertiesWidget::saveSettings); |
|
|
|
// Dynamic data refresher
|
|
|
|
|
|
|
|
m_refreshTimer = new QTimer(this); |
|
|
|
|
|
|
|
connect(m_refreshTimer, &QTimer::timeout, this, &PropertiesWidget::loadDynamicData); |
|
|
|
|
|
|
|
m_refreshTimer->start(3000); // 3sec
|
|
|
|
|
|
|
|
m_editHotkeyFile = new QShortcut(Qt::Key_F2, m_ui->filesList, nullptr, nullptr, Qt::WidgetShortcut); |
|
|
|
m_editHotkeyFile = new QShortcut(Qt::Key_F2, m_ui->filesList, nullptr, nullptr, Qt::WidgetShortcut); |
|
|
|
connect(m_editHotkeyFile, &QShortcut::activated, this, &PropertiesWidget::renameSelectedFile); |
|
|
|
connect(m_editHotkeyFile, &QShortcut::activated, this, &PropertiesWidget::renameSelectedFile); |
|
|
|
m_editHotkeyWeb = new QShortcut(Qt::Key_F2, m_ui->listWebSeeds, nullptr, nullptr, Qt::WidgetShortcut); |
|
|
|
m_editHotkeyWeb = new QShortcut(Qt::Key_F2, m_ui->listWebSeeds, nullptr, nullptr, Qt::WidgetShortcut); |
|
|
@ -170,7 +161,6 @@ PropertiesWidget::PropertiesWidget(QWidget *parent, MainWindow *mainWindow, Tran |
|
|
|
PropertiesWidget::~PropertiesWidget() |
|
|
|
PropertiesWidget::~PropertiesWidget() |
|
|
|
{ |
|
|
|
{ |
|
|
|
qDebug() << Q_FUNC_INFO << "ENTER"; |
|
|
|
qDebug() << Q_FUNC_INFO << "ENTER"; |
|
|
|
delete m_refreshTimer; |
|
|
|
|
|
|
|
delete m_trackerList; |
|
|
|
delete m_trackerList; |
|
|
|
delete m_peerList; |
|
|
|
delete m_peerList; |
|
|
|
delete m_speedWidget; |
|
|
|
delete m_speedWidget; |
|
|
@ -394,7 +384,7 @@ void PropertiesWidget::reloadPreferences() |
|
|
|
void PropertiesWidget::loadDynamicData() |
|
|
|
void PropertiesWidget::loadDynamicData() |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Refresh only if the torrent handle is valid and visible
|
|
|
|
// Refresh only if the torrent handle is valid and visible
|
|
|
|
if (!m_torrent || (m_mainWindow->currentTabWidget() != m_transferList) || (m_state != VISIBLE)) return; |
|
|
|
if (!m_torrent || (m_state != VISIBLE)) return; |
|
|
|
|
|
|
|
|
|
|
|
// Transfer infos
|
|
|
|
// Transfer infos
|
|
|
|
switch (m_ui->stackedProperties->currentIndex()) { |
|
|
|
switch (m_ui->stackedProperties->currentIndex()) { |
|
|
|