Convert the names used in ui and c++ files from snake_case to camelCase

This commit is contained in:
thalieht 2018-06-14 12:38:18 +03:00
parent ca68b86550
commit 6d4434ad66
22 changed files with 315 additions and 314 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -58,22 +58,23 @@ private:
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; 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, QSpinBox spinBoxCache, spinBoxSaveResumeDataInterval, spinBoxOutgoingPortsMin, spinBoxOutgoingPortsMax, spinBoxListRefresh, spinBoxMaxHalfOpen,
spinSendBufferWatermark, spinSendBufferLowWatermark, spinSendBufferWatermarkFactor, spinSavePathHistoryLength; spinBoxTrackerPort, spinBoxCacheTTL, spinBoxSendBufferWatermark, spinBoxSendBufferLowWatermark,
QCheckBox cb_os_cache, cb_recheck_completed, cb_resolve_countries, cb_resolve_hosts, cb_super_seeding, spinBoxSendBufferWatermarkFactor, spinBoxSavePathHistoryLength;
cb_program_notifications, cb_torrent_added_notifications, cb_tracker_favicon, cb_tracker_status, QCheckBox checkBoxOsCache, checkBoxRecheckCompleted, checkBoxResolveCountries, checkBoxResolveHosts, checkBoxSuperSeeding,
cb_confirm_torrent_recheck, cb_confirm_remove_all_tags, cb_listen_ipv6, cb_announce_all_trackers, cb_announce_all_tiers, checkBoxProgramNotifications, checkBoxTorrentAddedNotifications, checkBoxTrackerFavicon, checkBoxTrackerStatus,
cbGuidedReadCache, cbMultiConnectionsPerIp, cbSuggestMode, cbCoalesceRW; checkBoxConfirmTorrentRecheck, checkBoxConfirmRemoveAllTags, checkBoxListenIPv6, checkBoxAnnounceAllTrackers, checkBoxAnnounceAllTiers,
QComboBox combo_iface, combo_iface_address, comboUtpMixedMode, comboChokingAlgorithm, comboSeedChokingAlgorithm; checkBoxGuidedReadCache, checkBoxMultiConnectionsPerIp, checkBoxSuggestMode, checkBoxCoalesceRW;
QLineEdit txtAnnounceIP; QComboBox comboBoxInterface, comboBoxInterfaceAddress, comboBoxUtpMixedMode, comboBoxChokingAlgorithm, comboBoxSeedChokingAlgorithm;
QLineEdit lineEditAnnounceIP;
// OS dependent settings // OS dependent settings
#if defined(Q_OS_WIN) || defined(Q_OS_MAC) #if defined(Q_OS_WIN) || defined(Q_OS_MAC)
QCheckBox cb_update_check; QCheckBox checkBoxUpdateCheck;
#endif #endif
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC)) #if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC))
QCheckBox cb_use_icon_theme; QCheckBox checkBoxUseIconTheme;
#endif #endif
}; };

View file

@ -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))); 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 // Icons
const QSize iconSize = Utils::Gui::largeIconSize(); const QSize iconSize = Utils::Gui::largeIconSize();
lbl_warn->setPixmap(GuiIconProvider::instance()->getIcon("dialog-warning").pixmap(iconSize)); labelWarning->setPixmap(GuiIconProvider::instance()->getIcon("dialog-warning").pixmap(iconSize));
lbl_warn->setFixedWidth(iconSize.width()); labelWarning->setFixedWidth(iconSize.width());
rememberBtn->setIcon(GuiIconProvider::instance()->getIcon("object-locked")); rememberBtn->setIcon(GuiIconProvider::instance()->getIcon("object-locked"));
rememberBtn->setIconSize(Utils::Gui::mediumIconSize()); rememberBtn->setIconSize(Utils::Gui::mediumIconSize());

View file

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

View file

