|
|
@ -140,9 +140,6 @@ PropertiesWidget::PropertiesWidget(QWidget *parent, MainWindow *mainWindow, Tran |
|
|
|
// Peers list
|
|
|
|
// Peers list
|
|
|
|
m_peerList = new PeerListWidget(this); |
|
|
|
m_peerList = new PeerListWidget(this); |
|
|
|
m_ui->vBoxLayoutPeerPage->addWidget(m_peerList); |
|
|
|
m_ui->vBoxLayoutPeerPage->addWidget(m_peerList); |
|
|
|
// Speed widget
|
|
|
|
|
|
|
|
m_speedWidget = new SpeedWidget(this); |
|
|
|
|
|
|
|
m_ui->speedLayout->addWidget(m_speedWidget); |
|
|
|
|
|
|
|
// Tab bar
|
|
|
|
// Tab bar
|
|
|
|
m_tabBar = new PropTabBar(); |
|
|
|
m_tabBar = new PropTabBar(); |
|
|
|
m_tabBar->setContentsMargins(0, 5, 0, 0); |
|
|
|
m_tabBar->setContentsMargins(0, 5, 0, 0); |
|
|
@ -164,6 +161,9 @@ PropertiesWidget::PropertiesWidget(QWidget *parent, MainWindow *mainWindow, Tran |
|
|
|
connect(m_deleteHotkeyWeb, &QShortcut::activated, this, &PropertiesWidget::deleteSelectedUrlSeeds); |
|
|
|
connect(m_deleteHotkeyWeb, &QShortcut::activated, this, &PropertiesWidget::deleteSelectedUrlSeeds); |
|
|
|
m_openHotkeyFile = new QShortcut(Qt::Key_Return, m_ui->filesList, nullptr, nullptr, Qt::WidgetShortcut); |
|
|
|
m_openHotkeyFile = new QShortcut(Qt::Key_Return, m_ui->filesList, nullptr, nullptr, Qt::WidgetShortcut); |
|
|
|
connect(m_openHotkeyFile, &QShortcut::activated, this, &PropertiesWidget::openSelectedFile); |
|
|
|
connect(m_openHotkeyFile, &QShortcut::activated, this, &PropertiesWidget::openSelectedFile); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
configure(); |
|
|
|
|
|
|
|
connect(Preferences::instance(), &Preferences::changed, this, &PropertiesWidget::configure); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
PropertiesWidget::~PropertiesWidget() |
|
|
|
PropertiesWidget::~PropertiesWidget() |
|
|
@ -288,11 +288,6 @@ QTreeView *PropertiesWidget::getFilesList() const |
|
|
|
return m_ui->filesList; |
|
|
|
return m_ui->filesList; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
SpeedWidget *PropertiesWidget::getSpeedWidget() const |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return m_speedWidget; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void PropertiesWidget::updateSavePath(BitTorrent::TorrentHandle *const torrent) |
|
|
|
void PropertiesWidget::updateSavePath(BitTorrent::TorrentHandle *const torrent) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (torrent == m_torrent) |
|
|
|
if (torrent == m_torrent) |
|
|
@ -800,6 +795,29 @@ void PropertiesWidget::openSelectedFile() |
|
|
|
openDoubleClickedFile(selectedIndexes.first()); |
|
|
|
openDoubleClickedFile(selectedIndexes.first()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void PropertiesWidget::configure() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// Speed widget
|
|
|
|
|
|
|
|
if (Preferences::instance()->isSpeedWidgetEnabled()) { |
|
|
|
|
|
|
|
if (!m_speedWidget || !qobject_cast<SpeedWidget *>(m_speedWidget)) { |
|
|
|
|
|
|
|
m_ui->speedLayout->removeWidget(m_speedWidget); |
|
|
|
|
|
|
|
delete m_speedWidget; |
|
|
|
|
|
|
|
m_speedWidget = new SpeedWidget {this}; |
|
|
|
|
|
|
|
m_ui->speedLayout->addWidget(m_speedWidget); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
if (!m_speedWidget || !qobject_cast<QLabel *>(m_speedWidget)) { |
|
|
|
|
|
|
|
m_ui->speedLayout->removeWidget(m_speedWidget); |
|
|
|
|
|
|
|
delete m_speedWidget; |
|
|
|
|
|
|
|
auto *label = new QLabel(tr("<center><b>Speed graphs are disabled</b><p>You may change this setting in Advanced Options </center>"), this); |
|
|
|
|
|
|
|
label->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); |
|
|
|
|
|
|
|
m_speedWidget = label; |
|
|
|
|
|
|
|
m_ui->speedLayout->addWidget(m_speedWidget); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PropertiesWidget::askWebSeed() |
|
|
|
void PropertiesWidget::askWebSeed() |
|
|
|
{ |
|
|
|
{ |
|
|
|
bool ok; |
|
|
|
bool ok; |
|
|
|