mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-10-22 10:46:04 +03:00
commit
c61c3d7cd8
11 changed files with 135 additions and 61 deletions
|
@ -367,6 +367,10 @@ void PeerInfo::determineFlags()
|
||||||
if (useUTPSocket())
|
if (useUTPSocket())
|
||||||
updateFlags(u'P', C_UTP);
|
updateFlags(u'P', C_UTP);
|
||||||
|
|
||||||
|
// h = Peer is using NAT hole punching
|
||||||
|
if (isHolepunched())
|
||||||
|
updateFlags(u'h', tr("Peer is using NAT hole punching"));
|
||||||
|
|
||||||
m_flags.chop(1);
|
m_flags.chop(1);
|
||||||
m_flagsDescription.chop(1);
|
m_flagsDescription.chop(1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -460,6 +460,8 @@ Path TorrentImpl::savePath() const
|
||||||
void TorrentImpl::setSavePath(const Path &path)
|
void TorrentImpl::setSavePath(const Path &path)
|
||||||
{
|
{
|
||||||
Q_ASSERT(!isAutoTMMEnabled());
|
Q_ASSERT(!isAutoTMMEnabled());
|
||||||
|
if (isAutoTMMEnabled()) [[unlikely]]
|
||||||
|
return;
|
||||||
|
|
||||||
const Path basePath = m_session->useCategoryPathsInManualMode()
|
const Path basePath = m_session->useCategoryPathsInManualMode()
|
||||||
? m_session->categorySavePath(category()) : m_session->savePath();
|
? m_session->categorySavePath(category()) : m_session->savePath();
|
||||||
|
@ -487,6 +489,8 @@ Path TorrentImpl::downloadPath() const
|
||||||
void TorrentImpl::setDownloadPath(const Path &path)
|
void TorrentImpl::setDownloadPath(const Path &path)
|
||||||
{
|
{
|
||||||
Q_ASSERT(!isAutoTMMEnabled());
|
Q_ASSERT(!isAutoTMMEnabled());
|
||||||
|
if (isAutoTMMEnabled()) [[unlikely]]
|
||||||
|
return;
|
||||||
|
|
||||||
const Path basePath = m_session->useCategoryPathsInManualMode()
|
const Path basePath = m_session->useCategoryPathsInManualMode()
|
||||||
? m_session->categoryDownloadPath(category()) : m_session->downloadPath();
|
? m_session->categoryDownloadPath(category()) : m_session->downloadPath();
|
||||||
|
@ -1957,9 +1961,18 @@ void TorrentImpl::start(const TorrentOperatingMode mode)
|
||||||
void TorrentImpl::moveStorage(const Path &newPath, const MoveStorageContext context)
|
void TorrentImpl::moveStorage(const Path &newPath, const MoveStorageContext context)
|
||||||
{
|
{
|
||||||
if (!hasMetadata())
|
if (!hasMetadata())
|
||||||
|
{
|
||||||
|
if (context == MoveStorageContext::ChangeSavePath)
|
||||||
{
|
{
|
||||||
m_savePath = newPath;
|
m_savePath = newPath;
|
||||||
m_session->handleTorrentSavePathChanged(this);
|
m_session->handleTorrentSavePathChanged(this);
|
||||||
|
}
|
||||||
|
else if (context == MoveStorageContext::ChangeDownloadPath)
|
||||||
|
{
|
||||||
|
m_downloadPath = newPath;
|
||||||
|
m_session->handleTorrentSavePathChanged(this);
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Bittorrent Client using Qt and libtorrent.
|
* Bittorrent Client using Qt and libtorrent.
|
||||||
|
* Copyright (C) 2024 Vladimir Golovnev <glassez@yandex.ru>
|
||||||
* Copyright (C) 2006 Christophe Dumez <chris@qbittorrent.org>
|
* Copyright (C) 2006 Christophe Dumez <chris@qbittorrent.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
|
@ -46,9 +47,9 @@ namespace
|
||||||
}
|
}
|
||||||
|
|
||||||
DownloadedPiecesBar::DownloadedPiecesBar(QWidget *parent)
|
DownloadedPiecesBar::DownloadedPiecesBar(QWidget *parent)
|
||||||
: base {parent}
|
: base(parent)
|
||||||
, m_dlPieceColor {dlPieceColor(pieceColor())}
|
|
||||||
{
|
{
|
||||||
|
updateColorsImpl();
|
||||||
}
|
}
|
||||||
|
|
||||||
QVector<float> DownloadedPiecesBar::bitfieldToFloatVector(const QBitArray &vecin, int reqSize)
|
QVector<float> DownloadedPiecesBar::bitfieldToFloatVector(const QBitArray &vecin, int reqSize)
|
||||||
|
@ -128,25 +129,24 @@ QVector<float> DownloadedPiecesBar::bitfieldToFloatVector(const QBitArray &vecin
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DownloadedPiecesBar::updateImage(QImage &image)
|
QImage DownloadedPiecesBar::renderImage()
|
||||||
{
|
{
|
||||||
// qDebug() << "updateImage";
|
// qDebug() << "updateImage";
|
||||||
QImage image2(width() - 2 * borderWidth, 1, QImage::Format_RGB888);
|
QImage image {width() - 2 * borderWidth, 1, QImage::Format_RGB888};
|
||||||
if (image2.isNull())
|
if (image.isNull())
|
||||||
{
|
{
|
||||||
qDebug() << "QImage image2() allocation failed, width():" << width();
|
qDebug() << "QImage allocation failed, width():" << width();
|
||||||
return false;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_pieces.isEmpty())
|
if (m_pieces.isEmpty())
|
||||||
{
|
{
|
||||||
image2.fill(backgroundColor());
|
image.fill(backgroundColor());
|
||||||
image = image2;
|
return image;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QVector<float> scaledPieces = bitfieldToFloatVector(m_pieces, image2.width());
|
QVector<float> scaledPieces = bitfieldToFloatVector(m_pieces, image.width());
|
||||||
QVector<float> scaledPiecesDl = bitfieldToFloatVector(m_downloadedPieces, image2.width());
|
QVector<float> scaledPiecesDl = bitfieldToFloatVector(m_downloadedPieces, image.width());
|
||||||
|
|
||||||
// filling image
|
// filling image
|
||||||
for (int x = 0; x < scaledPieces.size(); ++x)
|
for (int x = 0; x < scaledPieces.size(); ++x)
|
||||||
|
@ -161,15 +161,15 @@ bool DownloadedPiecesBar::updateImage(QImage &image)
|
||||||
QRgb mixedColor = mixTwoColors(pieceColor().rgb(), m_dlPieceColor.rgb(), ratio);
|
QRgb mixedColor = mixTwoColors(pieceColor().rgb(), m_dlPieceColor.rgb(), ratio);
|
||||||
mixedColor = mixTwoColors(backgroundColor().rgb(), mixedColor, fillRatio);
|
mixedColor = mixTwoColors(backgroundColor().rgb(), mixedColor, fillRatio);
|
||||||
|
|
||||||
image2.setPixel(x, 0, mixedColor);
|
image.setPixel(x, 0, mixedColor);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
image2.setPixel(x, 0, pieceColors()[piecesToValue * 255]);
|
image.setPixel(x, 0, pieceColors()[piecesToValue * 255]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
image = image2;
|
|
||||||
return true;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DownloadedPiecesBar::setProgress(const QBitArray &pieces, const QBitArray &downloadedPieces)
|
void DownloadedPiecesBar::setProgress(const QBitArray &pieces, const QBitArray &downloadedPieces)
|
||||||
|
@ -177,7 +177,7 @@ void DownloadedPiecesBar::setProgress(const QBitArray &pieces, const QBitArray &
|
||||||
m_pieces = pieces;
|
m_pieces = pieces;
|
||||||
m_downloadedPieces = downloadedPieces;
|
m_downloadedPieces = downloadedPieces;
|
||||||
|
|
||||||
requestImageUpdate();
|
redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DownloadedPiecesBar::clear()
|
void DownloadedPiecesBar::clear()
|
||||||
|
@ -198,3 +198,14 @@ QString DownloadedPiecesBar::simpleToolTipText() const
|
||||||
+ u"</table>";
|
+ u"</table>";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DownloadedPiecesBar::updateColors()
|
||||||
|
{
|
||||||
|
PiecesBar::updateColors();
|
||||||
|
updateColorsImpl();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DownloadedPiecesBar::updateColorsImpl()
|
||||||
|
{
|
||||||
|
m_dlPieceColor = dlPieceColor(pieceColor());
|
||||||
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Bittorrent Client using Qt and libtorrent.
|
* Bittorrent Client using Qt and libtorrent.
|
||||||
|
* Copyright (C) 2024 Vladimir Golovnev <glassez@yandex.ru>
|
||||||
* Copyright (C) 2006 Christophe Dumez <chris@qbittorrent.org>
|
* Copyright (C) 2006 Christophe Dumez <chris@qbittorrent.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
|
@ -52,11 +53,13 @@ public:
|
||||||
private:
|
private:
|
||||||
// scale bitfield vector to float vector
|
// scale bitfield vector to float vector
|
||||||
QVector<float> bitfieldToFloatVector(const QBitArray &vecin, int reqSize);
|
QVector<float> bitfieldToFloatVector(const QBitArray &vecin, int reqSize);
|
||||||
bool updateImage(QImage &image) override;
|
QImage renderImage() override;
|
||||||
QString simpleToolTipText() const override;
|
QString simpleToolTipText() const override;
|
||||||
|
void updateColors() override;
|
||||||
|
void updateColorsImpl();
|
||||||
|
|
||||||
// incomplete piece color
|
// incomplete piece color
|
||||||
const QColor m_dlPieceColor;
|
QColor m_dlPieceColor;
|
||||||
// last used bitfields, uses to better resize redraw
|
// last used bitfields, uses to better resize redraw
|
||||||
// TODO: make a diff pieces to new pieces and update only changed pixels, speedup when update > 20x faster
|
// TODO: make a diff pieces to new pieces and update only changed pixels, speedup when update > 20x faster
|
||||||
QBitArray m_pieces;
|
QBitArray m_pieces;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Bittorrent Client using Qt and libtorrent.
|
* Bittorrent Client using Qt and libtorrent.
|
||||||
|
* Copyright (C) 2024 Vladimir Golovnev <glassez@yandex.ru>
|
||||||
* Copyright (C) 2006 Christophe Dumez <chris@qbittorrent.org>
|
* Copyright (C) 2006 Christophe Dumez <chris@qbittorrent.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
|
@ -126,39 +127,38 @@ QVector<float> PieceAvailabilityBar::intToFloatVector(const QVector<int> &vecin,
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PieceAvailabilityBar::updateImage(QImage &image)
|
QImage PieceAvailabilityBar::renderImage()
|
||||||
{
|
{
|
||||||
QImage image2(width() - 2 * borderWidth, 1, QImage::Format_RGB888);
|
QImage image {width() - 2 * borderWidth, 1, QImage::Format_RGB888};
|
||||||
if (image2.isNull())
|
if (image.isNull())
|
||||||
{
|
{
|
||||||
qDebug() << "QImage image2() allocation failed, width():" << width();
|
qDebug() << "QImage allocation failed, width():" << width();
|
||||||
return false;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_pieces.empty())
|
if (m_pieces.empty())
|
||||||
{
|
{
|
||||||
image2.fill(backgroundColor());
|
image.fill(backgroundColor());
|
||||||
image = image2;
|
return image;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QVector<float> scaledPieces = intToFloatVector(m_pieces, image2.width());
|
QVector<float> scaledPieces = intToFloatVector(m_pieces, image.width());
|
||||||
|
|
||||||
// filling image
|
// filling image
|
||||||
for (int x = 0; x < scaledPieces.size(); ++x)
|
for (int x = 0; x < scaledPieces.size(); ++x)
|
||||||
{
|
{
|
||||||
float piecesToValue = scaledPieces.at(x);
|
float piecesToValue = scaledPieces.at(x);
|
||||||
image2.setPixel(x, 0, pieceColors()[piecesToValue * 255]);
|
image.setPixel(x, 0, pieceColors()[piecesToValue * 255]);
|
||||||
}
|
}
|
||||||
image = image2;
|
|
||||||
return true;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PieceAvailabilityBar::setAvailability(const QVector<int> &avail)
|
void PieceAvailabilityBar::setAvailability(const QVector<int> &avail)
|
||||||
{
|
{
|
||||||
m_pieces = avail;
|
m_pieces = avail;
|
||||||
|
|
||||||
requestImageUpdate();
|
redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PieceAvailabilityBar::clear()
|
void PieceAvailabilityBar::clear()
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Bittorrent Client using Qt and libtorrent.
|
* Bittorrent Client using Qt and libtorrent.
|
||||||
|
* Copyright (C) 2024 Vladimir Golovnev <glassez@yandex.ru>
|
||||||
* Copyright (C) 2006 Christophe Dumez <chris@qbittorrent.org>
|
* Copyright (C) 2006 Christophe Dumez <chris@qbittorrent.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
|
@ -46,7 +47,7 @@ public:
|
||||||
void clear() override;
|
void clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool updateImage(QImage &image) override;
|
QImage renderImage() override;
|
||||||
QString simpleToolTipText() const override;
|
QString simpleToolTipText() const override;
|
||||||
|
|
||||||
// last used int vector, uses to better resize redraw
|
// last used int vector, uses to better resize redraw
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Bittorrent Client using Qt and libtorrent.
|
* Bittorrent Client using Qt and libtorrent.
|
||||||
|
* Copyright (C) 2024 Vladimir Golovnev <glassez@yandex.ru>
|
||||||
* Copyright (C) 2016 Eugene Shalygin
|
* Copyright (C) 2016 Eugene Shalygin
|
||||||
* Copyright (C) 2006 Christophe Dumez
|
* Copyright (C) 2006 Christophe Dumez
|
||||||
*
|
*
|
||||||
|
@ -41,6 +42,7 @@
|
||||||
#include "base/indexrange.h"
|
#include "base/indexrange.h"
|
||||||
#include "base/path.h"
|
#include "base/path.h"
|
||||||
#include "base/utils/misc.h"
|
#include "base/utils/misc.h"
|
||||||
|
#include "gui/uithememanager.h"
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
@ -114,10 +116,16 @@ namespace
|
||||||
}
|
}
|
||||||
|
|
||||||
PiecesBar::PiecesBar(QWidget *parent)
|
PiecesBar::PiecesBar(QWidget *parent)
|
||||||
: QWidget {parent}
|
: QWidget(parent)
|
||||||
{
|
{
|
||||||
updatePieceColors();
|
|
||||||
setMouseTracking(true);
|
setMouseTracking(true);
|
||||||
|
|
||||||
|
updateColorsImpl();
|
||||||
|
connect(UIThemeManager::instance(), &UIThemeManager::themeChanged, this, [this]
|
||||||
|
{
|
||||||
|
updateColors();
|
||||||
|
redraw();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void PiecesBar::setTorrent(const BitTorrent::Torrent *torrent)
|
void PiecesBar::setTorrent(const BitTorrent::Torrent *torrent)
|
||||||
|
@ -154,7 +162,7 @@ void PiecesBar::leaveEvent(QEvent *e)
|
||||||
{
|
{
|
||||||
m_hovered = false;
|
m_hovered = false;
|
||||||
m_highlightedRegion = {};
|
m_highlightedRegion = {};
|
||||||
requestImageUpdate();
|
redraw();
|
||||||
base::leaveEvent(e);
|
base::leaveEvent(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,7 +186,10 @@ void PiecesBar::paintEvent(QPaintEvent *)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (m_image.width() != imageRect.width())
|
if (m_image.width() != imageRect.width())
|
||||||
updateImage(m_image);
|
{
|
||||||
|
if (const QImage image = renderImage(); !image.isNull())
|
||||||
|
m_image = image;
|
||||||
|
}
|
||||||
painter.drawImage(imageRect, m_image);
|
painter.drawImage(imageRect, m_image);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -196,30 +207,33 @@ void PiecesBar::paintEvent(QPaintEvent *)
|
||||||
painter.drawPath(border);
|
painter.drawPath(border);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PiecesBar::requestImageUpdate()
|
void PiecesBar::redraw()
|
||||||
{
|
{
|
||||||
if (updateImage(m_image))
|
if (const QImage image = renderImage(); !image.isNull())
|
||||||
|
{
|
||||||
|
m_image = image;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QColor PiecesBar::backgroundColor() const
|
QColor PiecesBar::backgroundColor() const
|
||||||
{
|
{
|
||||||
return palette().color(QPalette::Base);
|
return palette().color(QPalette::Active, QPalette::Base);
|
||||||
}
|
}
|
||||||
|
|
||||||
QColor PiecesBar::borderColor() const
|
QColor PiecesBar::borderColor() const
|
||||||
{
|
{
|
||||||
return palette().color(QPalette::Dark);
|
return palette().color(QPalette::Active, QPalette::Dark);
|
||||||
}
|
}
|
||||||
|
|
||||||
QColor PiecesBar::pieceColor() const
|
QColor PiecesBar::pieceColor() const
|
||||||
{
|
{
|
||||||
return palette().color(QPalette::Highlight);
|
return palette().color(QPalette::Active, QPalette::Highlight);
|
||||||
}
|
}
|
||||||
|
|
||||||
QColor PiecesBar::colorBoxBorderColor() const
|
QColor PiecesBar::colorBoxBorderColor() const
|
||||||
{
|
{
|
||||||
return palette().color(QPalette::ToolTipText);
|
return palette().color(QPalette::Active, QPalette::ToolTipText);
|
||||||
}
|
}
|
||||||
|
|
||||||
const QVector<QRgb> &PiecesBar::pieceColors() const
|
const QVector<QRgb> &PiecesBar::pieceColors() const
|
||||||
|
@ -325,12 +339,17 @@ void PiecesBar::highlightFile(int imagePos)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PiecesBar::updatePieceColors()
|
void PiecesBar::updateColors()
|
||||||
|
{
|
||||||
|
updateColorsImpl();
|
||||||
|
}
|
||||||
|
|
||||||
|
void PiecesBar::updateColorsImpl()
|
||||||
{
|
{
|
||||||
m_pieceColors = QVector<QRgb>(256);
|
m_pieceColors = QVector<QRgb>(256);
|
||||||
for (int i = 0; i < 256; ++i)
|
for (int i = 0; i < 256; ++i)
|
||||||
{
|
{
|
||||||
float ratio = (i / 255.0);
|
const float ratio = (i / 255.0);
|
||||||
m_pieceColors[i] = mixTwoColors(backgroundColor().rgb(), pieceColor().rgb(), ratio);
|
m_pieceColors[i] = mixTwoColors(backgroundColor().rgb(), pieceColor().rgb(), ratio);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Bittorrent Client using Qt and libtorrent.
|
* Bittorrent Client using Qt and libtorrent.
|
||||||
|
* Copyright (C) 2024 Vladimir Golovnev <glassez@yandex.ru>
|
||||||
* Copyright (C) 2016 Eugene Shalygin
|
* Copyright (C) 2016 Eugene Shalygin
|
||||||
* Copyright (C) 2006 Christophe Dumez
|
* Copyright (C) 2006 Christophe Dumez
|
||||||
*
|
*
|
||||||
|
@ -54,17 +55,15 @@ public:
|
||||||
|
|
||||||
virtual void clear();
|
virtual void clear();
|
||||||
|
|
||||||
// QObject interface
|
|
||||||
bool event(QEvent *e) override;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// QWidget interface
|
bool event(QEvent *e) override;
|
||||||
void enterEvent(QEnterEvent *e) override;
|
void enterEvent(QEnterEvent *e) override;
|
||||||
void leaveEvent(QEvent *e) override;
|
void leaveEvent(QEvent *e) override;
|
||||||
void mouseMoveEvent(QMouseEvent *e) override;
|
void mouseMoveEvent(QMouseEvent *e) override;
|
||||||
|
|
||||||
void paintEvent(QPaintEvent *e) override;
|
void paintEvent(QPaintEvent *e) override;
|
||||||
void requestImageUpdate();
|
|
||||||
|
virtual void updateColors();
|
||||||
|
void redraw();
|
||||||
|
|
||||||
QColor backgroundColor() const;
|
QColor backgroundColor() const;
|
||||||
QColor borderColor() const;
|
QColor borderColor() const;
|
||||||
|
@ -82,11 +81,9 @@ private:
|
||||||
void highlightFile(int imagePos);
|
void highlightFile(int imagePos);
|
||||||
|
|
||||||
virtual QString simpleToolTipText() const = 0;
|
virtual QString simpleToolTipText() const = 0;
|
||||||
|
virtual QImage renderImage() = 0;
|
||||||
|
|
||||||
// draw new image to replace the actual image
|
void updateColorsImpl();
|
||||||
// returns true if image was successfully updated
|
|
||||||
virtual bool updateImage(QImage &image) = 0;
|
|
||||||
void updatePieceColors();
|
|
||||||
|
|
||||||
const BitTorrent::Torrent *m_torrent = nullptr;
|
const BitTorrent::Torrent *m_torrent = nullptr;
|
||||||
QImage m_image;
|
QImage m_image;
|
||||||
|
|
|
@ -235,10 +235,7 @@ void StatusFilterWidget::applyFilter(int row)
|
||||||
|
|
||||||
void StatusFilterWidget::handleTorrentsLoaded(const QVector<BitTorrent::Torrent *> &torrents)
|
void StatusFilterWidget::handleTorrentsLoaded(const QVector<BitTorrent::Torrent *> &torrents)
|
||||||
{
|
{
|
||||||
for (const BitTorrent::Torrent *torrent : torrents)
|
update(torrents);
|
||||||
updateTorrentStatus(torrent);
|
|
||||||
|
|
||||||
updateTexts();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void StatusFilterWidget::torrentAboutToBeDeleted(BitTorrent::Torrent *const torrent)
|
void StatusFilterWidget::torrentAboutToBeDeleted(BitTorrent::Torrent *const torrent)
|
||||||
|
@ -273,6 +270,12 @@ void StatusFilterWidget::torrentAboutToBeDeleted(BitTorrent::Torrent *const torr
|
||||||
m_nbStalled = m_nbStalledUploading + m_nbStalledDownloading;
|
m_nbStalled = m_nbStalledUploading + m_nbStalledDownloading;
|
||||||
|
|
||||||
updateTexts();
|
updateTexts();
|
||||||
|
|
||||||
|
if (Preferences::instance()->getHideZeroStatusFilters())
|
||||||
|
{
|
||||||
|
hideZeroItems();
|
||||||
|
updateGeometry();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void StatusFilterWidget::configure()
|
void StatusFilterWidget::configure()
|
||||||
|
|
|
@ -736,9 +736,13 @@ window.addEventListener("DOMContentLoaded", () => {
|
||||||
const full_update = (response["full_update"] === true);
|
const full_update = (response["full_update"] === true);
|
||||||
if (full_update) {
|
if (full_update) {
|
||||||
torrentsTableSelectedRows = torrentsTable.selectedRowsIds();
|
torrentsTableSelectedRows = torrentsTable.selectedRowsIds();
|
||||||
|
update_categories = true;
|
||||||
|
updateTags = true;
|
||||||
|
updateTrackers = true;
|
||||||
torrentsTable.clear();
|
torrentsTable.clear();
|
||||||
category_list.clear();
|
category_list.clear();
|
||||||
tagList.clear();
|
tagList.clear();
|
||||||
|
trackerList.clear();
|
||||||
}
|
}
|
||||||
if (response["rid"])
|
if (response["rid"])
|
||||||
syncMainDataLastResponseId = response["rid"];
|
syncMainDataLastResponseId = response["rid"];
|
||||||
|
|
|
@ -947,6 +947,9 @@ window.qBittorrent.DynamicTable = (function() {
|
||||||
this.newColumn("seen_complete", "", "QBT_TR(Last Seen Complete)QBT_TR[CONTEXT=TransferListModel]", 100, false);
|
this.newColumn("seen_complete", "", "QBT_TR(Last Seen Complete)QBT_TR[CONTEXT=TransferListModel]", 100, false);
|
||||||
this.newColumn("last_activity", "", "QBT_TR(Last Activity)QBT_TR[CONTEXT=TransferListModel]", 100, false);
|
this.newColumn("last_activity", "", "QBT_TR(Last Activity)QBT_TR[CONTEXT=TransferListModel]", 100, false);
|
||||||
this.newColumn("availability", "", "QBT_TR(Availability)QBT_TR[CONTEXT=TransferListModel]", 100, false);
|
this.newColumn("availability", "", "QBT_TR(Availability)QBT_TR[CONTEXT=TransferListModel]", 100, false);
|
||||||
|
this.newColumn("download_path", "", "QBT_TR(Incomplete Save Path)QBT_TR[CONTEXT=TransferListModel]", 100, false);
|
||||||
|
this.newColumn("infohash_v1", "", "QBT_TR(Info Hash v1)QBT_TR[CONTEXT=TransferListModel]", 100, false);
|
||||||
|
this.newColumn("infohash_v2", "", "QBT_TR(Info Hash v2)QBT_TR[CONTEXT=TransferListModel]", 100, false);
|
||||||
this.newColumn("reannounce", "", "QBT_TR(Reannounce In)QBT_TR[CONTEXT=TransferListModel]", 100, false);
|
this.newColumn("reannounce", "", "QBT_TR(Reannounce In)QBT_TR[CONTEXT=TransferListModel]", 100, false);
|
||||||
this.newColumn("private", "", "QBT_TR(Private)QBT_TR[CONTEXT=TransferListModel]", 100, false);
|
this.newColumn("private", "", "QBT_TR(Private)QBT_TR[CONTEXT=TransferListModel]", 100, false);
|
||||||
|
|
||||||
|
@ -1326,6 +1329,22 @@ window.qBittorrent.DynamicTable = (function() {
|
||||||
td.set("title", value);
|
td.set("title", value);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// infohash_v1
|
||||||
|
this.columns["infohash_v1"].updateTd = function(td, row) {
|
||||||
|
const sourceInfohashV1 = this.getRowValue(row);
|
||||||
|
const infohashV1 = (sourceInfohashV1 !== "") ? sourceInfohashV1 : "QBT_TR(N/A)QBT_TR[CONTEXT=TransferListDelegate]";
|
||||||
|
td.textContent = infohashV1;
|
||||||
|
td.title = infohashV1;
|
||||||
|
};
|
||||||
|
|
||||||
|
// infohash_v2
|
||||||
|
this.columns["infohash_v2"].updateTd = function(td, row) {
|
||||||
|
const sourceInfohashV2 = this.getRowValue(row);
|
||||||
|
const infohashV2 = (sourceInfohashV2 !== "") ? sourceInfohashV2 : "QBT_TR(N/A)QBT_TR[CONTEXT=TransferListDelegate]";
|
||||||
|
td.textContent = infohashV2;
|
||||||
|
td.title = infohashV2;
|
||||||
|
};
|
||||||
|
|
||||||
// reannounce
|
// reannounce
|
||||||
this.columns["reannounce"].updateTd = function(td, row) {
|
this.columns["reannounce"].updateTd = function(td, row) {
|
||||||
const time = window.qBittorrent.Misc.friendlyDuration(this.getRowValue(row));
|
const time = window.qBittorrent.Misc.friendlyDuration(this.getRowValue(row));
|
||||||
|
|
Loading…
Reference in a new issue