@ -165,7 +165,7 @@ OptionsDialog::OptionsDialog(QWidget *parent)
// Load week days (scheduler) // Load week days (scheduler)
for (uint i = 1; i <= 7; ++i) 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 // Load options
loadOptions(); loadOptions();
@ -176,7 +176,7 @@ OptionsDialog::OptionsDialog(QWidget *parent)
if (!QSystemTrayIcon::isSystemTrayAvailable()) { if (!QSystemTrayIcon::isSystemTrayAvailable()) {
m_ui->checkShowSystray->setChecked(false); m_ui->checkShowSystray->setChecked(false);
m_ui->checkShowSystray->setEnabled(false); m_ui->checkShowSystray->setEnabled(false);
m_ui->label_trayIconStyle->setVisible(false); m_ui->labelTrayIconStyle->setVisible(false);
m_ui->comboTrayIcon->setVisible(false); m_ui->comboTrayIcon->setVisible(false);
} }
#endif #endif
@ -275,14 +275,14 @@ OptionsDialog::OptionsDialog(QWidget *parent)
connect(m_ui->removeScanFolderButton, &QAbstractButton::clicked, this, &ThisType::enableApplyButton); connect(m_ui->removeScanFolderButton, &QAbstractButton::clicked, this, &ThisType::enableApplyButton);
connect(m_ui->groupMailNotification, &QGroupBox::toggled, this, &ThisType::enableApplyButton); connect(m_ui->groupMailNotification, &QGroupBox::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->senderEmailTxt, &QLineEdit::textChanged, 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->lineEditDestEmail, &QLineEdit::textChanged, this, &ThisType::enableApplyButton);
connect(m_ui->smtp_server_txt, &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->checkSmtpSSL, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->groupMailNotifAuth, &QGroupBox::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->mailNotifUsername, &QLineEdit::textChanged, this, &ThisType::enableApplyButton);
connect(m_ui->mailNotifPassword, &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->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") 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):") .arg(tr("Supported parameters (case sensitive):")
@ -297,7 +297,7 @@ OptionsDialog::OptionsDialog(QWidget *parent)
.arg(tr("%T: Current tracker") .arg(tr("%T: Current tracker")
, tr("%I: Info hash") , tr("%I: Info hash")
, tr("Tip: Encapsulate parameter with quotation marks to avoid text being cut off at whitespace (e.g., \"%N\")")); , 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 // Connection tab
connect(m_ui->comboProtocol, qComboBoxCurrentIndexChanged, this, &ThisType::enableApplyButton); connect(m_ui->comboProtocol, qComboBoxCurrentIndexChanged, this, &ThisType::enableApplyButton);
@ -312,10 +312,10 @@ OptionsDialog::OptionsDialog(QWidget *parent)
connect(m_ui->spinDownloadLimit, qSpinBoxValueChanged, this, &ThisType::enableApplyButton); connect(m_ui->spinDownloadLimit, qSpinBoxValueChanged, this, &ThisType::enableApplyButton);
connect(m_ui->spinUploadLimitAlt, qSpinBoxValueChanged, this, &ThisType::enableApplyButton); connect(m_ui->spinUploadLimitAlt, qSpinBoxValueChanged, this, &ThisType::enableApplyButton);
connect(m_ui->spinDownloadLimitAlt, 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->groupBoxSchedule, &QGroupBox::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->schedule_from, &QDateTimeEdit::timeChanged, this, &ThisType::enableApplyButton); connect(m_ui->timeEditScheduleFrom, &QDateTimeEdit::timeChanged, this, &ThisType::enableApplyButton);
connect(m_ui->schedule_to, &QDateTimeEdit::timeChanged, this, &ThisType::enableApplyButton); connect(m_ui->timeEditScheduleTo, &QDateTimeEdit::timeChanged, this, &ThisType::enableApplyButton);
connect(m_ui->schedule_days, qComboBoxCurrentIndexChanged, this, &ThisType::enableApplyButton); connect(m_ui->comboBoxScheduleDays, qComboBoxCurrentIndexChanged, this, &ThisType::enableApplyButton);
connect(m_ui->checkLimituTPConnections, &QAbstractButton::toggled, this, &ThisType::enableApplyButton); connect(m_ui->checkLimituTPConnections, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->checkLimitTransportOverhead, &QAbstractButton::toggled, this, &ThisType::enableApplyButton); connect(m_ui->checkLimitTransportOverhead, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->checkLimitLocalPeerRate, &QAbstractButton::toggled, this, &ThisType::enableApplyButton); connect(m_ui->checkLimitLocalPeerRate, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
@ -617,14 +617,14 @@ void OptionsDialog::saveOptions()
session->setFinishedTorrentExportDirectory(getFinishedTorrentExportDir()); session->setFinishedTorrentExportDirectory(getFinishedTorrentExportDir());
pref->setMailNotificationEnabled(m_ui->groupMailNotification->isChecked()); pref->setMailNotificationEnabled(m_ui->groupMailNotification->isChecked());
pref->setMailNotificationSender(m_ui->senderEmailTxt->text()); pref->setMailNotificationSender(m_ui->senderEmailTxt->text());
pref->setMailNotificationEmail(m_ui->dest_email_txt->text()); pref->setMailNotificationEmail(m_ui->lineEditDestEmail->text());
pref->setMailNotificationSMTP(m_ui->smtp_server_txt->text()); pref->setMailNotificationSMTP(m_ui->lineEditSmtpServer->text());
pref->setMailNotificationSMTPSSL(m_ui->checkSmtpSSL->isChecked()); pref->setMailNotificationSMTPSSL(m_ui->checkSmtpSSL->isChecked());
pref->setMailNotificationSMTPAuth(m_ui->groupMailNotifAuth->isChecked()); pref->setMailNotificationSMTPAuth(m_ui->groupMailNotifAuth->isChecked());
pref->setMailNotificationSMTPUsername(m_ui->mailNotifUsername->text()); pref->setMailNotificationSMTPUsername(m_ui->mailNotifUsername->text());
pref->setMailNotificationSMTPPassword(m_ui->mailNotifPassword->text()); pref->setMailNotificationSMTPPassword(m_ui->mailNotifPassword->text());
pref->setAutoRunEnabled(m_ui->autoRunBox->isChecked()); 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->setActionOnDblClOnTorrentDl(getActionOnDblClOnTorrentDl());
pref->setActionOnDblClOnTorrentFn(getActionOnDblClOnTorrentFn()); pref->setActionOnDblClOnTorrentFn(getActionOnDblClOnTorrentFn());
TorrentFileGuard::setAutoDeleteMode(!m_ui->deleteTorrentBox->isChecked() ? TorrentFileGuard::Never TorrentFileGuard::setAutoDeleteMode(!m_ui->deleteTorrentBox->isChecked() ? TorrentFileGuard::Never
@ -646,10 +646,10 @@ void OptionsDialog::saveOptions()
const QPair<int, int> alt_down_up_limit = getAltGlobalBandwidthLimits(); const QPair<int, int> alt_down_up_limit = getAltGlobalBandwidthLimits();
session->setAltGlobalDownloadSpeedLimit(alt_down_up_limit.first); session->setAltGlobalDownloadSpeedLimit(alt_down_up_limit.first);
session->setAltGlobalUploadSpeedLimit(alt_down_up_limit.second); session->setAltGlobalUploadSpeedLimit(alt_down_up_limit.second);
pref->setSchedulerStartTime(m_ui->schedule_from->time()); pref->setSchedulerStartTime(m_ui->timeEditScheduleFrom->time());
pref->setSchedulerEndTime(m_ui->schedule_to->time()); pref->setSchedulerEndTime(m_ui->timeEditScheduleTo->time());
pref->setSchedulerDays(static_cast<SchedulerDays>(m_ui->schedule_days->currentIndex())); pref->setSchedulerDays(static_cast<SchedulerDays>(m_ui->comboBoxScheduleDays->currentIndex()));
session->setBandwidthSchedulerEnabled(m_ui->check_schedule->isChecked()); session->setBandwidthSchedulerEnabled(m_ui->groupBoxSchedule->isChecked());
auto proxyConfigManager = Net::ProxyConfigurationManager::instance(); auto proxyConfigManager = Net::ProxyConfigurationManager::instance();
Net::ProxyConfiguration proxyConf; Net::ProxyConfiguration proxyConf;
@ -881,15 +881,15 @@ void OptionsDialog::loadOptions()
m_ui->groupMailNotification->setChecked(pref->isMailNotificationEnabled()); m_ui->groupMailNotification->setChecked(pref->isMailNotificationEnabled());
m_ui->senderEmailTxt->setText(pref->getMailNotificationSender()); m_ui->senderEmailTxt->setText(pref->getMailNotificationSender());
m_ui->dest_email_txt->setText(pref->getMailNotificationEmail()); m_ui->lineEditDestEmail->setText(pref->getMailNotificationEmail());
m_ui->smtp_server_txt->setText(pref->getMailNotificationSMTP()); m_ui->lineEditSmtpServer->setText(pref->getMailNotificationSMTP());
m_ui->checkSmtpSSL->setChecked(pref->getMailNotificationSMTPSSL()); m_ui->checkSmtpSSL->setChecked(pref->getMailNotificationSMTPSSL());
m_ui->groupMailNotifAuth->setChecked(pref->getMailNotificationSMTPAuth()); m_ui->groupMailNotifAuth->setChecked(pref->getMailNotificationSMTPAuth());
m_ui->mailNotifUsername->setText(pref->getMailNotificationSMTPUsername()); m_ui->mailNotifUsername->setText(pref->getMailNotificationSMTPUsername());
m_ui->mailNotifPassword->setText(pref->getMailNotificationSMTPPassword()); m_ui->mailNotifPassword->setText(pref->getMailNotificationSMTPPassword());
m_ui->autoRunBox->setChecked(pref->isAutoRunEnabled()); m_ui->autoRunBox->setChecked(pref->isAutoRunEnabled());
m_ui->autoRun_txt->setText(pref->getAutoRunProgram()); m_ui->lineEditAutoRun->setText(pref->getAutoRunProgram());
intValue = pref->getActionOnDblClOnTorrentDl(); intValue = pref->getActionOnDblClOnTorrentDl();
if (intValue >= m_ui->actionTorrentDlOnDblClBox->count()) if (intValue >= m_ui->actionTorrentDlOnDblClBox->count())
intValue = 0; intValue = 0;
@ -1056,10 +1056,10 @@ void OptionsDialog::loadOptions()
m_ui->checkLimitTransportOverhead->setChecked(session->includeOverheadInLimits()); m_ui->checkLimitTransportOverhead->setChecked(session->includeOverheadInLimits());
m_ui->checkLimitLocalPeerRate->setChecked(!session->ignoreLimitsOnLAN()); m_ui->checkLimitLocalPeerRate->setChecked(!session->ignoreLimitsOnLAN());
m_ui->check_schedule->setChecked(session->isBandwidthSchedulerEnabled()); m_ui->groupBoxSchedule->setChecked(session->isBandwidthSchedulerEnabled());
m_ui->schedule_from->setTime(pref->getSchedulerStartTime()); m_ui->timeEditScheduleFrom->setTime(pref->getSchedulerStartTime());
m_ui->schedule_to->setTime(pref->getSchedulerEndTime()); m_ui->timeEditScheduleTo->setTime(pref->getSchedulerEndTime());
m_ui->schedule_days->setCurrentIndex(static_cast<int>(pref->getSchedulerDays())); m_ui->comboBoxScheduleDays->setCurrentIndex(static_cast<int>(pref->getSchedulerDays()));
// End Speed preferences // End Speed preferences
// Bittorrent preferences // Bittorrent preferences
@ -1786,7 +1786,7 @@ bool OptionsDialog::setSslCertificate(const QByteArray &cert)
bool OptionsDialog::schedTimesOk() 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.")); QMessageBox::warning(this, tr("Time Error"), tr("The start time and the end time can't be the same."));
return false; return false;
} }

View file

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

View file

@ -55,13 +55,13 @@ QList<BitTorrent::PeerAddress> PeersAdditionDialog::askForPeers(QWidget *parent)
void PeersAdditionDialog::validateInput() 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"), QMessageBox::warning(this, tr("No peer entered"),
tr("Please type at least one peer."), tr("Please type at least one peer."),
QMessageBox::Ok); QMessageBox::Ok);
return; 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); BitTorrent::PeerAddress addr = parsePeer(peer);
if (!addr.ip.isNull()) { if (!addr.ip.isNull()) {
m_peersList.append(addr); m_peersList.append(addr);

View file

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

View file

@ -139,10 +139,10 @@ PropertiesWidget::PropertiesWidget(QWidget *parent, MainWindow *mainWindow, Tran
m_ui->trackerDownButton->setIconSize(Utils::Gui::smallIconSize()); m_ui->trackerDownButton->setIconSize(Utils::Gui::smallIconSize());
connect(m_ui->trackerUpButton, &QPushButton::clicked, m_trackerList, &TrackerListWidget::moveSelectionUp); connect(m_ui->trackerUpButton, &QPushButton::clicked, m_trackerList, &TrackerListWidget::moveSelectionUp);
connect(m_ui->trackerDownButton, &QPushButton::clicked, m_trackerList, &TrackerListWidget::moveSelectionDown); 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 // Peers list
m_peerList = new PeerListWidget(this); m_peerList = new PeerListWidget(this);
m_ui->peerpage_layout->addWidget(m_peerList); m_ui->vBoxLayoutPeerPage->addWidget(m_peerList);
// Speed widget // Speed widget
m_speedWidget = new SpeedWidget(this); m_speedWidget = new SpeedWidget(this);
m_ui->speedLayout->addWidget(m_speedWidget); m_ui->speedLayout->addWidget(m_speedWidget);
@ -604,7 +604,7 @@ void PropertiesWidget::displayFilesListMenu(const QPoint &)
QMenu subMenu; QMenu subMenu;
if (!m_torrent->isSeed()) { if (!m_torrent->isSeed()) {
subMenu.setTitle(tr("Priority")); subMenu.setTitle(tr("Priority"));
subMenu.addAction(m_ui->actionNot_downloaded); subMenu.addAction(m_ui->actionNotDownloaded);
subMenu.addAction(m_ui->actionNormal); subMenu.addAction(m_ui->actionNormal);
subMenu.addAction(m_ui->actionHigh); subMenu.addAction(m_ui->actionHigh);
subMenu.addAction(m_ui->actionMaximum); subMenu.addAction(m_ui->actionMaximum);
@ -632,7 +632,7 @@ void PropertiesWidget::displayFilesListMenu(const QPoint &)
prio = prio::HIGH; prio = prio::HIGH;
else if (act == m_ui->actionMaximum) else if (act == m_ui->actionMaximum)
prio = prio::MAXIMUM; prio = prio::MAXIMUM;
else if (act == m_ui->actionNot_downloaded) else if (act == m_ui->actionNotDownloaded)
prio = prio::IGNORED; prio = prio::IGNORED;
qDebug("Setting files priority"); qDebug("Setting files priority");

View file

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

View file

@ -60,7 +60,7 @@ TrackersAdditionDialog::~TrackersAdditionDialog()
QStringList TrackersAdditionDialog::newTrackers() const QStringList TrackersAdditionDialog::newTrackers() const
{ {
QStringList cleanTrackers; QStringList cleanTrackers;
foreach (QString url, m_ui->trackers_list->toPlainText().split('\n')) { foreach (QString url, m_ui->textEditTrackersList->toPlainText().split('\n')) {
url = url.trimmed(); url = url.trimmed();
if (!url.isEmpty()) if (!url.isEmpty())
cleanTrackers << url; cleanTrackers << url;
@ -71,7 +71,7 @@ QStringList TrackersAdditionDialog::newTrackers() const
void TrackersAdditionDialog::on_uTorrentListButton_clicked() void TrackersAdditionDialog::on_uTorrentListButton_clicked()
{ {
m_ui->uTorrentListButton->setEnabled(false); 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) connect(handler, static_cast<void (Net::DownloadHandler::*)(const QString &, const QByteArray &)>(&Net::DownloadHandler::downloadFinished)
, this, &TrackersAdditionDialog::parseUTorrentList); , this, &TrackersAdditionDialog::parseUTorrentList);
connect(handler, &Net::DownloadHandler::downloadFailed, this, &TrackersAdditionDialog::getTrackerError); connect(handler, &Net::DownloadHandler::downloadFailed, this, &TrackersAdditionDialog::getTrackerError);
@ -84,7 +84,7 @@ void TrackersAdditionDialog::parseUTorrentList(const QString &, const QByteArray
// Load from torrent handle // Load from torrent handle
QList<BitTorrent::TrackerEntry> existingTrackers = m_torrent->trackers(); QList<BitTorrent::TrackerEntry> existingTrackers = m_torrent->trackers();
// Load from current user list // 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) { foreach (const QString &userURL, tmp) {
BitTorrent::TrackerEntry userTracker(userURL); BitTorrent::TrackerEntry userTracker(userURL);
if (!existingTrackers.contains(userTracker)) if (!existingTrackers.contains(userTracker))
@ -92,8 +92,8 @@ void TrackersAdditionDialog::parseUTorrentList(const QString &, const QByteArray
} }
// Add new trackers to the list // Add new trackers to the list
if (!m_ui->trackers_list->toPlainText().isEmpty() && !m_ui->trackers_list->toPlainText().endsWith('\n')) if (!m_ui->textEditTrackersList->toPlainText().isEmpty() && !m_ui->textEditTrackersList->toPlainText().endsWith('\n'))
m_ui->trackers_list->insertPlainText("\n"); m_ui->textEditTrackersList->insertPlainText("\n");
int nb = 0; int nb = 0;
QBuffer buffer; QBuffer buffer;
buffer.setData(data); buffer.setData(data);
@ -104,7 +104,7 @@ void TrackersAdditionDialog::parseUTorrentList(const QString &, const QByteArray
BitTorrent::TrackerEntry newTracker(line); BitTorrent::TrackerEntry newTracker(line);
if (!existingTrackers.contains(newTracker)) { if (!existingTrackers.contains(newTracker)) {
m_ui->trackers_list->insertPlainText(line + '\n'); m_ui->textEditTrackersList->insertPlainText(line + '\n');
++nb; ++nb;
} }
} }

View file

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

View file

@ -253,7 +253,7 @@ void AutomatedRssDownloader::updateRuleDefinitionBox()
m_ui->lineEFilter->setText(m_currentRule.episodeFilter()); m_ui->lineEFilter->setText(m_currentRule.episodeFilter());
else else
m_ui->lineEFilter->clear(); 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->lineSavePath->setText(Utils::Fs::toNativePath(m_currentRule.savePath()));
m_ui->checkRegex->blockSignals(true); m_ui->checkRegex->blockSignals(true);
m_ui->checkRegex->setChecked(m_currentRule.useRegex()); m_ui->checkRegex->setChecked(m_currentRule.useRegex());
@ -300,7 +300,7 @@ void AutomatedRssDownloader::clearRuleDefinitionBox()
m_ui->lineContains->clear(); m_ui->lineContains->clear();
m_ui->lineNotContains->clear(); m_ui->lineNotContains->clear();
m_ui->lineEFilter->clear(); m_ui->lineEFilter->clear();
m_ui->saveDiffDir_check->setChecked(false); m_ui->checkBoxSaveDiffDir->setChecked(false);
m_ui->lineSavePath->clear(); m_ui->lineSavePath->clear();
m_ui->comboCategory->clearEditText(); m_ui->comboCategory->clearEditText();
m_ui->comboCategory->setCurrentIndex(-1); m_ui->comboCategory->setCurrentIndex(-1);
@ -334,7 +334,7 @@ void AutomatedRssDownloader::updateEditedRule()
m_currentRule.setMustContain(m_ui->lineContains->text()); m_currentRule.setMustContain(m_ui->lineContains->text());
m_currentRule.setMustNotContain(m_ui->lineNotContains->text()); m_currentRule.setMustNotContain(m_ui->lineNotContains->text());
m_currentRule.setEpisodeFilter(m_ui->lineEFilter->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()); m_currentRule.setCategory(m_ui->comboCategory->currentText());
TriStateBool addPaused; // Undefined by default TriStateBool addPaused; // Undefined by default
if (m_ui->comboAddPaused->currentIndex() == 1) if (m_ui->comboAddPaused->currentIndex() == 1)
@ -692,13 +692,13 @@ void AutomatedRssDownloader::updateMustLineValidity()
if (valid) { if (valid) {
m_ui->lineContains->setStyleSheet(""); m_ui->lineContains->setStyleSheet("");
m_ui->lbl_must_stat->setPixmap(QPixmap()); m_ui->labelMustStat->setPixmap(QPixmap());
m_ui->lbl_must_stat->setToolTip(""); m_ui->labelMustStat->setToolTip("");
} }
else { else {
m_ui->lineContains->setStyleSheet("QLineEdit { color: #ff0000; }"); m_ui->lineContains->setStyleSheet("QLineEdit { color: #ff0000; }");
m_ui->lbl_must_stat->setPixmap(GuiIconProvider::instance()->getIcon("task-attention").pixmap(16, 16)); m_ui->labelMustStat->setPixmap(GuiIconProvider::instance()->getIcon("task-attention").pixmap(16, 16));
m_ui->lbl_must_stat->setToolTip(error); m_ui->labelMustStat->setToolTip(error);
} }
} }
@ -730,13 +730,13 @@ void AutomatedRssDownloader::updateMustNotLineValidity()
if (valid) { if (valid) {
m_ui->lineNotContains->setStyleSheet(""); m_ui->lineNotContains->setStyleSheet("");
m_ui->lbl_mustnot_stat->setPixmap(QPixmap()); m_ui->labelMustNotStat->setPixmap(QPixmap());
m_ui->lbl_mustnot_stat->setToolTip(""); m_ui->labelMustNotStat->setToolTip("");
} }
else { else {
m_ui->lineNotContains->setStyleSheet("QLineEdit { color: #ff0000; }"); m_ui->lineNotContains->setStyleSheet("QLineEdit { color: #ff0000; }");
m_ui->lbl_mustnot_stat->setPixmap(GuiIconProvider::instance()->getIcon("task-attention").pixmap(16, 16)); m_ui->labelMustNotStat->setPixmap(GuiIconProvider::instance()->getIcon("task-attention").pixmap(16, 16));
m_ui->lbl_mustnot_stat->setToolTip(error); m_ui->labelMustNotStat->setToolTip(error);
} }
} }
@ -747,11 +747,11 @@ void AutomatedRssDownloader::updateEpisodeFilterValidity()
if (valid) { if (valid) {
m_ui->lineEFilter->setStyleSheet(""); m_ui->lineEFilter->setStyleSheet("");
m_ui->lbl_epfilter_stat->setPixmap(QPixmap()); m_ui->labelEpFilterStat->setPixmap(QPixmap());
} }
else { else {
m_ui->lineEFilter->setStyleSheet("QLineEdit { color: #ff0000; }"); 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));
} }
} }

