Browse Source

Merge pull request #9103 from thalieht/snaketocamel

Convert the names used in ui and c++ files from snake_case to camelCase
adaptive-webui-19844
Vladimir Golovnev 6 years ago committed by GitHub
parent
commit
9d58a189d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/app/application.cpp
  2. 3
      src/base/bittorrent/infohash.cpp
  3. 2
      src/base/bittorrent/infohash.h
  4. 12
      src/base/bittorrent/private/filterparserthread.cpp
  5. 1
      src/base/bittorrent/private/statistics.h
  6. 1
      src/base/bittorrent/session.cpp
  7. 3
      src/base/bittorrent/trackerentry.cpp
  8. 3
      src/base/iconprovider.cpp
  9. 1
      src/base/net/dnsupdater.cpp
  10. 1
      src/base/net/private/geoipdatabase.cpp
  11. 3
      src/base/net/smtp.cpp
  12. 1
      src/base/net/smtp.h
  13. 33
      src/base/preferences.cpp
  14. 2
      src/base/preferences.h
  15. 1
      src/base/private/profile_p.cpp
  16. 1
      src/base/profile.h
  17. 1
      src/base/rss/rss_feed.cpp
  18. 1
      src/base/rss/rss_session.h
  19. 1
      src/base/scanfoldersmodel.h
  20. 1
      src/base/settingsstorage.cpp
  21. 3
      src/base/torrentfilter.cpp
  22. 1
      src/base/utils/bytearray.cpp
  23. 2
      src/base/utils/fs.cpp
  24. 95
      src/base/utils/misc.cpp
  25. 1
      src/base/utils/misc.h
  26. 1
      src/base/utils/net.cpp
  27. 1
      src/base/utils/net.h
  28. 1
      src/base/utils/version.h
  29. 18
      src/gui/aboutdialog.h
  30. 16
      src/gui/aboutdialog.ui
  31. 37
      src/gui/addnewtorrentdialog.cpp
  32. 1
      src/gui/addnewtorrentdialog.h
  33. 18
      src/gui/addnewtorrentdialog.ui
  34. 342
      src/gui/advancedsettings.cpp
  35. 23
      src/gui/advancedsettings.h
  36. 1
      src/gui/categoryfiltermodel.h
  37. 2
      src/gui/categoryfilterwidget.cpp
  38. 6
      src/gui/deletionconfirmationdialog.h
  39. 2
      src/gui/deletionconfirmationdialog.ui
  40. 2
      src/gui/executionlogwidget.cpp
  41. 1
      src/gui/fspathedit_p.h
  42. 3
      src/gui/guiiconprovider.cpp
  43. 2
      src/gui/ipsubnetwhitelistoptionsdialog.cpp
  44. 19
      src/gui/mainwindow.h
  45. 71
      src/gui/optionsdialog.cpp
  46. 32
      src/gui/optionsdialog.ui
  47. 1
      src/gui/previewselectdialog.h
  48. 1
      src/gui/properties/peerlistsortmodel.h
  49. 4
      src/gui/properties/peersadditiondialog.cpp
  50. 2
      src/gui/properties/peersadditiondialog.ui
  51. 23
      src/gui/properties/propertieswidget.cpp
  52. 8
      src/gui/properties/propertieswidget.h
  53. 6
      src/gui/properties/propertieswidget.ui
  54. 1
      src/gui/properties/speedwidget.cpp
  55. 13
      src/gui/properties/trackersadditiondialog.cpp
  56. 4
      src/gui/properties/trackersadditiondialog.ui
  57. 27
      src/gui/rss/automatedrssdownloader.cpp
  58. 16
      src/gui/rss/automatedrssdownloader.ui
  59. 2
      src/gui/scanfoldersdelegate.cpp
  60. 6
      src/gui/search/pluginselectdialog.cpp
  61. 4
      src/gui/search/pluginselectdialog.h
  62. 3
      src/gui/search/searchjobwidget.cpp
  63. 2
      src/gui/search/searchjobwidget.h
  64. 7
      src/gui/search/searchlistdelegate.cpp
  65. 19
      src/gui/search/searchwidget.cpp
  66. 2
      src/gui/search/searchwidget.ui
  67. 1
      src/gui/speedlimitdialog.h
  68. 1
      src/gui/tagfiltermodel.cpp
  69. 1
      src/gui/tagfiltermodel.h
  70. 1
      src/gui/tagfilterwidget.cpp
  71. 3
      src/gui/torrentcontentmodel.cpp
  72. 40
      src/gui/trackerlogindialog.cpp
  73. 14
      src/gui/trackerlogindialog.h
  74. 4
      src/gui/trackerlogindialog.ui
  75. 1
      src/gui/transferlistfilterswidget.cpp
  76. 1
      src/gui/transferlistfilterswidget.h
  77. 12
      src/gui/transferlistwidget.cpp
  78. 1
      src/webui/webapplication.cpp

3
src/app/application.cpp

@ -33,7 +33,6 @@ @@ -33,7 +33,6 @@
#include <QAtomicInt>
#include <QDebug>
#include <QFileInfo>
#include <QLibraryInfo>
#include <QLocale>
#include <QProcess>
@ -51,8 +50,6 @@ @@ -51,8 +50,6 @@
#endif // Q_OS_WIN
#ifdef Q_OS_MAC
#include <QFileOpenEvent>
#include <QFont>
#include <QUrl>
#endif // Q_OS_MAC
#include "addnewtorrentdialog.h"
#include "gui/guiiconprovider.h"

3
src/base/bittorrent/infohash.cpp

@ -26,9 +26,10 @@ @@ -26,9 +26,10 @@
* exception statement from your version.
*/
#include <QHash>
#include "infohash.h"
#include <QHash>
using namespace BitTorrent;
InfoHash::InfoHash()

2
src/base/bittorrent/infohash.h

