mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-02 21:52:32 -06:00
Merge pull request #13885 from thalieht/torrentOptionsDialog
Rework global speed limit dialog and introduce torrent options dialog
This commit is contained in:
@@ -238,6 +238,9 @@ namespace BitTorrent
|
||||
virtual int downloadLimit() const = 0;
|
||||
virtual int uploadLimit() const = 0;
|
||||
virtual bool superSeeding() const = 0;
|
||||
virtual bool isDHTDisabled() const = 0;
|
||||
virtual bool isPEXDisabled() const = 0;
|
||||
virtual bool isLSDDisabled() const = 0;
|
||||
virtual QVector<PeerInfo> peers() const = 0;
|
||||
virtual QBitArray pieces() const = 0;
|
||||
virtual QBitArray downloadingPieces() const = 0;
|
||||
@@ -277,6 +280,9 @@ namespace BitTorrent
|
||||
virtual void setUploadLimit(int limit) = 0;
|
||||
virtual void setDownloadLimit(int limit) = 0;
|
||||
virtual void setSuperSeeding(bool enable) = 0;
|
||||
virtual void setDHTDisabled(bool disable) = 0;
|
||||
virtual void setPEXDisabled(bool disable) = 0;
|
||||
virtual void setLSDDisabled(bool disable) = 0;
|
||||
virtual void flushCache() const = 0;
|
||||
virtual void addTrackers(const QVector<TrackerEntry> &trackers) = 0;
|
||||
virtual void replaceTrackers(const QVector<TrackerEntry> &trackers) = 0;
|
||||
|
||||
@@ -1016,6 +1016,21 @@ bool TorrentHandleImpl::superSeeding() const
|
||||
return static_cast<bool>(m_nativeStatus.flags & lt::torrent_flags::super_seeding);
|
||||
}
|
||||
|
||||
bool TorrentHandleImpl::isDHTDisabled() const
|
||||
{
|
||||
return static_cast<bool>(m_nativeStatus.flags & lt::torrent_flags::disable_dht);
|
||||
}
|
||||
|
||||
bool TorrentHandleImpl::isPEXDisabled() const
|
||||
{
|
||||
return static_cast<bool>(m_nativeStatus.flags & lt::torrent_flags::disable_pex);
|
||||
}
|
||||
|
||||
bool TorrentHandleImpl::isLSDDisabled() const
|
||||
{
|
||||
return static_cast<bool>(m_nativeStatus.flags & lt::torrent_flags::disable_lsd);
|
||||
}
|
||||
|
||||
QVector<PeerInfo> TorrentHandleImpl::peers() const
|
||||
{
|
||||
std::vector<lt::peer_info> nativePeers;
|
||||
@@ -1935,20 +1950,68 @@ void TorrentHandleImpl::setSeedingTimeLimit(int limit)
|
||||
|
||||
void TorrentHandleImpl::setUploadLimit(const int limit)
|
||||
{
|
||||
if (limit == uploadLimit())
|
||||
return;
|
||||
|
||||
m_nativeHandle.set_upload_limit(limit);
|
||||
saveResumeData();
|
||||
}
|
||||
|
||||
void TorrentHandleImpl::setDownloadLimit(const int limit)
|
||||
{
|
||||
if (limit == downloadLimit())
|
||||
return;
|
||||
|
||||
m_nativeHandle.set_download_limit(limit);
|
||||
saveResumeData();
|
||||
}
|
||||
|
||||
void TorrentHandleImpl::setSuperSeeding(const bool enable)
|
||||
{
|
||||
if (enable == superSeeding())
|
||||
return;
|
||||
|
||||
if (enable)
|
||||
m_nativeHandle.set_flags(lt::torrent_flags::super_seeding);
|
||||
else
|
||||
m_nativeHandle.unset_flags(lt::torrent_flags::super_seeding);
|
||||
saveResumeData();
|
||||
}
|
||||
|
||||
void TorrentHandleImpl::setDHTDisabled(const bool disable)
|
||||
{
|
||||
if (disable == isDHTDisabled())
|
||||
return;
|
||||
|
||||
if (disable)
|
||||
m_nativeHandle.set_flags(lt::torrent_flags::disable_dht);
|
||||
else
|
||||
m_nativeHandle.unset_flags(lt::torrent_flags::disable_dht);
|
||||
saveResumeData();
|
||||
}
|
||||
|
||||
void TorrentHandleImpl::setPEXDisabled(const bool disable)
|
||||
{
|
||||
if (disable == isPEXDisabled())
|
||||
return;
|
||||
|
||||
if (disable)
|
||||
m_nativeHandle.set_flags(lt::torrent_flags::disable_pex);
|
||||
else
|
||||
m_nativeHandle.unset_flags(lt::torrent_flags::disable_pex);
|
||||
saveResumeData();
|
||||
}
|
||||
|
||||
void TorrentHandleImpl::setLSDDisabled(const bool disable)
|
||||
{
|
||||
if (disable == isLSDDisabled())
|
||||
return;
|
||||
|
||||
if (disable)
|
||||
m_nativeHandle.set_flags(lt::torrent_flags::disable_lsd);
|
||||
else
|
||||
m_nativeHandle.unset_flags(lt::torrent_flags::disable_lsd);
|
||||
saveResumeData();
|
||||
}
|
||||
|
||||
void TorrentHandleImpl::flushCache() const
|
||||
|
||||
@@ -191,6 +191,9 @@ namespace BitTorrent
|
||||
int downloadLimit() const override;
|
||||
int uploadLimit() const override;
|
||||
bool superSeeding() const override;
|
||||
bool isDHTDisabled() const override;
|
||||
bool isPEXDisabled() const override;
|
||||
bool isLSDDisabled() const override;
|
||||
QVector<PeerInfo> peers() const override;
|
||||
QBitArray pieces() const override;
|
||||
QBitArray downloadingPieces() const override;
|
||||
@@ -224,6 +227,9 @@ namespace BitTorrent
|
||||
void setUploadLimit(int limit) override;
|
||||
void setDownloadLimit(int limit) override;
|
||||
void setSuperSeeding(bool enable) override;
|
||||
void setDHTDisabled(bool disable) override;
|
||||
void setPEXDisabled(bool disable) override;
|
||||
void setLSDDisabled(bool disable) override;
|
||||
void flushCache() const override;
|
||||
void addTrackers(const QVector<TrackerEntry> &trackers) override;
|
||||
void replaceTrackers(const QVector<TrackerEntry> &trackers) override;
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
// See issue #3059 for more details (https://github.com/qbittorrent/qBittorrent/issues/3059).
|
||||
|
||||
const char C_COPYRIGHT[] = "©";
|
||||
const char C_INEQUALITY[] = "≠";
|
||||
const char C_INFINITY[] = "∞";
|
||||
const char C_NON_BREAKING_SPACE[] = " ";
|
||||
const char C_THIN_SPACE[] = " ";
|
||||
|
||||
Reference in New Issue
Block a user