View file

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

View file

@ -116,7 +116,7 @@ SearchWidget::SearchWidget(MainWindow *mainWindow)
"Search phrase example, illustrates quotes usage, double quoted" "Search phrase example, illustrates quotes usage, double quoted"
"pair of space delimited words, the whole pair is highlighted") "pair of space delimited words, the whole pair is highlighted")
<< "</p></body></html>" << flush; << "</p></body></html>" << flush;
m_ui->m_searchPattern->setToolTip(searchPatternHint); m_ui->lineEditSearchPattern->setToolTip(searchPatternHint);
#ifndef Q_OS_MAC #ifndef Q_OS_MAC
// Icons // Icons
@ -153,8 +153,8 @@ SearchWidget::SearchWidget(MainWindow *mainWindow)
// Fill in category combobox // Fill in category combobox
onPluginChanged(); onPluginChanged();
connect(m_ui->m_searchPattern, &LineEdit::returnPressed, m_ui->searchButton, &QPushButton::click); connect(m_ui->lineEditSearchPattern, &LineEdit::returnPressed, m_ui->searchButton, &QPushButton::click);
connect(m_ui->m_searchPattern, &LineEdit::textEdited, this, &SearchWidget::searchTextEdited); connect(m_ui->lineEditSearchPattern, &LineEdit::textEdited, this, &SearchWidget::searchTextEdited);
connect(m_ui->selectPlugin, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged) connect(m_ui->selectPlugin, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged)
, this, &SearchWidget::selectMultipleBox); , this, &SearchWidget::selectMultipleBox);
connect(m_ui->selectPlugin, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged) connect(m_ui->selectPlugin, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged)
@ -215,14 +215,14 @@ void SearchWidget::selectActivePage()
{ {
if (SearchPluginManager::instance()->allPlugins().isEmpty()) { if (SearchPluginManager::instance()->allPlugins().isEmpty()) {
m_ui->stackedPages->setCurrentWidget(m_ui->emptyPage); 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->comboCategory->setEnabled(false);
m_ui->selectPlugin->setEnabled(false); m_ui->selectPlugin->setEnabled(false);
m_ui->searchButton->setEnabled(false); m_ui->searchButton->setEnabled(false);
} }
else { else {
m_ui->stackedPages->setCurrentWidget(m_ui->searchPage); 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->comboCategory->setEnabled(true);
m_ui->selectPlugin->setEnabled(true); m_ui->selectPlugin->setEnabled(true);
m_ui->searchButton->setEnabled(true); m_ui->searchButton->setEnabled(true);
@ -279,7 +279,7 @@ void SearchWidget::searchTextEdited(QString)
void SearchWidget::giveFocusToSearchInput() void SearchWidget::giveFocusToSearchInput()
{ {
m_ui->m_searchPattern->setFocus(); m_ui->lineEditSearchPattern->setFocus();
} }
// Function called when we click on search button // Function called when we click on search button
@ -300,7 +300,7 @@ void SearchWidget::on_searchButton_clicked()
m_isNewQueryString = false; m_isNewQueryString = false;
const QString pattern = m_ui->m_searchPattern->text().trimmed(); const QString pattern = m_ui->lineEditSearchPattern->text().trimmed();
// No search pattern entered // No search pattern entered
if (pattern.isEmpty()) { if (pattern.isEmpty()) {
QMessageBox::critical(this, tr("Empty search pattern"), tr("Please type a search pattern first")); QMessageBox::critical(this, tr("Empty search pattern"), tr("Please type a search pattern first"));

View file

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

View file

@ -44,9 +44,9 @@ TrackerLoginDialog::TrackerLoginDialog(QWidget *parent, BitTorrent::TorrentHandl
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::accepted, this, &TrackerLoginDialog::loginButtonClicked);
connect(buttonBox, &QDialogButtonBox::rejected, this, &TrackerLoginDialog::cancelButtonClicked); connect(buttonBox, &QDialogButtonBox::rejected, this, &TrackerLoginDialog::cancelButtonClicked);

View file

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