@ -29,8 +29,8 @@ @@ -29,8 +29,8 @@
#ifndef BITTORRENT_INFOHASH_H
#define BITTORRENT_INFOHASH_H
#include <QString>
#include <libtorrent/sha1_hash.hpp>
#include <QString>
namespace BitTorrent
{

12
src/base/bittorrent/private/filterparserthread.cpp

@ -407,24 +407,24 @@ int FilterParserThread::parseP2PFilterFile() @@ -407,24 +407,24 @@ int FilterParserThread::parseP2PFilterFile()
int FilterParserThread::getlineInStream(QDataStream &stream, std::string &name, char delim)
{
char c;
int total_read = 0;
int totalRead = 0;
int read;
do {
read = stream.readRawData(&c, 1);
total_read += read;
totalRead += read;
if (read > 0) {
if (c != delim) {
name += c;
}
else {
// Delim found
return total_read;
return totalRead;
}
}
}
while(read > 0);
while (read > 0);
return total_read;
return totalRead;
}
// Parser for PeerGuardian ip filter in p2p format
@ -455,7 +455,7 @@ int FilterParserThread::parseP2BFilterFile() @@ -455,7 +455,7 @@ int FilterParserThread::parseP2BFilterFile()
unsigned int start, end;
std::string name;
while(getlineInStream(stream, name, '\0') && !m_abort) {
while (getlineInStream(stream, name, '\0') && !m_abort) {
if (!stream.readRawData(reinterpret_cast<char*>(&start), sizeof(start))
|| !stream.readRawData(reinterpret_cast<char*>(&end), sizeof(end))) {
LogMsg(tr("Parsing Error: The filter file is not a valid PeerGuardian P2B file."), Log::CRITICAL);

1
src/base/bittorrent/private/statistics.h

@ -28,7 +28,6 @@ private: @@ -28,7 +28,6 @@ private:
void save() const;
void load();
private:
BitTorrent::Session *m_session;
// Will overflow at 15.9 EiB
quint64 m_alltimeUL;

1
src/base/bittorrent/session.cpp

@ -35,7 +35,6 @@ @@ -35,7 +35,6 @@
#include <string>
#include <QCoreApplication>
#include <QDateTime>
#include <QDebug>
#include <QDir>
#include <QHostAddress>

3
src/base/bittorrent/trackerentry.cpp

@ -26,11 +26,12 @@ @@ -26,11 +26,12 @@
* exception statement from your version.
*/
#include "trackerentry.h"
#include <QString>
#include "base/utils/misc.h"
#include "base/utils/string.h"
#include "trackerentry.h"
using namespace BitTorrent;

3
src/base/iconprovider.cpp

@ -27,9 +27,10 @@ @@ -27,9 +27,10 @@
* exception statement from your version.
*/
#include <QString>
#include "iconprovider.h"
#include <QString>
IconProvider::IconProvider(QObject *parent)
: QObject(parent)
{

1
src/base/net/dnsupdater.cpp

@ -30,7 +30,6 @@ @@ -30,7 +30,6 @@
#include <QDebug>
#include <QRegularExpression>
#include <QStringList>
#include <QUrlQuery>
#include "base/logger.h"

1
src/base/net/private/geoipdatabase.cpp

@ -29,7 +29,6 @@ @@ -29,7 +29,6 @@
#include <QDateTime>
#include <QDebug>
#include <QFile>
#include <QHash>
#include <QHostAddress>
#include <QVariant>

3
src/base/net/smtp.cpp

@ -34,12 +34,9 @@ @@ -34,12 +34,9 @@
#include <QCryptographicHash>
#include <QDebug>
#include <QHostAddress>
#include <QHostInfo>
#include <QNetworkInterface>
#include <QStringList>
#include <QTextCodec>
#include <QTextStream>
#ifndef QT_NO_OPENSSL
#include <QSslSocket>
#else

1
src/base/net/smtp.h

@ -46,7 +46,6 @@ class QSslSocket; @@ -46,7 +46,6 @@ class QSslSocket;
class QTcpSocket;
#endif
class QTextCodec;
class QTextStream;
namespace Net
{

33
src/base/preferences.cpp

@ -33,7 +33,6 @@ @@ -33,7 +33,6 @@
#include <QDir>
#include <QLocale>
#include <QMutableListIterator>
#include <QPair>
#include <QSettings>
#ifndef DISABLE_GUI
@ -257,8 +256,8 @@ void Preferences::setWinStartup(bool b) @@ -257,8 +256,8 @@ void Preferences::setWinStartup(bool b)
{
QSettings settings("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run", QSettings::NativeFormat);
if (b) {
const QString bin_path = "\"" + Utils::Fs::toNativePath(qApp->applicationFilePath()) + "\"";
settings.setValue("qBittorrent", bin_path);
const QString binPath = "\"" + Utils::Fs::toNativePath(qApp->applicationFilePath()) + "\"";
settings.setValue("qBittorrent", binPath);
}
else {
settings.remove("qBittorrent");
@ -555,24 +554,24 @@ void Preferences::setWebUiUsername(const QString &username) @@ -555,24 +554,24 @@ void Preferences::setWebUiUsername(const QString &username)
QString Preferences::getWebUiPassword() const
{
QString pass_ha1 = value("Preferences/WebUI/Password_ha1").toString();
if (pass_ha1.isEmpty()) {
QString passHa1 = value("Preferences/WebUI/Password_ha1").toString();
if (passHa1.isEmpty()) {
QCryptographicHash md5(QCryptographicHash::Md5);
md5.addData("adminadmin");
pass_ha1 = md5.result().toHex();
passHa1 = md5.result().toHex();
}
return pass_ha1;
return passHa1;
}
void Preferences::setWebUiPassword(const QString &new_password)
void Preferences::setWebUiPassword(const QString &newPassword)
{
// Do not overwrite current password with its hash
if (new_password == getWebUiPassword())
if (newPassword == getWebUiPassword())
return;
// Encode to md5 and save
QCryptographicHash md5(QCryptographicHash::Md5);
md5.addData(new_password.toLocal8Bit());
md5.addData(newPassword.toLocal8Bit());
setValue("Preferences/WebUI/Password_ha1", md5.result().toHex());
}
@ -1041,9 +1040,9 @@ void Preferences::setTorrentFileAssoc(bool set) @@ -1041,9 +1040,9 @@ void Preferences::setTorrentFileAssoc(bool set)
// .Torrent association
if (set) {
QString old_progid = settings.value(".torrent/Default").toString();
if (!old_progid.isEmpty() && (old_progid != "qBittorrent"))
settings.setValue(".torrent/OpenWithProgids/" + old_progid, "");
QString oldProgId = settings.value(".torrent/Default").toString();
if (!oldProgId.isEmpty() && (oldProgId != "qBittorrent"))
settings.setValue(".torrent/OpenWithProgids/" + oldProgId, "");
settings.setValue(".torrent/Default", "qBittorrent");
}
else if (isTorrentFileAssocSet()) {
@ -1059,15 +1058,15 @@ void Preferences::setMagnetLinkAssoc(bool set) @@ -1059,15 +1058,15 @@ void Preferences::setMagnetLinkAssoc(bool set)
// Magnet association
if (set) {
const QString command_str = "\"" + qApp->applicationFilePath() + "\" \"%1\"";
const QString icon_str = "\"" + qApp->applicationFilePath() + "\",1";
const QString commandStr = "\"" + qApp->applicationFilePath() + "\" \"%1\"";
const QString iconStr = "\"" + qApp->applicationFilePath() + "\",1";
settings.setValue("magnet/Default", "URL:Magnet link");
settings.setValue("magnet/Content Type", "application/x-magnet");
settings.setValue("magnet/URL Protocol", "");
settings.setValue("magnet/DefaultIcon/Default", Utils::Fs::toNativePath(icon_str));
settings.setValue("magnet/DefaultIcon/Default", Utils::Fs::toNativePath(iconStr));
settings.setValue("magnet/shell/Default", "open");
settings.setValue("magnet/shell/open/command/Default", Utils::Fs::toNativePath(command_str));
settings.setValue("magnet/shell/open/command/Default", Utils::Fs::toNativePath(commandStr));
}
else if (isMagnetLinkAssocSet()) {
settings.remove("magnet");

2
src/base/preferences.h

@ -192,7 +192,7 @@ public: @@ -192,7 +192,7 @@ public:
QString getWebUiUsername() const;
void setWebUiUsername(const QString &username);
QString getWebUiPassword() const;
void setWebUiPassword(const QString &new_password);
void setWebUiPassword(const QString &newPassword);
// WebUI security
bool isWebUiClickjackingProtectionEnabled() const;

1
src/base/private/profile_p.cpp

@ -25,7 +25,6 @@ @@ -25,7 +25,6 @@
* modify file(s), you may extend this exception to your version of the file(s),
* but you are not obligated to do so. If you do not wish to do so, delete this
* exception statement from your version.
*
*/
#include "profile_p.h"

1
src/base/profile.h

@ -25,7 +25,6 @@ @@ -25,7 +25,6 @@
* modify file(s), you may extend this exception to your version of the file(s),
* but you are not obligated to do so. If you do not wish to do so, delete this
* exception statement from your version.
*
*/
#ifndef QBT_PROFILE_H

1
src/base/rss/rss_feed.cpp

@ -30,7 +30,6 @@ @@ -30,7 +30,6 @@
#include "rss_feed.h"
#include <QCryptographicHash>
#include <QDebug>
#include <QDir>
#include <QJsonArray>

1
src/base/rss/rss_session.h

@ -65,7 +65,6 @@ @@ -65,7 +65,6 @@
#include <QHash>
#include <QObject>
#include <QPointer>
#include <QStringList>
#include <QTimer>
class QThread;

1
src/base/scanfoldersmodel.h

@ -104,7 +104,6 @@ private: @@ -104,7 +104,6 @@ private:
QString downloadPathTorrentFolder(const QString &filePath) const;
int findPathData(const QString &path) const;
private:
static ScanFoldersModel *m_instance;
struct PathData;

1
src/base/settingsstorage.cpp

@ -32,7 +32,6 @@ @@ -32,7 +32,6 @@
#include <memory>
#include <QFile>
#include <QHash>
#include <QStringList>
#include "logger.h"
#include "profile.h"

3
src/base/torrentfilter.cpp

@ -26,9 +26,10 @@ @@ -26,9 +26,10 @@
* exception statement from your version.
*/
#include "bittorrent/torrenthandle.h"
#include "torrentfilter.h"
#include "bittorrent/torrenthandle.h"
const QString TorrentFilter::AnyCategory;
const QStringSet TorrentFilter::AnyHash = (QStringSet() << QString());
const QString TorrentFilter::AnyTag;

1
src/base/utils/bytearray.cpp

@ -27,6 +27,7 @@ @@ -27,6 +27,7 @@
*/
#include "bytearray.h"
#include <QList>
QList<QByteArray> Utils::ByteArray::splitToViews(const QByteArray &in, const QByteArray &sep, const QString::SplitBehavior behavior)

2
src/base/utils/fs.cpp

@ -210,7 +210,7 @@ bool Utils::Fs::sameFiles(const QString &path1, const QString &path2) @@ -210,7 +210,7 @@ bool Utils::Fs::sameFiles(const QString &path1, const QString &path2)
if (!f2.open(QIODevice::ReadOnly)) return false;
const int readSize = 1024 * 1024; // 1 MiB
while(!f1.atEnd() && !f2.atEnd()) {
while (!f1.atEnd() && !f2.atEnd()) {
if (f1.read(readSize) != f2.read(readSize))
return false;
}

95
src/base/utils/misc.cpp

@ -45,9 +45,7 @@ @@ -45,9 +45,7 @@
#endif
#include <QByteArray>
#include <QDateTime>
#include <QDebug>
#include <QDir>
#include <QFileInfo>
#include <QProcess>
#include <QRegularExpression>
@ -299,55 +297,50 @@ qlonglong Utils::Misc::sizeInBytes(qreal size, Utils::Misc::SizeUnit unit) @@ -299,55 +297,50 @@ qlonglong Utils::Misc::sizeInBytes(qreal size, Utils::Misc::SizeUnit unit)
bool Utils::Misc::isPreviewable(const QString &extension)
{
static QSet<QString> multimedia_extensions;
if (multimedia_extensions.empty()) {
multimedia_extensions.insert("3GP");
multimedia_extensions.insert("AAC");
multimedia_extensions.insert("AC3");
multimedia_extensions.insert("AIF");
multimedia_extensions.insert("AIFC");
multimedia_extensions.insert("AIFF");
multimedia_extensions.insert("ASF");
multimedia_extensions.insert("AU");
multimedia_extensions.insert("AVI");
multimedia_extensions.insert("FLAC");
multimedia_extensions.insert("FLV");
multimedia_extensions.insert("M3U");
multimedia_extensions.insert("M4A");
multimedia_extensions.insert("M4P");
multimedia_extensions.insert("M4V");
multimedia_extensions.insert("MID");
multimedia_extensions.insert("MKV");
multimedia_extensions.insert("MOV");
multimedia_extensions.insert("MP2");
multimedia_extensions.insert("MP3");
multimedia_extensions.insert("MP4");
multimedia_extensions.insert("MPC");
multimedia_extensions.insert("MPE");
multimedia_extensions.insert("MPEG");
multimedia_extensions.insert("MPG");
multimedia_extensions.insert("MPP");
multimedia_extensions.insert("OGG");
multimedia_extensions.insert("OGM");
multimedia_extensions.insert("OGV");
multimedia_extensions.insert("QT");
multimedia_extensions.insert("RA");
multimedia_extensions.insert("RAM");
multimedia_extensions.insert("RM");
multimedia_extensions.insert("RMV");
multimedia_extensions.insert("RMVB");
multimedia_extensions.insert("SWA");
multimedia_extensions.insert("SWF");
multimedia_extensions.insert("VOB");
multimedia_extensions.insert("WAV");
multimedia_extensions.insert("WMA");
multimedia_extensions.insert("WMV");
}
if (extension.isEmpty())
return false;
return multimedia_extensions.contains(extension.toUpper());
static const QSet<QString> multimediaExtensions = {
"3GP",
"AAC",
"AC3",
"AIF",
"AIFC",
"AIFF",
"ASF",
"AU",
"AVI",
"FLAC",
"FLV",
"M3U",
"M4A",
"M4P",
"M4V",
"MID",
"MKV",
"MOV",
"MP2",
"MP3",
"MP4",
"MPC",
"MPE",
"MPEG",
"MPG",
"MPP",
"OGG",
"OGM",
"OGV",
"QT",
"RA",
"RAM",
"RM",
"RMV",
"RMVB",
"SWA",
"SWF",
"VOB",
"WAV",
"WMA",
"WMV"
};
return multimediaExtensions.contains(extension.toUpper());
}
// Take a number of seconds and return an user-friendly

1
src/base/utils/misc.h

@ -40,7 +40,6 @@ @@ -40,7 +40,6 @@
#endif
#include <QDir>
#include <QFile>
#include <QPoint>
#include <QSize>
#include <QString>

1
src/base/utils/net.cpp

@ -30,7 +30,6 @@ @@ -30,7 +30,6 @@
#include <QHostAddress>
#include <QString>
#include <QStringList>
namespace Utils
{

1
src/base/utils/net.h

@ -34,7 +34,6 @@ @@ -34,7 +34,6 @@
class QHostAddress;
class QString;
class QStringList;
namespace Utils
{

1
src/base/utils/version.h

@ -34,7 +34,6 @@ @@ -34,7 +34,6 @@
#include <QDebug>
#include <QString>
#include <QStringList>
namespace Utils
{

18
src/gui/aboutdialog.h

@ -49,9 +49,9 @@ public: @@ -49,9 +49,9 @@ public:
// Title
#if defined(__x86_64__) || defined(_M_X64)
lb_name->setText("<b><h2>qBittorrent " QBT_VERSION " (64-bit)</h2></b>");
labelName->setText("<b><h2>qBittorrent " QBT_VERSION " (64-bit)</h2></b>");
#else
lb_name->setText("<b><h2>qBittorrent " QBT_VERSION " (32-bit)</h2></b>");
labelName->setText("<b><h2>qBittorrent " QBT_VERSION " (32-bit)</h2></b>");
#endif
logo->setPixmap(Utils::Gui::scaledPixmapSvg(":/icons/skin/qbittorrent-tray.svg", this, 32));
@ -72,35 +72,35 @@ public: @@ -72,35 +72,35 @@ public:
, tr("Home Page:")
, tr("Forum:")
, tr("Bug Tracker:"));
lb_about->setText(aboutText);
labelAbout->setText(aboutText);
labelMascot->setPixmap(Utils::Gui::scaledPixmap(":/icons/skin/mascot.png", this));
// Thanks
QFile thanksfile(":/thanks.html");
if (thanksfile.open(QIODevice::ReadOnly | QIODevice::Text)) {
te_thanks->setHtml(QString::fromUtf8(thanksfile.readAll().constData()));
textBrowserThanks->setHtml(QString::fromUtf8(thanksfile.readAll().constData()));
thanksfile.close();
}
// Translation
QFile translatorsfile(":/translators.html");
if (translatorsfile.open(QIODevice::ReadOnly | QIODevice::Text)) {
te_translation->setHtml(QString::fromUtf8(translatorsfile.readAll().constData()));
textBrowserTranslation->setHtml(QString::fromUtf8(translatorsfile.readAll().constData()));
translatorsfile.close();
}
// License
QFile licensefile(":/gpl.html");
if (licensefile.open(QIODevice::ReadOnly | QIODevice::Text)) {
te_license->setHtml(QString::fromUtf8(licensefile.readAll().constData()));
textBrowserLicense->setHtml(QString::fromUtf8(licensefile.readAll().constData()));
licensefile.close();
}
// Libraries
label_11->setText(QT_VERSION_STR);
label_12->setText(Utils::Misc::libtorrentVersionString());
label_13->setText(Utils::Misc::boostVersionString());
labelQtVer->setText(QT_VERSION_STR);
labelLibtVer->setText(Utils::Misc::libtorrentVersionString());
labelBoostVer->setText(Utils::Misc::boostVersionString());
Utils::Gui::resize(this);
show();

16
src/gui/aboutdialog.ui

@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
<widget class="QLabel" name="logo"/>
</item>
<item>
<widget class="QLabel" name="lb_name">
<widget class="QLabel" name="labelName">
<property name="text">
<string notr="true">qBittorrent</string>
</property>
@ -56,7 +56,7 @@ @@ -56,7 +56,7 @@
<widget class="QLabel" name="labelMascot"/>
</item>
<item row="0" column="1">
<widget class="QLabel" name="lb_about">
<widget class="QLabel" name="labelAbout">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
@ -254,7 +254,7 @@ @@ -254,7 +254,7 @@
<number>0</number>
</property>
<item>
<widget class="QTextBrowser" name="te_thanks">
<widget class="QTextBrowser" name="textBrowserThanks">
<property name="openExternalLinks">
<bool>true</bool>
</property>
@ -280,7 +280,7 @@ @@ -280,7 +280,7 @@
<number>0</number>
</property>
<item>
<widget class="QTextBrowser" name="te_translation">
<widget class="QTextBrowser" name="textBrowserTranslation">
<property name="lineWrapMode">
<enum>QTextEdit::NoWrap</enum>
</property>
@ -306,7 +306,7 @@ @@ -306,7 +306,7 @@
<number>0</number>
</property>
<item>
<widget class="QTextBrowser" name="te_license">
<widget class="QTextBrowser" name="textBrowserLicense">
<property name="openExternalLinks">
<bool>true</bool>
</property>
@ -336,7 +336,7 @@ @@ -336,7 +336,7 @@
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="2">
<widget class="QLabel" name="label_13">
<widget class="QLabel" name="labelBoostVer">
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
@ -395,14 +395,14 @@ @@ -395,14 +395,14 @@
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="label_11">
<widget class="QLabel" name="labelQtVer">
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="label_12">
<widget class="QLabel" name="labelLibtVer">
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>

37
src/gui/addnewtorrentdialog.cpp

@ -30,7 +30,6 @@ @@ -30,7 +30,6 @@
#include <QDebug>
#include <QFile>
#include <QFileDialog>
#include <QMenu>
#include <QPushButton>
#include <QString>
@ -148,7 +147,7 @@ AddNewTorrentDialog::AddNewTorrentDialog(const BitTorrent::AddTorrentParams &inP @@ -148,7 +147,7 @@ AddNewTorrentDialog::AddNewTorrentDialog(const BitTorrent::AddTorrentParams &inP
m_ui->contentTreeView->header()->setSortIndicator(0, Qt::AscendingOrder);
loadState();
// Signal / slots
connect(m_ui->adv_button, &QToolButton::clicked, this, &AddNewTorrentDialog::showAdvancedSettings);
connect(m_ui->toolButtonAdvanced, &QToolButton::clicked, this, &AddNewTorrentDialog::showAdvancedSettings);
connect(m_ui->doNotDeleteTorrentCheckBox, &QCheckBox::clicked, this, &AddNewTorrentDialog::doNotDeleteTorrentClicked);
QShortcut *editHotkey = new QShortcut(Qt::Key_F2, m_ui->contentTreeView, nullptr, nullptr, Qt::WidgetShortcut);
connect(editHotkey, &QShortcut::activated, this, &AddNewTorrentDialog::renameSelectedFile);
@ -213,7 +212,7 @@ void AddNewTorrentDialog::loadState() @@ -213,7 +212,7 @@ void AddNewTorrentDialog::loadState()
const int height = newSize.height();
resize(width, height);
m_ui->adv_button->setChecked(settings()->loadValue(KEY_EXPANDED).toBool());
m_ui->toolButtonAdvanced->setChecked(settings()->loadValue(KEY_EXPANDED).toBool());
}
void AddNewTorrentDialog::saveState()
@ -221,7 +220,7 @@ void AddNewTorrentDialog::saveState() @@ -221,7 +220,7 @@ void AddNewTorrentDialog::saveState()
if (m_contentModel)
settings()->storeValue(KEY_TREEHEADERSTATE, m_ui->contentTreeView->header()->saveState());
settings()->storeValue(KEY_WIDTH, width());
settings()->storeValue(KEY_EXPANDED, m_ui->adv_button->isChecked());
settings()->storeValue(KEY_EXPANDED, m_ui->toolButtonAdvanced->isChecked());
}
void AddNewTorrentDialog::show(QString source, const BitTorrent::AddTorrentParams &inParams, QWidget *parent)
@ -375,17 +374,17 @@ void AddNewTorrentDialog::showAdvancedSettings(bool show) @@ -375,17 +374,17 @@ void AddNewTorrentDialog::showAdvancedSettings(bool show)
const int minimumW = minimumWidth();
setMinimumWidth(width()); // to remain the same width
if (show) {
m_ui->adv_button->setText(QString::fromUtf8(C_UP));
m_ui->settings_group->setVisible(true);
m_ui->toolButtonAdvanced->setText(QString::fromUtf8(C_UP));
m_ui->groupBoxSettings->setVisible(true);
m_ui->infoGroup->setVisible(true);
m_ui->contentTreeView->setVisible(m_hasMetadata);
static_cast<QVBoxLayout *>(layout())->insertWidget(layout()->indexOf(m_ui->never_show_cb) + 1, m_ui->adv_button);
static_cast<QVBoxLayout *>(layout())->insertWidget(layout()->indexOf(m_ui->checkBoxNeverShow) + 1, m_ui->toolButtonAdvanced);
}
else {
m_ui->adv_button->setText(QString::fromUtf8(C_DOWN));
m_ui->settings_group->setVisible(false);
m_ui->toolButtonAdvanced->setText(QString::fromUtf8(C_DOWN));
m_ui->groupBoxSettings->setVisible(false);
m_ui->infoGroup->setVisible(false);
m_ui->buttonsHLayout->insertWidget(0, layout()->takeAt(layout()->indexOf(m_ui->never_show_cb) + 1)->widget());
m_ui->buttonsHLayout->insertWidget(0, layout()->takeAt(layout()->indexOf(m_ui->checkBoxNeverShow) + 1)->widget());
}
adjustSize();
setMinimumWidth(minimumW);
@ -444,7 +443,7 @@ void AddNewTorrentDialog::updateDiskSpaceLabel() @@ -444,7 +443,7 @@ void AddNewTorrentDialog::updateDiskSpaceLabel()
sizeString += tr("Free space on disk: %1").arg(Utils::Misc::friendlyUnit(Utils::Fs::freeDiskSpaceOnPath(
m_ui->savePath->selectedPath())));
sizeString += ")";
m_ui->size_lbl->setText(sizeString);
m_ui->labelSize->setText(sizeString);
}
void AddNewTorrentDialog::onSavePathChanged(const QString &newPath)
@ -608,7 +607,7 @@ void AddNewTorrentDialog::displayContentTreeMenu(const QPoint &) @@ -608,7 +607,7 @@ void AddNewTorrentDialog::displayContentTreeMenu(const QPoint &)
}
QMenu subMenu;
subMenu.setTitle(tr("Priority"));
subMenu.addAction(m_ui->actionNot_downloaded);
subMenu.addAction(m_ui->actionNotDownloaded);
subMenu.addAction(m_ui->actionNormal);
subMenu.addAction(m_ui->actionHigh);
subMenu.addAction(m_ui->actionMaximum);
@ -625,7 +624,7 @@ void AddNewTorrentDialog::displayContentTreeMenu(const QPoint &) @@ -625,7 +624,7 @@ void AddNewTorrentDialog::displayContentTreeMenu(const QPoint &)
prio = prio::HIGH;
else if (act == m_ui->actionMaximum)
prio = prio::MAXIMUM;
else if (act == m_ui->actionNot_downloaded)
else if (act == m_ui->actionNotDownloaded)
prio = prio::IGNORED;
qDebug("Setting files priority");
@ -669,7 +668,7 @@ void AddNewTorrentDialog::accept() @@ -669,7 +668,7 @@ void AddNewTorrentDialog::accept()
m_torrentParams.useAutoTMM = TriStateBool::True;
}
setEnabled(!m_ui->never_show_cb->isChecked());
setEnabled(!m_ui->checkBoxNeverShow->isChecked());
// Add torrent
if (!m_hasMetadata)
@ -725,7 +724,7 @@ void AddNewTorrentDialog::setupTreeview() @@ -725,7 +724,7 @@ void AddNewTorrentDialog::setupTreeview()
{
if (!m_hasMetadata) {
setCommentText(tr("Not Available", "This comment is unavailable"));
m_ui->date_lbl->setText(tr("Not Available", "This date is unavailable"));
m_ui->labelDate->setText(tr("Not Available", "This date is unavailable"));
}
else {
// Set dialog title
@ -733,7 +732,7 @@ void AddNewTorrentDialog::setupTreeview() @@ -733,7 +732,7 @@ void AddNewTorrentDialog::setupTreeview()
// Set torrent information
setCommentText(Utils::Misc::parseHtmlLinks(m_torrentInfo.comment()));
m_ui->date_lbl->setText(!m_torrentInfo.creationDate().isNull() ? m_torrentInfo.creationDate().toString(Qt::DefaultLocaleShortDate) : tr("Not available"));
m_ui->labelDate->setText(!m_torrentInfo.creationDate().isNull() ? m_torrentInfo.creationDate().toString(Qt::DefaultLocaleShortDate) : tr("Not available"));
// Prepare content tree
m_contentModel = new TorrentContentFilterModel(this);
@ -795,7 +794,7 @@ void AddNewTorrentDialog::TMMChanged(int index) @@ -795,7 +794,7 @@ void AddNewTorrentDialog::TMMChanged(int index)
m_ui->groupBoxSavePath->setEnabled(true);
m_ui->savePath->blockSignals(false);
m_ui->savePath->setCurrentIndex(m_oldIndex < m_ui->savePath->count() ? m_oldIndex : m_ui->savePath->count() - 1);
m_ui->adv_button->setEnabled(true);
m_ui->toolButtonAdvanced->setEnabled(true);
}
else {
m_ui->groupBoxSavePath->setEnabled(false);
@ -803,8 +802,8 @@ void AddNewTorrentDialog::TMMChanged(int index) @@ -803,8 +802,8 @@ void AddNewTorrentDialog::TMMChanged(int index)
m_ui->savePath->clear();
QString savePath = BitTorrent::Session::instance()->categorySavePath(m_ui->categoryComboBox->currentText());
m_ui->savePath->addItem(savePath);
m_ui->adv_button->setChecked(true);
m_ui->adv_button->setEnabled(false);
m_ui->toolButtonAdvanced->setChecked(true);
m_ui->toolButtonAdvanced->setEnabled(false);
showAdvancedSettings(true);
}
}

1
src/gui/addnewtorrentdialog.h

@ -32,7 +32,6 @@ @@ -32,7 +32,6 @@
#include <QDialog>
#include <QScopedPointer>
#include <QShortcut>
#include <QUrl>
#include "base/bittorrent/addtorrentparams.h"
#include "base/bittorrent/infohash.h"

18
src/gui/addnewtorrentdialog.ui

@ -82,14 +82,14 @@ @@ -82,14 +82,14 @@
</widget>
</item>
<item>
<widget class="QCheckBox" name="never_show_cb">
<widget class="QCheckBox" name="checkBoxNeverShow">
<property name="text">
<string>Never show again</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="adv_button">
<widget class="QToolButton" name="toolButtonAdvanced">
<property name="text">
<string notr="true">▼</string>
</property>
@ -99,7 +99,7 @@ @@ -99,7 +99,7 @@
</widget>
</item>
<item>
<widget class="QGroupBox" name="settings_group">
<widget class="QGroupBox" name="groupBoxSettings">
<property name="title">
<string>Torrent settings</string>
</property>
@ -224,7 +224,7 @@ @@ -224,7 +224,7 @@
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="date_lbl">
<widget class="QLabel" name="labelDate">
<property name="text">
<string/>
</property>
@ -245,7 +245,7 @@ @@ -245,7 +245,7 @@
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="size_lbl">
<widget class="QLabel" name="labelSize">
<property name="text">
<string/>
</property>
@ -372,7 +372,7 @@ @@ -372,7 +372,7 @@
<string>Maximum</string>
</property>
</action>
<action name="actionNot_downloaded">
<action name="actionNotDownloaded">
<property name="text">
<string>Do not download</string>
</property>
@ -393,9 +393,9 @@ @@ -393,9 +393,9 @@
</customwidgets>
<tabstops>
<tabstop>savePath</tabstop>
<tabstop>checkBoxRememberLastSavePath</tabstop>
<tabstop>never_show_cb</tabstop>
<tabstop>adv_button</tabstop>
<tabstop>checkBoxRememberLastSavePath</tabstop>
<tabstop>checkBoxNeverShow</tabstop>
<tabstop>toolButtonAdvanced</tabstop>
<tabstop>startTorrentCheckBox</tabstop>
<tabstop>skipCheckingCheckBox</tabstop>
<tabstop>categoryComboBox</tabstop>

342
src/gui/advancedsettings.cpp

@ -125,9 +125,9 @@ AdvancedSettings::AdvancedSettings(QWidget *parent) @@ -125,9 +125,9 @@ AdvancedSettings::AdvancedSettings(QWidget *parent)
setSelectionMode(QAbstractItemView::NoSelection);
setEditTriggers(QAbstractItemView::NoEditTriggers);
// Signals
connect(&spin_cache, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged)
connect(&spinBoxCache, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged)
, this, &AdvancedSettings::updateCacheSpinSuffix);
connect(&combo_iface, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged)
connect(&comboBoxInterface, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged)
, this, &AdvancedSettings::updateInterfaceAddressCombo);
// Load settings
loadAdvancedSettings();
@ -141,116 +141,116 @@ void AdvancedSettings::saveAdvancedSettings() @@ -141,116 +141,116 @@ void AdvancedSettings::saveAdvancedSettings()
BitTorrent::Session *const session = BitTorrent::Session::instance();
// Disk write cache
session->setDiskCacheSize(spin_cache.value());
session->setDiskCacheTTL(spin_cache_ttl.value());
session->setDiskCacheSize(spinBoxCache.value());
session->setDiskCacheTTL(spinBoxCacheTTL.value());
// Enable OS cache
session->setUseOSCache(cb_os_cache.isChecked());
session->setUseOSCache(checkBoxOsCache.isChecked());
// Guided read cache
session->setGuidedReadCacheEnabled(cbGuidedReadCache.isChecked());
session->setGuidedReadCacheEnabled(checkBoxGuidedReadCache.isChecked());
// Coalesce reads & writes
session->setCoalesceReadWriteEnabled(cbCoalesceRW.isChecked());
session->setCoalesceReadWriteEnabled(checkBoxCoalesceRW.isChecked());
// Suggest mode
session->setSuggestMode(cbSuggestMode.isChecked());
session->setSuggestMode(checkBoxSuggestMode.isChecked());
// Send buffer watermark
session->setSendBufferWatermark(spinSendBufferWatermark.value());
session->setSendBufferLowWatermark(spinSendBufferLowWatermark.value());
session->setSendBufferWatermarkFactor(spinSendBufferWatermarkFactor.value());
session->setSendBufferWatermark(spinBoxSendBufferWatermark.value());
session->setSendBufferLowWatermark(spinBoxSendBufferLowWatermark.value());
session->setSendBufferWatermarkFactor(spinBoxSendBufferWatermarkFactor.value());
// Save resume data interval
session->setSaveResumeDataInterval(spin_save_resume_data_interval.value());
session->setSaveResumeDataInterval(spinBoxSaveResumeDataInterval.value());
// Outgoing ports
session->setOutgoingPortsMin(outgoing_ports_min.value());
session->setOutgoingPortsMax(outgoing_ports_max.value());
session->setOutgoingPortsMin(spinBoxOutgoingPortsMin.value());
session->setOutgoingPortsMax(spinBoxOutgoingPortsMax.value());
// uTP-TCP mixed mode
session->setUtpMixedMode(static_cast<BitTorrent::MixedModeAlgorithm>(comboUtpMixedMode.currentIndex()));
session->setUtpMixedMode(static_cast<BitTorrent::MixedModeAlgorithm>(comboBoxUtpMixedMode.currentIndex()));
// multiple connections per IP
session->setMultiConnectionsPerIpEnabled(cbMultiConnectionsPerIp.isChecked());
session->setMultiConnectionsPerIpEnabled(checkBoxMultiConnectionsPerIp.isChecked());
// Recheck torrents on completion
pref->recheckTorrentsOnCompletion(cb_recheck_completed.isChecked());
pref->recheckTorrentsOnCompletion(checkBoxRecheckCompleted.isChecked());
// Transfer list refresh interval
session->setRefreshInterval(spin_list_refresh.value());
session->setRefreshInterval(spinBoxListRefresh.value());
// Peer resolution
pref->resolvePeerCountries(cb_resolve_countries.isChecked());
pref->resolvePeerHostNames(cb_resolve_hosts.isChecked());
pref->resolvePeerCountries(checkBoxResolveCountries.isChecked());
pref->resolvePeerHostNames(checkBoxResolveHosts.isChecked());
// Max Half-Open connections
session->setMaxHalfOpenConnections(spin_maxhalfopen.value());
session->setMaxHalfOpenConnections(spinBoxMaxHalfOpen.value());
// Super seeding
session->setSuperSeedingEnabled(cb_super_seeding.isChecked());
session->setSuperSeedingEnabled(checkBoxSuperSeeding.isChecked());
// Network interface
if (combo_iface.currentIndex() == 0) {
if (comboBoxInterface.currentIndex() == 0) {
// All interfaces (default)
session->setNetworkInterface(QString());
session->setNetworkInterfaceName(QString());
}
else {
session->setNetworkInterface(combo_iface.itemData(combo_iface.currentIndex()).toString());
session->setNetworkInterfaceName(combo_iface.currentText());
session->setNetworkInterface(comboBoxInterface.itemData(comboBoxInterface.currentIndex()).toString());
session->setNetworkInterfaceName(comboBoxInterface.currentText());
}
// Interface address
if (combo_iface_address.currentIndex() == 0) {
if (comboBoxInterfaceAddress.currentIndex() == 0) {
// All addresses (default)
session->setNetworkInterfaceAddress(QString::null);
}
else {
QHostAddress ifaceAddr(combo_iface_address.currentText().trimmed());
QHostAddress ifaceAddr(comboBoxInterfaceAddress.currentText().trimmed());
ifaceAddr.isNull() ? session->setNetworkInterfaceAddress(QString::null) : session->setNetworkInterfaceAddress(ifaceAddr.toString());
}
session->setIPv6Enabled(cb_listen_ipv6.isChecked());
session->setIPv6Enabled(checkBoxListenIPv6.isChecked());
// Announce IP
QHostAddress addr(txtAnnounceIP.text().trimmed());
QHostAddress addr(lineEditAnnounceIP.text().trimmed());
session->setAnnounceIP(addr.isNull() ? "" : addr.toString());
// Program notification
MainWindow *const mainWindow = static_cast<Application*>(QCoreApplication::instance())->mainWindow();
mainWindow->setNotificationsEnabled(cb_program_notifications.isChecked());
mainWindow->setTorrentAddedNotificationsEnabled(cb_torrent_added_notifications.isChecked());
mainWindow->setNotificationsEnabled(checkBoxProgramNotifications.isChecked());
mainWindow->setTorrentAddedNotificationsEnabled(checkBoxTorrentAddedNotifications.isChecked());
// Misc GUI properties
mainWindow->setDownloadTrackerFavicon(cb_tracker_favicon.isChecked());
AddNewTorrentDialog::setSavePathHistoryLength(spinSavePathHistoryLength.value());
mainWindow->setDownloadTrackerFavicon(checkBoxTrackerFavicon.isChecked());
AddNewTorrentDialog::setSavePathHistoryLength(spinBoxSavePathHistoryLength.value());
// Tracker
session->setTrackerEnabled(cb_tracker_status.isChecked());
pref->setTrackerPort(spin_tracker_port.value());
session->setTrackerEnabled(checkBoxTrackerStatus.isChecked());
pref->setTrackerPort(spinBoxTrackerPort.value());
// Choking algorithm
session->setChokingAlgorithm(static_cast<BitTorrent::ChokingAlgorithm>(comboChokingAlgorithm.currentIndex()));
session->setChokingAlgorithm(static_cast<BitTorrent::ChokingAlgorithm>(comboBoxChokingAlgorithm.currentIndex()));
// Seed choking algorithm
session->setSeedChokingAlgorithm(static_cast<BitTorrent::SeedChokingAlgorithm>(comboSeedChokingAlgorithm.currentIndex()));
session->setSeedChokingAlgorithm(static_cast<BitTorrent::SeedChokingAlgorithm>(comboBoxSeedChokingAlgorithm.currentIndex()));
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
pref->setUpdateCheckEnabled(cb_update_check.isChecked());
pref->setUpdateCheckEnabled(checkBoxUpdateCheck.isChecked());
#endif
// Icon theme
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC))
pref->useSystemIconTheme(cb_use_icon_theme.isChecked());
pref->useSystemIconTheme(checkBoxUseIconTheme.isChecked());
#endif
pref->setConfirmTorrentRecheck(cb_confirm_torrent_recheck.isChecked());
pref->setConfirmTorrentRecheck(checkBoxConfirmTorrentRecheck.isChecked());
pref->setConfirmRemoveAllTags(cb_confirm_remove_all_tags.isChecked());
pref->setConfirmRemoveAllTags(checkBoxConfirmRemoveAllTags.isChecked());
session->setAnnounceToAllTrackers(cb_announce_all_trackers.isChecked());
session->setAnnounceToAllTiers(cb_announce_all_tiers.isChecked());
session->setAnnounceToAllTrackers(checkBoxAnnounceAllTrackers.isChecked());
session->setAnnounceToAllTiers(checkBoxAnnounceAllTiers.isChecked());
}
void AdvancedSettings::updateCacheSpinSuffix(int value)
{
if (value == 0)
spin_cache.setSuffix(tr(" (disabled)"));
spinBoxCache.setSuffix(tr(" (disabled)"));
else if (value < 0)
spin_cache.setSuffix(tr(" (auto)"));
spinBoxCache.setSuffix(tr(" (auto)"));
else
spin_cache.setSuffix(tr(" MiB"));
spinBoxCache.setSuffix(tr(" MiB"));
}
void AdvancedSettings::updateInterfaceAddressCombo()
{
// Try to get the currently selected interface name
const QString ifaceName = combo_iface.itemData(combo_iface.currentIndex()).toString(); // Empty string for the first element
const QString ifaceName = comboBoxInterface.itemData(comboBoxInterface.currentIndex()).toString(); // Empty string for the first element
const QString currentAddress = BitTorrent::Session::instance()->networkInterfaceAddress();
// Clear all items and reinsert them, default to all
combo_iface_address.clear();
combo_iface_address.addItem(tr("All addresses"));
combo_iface_address.setCurrentIndex(0);
comboBoxInterfaceAddress.clear();
comboBoxInterfaceAddress.addItem(tr("All addresses"));
comboBoxInterfaceAddress.setCurrentIndex(0);
auto populateCombo = [this, &currentAddress](const QString &ip, const QAbstractSocket::NetworkLayerProtocol &protocol)
{
@ -258,10 +258,10 @@ void AdvancedSettings::updateInterfaceAddressCombo() @@ -258,10 +258,10 @@ void AdvancedSettings::updateInterfaceAddressCombo()
// Only take ipv4 for now?
if ((protocol != QAbstractSocket::IPv4Protocol) && (protocol != QAbstractSocket::IPv6Protocol))
return;
combo_iface_address.addItem(ip);
comboBoxInterfaceAddress.addItem(ip);
//Try to select the last added one
if (ip == currentAddress)
combo_iface_address.setCurrentIndex(combo_iface_address.count() - 1);
comboBoxInterfaceAddress.setCurrentIndex(comboBoxInterfaceAddress.count() - 1);
};
if (ifaceName.isEmpty()) {
@ -297,104 +297,104 @@ void AdvancedSettings::loadAdvancedSettings() @@ -297,104 +297,104 @@ void AdvancedSettings::loadAdvancedSettings()
labelLibtorrentLink.setText(QString("<a href=\"%1\">%2</a>").arg("https://www.libtorrent.org/reference.html", tr("Open documentation")));
labelLibtorrentLink.setOpenExternalLinks(true);
// Disk write cache
spin_cache.setMinimum(-1);
spinBoxCache.setMinimum(-1);
// When build as 32bit binary, set the maximum at less than 2GB to prevent crashes.
// These macros may not be available on compilers other than MSVC and GCC
#if defined(__x86_64__) || defined(_M_X64)
spin_cache.setMaximum(4096);
spinBoxCache.setMaximum(4096);
#else
// allocate 1536MiB and leave 512MiB to the rest of program data in RAM
spin_cache.setMaximum(1536);
spinBoxCache.setMaximum(1536);
#endif
spin_cache.setValue(session->diskCacheSize());
updateCacheSpinSuffix(spin_cache.value());
addRow(DISK_CACHE, tr("Disk cache"), &spin_cache);
spinBoxCache.setValue(session->diskCacheSize());
updateCacheSpinSuffix(spinBoxCache.value());
addRow(DISK_CACHE, tr("Disk cache"), &spinBoxCache);
// Disk cache expiry
spin_cache_ttl.setMinimum(15);
spin_cache_ttl.setMaximum(600);
spin_cache_ttl.setValue(session->diskCacheTTL());
spin_cache_ttl.setSuffix(tr(" s", " seconds"));
addRow(DISK_CACHE_TTL, tr("Disk cache expiry interval"), &spin_cache_ttl);
spinBoxCacheTTL.setMinimum(15);
spinBoxCacheTTL.setMaximum(600);
spinBoxCacheTTL.setValue(session->diskCacheTTL());
spinBoxCacheTTL.setSuffix(tr(" s", " seconds"));
addRow(DISK_CACHE_TTL, tr("Disk cache expiry interval"), &spinBoxCacheTTL);
// Enable OS cache
cb_os_cache.setChecked(session->useOSCache());
addRow(OS_CACHE, tr("Enable OS cache"), &cb_os_cache);
checkBoxOsCache.setChecked(session->useOSCache());
addRow(OS_CACHE, tr("Enable OS cache"), &checkBoxOsCache);
// Guided read cache
cbGuidedReadCache.setChecked(session->isGuidedReadCacheEnabled());
addRow(GUIDED_READ_CACHE, tr("Guided read cache"), &cbGuidedReadCache);
checkBoxGuidedReadCache.setChecked(session->isGuidedReadCacheEnabled());
addRow(GUIDED_READ_CACHE, tr("Guided read cache"), &checkBoxGuidedReadCache);
// Coalesce reads & writes
cbCoalesceRW.setChecked(session->isCoalesceReadWriteEnabled());
checkBoxCoalesceRW.setChecked(session->isCoalesceReadWriteEnabled());
#if LIBTORRENT_VERSION_NUM >= 10107
addRow(COALESCE_RW, tr("Coalesce reads & writes"), &cbCoalesceRW);
addRow(COALESCE_RW, tr("Coalesce reads & writes"), &checkBoxCoalesceRW);
#endif
// Suggest mode
cbSuggestMode.setChecked(session->isSuggestModeEnabled());
addRow(SUGGEST_MODE, tr("Send upload piece suggestions"), &cbSuggestMode);
checkBoxSuggestMode.setChecked(session->isSuggestModeEnabled());
addRow(SUGGEST_MODE, tr("Send upload piece suggestions"), &checkBoxSuggestMode);
// Send buffer watermark
spinSendBufferWatermark.setMinimum(1);
spinSendBufferWatermark.setMaximum(INT_MAX);
spinSendBufferWatermark.setSuffix(tr(" KiB"));
spinSendBufferWatermark.setValue(session->sendBufferWatermark());
addRow(SEND_BUF_WATERMARK, tr("Send buffer watermark"), &spinSendBufferWatermark);
spinSendBufferLowWatermark.setMinimum(1);
spinSendBufferLowWatermark.setMaximum(INT_MAX);
spinSendBufferLowWatermark.setSuffix(tr(" KiB"));
spinSendBufferLowWatermark.setValue(session->sendBufferLowWatermark());
addRow(SEND_BUF_LOW_WATERMARK, tr("Send buffer low watermark"), &spinSendBufferLowWatermark);
spinSendBufferWatermarkFactor.setMinimum(1);
spinSendBufferWatermarkFactor.setMaximum(INT_MAX);
spinSendBufferWatermarkFactor.setSuffix(" %");
spinSendBufferWatermarkFactor.setValue(session->sendBufferWatermarkFactor());
addRow(SEND_BUF_WATERMARK_FACTOR, tr("Send buffer watermark factor"), &spinSendBufferWatermarkFactor);
spinBoxSendBufferWatermark.setMinimum(1);
spinBoxSendBufferWatermark.setMaximum(INT_MAX);
spinBoxSendBufferWatermark.setSuffix(tr(" KiB"));
spinBoxSendBufferWatermark.setValue(session->sendBufferWatermark());
addRow(SEND_BUF_WATERMARK, tr("Send buffer watermark"), &spinBoxSendBufferWatermark);
spinBoxSendBufferLowWatermark.setMinimum(1);
spinBoxSendBufferLowWatermark.setMaximum(INT_MAX);
spinBoxSendBufferLowWatermark.setSuffix(tr(" KiB"));
spinBoxSendBufferLowWatermark.setValue(session->sendBufferLowWatermark());
addRow(SEND_BUF_LOW_WATERMARK, tr("Send buffer low watermark"), &spinBoxSendBufferLowWatermark);
spinBoxSendBufferWatermarkFactor.setMinimum(1);
spinBoxSendBufferWatermarkFactor.setMaximum(INT_MAX);
spinBoxSendBufferWatermarkFactor.setSuffix(" %");
spinBoxSendBufferWatermarkFactor.setValue(session->sendBufferWatermarkFactor());
addRow(SEND_BUF_WATERMARK_FACTOR, tr("Send buffer watermark factor"), &spinBoxSendBufferWatermarkFactor);
// Save resume data interval
spin_save_resume_data_interval.setMinimum(1);
spin_save_resume_data_interval.setMaximum(1440);
spin_save_resume_data_interval.setValue(session->saveResumeDataInterval());
spin_save_resume_data_interval.setSuffix(tr(" m", " minutes"));
addRow(SAVE_RESUME_DATA_INTERVAL, tr("Save resume data interval", "How often the fastresume file is saved."), &spin_save_resume_data_interval);
spinBoxSaveResumeDataInterval.setMinimum(1);
spinBoxSaveResumeDataInterval.setMaximum(1440);
spinBoxSaveResumeDataInterval.setValue(session->saveResumeDataInterval());
spinBoxSaveResumeDataInterval.setSuffix(tr(" m", " minutes"));
addRow(SAVE_RESUME_DATA_INTERVAL, tr("Save resume data interval", "How often the fastresume file is saved."), &spinBoxSaveResumeDataInterval);
// Outgoing port Min
outgoing_ports_min.setMinimum(0);
outgoing_ports_min.setMaximum(65535);
outgoing_ports_min.setValue(session->outgoingPortsMin());
addRow(OUTGOING_PORT_MIN, tr("Outgoing ports (Min) [0: Disabled]"), &outgoing_ports_min);
spinBoxOutgoingPortsMin.setMinimum(0);
spinBoxOutgoingPortsMin.setMaximum(65535);
spinBoxOutgoingPortsMin.setValue(session->outgoingPortsMin());
addRow(OUTGOING_PORT_MIN, tr("Outgoing ports (Min) [0: Disabled]"), &spinBoxOutgoingPortsMin);
// Outgoing port Min
outgoing_ports_max.setMinimum(0);
outgoing_ports_max.setMaximum(65535);
outgoing_ports_max.setValue(session->outgoingPortsMax());
addRow(OUTGOING_PORT_MAX, tr("Outgoing ports (Max) [0: Disabled]"), &outgoing_ports_max);
spinBoxOutgoingPortsMax.setMinimum(0);
spinBoxOutgoingPortsMax.setMaximum(65535);
spinBoxOutgoingPortsMax.setValue(session->outgoingPortsMax());
addRow(OUTGOING_PORT_MAX, tr("Outgoing ports (Max) [0: Disabled]"), &spinBoxOutgoingPortsMax);
// uTP-TCP mixed mode
comboUtpMixedMode.addItems({tr("Prefer TCP"), tr("Peer proportional (throttles TCP)")});
comboUtpMixedMode.setCurrentIndex(static_cast<int>(session->utpMixedMode()));
addRow(UTP_MIX_MODE, tr("%1-TCP mixed mode algorithm", "uTP-TCP mixed mode algorithm").arg(C_UTP), &comboUtpMixedMode);
comboBoxUtpMixedMode.addItems({tr("Prefer TCP"), tr("Peer proportional (throttles TCP)")});
comboBoxUtpMixedMode.setCurrentIndex(static_cast<int>(session->utpMixedMode()));
addRow(UTP_MIX_MODE, tr("%1-TCP mixed mode algorithm", "uTP-TCP mixed mode algorithm").arg(C_UTP), &comboBoxUtpMixedMode);
// multiple connections per IP
cbMultiConnectionsPerIp.setChecked(session->multiConnectionsPerIpEnabled());
addRow(MULTI_CONNECTIONS_PER_IP, tr("Allow multiple connections from the same IP address"), &cbMultiConnectionsPerIp);
checkBoxMultiConnectionsPerIp.setChecked(session->multiConnectionsPerIpEnabled());
addRow(MULTI_CONNECTIONS_PER_IP, tr("Allow multiple connections from the same IP address"), &checkBoxMultiConnectionsPerIp);
// Recheck completed torrents
cb_recheck_completed.setChecked(pref->recheckTorrentsOnCompletion());
addRow(RECHECK_COMPLETED, tr("Recheck torrents on completion"), &cb_recheck_completed);
checkBoxRecheckCompleted.setChecked(pref->recheckTorrentsOnCompletion());
addRow(RECHECK_COMPLETED, tr("Recheck torrents on completion"), &checkBoxRecheckCompleted);
// Transfer list refresh interval
spin_list_refresh.setMinimum(30);
spin_list_refresh.setMaximum(99999);
spin_list_refresh.setValue(session->refreshInterval());
spin_list_refresh.setSuffix(tr(" ms", " milliseconds"));
addRow(LIST_REFRESH, tr("Transfer list refresh interval"), &spin_list_refresh);
spinBoxListRefresh.setMinimum(30);
spinBoxListRefresh.setMaximum(99999);
spinBoxListRefresh.setValue(session->refreshInterval());
spinBoxListRefresh.setSuffix(tr(" ms", " milliseconds"));
addRow(LIST_REFRESH, tr("Transfer list refresh interval"), &spinBoxListRefresh);
// Resolve Peer countries
cb_resolve_countries.setChecked(pref->resolvePeerCountries());
addRow(RESOLVE_COUNTRIES, tr("Resolve peer countries (GeoIP)"), &cb_resolve_countries);
checkBoxResolveCountries.setChecked(pref->resolvePeerCountries());
addRow(RESOLVE_COUNTRIES, tr("Resolve peer countries (GeoIP)"), &checkBoxResolveCountries);
// Resolve peer hosts
cb_resolve_hosts.setChecked(pref->resolvePeerHostNames());
addRow(RESOLVE_HOSTS, tr("Resolve peer host names"), &cb_resolve_hosts);
checkBoxResolveHosts.setChecked(pref->resolvePeerHostNames());
addRow(RESOLVE_HOSTS, tr("Resolve peer host names"), &checkBoxResolveHosts);
// Max Half Open connections
spin_maxhalfopen.setMinimum(0);
spin_maxhalfopen.setMaximum(99999);
spin_maxhalfopen.setValue(session->maxHalfOpenConnections());
addRow(MAX_HALF_OPEN, tr("Maximum number of half-open connections [0: Unlimited]"), &spin_maxhalfopen);
spinBoxMaxHalfOpen.setMinimum(0);
spinBoxMaxHalfOpen.setMaximum(99999);
spinBoxMaxHalfOpen.setValue(session->maxHalfOpenConnections());
addRow(MAX_HALF_OPEN, tr("Maximum number of half-open connections [0: Unlimited]"), &spinBoxMaxHalfOpen);
// Super seeding
cb_super_seeding.setChecked(session->isSuperSeedingEnabled());
addRow(SUPER_SEEDING, tr("Strict super seeding"), &cb_super_seeding);
checkBoxSuperSeeding.setChecked(session->isSuperSeedingEnabled());
addRow(SUPER_SEEDING, tr("Strict super seeding"), &checkBoxSuperSeeding);
// Network interface
combo_iface.addItem(tr("Any interface", "i.e. Any network interface"));
const QString current_iface = session->networkInterface();
bool interface_exists = current_iface.isEmpty();
comboBoxInterface.addItem(tr("Any interface", "i.e. Any network interface"));
const QString currentInterface = session->networkInterface();
bool interfaceExists = currentInterface.isEmpty();
int i = 1;
foreach (const QNetworkInterface& iface, QNetworkInterface::allInterfaces()) {
// This line fixes a Qt bug => https://bugreports.qt.io/browse/QTBUG-52633
@ -403,83 +403,83 @@ void AdvancedSettings::loadAdvancedSettings() @@ -403,83 +403,83 @@ void AdvancedSettings::loadAdvancedSettings()
// https://github.com/qbittorrent/qBittorrent/pull/5135
if (iface.addressEntries().isEmpty()) continue;
combo_iface.addItem(iface.humanReadableName(), iface.name());
if (!current_iface.isEmpty() && (iface.name() == current_iface)) {
combo_iface.setCurrentIndex(i);
interface_exists = true;
comboBoxInterface.addItem(iface.humanReadableName(), iface.name());
if (!currentInterface.isEmpty() && (iface.name() == currentInterface)) {
comboBoxInterface.setCurrentIndex(i);
interfaceExists = true;
}
++i;
}
// Saved interface does not exist, show it anyway
if (!interface_exists) {
combo_iface.addItem(session->networkInterfaceName(), current_iface);
combo_iface.setCurrentIndex(i);
if (!interfaceExists) {
comboBoxInterface.addItem(session->networkInterfaceName(), currentInterface);
comboBoxInterface.setCurrentIndex(i);
}
addRow(NETWORK_IFACE, tr("Network Interface (requires restart)"), &combo_iface);
addRow(NETWORK_IFACE, tr("Network Interface (requires restart)"), &comboBoxInterface);
// Network interface address
updateInterfaceAddressCombo();
addRow(NETWORK_IFACE_ADDRESS, tr("Optional IP Address to bind to (requires restart)"), &combo_iface_address);
addRow(NETWORK_IFACE_ADDRESS, tr("Optional IP Address to bind to (requires restart)"), &comboBoxInterfaceAddress);
// Listen on IPv6 address
cb_listen_ipv6.setChecked(session->isIPv6Enabled());
addRow(NETWORK_LISTEN_IPV6, tr("Listen on IPv6 address (requires restart)"), &cb_listen_ipv6);
checkBoxListenIPv6.setChecked(session->isIPv6Enabled());
addRow(NETWORK_LISTEN_IPV6, tr("Listen on IPv6 address (requires restart)"), &checkBoxListenIPv6);
// Announce IP
txtAnnounceIP.setText(session->announceIP());
addRow(ANNOUNCE_IP, tr("IP Address to report to trackers (requires restart)"), &txtAnnounceIP);
lineEditAnnounceIP.setText(session->announceIP());
addRow(ANNOUNCE_IP, tr("IP Address to report to trackers (requires restart)"), &lineEditAnnounceIP);
// Program notifications
const MainWindow * const mainWindow = static_cast<Application*>(QCoreApplication::instance())->mainWindow();
cb_program_notifications.setChecked(mainWindow->isNotificationsEnabled());
addRow(PROGRAM_NOTIFICATIONS, tr("Display notifications"), &cb_program_notifications);
const MainWindow *const mainWindow = static_cast<Application*>(QCoreApplication::instance())->mainWindow();
checkBoxProgramNotifications.setChecked(mainWindow->isNotificationsEnabled());
addRow(PROGRAM_NOTIFICATIONS, tr("Display notifications"), &checkBoxProgramNotifications);
// Torrent added notifications
cb_torrent_added_notifications.setChecked(mainWindow->isTorrentAddedNotificationsEnabled());
addRow(TORRENT_ADDED_NOTIFICATIONS, tr("Display notifications for added torrents"), &cb_torrent_added_notifications);
checkBoxTorrentAddedNotifications.setChecked(mainWindow->isTorrentAddedNotificationsEnabled());
addRow(TORRENT_ADDED_NOTIFICATIONS, tr("Display notifications for added torrents"), &checkBoxTorrentAddedNotifications);
// Download tracker's favicon
cb_tracker_favicon.setChecked(mainWindow->isDownloadTrackerFavicon());
addRow(DOWNLOAD_TRACKER_FAVICON, tr("Download tracker's favicon"), &cb_tracker_favicon);
checkBoxTrackerFavicon.setChecked(mainWindow->isDownloadTrackerFavicon());
addRow(DOWNLOAD_TRACKER_FAVICON, tr("Download tracker's favicon"), &checkBoxTrackerFavicon);
// Save path history length
spinSavePathHistoryLength.setRange(AddNewTorrentDialog::minPathHistoryLength, AddNewTorrentDialog::maxPathHistoryLength);
spinSavePathHistoryLength.setValue(AddNewTorrentDialog::savePathHistoryLength());
addRow(SAVE_PATH_HISTORY_LENGTH, tr("Save path history length"), &spinSavePathHistoryLength);
spinBoxSavePathHistoryLength.setRange(AddNewTorrentDialog::minPathHistoryLength, AddNewTorrentDialog::maxPathHistoryLength);
spinBoxSavePathHistoryLength.setValue(AddNewTorrentDialog::savePathHistoryLength());
addRow(SAVE_PATH_HISTORY_LENGTH, tr("Save path history length"), &spinBoxSavePathHistoryLength);
// Tracker State
cb_tracker_status.setChecked(session->isTrackerEnabled());
addRow(TRACKER_STATUS, tr("Enable embedded tracker"), &cb_tracker_status);
checkBoxTrackerStatus.setChecked(session->isTrackerEnabled());
addRow(TRACKER_STATUS, tr("Enable embedded tracker"), &checkBoxTrackerStatus);
// Tracker port
spin_tracker_port.setMinimum(1);
spin_tracker_port.setMaximum(65535);
spin_tracker_port.setValue(pref->getTrackerPort());
addRow(TRACKER_PORT, tr("Embedded tracker port"), &spin_tracker_port);
spinBoxTrackerPort.setMinimum(1);
spinBoxTrackerPort.setMaximum(65535);
spinBoxTrackerPort.setValue(pref->getTrackerPort());
addRow(TRACKER_PORT, tr("Embedded tracker port"), &spinBoxTrackerPort);
// Choking algorithm
comboChokingAlgorithm.addItems({tr("Fixed slots"), tr("Upload rate based")});
comboChokingAlgorithm.setCurrentIndex(static_cast<int>(session->chokingAlgorithm()));
addRow(CHOKING_ALGORITHM, tr("Upload slots behavior"), &comboChokingAlgorithm);
comboBoxChokingAlgorithm.addItems({tr("Fixed slots"), tr("Upload rate based")});
comboBoxChokingAlgorithm.setCurrentIndex(static_cast<int>(session->chokingAlgorithm()));
addRow(CHOKING_ALGORITHM, tr("Upload slots behavior"), &comboBoxChokingAlgorithm);
// Seed choking algorithm
comboSeedChokingAlgorithm.addItems({tr("Round-robin"), tr("Fastest upload"), tr("Anti-leech")});
comboSeedChokingAlgorithm.setCurrentIndex(static_cast<int>(session->seedChokingAlgorithm()));
addRow(SEED_CHOKING_ALGORITHM, tr("Upload choking algorithm"), &comboSeedChokingAlgorithm);
comboBoxSeedChokingAlgorithm.addItems({tr("Round-robin"), tr("Fastest upload"), tr("Anti-leech")});
comboBoxSeedChokingAlgorithm.setCurrentIndex(static_cast<int>(session->seedChokingAlgorithm()));
addRow(SEED_CHOKING_ALGORITHM, tr("Upload choking algorithm"), &comboBoxSeedChokingAlgorithm);
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
cb_update_check.setChecked(pref->isUpdateCheckEnabled());
addRow(UPDATE_CHECK, tr("Check for software updates"), &cb_update_check);
checkBoxUpdateCheck.setChecked(pref->isUpdateCheckEnabled());
addRow(UPDATE_CHECK, tr("Check for software updates"), &checkBoxUpdateCheck);
#endif
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC))
cb_use_icon_theme.setChecked(pref->useSystemIconTheme());
addRow(USE_ICON_THEME, tr("Use system icon theme"), &cb_use_icon_theme);
checkBoxUseIconTheme.setChecked(pref->useSystemIconTheme());
addRow(USE_ICON_THEME, tr("Use system icon theme"), &checkBoxUseIconTheme);
#endif
// Torrent recheck confirmation
cb_confirm_torrent_recheck.setChecked(pref->confirmTorrentRecheck());
addRow(CONFIRM_RECHECK_TORRENT, tr("Confirm torrent recheck"), &cb_confirm_torrent_recheck);
checkBoxConfirmTorrentRecheck.setChecked(pref->confirmTorrentRecheck());
addRow(CONFIRM_RECHECK_TORRENT, tr("Confirm torrent recheck"), &checkBoxConfirmTorrentRecheck);
// Remove all tags confirmation
cb_confirm_remove_all_tags.setChecked(pref->confirmRemoveAllTags());
addRow(CONFIRM_REMOVE_ALL_TAGS, tr("Confirm removal of all tags"), &cb_confirm_remove_all_tags);
checkBoxConfirmRemoveAllTags.setChecked(pref->confirmRemoveAllTags());
addRow(CONFIRM_REMOVE_ALL_TAGS, tr("Confirm removal of all tags"), &checkBoxConfirmRemoveAllTags);
// Announce to all trackers in a tier
cb_announce_all_trackers.setChecked(session->announceToAllTrackers());
addRow(ANNOUNCE_ALL_TRACKERS, tr("Always announce to all trackers in a tier"), &cb_announce_all_trackers);
checkBoxAnnounceAllTrackers.setChecked(session->announceToAllTrackers());
addRow(ANNOUNCE_ALL_TRACKERS, tr("Always announce to all trackers in a tier"), &checkBoxAnnounceAllTrackers);
// Announce to all tiers
cb_announce_all_tiers.setChecked(session->announceToAllTiers());
addRow(ANNOUNCE_ALL_TIERS, tr("Always announce to all tiers"), &cb_announce_all_tiers);
checkBoxAnnounceAllTiers.setChecked(session->announceToAllTiers());
addRow(ANNOUNCE_ALL_TIERS, tr("Always announce to all tiers"), &checkBoxAnnounceAllTiers);
}
template <typename T>

23
src/gui/advancedsettings.h

@ -55,25 +55,26 @@ private slots: @@ -55,25 +55,26 @@ private slots:
private:
void loadAdvancedSettings();
template <typename T> void addRow(int row, const QString &rowText, T* widget);
template <typename T> void addRow(int row, const QString &rowText, T *widget);
QLabel labelQbtLink, labelLibtorrentLink;
QSpinBox spin_cache, spin_save_resume_data_interval, outgoing_ports_min, outgoing_ports_max, spin_list_refresh, spin_maxhalfopen, spin_tracker_port, spin_cache_ttl,
spinSendBufferWatermark, spinSendBufferLowWatermark, spinSendBufferWatermarkFactor, spinSavePathHistoryLength;
QCheckBox cb_os_cache, cb_recheck_completed, cb_resolve_countries, cb_resolve_hosts, cb_super_seeding,
cb_program_notifications, cb_torrent_added_notifications, cb_tracker_favicon, cb_tracker_status,
cb_confirm_torrent_recheck, cb_confirm_remove_all_tags, cb_listen_ipv6, cb_announce_all_trackers, cb_announce_all_tiers,
cbGuidedReadCache, cbMultiConnectionsPerIp, cbSuggestMode, cbCoalesceRW;
QComboBox combo_iface, combo_iface_address, comboUtpMixedMode, comboChokingAlgorithm, comboSeedChokingAlgorithm;
QLineEdit txtAnnounceIP;
QSpinBox spinBoxCache, spinBoxSaveResumeDataInterval, spinBoxOutgoingPortsMin, spinBoxOutgoingPortsMax, spinBoxListRefresh, spinBoxMaxHalfOpen,
spinBoxTrackerPort, spinBoxCacheTTL, spinBoxSendBufferWatermark, spinBoxSendBufferLowWatermark,
spinBoxSendBufferWatermarkFactor, spinBoxSavePathHistoryLength;
QCheckBox checkBoxOsCache, checkBoxRecheckCompleted, checkBoxResolveCountries, checkBoxResolveHosts, checkBoxSuperSeeding,
checkBoxProgramNotifications, checkBoxTorrentAddedNotifications, checkBoxTrackerFavicon, checkBoxTrackerStatus,
checkBoxConfirmTorrentRecheck, checkBoxConfirmRemoveAllTags, checkBoxListenIPv6, checkBoxAnnounceAllTrackers, checkBoxAnnounceAllTiers,
checkBoxGuidedReadCache, checkBoxMultiConnectionsPerIp, checkBoxSuggestMode, checkBoxCoalesceRW;
QComboBox comboBoxInterface, comboBoxInterfaceAddress, comboBoxUtpMixedMode, comboBoxChokingAlgorithm, comboBoxSeedChokingAlgorithm;
QLineEdit lineEditAnnounceIP;
// OS dependent settings
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
QCheckBox cb_update_check;
QCheckBox checkBoxUpdateCheck;
#endif
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC))
QCheckBox cb_use_icon_theme;
QCheckBox checkBoxUseIconTheme;
#endif
};

1
src/gui/categoryfiltermodel.h

@ -30,7 +30,6 @@ @@ -30,7 +30,6 @@
#define CATEGORYFILTERMODEL_H
#include <QAbstractItemModel>
#include <QHash>
#include <QModelIndex>
namespace BitTorrent

2
src/gui/categoryfilterwidget.cpp

@ -30,9 +30,7 @@ @@ -30,9 +30,7 @@
#include <QAction>
#include <QHeaderView>
#include <QLayout>
#include <QMenu>
#include <QMessageBox>
#include "base/bittorrent/session.h"
#include "base/global.h"

6
src/gui/deletionconfirmationdialog.h

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Bittorrent Client using Qt4 and libtorrent.
* Bittorrent Client using Qt and libtorrent.
* Copyright (C) 2006 Christophe Dumez <chris@qbittorrent.org>
*
* This program is free software; you can redistribute it and/or
@ -54,8 +54,8 @@ public: @@ -54,8 +54,8 @@ public:
label->setText(tr("Are you sure you want to delete these %1 torrents from the transfer list?", "Are you sure you want to delete these 5 torrents from the transfer list?").arg(QString::number(size)));
// Icons
const QSize iconSize = Utils::Gui::largeIconSize();
lbl_warn->setPixmap(GuiIconProvider::instance()->getIcon("dialog-warning").pixmap(iconSize));
lbl_warn->setFixedWidth(iconSize.width());
labelWarning->setPixmap(GuiIconProvider::instance()->getIcon("dialog-warning").pixmap(iconSize));
labelWarning->setFixedWidth(iconSize.width());
rememberBtn->setIcon(GuiIconProvider::instance()->getIcon("object-locked"));
rememberBtn->setIconSize(Utils::Gui::mediumIconSize());

2
src/gui/deletionconfirmationdialog.ui

@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="lbl_warn">
<widget class="QLabel" name="labelWarning">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>

2
src/gui/executionlogwidget.cpp

@ -30,8 +30,6 @@ @@ -30,8 +30,6 @@
#include <QColor>
#include <QDateTime>
#include <QLabel>
#include <QListWidgetItem>
#include <QPalette>
#include "guiiconprovider.h"

1
src/gui/fspathedit_p.h

@ -33,7 +33,6 @@ @@ -33,7 +33,6 @@
#include <QComboBox>
#include <QCompleter>
#include <QContextMenuEvent>
#include <QDir>
#include <QFileIconProvider>
#include <QFileSystemModel>
#include <QKeyEvent>

3
src/gui/guiiconprovider.cpp

@ -28,7 +28,6 @@ @@ -28,7 +28,6 @@
*/
#include "guiiconprovider.h"
#include "base/preferences.h"
#include <QIcon>
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC))
@ -36,6 +35,8 @@ @@ -36,6 +35,8 @@
#include <QFile>
#endif
#include "base/preferences.h"
GuiIconProvider::GuiIconProvider(QObject *parent)
: IconProvider(parent)
{

2
src/gui/ipsubnetwhitelistoptionsdialog.cpp

@ -28,9 +28,7 @@ @@ -28,9 +28,7 @@
#include "ipsubnetwhitelistoptionsdialog.h"
#include <QHostAddress>
#include <QMessageBox>
#include <QPair>
#include <QSortFilterProxyModel>
#include <QStringListModel>

19
src/gui/mainwindow.h

@ -38,25 +38,24 @@ @@ -38,25 +38,24 @@
class QCloseEvent;
class QFileSystemWatcher;
class QShortcut;
class QSplitter;
class QTabWidget;
class QTimer;
class DownloadFromURLDialog;
class SearchWidget;
class RSSWidget;
class AboutDialog;
class DownloadFromURLDialog;
class ExecutionLogWidget;
class LineEdit;
class OptionsDialog;
class TransferListWidget;
class TransferListFiltersWidget;
class PowerManagement;
class PropertiesWidget;
class RSSWidget;
class SearchWidget;
class StatsDialog;
class StatusBar;
class TorrentCreatorDialog;
class LineEdit;
class ExecutionLogWidget;
class PowerManagement;
class StatsDialog;
class TransferListFiltersWidget;
class TransferListWidget;
namespace BitTorrent
{

71
src/gui/optionsdialog.cpp

@ -165,7 +165,7 @@ OptionsDialog::OptionsDialog(QWidget *parent) @@ -165,7 +165,7 @@ OptionsDialog::OptionsDialog(QWidget *parent)
// Load week days (scheduler)
for (uint i = 1; i <= 7; ++i)
m_ui->schedule_days->addItem(QDate::longDayName(i, QDate::StandaloneFormat));
m_ui->comboBoxScheduleDays->addItem(QDate::longDayName(i, QDate::StandaloneFormat));
// Load options
loadOptions();
@ -176,7 +176,7 @@ OptionsDialog::OptionsDialog(QWidget *parent) @@ -176,7 +176,7 @@ OptionsDialog::OptionsDialog(QWidget *parent)
if (!QSystemTrayIcon::isSystemTrayAvailable()) {
m_ui->checkShowSystray->setChecked(false);
m_ui->checkShowSystray->setEnabled(false);
m_ui->label_trayIconStyle->setVisible(false);
m_ui->labelTrayIconStyle->setVisible(false);
m_ui->comboTrayIcon->setVisible(false);
}
#endif
@ -275,14 +275,14 @@ OptionsDialog::OptionsDialog(QWidget *parent) @@ -275,14 +275,14 @@ OptionsDialog::OptionsDialog(QWidget *parent)
connect(m_ui->removeScanFolderButton, &QAbstractButton::clicked, this, &ThisType::enableApplyButton);
connect(m_ui->groupMailNotification, &QGroupBox::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->senderEmailTxt, &QLineEdit::textChanged, this, &ThisType::enableApplyButton);
connect(m_ui->dest_email_txt, &QLineEdit::textChanged, this, &ThisType::enableApplyButton);
connect(m_ui->smtp_server_txt, &QLineEdit::textChanged, this, &ThisType::enableApplyButton);
connect(m_ui->lineEditDestEmail, &QLineEdit::textChanged, this, &ThisType::enableApplyButton);
connect(m_ui->lineEditSmtpServer, &QLineEdit::textChanged, this, &ThisType::enableApplyButton);
connect(m_ui->checkSmtpSSL, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->groupMailNotifAuth, &QGroupBox::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->mailNotifUsername, &QLineEdit::textChanged, this, &ThisType::enableApplyButton);
connect(m_ui->mailNotifPassword, &QLineEdit::textChanged, this, &ThisType::enableApplyButton);
connect(m_ui->autoRunBox, &QGroupBox::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->autoRun_txt, &QLineEdit::textChanged, this, &ThisType::enableApplyButton);
connect(m_ui->lineEditAutoRun, &QLineEdit::textChanged, this, &ThisType::enableApplyButton);
const QString autoRunStr = QString("%1\n %2\n %3\n %4\n %5\n %6\n %7\n %8\n %9\n %10\n %11\n%12")
.arg(tr("Supported parameters (case sensitive):")
@ -297,7 +297,7 @@ OptionsDialog::OptionsDialog(QWidget *parent) @@ -297,7 +297,7 @@ OptionsDialog::OptionsDialog(QWidget *parent)
.arg(tr("%T: Current tracker")
, tr("%I: Info hash")
, tr("Tip: Encapsulate parameter with quotation marks to avoid text being cut off at whitespace (e.g., \"%N\")"));
m_ui->autoRun_param->setText(autoRunStr);
m_ui->labelAutoRunParam->setText(autoRunStr);
// Connection tab
connect(m_ui->comboProtocol, qComboBoxCurrentIndexChanged, this, &ThisType::enableApplyButton);
@ -312,10 +312,10 @@ OptionsDialog::OptionsDialog(QWidget *parent) @@ -312,10 +312,10 @@ OptionsDialog::OptionsDialog(QWidget *parent)
connect(m_ui->spinDownloadLimit, qSpinBoxValueChanged, this, &ThisType::enableApplyButton);
connect(m_ui->spinUploadLimitAlt, qSpinBoxValueChanged, this, &ThisType::enableApplyButton);
connect(m_ui->spinDownloadLimitAlt, qSpinBoxValueChanged, this, &ThisType::enableApplyButton);
connect(m_ui->check_schedule, &QGroupBox::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->schedule_from, &QDateTimeEdit::timeChanged, this, &ThisType::enableApplyButton);
connect(m_ui->schedule_to, &QDateTimeEdit::timeChanged, this, &ThisType::enableApplyButton);
connect(m_ui->schedule_days, qComboBoxCurrentIndexChanged, this, &ThisType::enableApplyButton);
connect(m_ui->groupBoxSchedule, &QGroupBox::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->timeEditScheduleFrom, &QDateTimeEdit::timeChanged, this, &ThisType::enableApplyButton);
connect(m_ui->timeEditScheduleTo, &QDateTimeEdit::timeChanged, this, &ThisType::enableApplyButton);
connect(m_ui->comboBoxScheduleDays, qComboBoxCurrentIndexChanged, this, &ThisType::enableApplyButton);
connect(m_ui->checkLimituTPConnections, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->checkLimitTransportOverhead, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->checkLimitLocalPeerRate, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
@ -518,10 +518,11 @@ void OptionsDialog::saveWindowState() const @@ -518,10 +518,11 @@ void OptionsDialog::saveWindowState() const
pref->setPrefSize(size());
// Splitter size
QStringList sizes_str;
sizes_str << QString::number(m_ui->hsplitter->sizes().first());
sizes_str << QString::number(m_ui->hsplitter->sizes().last());
pref->setPrefHSplitterSizes(sizes_str);
const QStringList sizesStr = {
QString::number(m_ui->hsplitter->sizes().first()),
QString::number(m_ui->hsplitter->sizes().last())
};
pref->setPrefHSplitterSizes(sizesStr);
}
void OptionsDialog::saveOptions()
@ -617,14 +618,14 @@ void OptionsDialog::saveOptions() @@ -617,14 +618,14 @@ void OptionsDialog::saveOptions()
session->setFinishedTorrentExportDirectory(getFinishedTorrentExportDir());
pref->setMailNotificationEnabled(m_ui->groupMailNotification->isChecked());
pref->setMailNotificationSender(m_ui->senderEmailTxt->text());
pref->setMailNotificationEmail(m_ui->dest_email_txt->text());
pref->setMailNotificationSMTP(m_ui->smtp_server_txt->text());
pref->setMailNotificationEmail(m_ui->lineEditDestEmail->text());
pref->setMailNotificationSMTP(m_ui->lineEditSmtpServer->text());
pref->setMailNotificationSMTPSSL(m_ui->checkSmtpSSL->isChecked());
pref->setMailNotificationSMTPAuth(m_ui->groupMailNotifAuth->isChecked());
pref->setMailNotificationSMTPUsername(m_ui->mailNotifUsername->text());
pref->setMailNotificationSMTPPassword(m_ui->mailNotifPassword->text());
pref->setAutoRunEnabled(m_ui->autoRunBox->isChecked());
pref->setAutoRunProgram(m_ui->autoRun_txt->text().trimmed());
pref->setAutoRunProgram(m_ui->lineEditAutoRun->text().trimmed());
pref->setActionOnDblClOnTorrentDl(getActionOnDblClOnTorrentDl());
pref->setActionOnDblClOnTorrentFn(getActionOnDblClOnTorrentFn());
TorrentFileGuard::setAutoDeleteMode(!m_ui->deleteTorrentBox->isChecked() ? TorrentFileGuard::Never
@ -637,19 +638,19 @@ void OptionsDialog::saveOptions() @@ -637,19 +638,19 @@ void OptionsDialog::saveOptions()
session->setPort(getPort());
session->setUseRandomPort(m_ui->checkRandomPort->isChecked());
Net::PortForwarder::instance()->setEnabled(isUPnPEnabled());
const QPair<int, int> down_up_limit = getGlobalBandwidthLimits();
session->setGlobalDownloadSpeedLimit(down_up_limit.first);
session->setGlobalUploadSpeedLimit(down_up_limit.second);
const QPair<int, int> downUpLimit = getGlobalBandwidthLimits();
session->setGlobalDownloadSpeedLimit(downUpLimit.first);
session->setGlobalUploadSpeedLimit(downUpLimit.second);
session->setUTPRateLimited(m_ui->checkLimituTPConnections->isChecked());
session->setIncludeOverheadInLimits(m_ui->checkLimitTransportOverhead->isChecked());
session->setIgnoreLimitsOnLAN(!m_ui->checkLimitLocalPeerRate->isChecked());
const QPair<int, int> alt_down_up_limit = getAltGlobalBandwidthLimits();
session->setAltGlobalDownloadSpeedLimit(alt_down_up_limit.first);
session->setAltGlobalUploadSpeedLimit(alt_down_up_limit.second);
pref->setSchedulerStartTime(m_ui->schedule_from->time());
pref->setSchedulerEndTime(m_ui->schedule_to->time());
pref->setSchedulerDays(static_cast<SchedulerDays>(m_ui->schedule_days->currentIndex()));
session->setBandwidthSchedulerEnabled(m_ui->check_schedule->isChecked());
const QPair<int, int> altDownUpLimit = getAltGlobalBandwidthLimits();
session->setAltGlobalDownloadSpeedLimit(altDownUpLimit.first);
session->setAltGlobalUploadSpeedLimit(altDownUpLimit.second);
pref->setSchedulerStartTime(m_ui->timeEditScheduleFrom->time());
pref->setSchedulerEndTime(m_ui->timeEditScheduleTo->time());
pref->setSchedulerDays(static_cast<SchedulerDays>(m_ui->comboBoxScheduleDays->currentIndex()));
session->setBandwidthSchedulerEnabled(m_ui->groupBoxSchedule->isChecked());
auto proxyConfigManager = Net::ProxyConfigurationManager::instance();
Net::ProxyConfiguration proxyConf;
@ -881,15 +882,15 @@ void OptionsDialog::loadOptions() @@ -881,15 +882,15 @@ void OptionsDialog::loadOptions()
m_ui->groupMailNotification->setChecked(pref->isMailNotificationEnabled());
m_ui->senderEmailTxt->setText(pref->getMailNotificationSender());
m_ui->dest_email_txt->setText(pref->getMailNotificationEmail());
m_ui->smtp_server_txt->setText(pref->getMailNotificationSMTP());
m_ui->lineEditDestEmail->setText(pref->getMailNotificationEmail());
m_ui->lineEditSmtpServer->setText(pref->getMailNotificationSMTP());
m_ui->checkSmtpSSL->setChecked(pref->getMailNotificationSMTPSSL());
m_ui->groupMailNotifAuth->setChecked(pref->getMailNotificationSMTPAuth());
m_ui->mailNotifUsername->setText(pref->getMailNotificationSMTPUsername());
m_ui->mailNotifPassword->setText(pref->getMailNotificationSMTPPassword());
m_ui->autoRunBox->setChecked(pref->isAutoRunEnabled());
m_ui->autoRun_txt->setText(pref->getAutoRunProgram());
m_ui->lineEditAutoRun->setText(pref->getAutoRunProgram());
intValue = pref->getActionOnDblClOnTorrentDl();
if (intValue >= m_ui->actionTorrentDlOnDblClBox->count())
intValue = 0;
@ -1056,10 +1057,10 @@ void OptionsDialog::loadOptions() @@ -1056,10 +1057,10 @@ void OptionsDialog::loadOptions()
m_ui->checkLimitTransportOverhead->setChecked(session->includeOverheadInLimits());
m_ui->checkLimitLocalPeerRate->setChecked(!session->ignoreLimitsOnLAN());
m_ui->check_schedule->setChecked(session->isBandwidthSchedulerEnabled());
m_ui->schedule_from->setTime(pref->getSchedulerStartTime());
m_ui->schedule_to->setTime(pref->getSchedulerEndTime());
m_ui->schedule_days->setCurrentIndex(static_cast<int>(pref->getSchedulerDays()));
m_ui->groupBoxSchedule->setChecked(session->isBandwidthSchedulerEnabled());
m_ui->timeEditScheduleFrom->setTime(pref->getSchedulerStartTime());
m_ui->timeEditScheduleTo->setTime(pref->getSchedulerEndTime());
m_ui->comboBoxScheduleDays->setCurrentIndex(static_cast<int>(pref->getSchedulerDays()));
// End Speed preferences
// Bittorrent preferences
@ -1786,7 +1787,7 @@ bool OptionsDialog::setSslCertificate(const QByteArray &cert) @@ -1786,7 +1787,7 @@ bool OptionsDialog::setSslCertificate(const QByteArray &cert)
bool OptionsDialog::schedTimesOk()
{
if (m_ui->schedule_from->time() == m_ui->schedule_to->time()) {
if (m_ui->timeEditScheduleFrom->time() == m_ui->timeEditScheduleTo->time()) {
QMessageBox::warning(this, tr("Time Error"), tr("The start time and the end time can't be the same."));
return false;
}

32
src/gui/optionsdialog.ui

@ -416,7 +416,7 @@ @@ -416,7 +416,7 @@
<item>
<layout class="QFormLayout" name="formLayout_4">
<item row="0" column="0">
<widget class="QLabel" name="label_trayIconStyle">
<widget class="QLabel" name="labelTrayIconStyle">
<property name="text">
<string>Tray icon style:</string>
</property>
@ -1127,7 +1127,7 @@ @@ -1127,7 +1127,7 @@
<item>
<layout class="QGridLayout" name="gridLayout_9">
<item row="1" column="1">
<widget class="QLineEdit" name="dest_email_txt"/>
<widget class="QLineEdit" name="lineEditDestEmail"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
@ -1144,7 +1144,7 @@ @@ -1144,7 +1144,7 @@
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="smtp_server_txt"/>
<widget class="QLineEdit" name="lineEditSmtpServer"/>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="senderEmailTxt"/>
@ -1220,10 +1220,10 @@ @@ -1220,10 +1220,10 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout_19">
<item>
<widget class="QLineEdit" name="autoRun_txt"/>
<widget class="QLineEdit" name="lineEditAutoRun"/>
</item>
<item>
<widget class="QLabel" name="autoRun_param">
<widget class="QLabel" name="labelAutoRunParam">
<property name="wordWrap">
<bool>true</bool>
</property>
@ -1884,7 +1884,7 @@ @@ -1884,7 +1884,7 @@
<widget class="QLabel" name="labelAltRate"/>
</item>
<item row="2" column="0" colspan="4">
<widget class="QGroupBox" name="check_schedule">
<widget class="QGroupBox" name="groupBoxSchedule">
<property name="title">
<string>Schedule &amp;the use of alternative rate limits</string>
</property>
@ -1903,7 +1903,7 @@ @@ -1903,7 +1903,7 @@
</widget>
</item>
<item row="0" column="3">
<widget class="QTimeEdit" name="schedule_to">
<widget class="QTimeEdit" name="timeEditScheduleTo">
<property name="wrapping">
<bool>true</bool>
</property>
@ -1927,7 +1927,7 @@ @@ -1927,7 +1927,7 @@
</widget>
</item>
<item row="0" column="1">
<widget class="QTimeEdit" name="schedule_from">
<widget class="QTimeEdit" name="timeEditScheduleFrom">
<property name="wrapping">
<bool>true</bool>
</property>
@ -1954,7 +1954,7 @@ @@ -1954,7 +1954,7 @@
</widget>
</item>
<item row="1" column="1" colspan="3">
<widget class="QComboBox" name="schedule_days">
<widget class="QComboBox" name="comboBoxScheduleDays">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
@ -3384,14 +3384,14 @@ Use ';' to split multiple entries. Can use wildcard '*'.</string> @@ -3384,14 +3384,14 @@ Use ';' to split multiple entries. Can use wildcard '*'.</string>
<tabstop>checkExportDirFin</tabstop>
<tabstop>textExportDirFin</tabstop>
<tabstop>groupMailNotification</tabstop>
<tabstop>dest_email_txt</tabstop>
<tabstop>smtp_server_txt</tabstop>
<tabstop>lineEditDestEmail</tabstop>
<tabstop>lineEditSmtpServer</tabstop>
<tabstop>groupMailNotifAuth</tabstop>
<tabstop>mailNotifUsername</tabstop>
<tabstop>mailNotifPassword</tabstop>
<tabstop>checkSmtpSSL</tabstop>
<tabstop>autoRunBox</tabstop>
<tabstop>autoRun_txt</tabstop>
<tabstop>lineEditAutoRun</tabstop>
<tabstop>scrollArea_3</tabstop>
<tabstop>randomButton</tabstop>
<tabstop>checkRandomPort</tabstop>
@ -3421,10 +3421,10 @@ Use ';' to split multiple entries. Can use wildcard '*'.</string> @@ -3421,10 +3421,10 @@ Use ';' to split multiple entries. Can use wildcard '*'.</string>
<tabstop>checkUploadLimit</tabstop>
<tabstop>spinDownloadLimit</tabstop>
<tabstop>checkDownloadLimit</tabstop>
<tabstop>check_schedule</tabstop>
<tabstop>schedule_to</tabstop>
<tabstop>schedule_from</tabstop>
<tabstop>schedule_days</tabstop>
<tabstop>groupBoxSchedule</tabstop>
<tabstop>timeEditScheduleTo</tabstop>
<tabstop>timeEditScheduleFrom</tabstop>
<tabstop>comboBoxScheduleDays</tabstop>
<tabstop>checkUploadLimitAlt</tabstop>
<tabstop>checkDownloadLimitAlt</tabstop>
<tabstop>spinUploadLimitAlt</tabstop>

1
src/gui/previewselectdialog.h

@ -30,7 +30,6 @@ @@ -30,7 +30,6 @@
#define PREVIEWSELECTDIALOG_H
#include <QDialog>
#include <QList>
#include "base/bittorrent/torrenthandle.h"
#include "base/settingvalue.h"

1
src/gui/properties/peerlistsortmodel.h

@ -30,7 +30,6 @@ @@ -30,7 +30,6 @@
#define PEERLISTSORTMODEL_H
#include <QSortFilterProxyModel>
#include <QStringList>
#include "peerlistdelegate.h"

4
src/gui/properties/peersadditiondialog.cpp

@ -55,13 +55,13 @@ QList<BitTorrent::PeerAddress> PeersAdditionDialog::askForPeers(QWidget *parent) @@ -55,13 +55,13 @@ QList<BitTorrent::PeerAddress> PeersAdditionDialog::askForPeers(QWidget *parent)
void PeersAdditionDialog::validateInput()
{
if (m_ui->peers_txt->toPlainText().trimmed().isEmpty()) {
if (m_ui->textEditPeers->toPlainText().trimmed().isEmpty()) {
QMessageBox::warning(this, tr("No peer entered"),
tr("Please type at least one peer."),
QMessageBox::Ok);
return;
}
foreach (const QString &peer, m_ui->peers_txt->toPlainText().trimmed().split('\n')) {
foreach (const QString &peer, m_ui->textEditPeers->toPlainText().trimmed().split('\n')) {
BitTorrent::PeerAddress addr = parsePeer(peer);
if (!addr.ip.isNull()) {
m_peersList.append(addr);

2
src/gui/properties/peersadditiondialog.ui

@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
</widget>
</item>
<item>
<widget class="QTextEdit" name="peers_txt">
<widget class="QTextEdit" name="textEditPeers">
<property name="lineWrapMode">
<enum>QTextEdit::NoWrap</enum>
</property>

23
src/gui/properties/propertieswidget.cpp

@ -29,9 +29,7 @@ @@ -29,9 +29,7 @@
#include "propertieswidget.h"
#include <QAction>
#include <QBitArray>
#include <QDebug>
#include <QFileDialog>
#include <QHeaderView>
#include <QListWidgetItem>
#include <QMenu>
@ -39,7 +37,6 @@ @@ -39,7 +37,6 @@
#include <QStackedWidget>
#include <QThread>
#include <QTimer>
#include <QVBoxLayout>
#include "base/bittorrent/session.h"
#include "base/preferences.h"
@ -139,10 +136,10 @@ PropertiesWidget::PropertiesWidget(QWidget *parent, MainWindow *mainWindow, Tran @@ -139,10 +136,10 @@ PropertiesWidget::PropertiesWidget(QWidget *parent, MainWindow *mainWindow, Tran
m_ui->trackerDownButton->setIconSize(Utils::Gui::smallIconSize());
connect(m_ui->trackerUpButton, &QPushButton::clicked, m_trackerList, &TrackerListWidget::moveSelectionUp);
connect(m_ui->trackerDownButton, &QPushButton::clicked, m_trackerList, &TrackerListWidget::moveSelectionDown);
m_ui->horizontalLayout_trackers->insertWidget(0, m_trackerList);
m_ui->hBoxLayoutTrackers->insertWidget(0, m_trackerList);
// Peers list
m_peerList = new PeerListWidget(this);
m_ui->peerpage_layout->addWidget(m_peerList);
m_ui->vBoxLayoutPeerPage->addWidget(m_peerList);
// Speed widget
m_speedWidget = new SpeedWidget(this);
m_ui->speedLayout->addWidget(m_speedWidget);
@ -364,10 +361,10 @@ void PropertiesWidget::readSettings() @@ -364,10 +361,10 @@ void PropertiesWidget::readSettings()
QSplitter *hSplitter = static_cast<QSplitter *>(parentWidget());
hSplitter->setSizes(m_slideSizes);
}
const int current_tab = pref->getPropCurTab();
const int currentTab = pref->getPropCurTab();
const bool visible = pref->getPropVisible();
m_ui->filesList->header()->restoreState(pref->getPropFileListState());
m_tabBar->setCurrentIndex(current_tab);
m_tabBar->setCurrentIndex(currentTab);
if (!visible)
setVisibility(false);
}
@ -604,7 +601,7 @@ void PropertiesWidget::displayFilesListMenu(const QPoint &) @@ -604,7 +601,7 @@ void PropertiesWidget::displayFilesListMenu(const QPoint &)
QMenu subMenu;
if (!m_torrent->isSeed()) {
subMenu.setTitle(tr("Priority"));
subMenu.addAction(m_ui->actionNot_downloaded);
subMenu.addAction(m_ui->actionNotDownloaded);
subMenu.addAction(m_ui->actionNormal);
subMenu.addAction(m_ui->actionHigh);
subMenu.addAction(m_ui->actionMaximum);
@ -632,7 +629,7 @@ void PropertiesWidget::displayFilesListMenu(const QPoint &) @@ -632,7 +629,7 @@ void PropertiesWidget::displayFilesListMenu(const QPoint &)
prio = prio::HIGH;
else if (act == m_ui->actionMaximum)
prio = prio::MAXIMUM;
else if (act == m_ui->actionNot_downloaded)
else if (act == m_ui->actionNotDownloaded)
prio = prio::IGNORED;
qDebug("Setting files priority");
@ -807,19 +804,19 @@ void PropertiesWidget::askWebSeed() @@ -807,19 +804,19 @@ void PropertiesWidget::askWebSeed()
{
bool ok;
// Ask user for a new url seed
const QString url_seed = AutoExpandableDialog::getText(this, tr("New URL seed", "New HTTP source"),
const QString urlSeed = AutoExpandableDialog::getText(this, tr("New URL seed", "New HTTP source"),
tr("New URL seed:"), QLineEdit::Normal,
QLatin1String("http://www."), &ok);
if (!ok) return;
qDebug("Adding %s web seed", qUtf8Printable(url_seed));
if (!m_ui->listWebSeeds->findItems(url_seed, Qt::MatchFixedString).empty()) {
qDebug("Adding %s web seed", qUtf8Printable(urlSeed));
if (!m_ui->listWebSeeds->findItems(urlSeed, Qt::MatchFixedString).empty()) {
QMessageBox::warning(this, "qBittorrent",
tr("This URL seed is already in the list."),
QMessageBox::Ok);
return;
}
if (m_torrent)
m_torrent->addUrlSeeds(QList<QUrl>() << url_seed);
m_torrent->addUrlSeeds(QList<QUrl>() << urlSeed);
// Refresh the seeds list
loadUrlSeeds();
}

8
src/gui/properties/propertieswidget.h

@ -107,6 +107,10 @@ protected slots: @@ -107,6 +107,10 @@ protected slots:
void renameSelectedFile();
void openSelectedFile();
private slots:
void filterText(const QString &filter);
void updateSavePath(BitTorrent::TorrentHandle *const torrent);
private:
void openFile(const QModelIndex &index);
void openFolder(const QModelIndex &index, bool containingFolder);
@ -131,10 +135,6 @@ private: @@ -131,10 +135,6 @@ private:
QShortcut *m_editHotkeyWeb;
QShortcut *m_deleteHotkeyWeb;
QShortcut *m_openHotkeyFile;
private slots:
void filterText(const QString &filter);
void updateSavePath(BitTorrent::TorrentHandle *const torrent);
};
#endif // PROPERTIESWIDGET_H

6
src/gui/properties/propertieswidget.ui

@ -905,7 +905,7 @@ @@ -905,7 +905,7 @@
</layout>
</widget>
<widget class="QWidget" name="pageTrackers">
<layout class="QHBoxLayout" name="horizontalLayout_trackers">
<layout class="QHBoxLayout" name="hBoxLayoutTrackers">
<property name="leftMargin">
<number>0</number>
</property>
@ -957,7 +957,7 @@ @@ -957,7 +957,7 @@
</layout>
</widget>
<widget class="QWidget" name="pagePeers">
<layout class="QVBoxLayout" name="peerpage_layout">
<layout class="QVBoxLayout" name="vBoxLayoutPeerPage">
<property name="leftMargin">
<number>0</number>
</property>
@ -1083,7 +1083,7 @@ @@ -1083,7 +1083,7 @@
</widget>
</item>
</layout>
<action name="actionNot_downloaded">
<action name="actionNotDownloaded">
<property name="text">
<string>Do not download</string>
</property>

1
src/gui/properties/speedwidget.cpp

@ -33,7 +33,6 @@ @@ -33,7 +33,6 @@
#include <QLabel>
#include <QMenu>
#include <QSignalMapper>
#include <QThread>
#include <QTimer>
#include <libtorrent/session_status.hpp>

13
src/gui/properties/trackersadditiondialog.cpp

@ -31,7 +31,6 @@ @@ -31,7 +31,6 @@
#include <QBuffer>
#include <QMessageBox>
#include <QStringList>
#include <QUrl>
#include "base/bittorrent/torrenthandle.h"
#include "base/bittorrent/trackerentry.h"
@ -60,7 +59,7 @@ TrackersAdditionDialog::~TrackersAdditionDialog() @@ -60,7 +59,7 @@ TrackersAdditionDialog::~TrackersAdditionDialog()
QStringList TrackersAdditionDialog::newTrackers() const
{
QStringList cleanTrackers;
foreach (QString url, m_ui->trackers_list->toPlainText().split('\n')) {
foreach (QString url, m_ui->textEditTrackersList->toPlainText().split('\n')) {
url = url.trimmed();
if (!url.isEmpty())
cleanTrackers << url;
@ -71,7 +70,7 @@ QStringList TrackersAdditionDialog::newTrackers() const @@ -71,7 +70,7 @@ QStringList TrackersAdditionDialog::newTrackers() const
void TrackersAdditionDialog::on_uTorrentListButton_clicked()
{
m_ui->uTorrentListButton->setEnabled(false);
Net::DownloadHandler *handler = Net::DownloadManager::instance()->download({m_ui->list_url->text()});
Net::DownloadHandler *handler = Net::DownloadManager::instance()->download({m_ui->lineEditListURL->text()});
connect(handler, static_cast<void (Net::DownloadHandler::*)(const QString &, const QByteArray &)>(&Net::DownloadHandler::downloadFinished)
, this, &TrackersAdditionDialog::parseUTorrentList);
connect(handler, &Net::DownloadHandler::downloadFailed, this, &TrackersAdditionDialog::getTrackerError);
@ -84,7 +83,7 @@ void TrackersAdditionDialog::parseUTorrentList(const QString &, const QByteArray @@ -84,7 +83,7 @@ void TrackersAdditionDialog::parseUTorrentList(const QString &, const QByteArray
// Load from torrent handle
QList<BitTorrent::TrackerEntry> existingTrackers = m_torrent->trackers();
// Load from current user list
QStringList tmp = m_ui->trackers_list->toPlainText().split('\n');
QStringList tmp = m_ui->textEditTrackersList->toPlainText().split('\n');
foreach (const QString &userURL, tmp) {
BitTorrent::TrackerEntry userTracker(userURL);
if (!existingTrackers.contains(userTracker))
@ -92,8 +91,8 @@ void TrackersAdditionDialog::parseUTorrentList(const QString &, const QByteArray @@ -92,8 +91,8 @@ void TrackersAdditionDialog::parseUTorrentList(const QString &, const QByteArray
}
// Add new trackers to the list
if (!m_ui->trackers_list->toPlainText().isEmpty() && !m_ui->trackers_list->toPlainText().endsWith('\n'))
m_ui->trackers_list->insertPlainText("\n");
if (!m_ui->textEditTrackersList->toPlainText().isEmpty() && !m_ui->textEditTrackersList->toPlainText().endsWith('\n'))
m_ui->textEditTrackersList->insertPlainText("\n");
int nb = 0;
QBuffer buffer;
buffer.setData(data);
@ -104,7 +103,7 @@ void TrackersAdditionDialog::parseUTorrentList(const QString &, const QByteArray @@ -104,7 +103,7 @@ void TrackersAdditionDialog::parseUTorrentList(const QString &, const QByteArray
BitTorrent::TrackerEntry newTracker(line);
if (!existingTrackers.contains(newTracker)) {
m_ui->trackers_list->insertPlainText(line + '\n');
m_ui->textEditTrackersList->insertPlainText(line + '\n');
++nb;
}
}

4
src/gui/properties/trackersadditiondialog.ui

@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
</widget>
</item>
<item>
<widget class="QTextEdit" name="trackers_list">
<widget class="QTextEdit" name="textEditTrackersList">
<property name="lineWrapMode">
<enum>QTextEdit::NoWrap</enum>
</property>
@ -41,7 +41,7 @@ @@ -41,7 +41,7 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLineEdit" name="list_url"/>
<widget class="QLineEdit" name="lineEditListURL"/>
</item>
<item>
<widget class="QPushButton" name="uTorrentListButton"/>

27
src/gui/rss/automatedrssdownloader.cpp

@ -36,7 +36,6 @@ @@ -36,7 +36,6 @@
#include <QMessageBox>
#include <QPair>
#include <QRegularExpression>
#include <QSet>
#include <QShortcut>
#include <QSignalBlocker>
#include <QString>
@ -253,7 +252,7 @@ void AutomatedRssDownloader::updateRuleDefinitionBox() @@ -253,7 +252,7 @@ void AutomatedRssDownloader::updateRuleDefinitionBox()
m_ui->lineEFilter->setText(m_currentRule.episodeFilter());
else
m_ui->lineEFilter->clear();
m_ui->saveDiffDir_check->setChecked(!m_currentRule.savePath().isEmpty());
m_ui->checkBoxSaveDiffDir->setChecked(!m_currentRule.savePath().isEmpty());
m_ui->lineSavePath->setText(Utils::Fs::toNativePath(m_currentRule.savePath()));
m_ui->checkRegex->blockSignals(true);
m_ui->checkRegex->setChecked(m_currentRule.useRegex());
@ -300,7 +299,7 @@ void AutomatedRssDownloader::clearRuleDefinitionBox() @@ -300,7 +299,7 @@ void AutomatedRssDownloader::clearRuleDefinitionBox()
m_ui->lineContains->clear();
m_ui->lineNotContains->clear();
m_ui->lineEFilter->clear();
m_ui->saveDiffDir_check->setChecked(false);
m_ui->checkBoxSaveDiffDir->setChecked(false);
m_ui->lineSavePath->clear();
m_ui->comboCategory->clearEditText();
m_ui->comboCategory->setCurrentIndex(-1);
@ -334,7 +333,7 @@ void AutomatedRssDownloader::updateEditedRule() @@ -334,7 +333,7 @@ void AutomatedRssDownloader::updateEditedRule()
m_currentRule.setMustContain(m_ui->lineContains->text());
m_currentRule.setMustNotContain(m_ui->lineNotContains->text());
m_currentRule.setEpisodeFilter(m_ui->lineEFilter->text());
m_currentRule.setSavePath(m_ui->saveDiffDir_check->isChecked() ? m_ui->lineSavePath->text() : "");
m_currentRule.setSavePath(m_ui->checkBoxSaveDiffDir->isChecked() ? m_ui->lineSavePath->text() : "");
m_currentRule.setCategory(m_ui->comboCategory->currentText());
TriStateBool addPaused; // Undefined by default
if (m_ui->comboAddPaused->currentIndex() == 1)
@ -692,13 +691,13 @@ void AutomatedRssDownloader::updateMustLineValidity() @@ -692,13 +691,13 @@ void AutomatedRssDownloader::updateMustLineValidity()
if (valid) {
m_ui->lineContains->setStyleSheet("");
m_ui->lbl_must_stat->setPixmap(QPixmap());
m_ui->lbl_must_stat->setToolTip("");
m_ui->labelMustStat->setPixmap(QPixmap());
m_ui->labelMustStat->setToolTip("");
}
else {
m_ui->lineContains->setStyleSheet("QLineEdit { color: #ff0000; }");
m_ui->lbl_must_stat->setPixmap(GuiIconProvider::instance()->getIcon("task-attention").pixmap(16, 16));
m_ui->lbl_must_stat->setToolTip(error);
m_ui->labelMustStat->setPixmap(GuiIconProvider::instance()->getIcon("task-attention").pixmap(16, 16));
m_ui->labelMustStat->setToolTip(error);
}
}
@ -730,13 +729,13 @@ void AutomatedRssDownloader::updateMustNotLineValidity() @@ -730,13 +729,13 @@ void AutomatedRssDownloader::updateMustNotLineValidity()
if (valid) {
m_ui->lineNotContains->setStyleSheet("");
m_ui->lbl_mustnot_stat->setPixmap(QPixmap());
m_ui->lbl_mustnot_stat->setToolTip("");
m_ui->labelMustNotStat->setPixmap(QPixmap());
m_ui->labelMustNotStat->setToolTip("");
}
else {
m_ui->lineNotContains->setStyleSheet("QLineEdit { color: #ff0000; }");
m_ui->lbl_mustnot_stat->setPixmap(GuiIconProvider::instance()->getIcon("task-attention").pixmap(16, 16));
m_ui->lbl_mustnot_stat->setToolTip(error);
m_ui->labelMustNotStat->setPixmap(GuiIconProvider::instance()->getIcon("task-attention").pixmap(16, 16));
m_ui->labelMustNotStat->setToolTip(error);
}
}
@ -747,11 +746,11 @@ void AutomatedRssDownloader::updateEpisodeFilterValidity() @@ -747,11 +746,11 @@ void AutomatedRssDownloader::updateEpisodeFilterValidity()
if (valid) {
m_ui->lineEFilter->setStyleSheet("");
m_ui->lbl_epfilter_stat->setPixmap(QPixmap());
m_ui->labelEpFilterStat->setPixmap(QPixmap());
}
else {
m_ui->lineEFilter->setStyleSheet("QLineEdit { color: #ff0000; }");
m_ui->lbl_epfilter_stat->setPixmap(GuiIconProvider::instance()->getIcon("task-attention").pixmap(16, 16));
m_ui->labelEpFilterStat->setPixmap(GuiIconProvider::instance()->getIcon("task-attention").pixmap(16, 16));
}
}

16
src/gui/rss/automatedrssdownloader.ui

@ -140,7 +140,7 @@ @@ -140,7 +140,7 @@
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="lbl_mustnot_stat">
<widget class="QLabel" name="labelMustNotStat">
<property name="maximumSize">
<size>
<width>18</width>
@ -153,7 +153,7 @@ @@ -153,7 +153,7 @@
<widget class="QLineEdit" name="lineContains"/>
</item>
<item row="0" column="2">
<widget class="QLabel" name="lbl_must_stat">
<widget class="QLabel" name="labelMustStat">
<property name="maximumSize">
<size>
<width>18</width>
@ -163,7 +163,7 @@ @@ -163,7 +163,7 @@
</widget>
</item>
<item row="2" column="2">
<widget class="QLabel" name="lbl_epfilter_stat">
<widget class="QLabel" name="labelEpFilterStat">
<property name="maximumSize">
<size>
<width>18</width>
@ -223,7 +223,7 @@ Supports the formats: S01E01, 1x1, 2017.01.01 and 01.01.2017 (Date formats also @@ -223,7 +223,7 @@ Supports the formats: S01E01, 1x1, 2017.01.01 and 01.01.2017 (Date formats also
</layout>
</item>
<item>
<widget class="QCheckBox" name="saveDiffDir_check">
<widget class="QCheckBox" name="checkBoxSaveDiffDir">
<property name="text">
<string>Save to a Different Directory</string>
</property>
@ -438,7 +438,7 @@ Supports the formats: S01E01, 1x1, 2017.01.01 and 01.01.2017 (Date formats also @@ -438,7 +438,7 @@ Supports the formats: S01E01, 1x1, 2017.01.01 and 01.01.2017 (Date formats also
<tabstop>lineNotContains</tabstop>
<tabstop>lineEFilter</tabstop>
<tabstop>comboCategory</tabstop>
<tabstop>saveDiffDir_check</tabstop>
<tabstop>checkBoxSaveDiffDir</tabstop>
<tabstop>lineSavePath</tabstop>
<tabstop>browseSP</tabstop>
<tabstop>spinIgnorePeriod</tabstop>
@ -483,7 +483,7 @@ Supports the formats: S01E01, 1x1, 2017.01.01 and 01.01.2017 (Date formats also @@ -483,7 +483,7 @@ Supports the formats: S01E01, 1x1, 2017.01.01 and 01.01.2017 (Date formats also
</hints>
</connection>
<connection>
<sender>saveDiffDir_check</sender>
<sender>checkBoxSaveDiffDir</sender>
<signal>toggled(bool)</signal>
<receiver>label_6</receiver>
<slot>setEnabled(bool)</slot>
@ -499,7 +499,7 @@ Supports the formats: S01E01, 1x1, 2017.01.01 and 01.01.2017 (Date formats also @@ -499,7 +499,7 @@ Supports the formats: S01E01, 1x1, 2017.01.01 and 01.01.2017 (Date formats also
</hints>
</connection>
<connection>
<sender>saveDiffDir_check</sender>
<sender>checkBoxSaveDiffDir</sender>
<signal>toggled(bool)</signal>
<receiver>lineSavePath</receiver>
<slot>setEnabled(bool)</slot>
@ -515,7 +515,7 @@ Supports the formats: S01E01, 1x1, 2017.01.01 and 01.01.2017 (Date formats also @@ -515,7 +515,7 @@ Supports the formats: S01E01, 1x1, 2017.01.01 and 01.01.2017 (Date formats also
</hints>
</connection>
<connection>
<sender>saveDiffDir_check</sender>
<sender>checkBoxSaveDiffDir</sender>
<signal>toggled(bool)</signal>
<receiver>browseSP</receiver>
<slot>setEnabled(bool)</slot>

2
src/gui/scanfoldersdelegate.cpp

@ -31,8 +31,6 @@ @@ -31,8 +31,6 @@
#include <QComboBox>
#include <QDebug>
#include <QFileDialog>
#include <QItemSelectionModel>
#include <QPainter>
#include <QTreeView>
#include "base/bittorrent/session.h"

6
src/gui/search/pluginselectdialog.cpp

@ -172,8 +172,8 @@ void PluginSelectDialog::displayContextMenu(const QPoint&) @@ -172,8 +172,8 @@ void PluginSelectDialog::displayContextMenu(const QPoint&)
QList<QTreeWidgetItem *> items = m_ui->pluginsTree->selectedItems();
if (items.isEmpty()) return;
QString first_id = items.first()->text(PLUGIN_ID);
m_ui->actionEnable->setChecked(m_pluginManager->pluginInfo(first_id)->enabled);
QString firstID = items.first()->text(PLUGIN_ID);
m_ui->actionEnable->setChecked(m_pluginManager->pluginInfo(firstID)->enabled);
myContextMenu.addAction(m_ui->actionEnable);
myContextMenu.addSeparator();
myContextMenu.addAction(m_ui->actionUninstall);
@ -318,7 +318,7 @@ void PluginSelectDialog::finishAsyncOp() @@ -318,7 +318,7 @@ void PluginSelectDialog::finishAsyncOp()
void PluginSelectDialog::finishPluginUpdate()
{
--m_pendingUpdates;
if (m_pendingUpdates == 0 && !m_updatedPlugins.isEmpty()) {
if ((m_pendingUpdates == 0) && !m_updatedPlugins.isEmpty()) {
m_updatedPlugins.sort(Qt::CaseInsensitive);
QMessageBox::information(this, tr("Search plugin update"), tr("Plugins installed or updated: %1").arg(m_updatedPlugins.join(", ")));
m_updatedPlugins.clear();

4
src/gui/search/pluginselectdialog.h

@ -55,8 +55,8 @@ public: @@ -55,8 +55,8 @@ public:
QTreeWidgetItem *findItemWithID(QString id);
protected:
void dropEvent(QDropEvent *event);
void dragEnterEvent(QDragEnterEvent *event);
void dropEvent(QDropEvent *event) override;
void dragEnterEvent(QDragEnterEvent *event) override;
private slots:
void on_actionUninstall_triggered();

3
src/gui/search/searchjobwidget.cpp

@ -32,16 +32,13 @@ @@ -32,16 +32,13 @@
#include <QApplication>
#include <QClipboard>
#include <QDesktopServices>
#include <QDir>
#include <QHeaderView>
#include <QLabel>
#include <QMenu>
#include <QPalette>
#include <QSortFilterProxyModel>
#include <QStandardItemModel>
#include <QTableView>
#include <QTreeView>
#include <QVBoxLayout>
#include "base/bittorrent/session.h"
#include "base/preferences.h"

2
src/gui/search/searchjobwidget.h

@ -35,11 +35,9 @@ @@ -35,11 +35,9 @@
#define URL_COLUMN 5
class QHeaderView;
class QLabel;
class QModelIndex;
class QStandardItem;
class QStandardItemModel;
class QVBoxLayout;
template <typename T> class CachedSettingValue;

7
src/gui/search/searchlistdelegate.cpp

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
/*
* Bittorrent Client using Qt and libtorrent.
* Copyright (C) 2006 Christophe Dumez
* Copyright (C) 2006 Christophe Dumez <chris@qbittorrent.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -24,10 +24,10 @@ @@ -24,10 +24,10 @@
* modify file(s), you may extend this exception to your version of the file(s),
* but you are not obligated to do so. If you do not wish to do so, delete this
* exception statement from your version.
*
* Contact : chris@qbittorrent.org
*/
#include "searchlistdelegate.h"
#include <QCoreApplication>
#include <QModelIndex>
#include <QPainter>
@ -35,7 +35,6 @@ @@ -35,7 +35,6 @@
#include <QStyleOptionViewItem>
#include "base/utils/misc.h"
#include "searchlistdelegate.h"
#include "searchsortmodel.h"
namespace

19
src/gui/search/searchwidget.cpp

@ -36,10 +36,7 @@ @@ -36,10 +36,7 @@
#endif
#include <QDebug>
#include <QDir>
#include <QFileDialog>
#include <QHeaderView>
#include <QMenu>
#include <QMessageBox>
#include <QMimeData>
#include <QProcess>
@ -47,9 +44,7 @@ @@ -47,9 +44,7 @@
#include <QSignalMapper>
#include <QSortFilterProxyModel>
#include <QStandardItemModel>
#include <QSystemTrayIcon>
#include <QTextStream>
#include <QTimer>
#include <QTreeView>
#include "base/bittorrent/session.h"
@ -116,7 +111,7 @@ SearchWidget::SearchWidget(MainWindow *mainWindow) @@ -116,7 +111,7 @@ SearchWidget::SearchWidget(MainWindow *mainWindow)
"Search phrase example, illustrates quotes usage, double quoted"
"pair of space delimited words, the whole pair is highlighted")
<< "</p></body></html>" << flush;
m_ui->m_searchPattern->setToolTip(searchPatternHint);
m_ui->lineEditSearchPattern->setToolTip(searchPatternHint);
#ifndef Q_OS_MAC
// Icons
@ -153,8 +148,8 @@ SearchWidget::SearchWidget(MainWindow *mainWindow) @@ -153,8 +148,8 @@ SearchWidget::SearchWidget(MainWindow *mainWindow)
// Fill in category combobox
onPluginChanged();
connect(m_ui->m_searchPattern, &LineEdit::returnPressed, m_ui->searchButton, &QPushButton::click);
connect(m_ui->m_searchPattern, &LineEdit::textEdited, this, &SearchWidget::searchTextEdited);
connect(m_ui->lineEditSearchPattern, &LineEdit::returnPressed, m_ui->searchButton, &QPushButton::click);
connect(m_ui->lineEditSearchPattern, &LineEdit::textEdited, this, &SearchWidget::searchTextEdited);
connect(m_ui->selectPlugin, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged)
, this, &SearchWidget::selectMultipleBox);
connect(m_ui->selectPlugin, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged)
@ -215,14 +210,14 @@ void SearchWidget::selectActivePage() @@ -215,14 +210,14 @@ void SearchWidget::selectActivePage()
{
if (SearchPluginManager::instance()->allPlugins().isEmpty()) {
m_ui->stackedPages->setCurrentWidget(m_ui->emptyPage);
m_ui->m_searchPattern->setEnabled(false);
m_ui->lineEditSearchPattern->setEnabled(false);
m_ui->comboCategory->setEnabled(false);
m_ui->selectPlugin->setEnabled(false);
m_ui->searchButton->setEnabled(false);
}
else {
m_ui->stackedPages->setCurrentWidget(m_ui->searchPage);
m_ui->m_searchPattern->setEnabled(true);
m_ui->lineEditSearchPattern->setEnabled(true);
m_ui->comboCategory->setEnabled(true);
m_ui->selectPlugin->setEnabled(true);
m_ui->searchButton->setEnabled(true);
@ -279,7 +274,7 @@ void SearchWidget::searchTextEdited(QString) @@ -279,7 +274,7 @@ void SearchWidget::searchTextEdited(QString)
void SearchWidget::giveFocusToSearchInput()
{
m_ui->m_searchPattern->setFocus();
m_ui->lineEditSearchPattern->setFocus();
}
// Function called when we click on search button
@ -300,7 +295,7 @@ void SearchWidget::on_searchButton_clicked() @@ -300,7 +295,7 @@ void SearchWidget::on_searchButton_clicked()
m_isNewQueryString = false;
const QString pattern = m_ui->m_searchPattern->text().trimmed();
const QString pattern = m_ui->lineEditSearchPattern->text().trimmed();
// No search pattern entered
if (pattern.isEmpty()) {
QMessageBox::critical(this, tr("Empty search pattern"), tr("Please type a search pattern first"));

2
src/gui/search/searchwidget.ui

@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
<item>
<layout class="QHBoxLayout" name="searchBarLayout">
<item>
<widget class="LineEdit" name="m_searchPattern"/>
<widget class="LineEdit" name="lineEditSearchPattern"/>
</item>
<item>
<widget class="QComboBox" name="comboCategory">

1
src/gui/speedlimitdialog.h

@ -30,7 +30,6 @@ @@ -30,7 +30,6 @@
#define SPEEDLIMITDIALOG_H
#include <QDialog>
#include <QList>
#include "base/bittorrent/session.h"
#include "base/utils/misc.h"

1
src/gui/tagfiltermodel.cpp

@ -29,7 +29,6 @@ @@ -29,7 +29,6 @@
#include "tagfiltermodel.h"
#include <QDebug>
#include <QHash>
#include <QIcon>
#include "base/bittorrent/session.h"

1
src/gui/tagfiltermodel.h

@ -30,7 +30,6 @@ @@ -30,7 +30,6 @@
#define TAGFILTERMODEL_H
#include <QAbstractListModel>
#include <QHash>
#include <QModelIndex>
#include <QSet>
#include <QVector>

1
src/gui/tagfilterwidget.cpp

@ -31,7 +31,6 @@ @@ -31,7 +31,6 @@
#include <QAction>
#include <QDebug>
#include <QHeaderView>
#include <QLayout>
#include <QMenu>
#include <QMessageBox>

3
src/gui/torrentcontentmodel.cpp

@ -26,6 +26,8 @@ @@ -26,6 +26,8 @@
* exception statement from your version.
*/
#include "torrentcontentmodel.h"
#include <QDir>
#include <QFileIconProvider>
#include <QFileInfo>
@ -49,7 +51,6 @@ @@ -49,7 +51,6 @@
#include "base/utils/misc.h"
#include "base/utils/fs.h"
#include "guiiconprovider.h"
#include "torrentcontentmodel.h"
#include "torrentcontentmodelfile.h"
#include "torrentcontentmodelfolder.h"
#include "torrentcontentmodelitem.h"

40
src/gui/trackerlogindialog.cpp

@ -36,42 +36,42 @@ @@ -36,42 +36,42 @@
#include "utils.h"
TrackerLoginDialog::TrackerLoginDialog(QWidget *parent, BitTorrent::TorrentHandle *const torrent)
: QDialog(parent)
, m_torrent(torrent)
: QDialog(parent)
, m_torrent(torrent)
{
setupUi(this);
setAttribute(Qt::WA_DeleteOnClose);
setupUi(this);
setAttribute(Qt::WA_DeleteOnClose);
buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Log in"));
buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Log in"));
login_logo->setPixmap(QPixmap(QLatin1String(":/icons/qbt-theme/encrypted.png")));
labelLoginLogo->setPixmap(QPixmap(QLatin1String(":/icons/qbt-theme/encrypted.png")));
tracker_url->setText(torrent->currentTracker());
labelTrackerURL->setText(torrent->currentTracker());
connect(buttonBox, &QDialogButtonBox::accepted, this, &TrackerLoginDialog::loginButtonClicked);
connect(buttonBox, &QDialogButtonBox::rejected, this, &TrackerLoginDialog::cancelButtonClicked);
connect(linePasswd, &QLineEdit::returnPressed, this, &TrackerLoginDialog::loginButtonClicked);
connect(this, SIGNAL(trackerLoginCancelled(QPair<BitTorrent::TorrentHandle*, QString>)), // TODO: use Qt5 connect syntax
parent, SLOT(addUnauthenticatedTracker(QPair<BitTorrent::TorrentHandle*, QString>)));
connect(buttonBox, &QDialogButtonBox::accepted, this, &TrackerLoginDialog::loginButtonClicked);
connect(buttonBox, &QDialogButtonBox::rejected, this, &TrackerLoginDialog::cancelButtonClicked);
connect(linePasswd, &QLineEdit::returnPressed, this, &TrackerLoginDialog::loginButtonClicked);
connect(this, SIGNAL(trackerLoginCancelled(QPair<BitTorrent::TorrentHandle*, QString>)), // TODO: use Qt5 connect syntax
parent, SLOT(addUnauthenticatedTracker(QPair<BitTorrent::TorrentHandle*, QString>)));
Utils::Gui::resize(this);
show();
Utils::Gui::resize(this);
show();
}
TrackerLoginDialog::~TrackerLoginDialog() {}
void TrackerLoginDialog::loginButtonClicked()
{
// login
// login
#if LIBTORRENT_VERSION_NUM < 10100
m_torrent->setTrackerLogin(lineUsername->text(), linePasswd->text());
m_torrent->setTrackerLogin(lineUsername->text(), linePasswd->text());
#endif
accept();
accept();
}
void TrackerLoginDialog::cancelButtonClicked()
{
// Emit a signal to GUI to stop asking for authentication
emit trackerLoginCancelled(qMakePair(m_torrent, m_torrent->currentTracker()));
reject();
// Emit a signal to GUI to stop asking for authentication
emit trackerLoginCancelled(qMakePair(m_torrent, m_torrent->currentTracker()));
reject();
}

14
src/gui/trackerlogindialog.h

@ -40,21 +40,21 @@ namespace BitTorrent @@ -40,21 +40,21 @@ namespace BitTorrent
class TrackerLoginDialog : public QDialog, private Ui::TrackerLoginDialog
{
Q_OBJECT
Q_OBJECT
private:
BitTorrent::TorrentHandle *const m_torrent;
public:
public:
TrackerLoginDialog(QWidget *parent, BitTorrent::TorrentHandle *const torrent);
~TrackerLoginDialog();
signals:
signals:
void trackerLoginCancelled(QPair<BitTorrent::TorrentHandle*, QString> tracker);
private slots:
private slots:
void loginButtonClicked();
void cancelButtonClicked();
private:
BitTorrent::TorrentHandle *const m_torrent;
};
#endif // TRACKERLOGINDIALOG_H

4
src/gui/trackerlogindialog.ui

@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
<item>
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="login_logo">
<widget class="QLabel" name="labelLoginLogo">
<property name="maximumSize">
<size>
<width>39</width>
@ -66,7 +66,7 @@ @@ -66,7 +66,7 @@
</widget>
</item>
<item>
<widget class="QLabel" name="tracker_url">
<widget class="QLabel" name="labelTrackerURL">
<property name="minimumSize">
<size>
<width>220</width>

1
src/gui/transferlistfilterswidget.cpp

@ -33,7 +33,6 @@ @@ -33,7 +33,6 @@
#include <QIcon>
#include <QListWidgetItem>
#include <QMenu>
#include <QMessageBox>
#include <QScrollArea>
#include <QUrl>
#include <QVBoxLayout>

1
src/gui/transferlistfilterswidget.h

@ -121,7 +121,6 @@ private: @@ -121,7 +121,6 @@ private:
QStringList getHashes(int row);
void downloadFavicon(const QString &url);
private:
QHash<QString, QStringList> m_trackers;
QHash<QString, QStringList> m_errors;
QHash<QString, QStringList> m_warnings;

12
src/gui/transferlistwidget.cpp

@ -527,20 +527,20 @@ void TransferListWidget::bottomPrioSelectedTorrents() @@ -527,20 +527,20 @@ void TransferListWidget::bottomPrioSelectedTorrents()
void TransferListWidget::copySelectedMagnetURIs() const
{
QStringList magnet_uris;
QStringList magnetUris;
foreach (BitTorrent::TorrentHandle *const torrent, getSelectedTorrents())
magnet_uris << torrent->toMagnetUri();
magnetUris << torrent->toMagnetUri();
qApp->clipboard()->setText(magnet_uris.join('\n'));
qApp->clipboard()->setText(magnetUris.join('\n'));
}
void TransferListWidget::copySelectedNames() const
{
QStringList torrent_names;
QStringList torrentNames;
foreach (BitTorrent::TorrentHandle *const torrent, getSelectedTorrents())
torrent_names << torrent->name();
torrentNames << torrent->name();
qApp->clipboard()->setText(torrent_names.join('\n'));
qApp->clipboard()->setText(torrentNames.join('\n'));
}
void TransferListWidget::copySelectedHashes() const

1
src/webui/webapplication.cpp

@ -43,7 +43,6 @@ @@ -43,7 +43,6 @@
#include <QMimeDatabase>
#include <QMimeType>
#include <QRegExp>
#include <QTimer>
#include <QUrl>
#include "base/global.h"

Loading…
Cancel
Save