From 98215d2231380860797566920d7795f32af04112 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Mon, 25 Apr 2016 14:14:48 +0800 Subject: [PATCH 1/7] Cleanup Connection page in Option dialog. Add vertical spacer, closes #845. --- src/gui/options.ui | 355 +++++++++++++++++++-------------------------- 1 file changed, 149 insertions(+), 206 deletions(-) diff --git a/src/gui/options.ui b/src/gui/options.ui index a173ad09d..06af50bcc 100644 --- a/src/gui/options.ui +++ b/src/gui/options.ui @@ -114,8 +114,8 @@ 0 0 - 514 - 968 + 497 + 880 @@ -670,8 +670,8 @@ 0 0 - 470 - 926 + 586 + 1127 @@ -1363,84 +1363,80 @@ 0 0 - 457 - 713 + 497 + 672 - - - - - Listening Port - - + + + Listening Port + + + + - - - - - Port used for incoming connections: - - - - - - - 1 - - - 65535 - - - 8999 - - - - - - - Random - - - - - - - Qt::Horizontal - - - - 20 - 20 - - - - - + + + Port used for incoming connections: + + - - - Use UPnP / NAT-PMP port forwarding from my router + + + 1 - - true + + 65535 + + + 8999 - + - Use different port on each startup + Random + + + + Qt::Horizontal + + + + 40 + 20 + + + + - - - + + + + + Use UPnP / NAT-PMP port forwarding from my router + + + true + + + + + + + Use different port on each startup + + + + + @@ -1448,6 +1444,26 @@ Connections Limits + + + + 500 + + + 4 + + + + + + + Maximum number of connections per torrent: + + + true + + + @@ -1474,17 +1490,7 @@ - - - - Maximum number of connections per torrent: - - - true - - - - + 2 @@ -1497,7 +1503,7 @@ - + Maximum number of upload slots per torrent: @@ -1507,56 +1513,7 @@ - - - - 500 - - - 4 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - + Global maximum number of upload slots: @@ -1566,7 +1523,7 @@ - + 2000 @@ -1576,8 +1533,8 @@ - - + + Qt::Horizontal @@ -1602,7 +1559,7 @@ - + @@ -1652,12 +1609,6 @@ - - 75 - - - QLineEdit::Normal - @@ -1749,17 +1700,7 @@ - - - - - - 1000 - - - QLineEdit::Normal - - + @@ -1770,12 +1711,6 @@ - - - - - 1000 - QLineEdit::Password @@ -1807,53 +1742,48 @@ false - - - - - Filter path (.dat, .p2p, .p2b): - - - - - - - - - - - 28 - 27 - - - - ... - - - - - - - - 28 - 27 - - - - Reload the filter - - - - - - - 16 - 16 - - - + + + + + + + Filter path (.dat, .p2p, .p2b): + + + + + + + + + + + 0 + 25 + + + + ... + + + + + + + + 16777215 + 25 + + + + Reload the filter + + + + - + Apply to trackers @@ -1863,6 +1793,19 @@ + + + + Qt::Vertical + + + + 20 + 40 + + + + @@ -1893,8 +1836,8 @@ 0 0 - 362 - 484 + 510 + 538 @@ -2280,8 +2223,8 @@ 0 0 - 587 - 578 + 574 + 534 @@ -2677,8 +2620,8 @@ 0 0 - 460 - 562 + 438 + 543 From 05cbb35814669b98617c01494525476777ff6c9e Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Mon, 25 Apr 2016 14:50:44 +0800 Subject: [PATCH 2/7] Follow header inclusion rule --- src/gui/options_imp.cpp | 38 +++++++++++++++++++------------------- src/gui/options_imp.h | 9 +++------ 2 files changed, 22 insertions(+), 25 deletions(-) diff --git a/src/gui/options_imp.cpp b/src/gui/options_imp.cpp index 084c1683d..0c56eb3ec 100644 --- a/src/gui/options_imp.cpp +++ b/src/gui/options_imp.cpp @@ -28,38 +28,38 @@ * Contact : chris@qbittorrent.org */ -#include -#include -#include -#include +#include "options_imp.h" + +#include + #include -#include #include +#include +#include #include +#include +#include +#include +#include #include -#include -#include -#include +#ifndef QT_NO_OPENSSL +#include +#include +#endif #include "app/application.h" -#include "base/preferences.h" -#include "base/utils/fs.h" -#include "base/scanfoldersmodel.h" #include "base/bittorrent/session.h" #include "base/net/dnsupdater.h" -#include "base/unicodestrings.h" +#include "base/preferences.h" +#include "base/scanfoldersmodel.h" #include "base/torrentfileguard.h" +#include "base/unicodestrings.h" +#include "base/utils/fs.h" +#include "addnewtorrentdialog.h" #include "advancedsettings.h" #include "guiiconprovider.h" #include "scanfoldersdelegate.h" -#include "addnewtorrentdialog.h" -#include "options_imp.h" - -#ifndef QT_NO_OPENSSL -#include -#include -#endif // Constructor options_imp::options_imp(QWidget *parent) diff --git a/src/gui/options_imp.h b/src/gui/options_imp.h index 1f89fb82a..6dd3706da 100644 --- a/src/gui/options_imp.h +++ b/src/gui/options_imp.h @@ -33,6 +33,9 @@ #include "ui_options.h" +class QCloseEvent; +class AdvancedSettings; + // actions on double-click on torrents enum DoubleClickAction { @@ -41,12 +44,6 @@ enum DoubleClickAction NO_ACTION }; -class AdvancedSettings; - -QT_BEGIN_NAMESPACE -class QCloseEvent; -QT_END_NAMESPACE - class options_imp: public QDialog, private Ui_Preferences { Q_OBJECT From 97ee63fc78a5ff9bd73c750c28576257782aa8a9 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Mon, 25 Apr 2016 15:11:33 +0800 Subject: [PATCH 3/7] Move options ui as a pointer member variable --- src/gui/options.ui | 10 +- src/gui/options_imp.cpp | 1107 ++++++++++++++++++++------------------- src/gui/options_imp.h | 13 +- 3 files changed, 571 insertions(+), 559 deletions(-) diff --git a/src/gui/options.ui b/src/gui/options.ui index 06af50bcc..2390066af 100644 --- a/src/gui/options.ui +++ b/src/gui/options.ui @@ -1,7 +1,7 @@ - Preferences - + OptionsDialog + 0 @@ -1363,7 +1363,7 @@ 0 0 - 497 + 457 672 @@ -1836,8 +1836,8 @@ 0 0 - 510 - 538 + 388 + 452 diff --git a/src/gui/options_imp.cpp b/src/gui/options_imp.cpp index 0c56eb3ec..e6faccb7c 100644 --- a/src/gui/options_imp.cpp +++ b/src/gui/options_imp.cpp @@ -61,38 +61,41 @@ #include "guiiconprovider.h" #include "scanfoldersdelegate.h" +#include "ui_options.h" + // Constructor options_imp::options_imp(QWidget *parent) : QDialog(parent) , m_refreshingIpFilter(false) + , m_ui(new Ui::OptionsDialog) { qDebug("-> Constructing Options"); - setupUi(this); + m_ui->setupUi(this); setAttribute(Qt::WA_DeleteOnClose); setModal(true); // Icons - tabSelection->item(TAB_UI)->setIcon(GuiIconProvider::instance()->getIcon("preferences-desktop")); - tabSelection->item(TAB_BITTORRENT)->setIcon(GuiIconProvider::instance()->getIcon("preferences-system-network")); - tabSelection->item(TAB_CONNECTION)->setIcon(GuiIconProvider::instance()->getIcon("network-wired")); - tabSelection->item(TAB_DOWNLOADS)->setIcon(GuiIconProvider::instance()->getIcon("download")); - tabSelection->item(TAB_SPEED)->setIcon(GuiIconProvider::instance()->getIcon("chronometer")); + m_ui->tabSelection->item(TAB_UI)->setIcon(GuiIconProvider::instance()->getIcon("preferences-desktop")); + m_ui->tabSelection->item(TAB_BITTORRENT)->setIcon(GuiIconProvider::instance()->getIcon("preferences-system-network")); + m_ui->tabSelection->item(TAB_CONNECTION)->setIcon(GuiIconProvider::instance()->getIcon("network-wired")); + m_ui->tabSelection->item(TAB_DOWNLOADS)->setIcon(GuiIconProvider::instance()->getIcon("download")); + m_ui->tabSelection->item(TAB_SPEED)->setIcon(GuiIconProvider::instance()->getIcon("chronometer")); #ifndef DISABLE_WEBUI - tabSelection->item(TAB_WEBUI)->setIcon(GuiIconProvider::instance()->getIcon("network-server")); + m_ui->tabSelection->item(TAB_WEBUI)->setIcon(GuiIconProvider::instance()->getIcon("network-server")); #else - tabSelection->item(TAB_WEBUI)->setHidden(true); + m_ui->tabSelection->item(TAB_WEBUI)->setHidden(true); #endif - tabSelection->item(TAB_ADVANCED)->setIcon(GuiIconProvider::instance()->getIcon("preferences-other")); - for (int i = 0; i < tabSelection->count(); ++i) { - tabSelection->item(i)->setSizeHint(QSize(std::numeric_limits::max(), 64)); // uniform size for all icons + m_ui->tabSelection->item(TAB_ADVANCED)->setIcon(GuiIconProvider::instance()->getIcon("preferences-other")); + for (int i = 0; i < m_ui->tabSelection->count(); ++i) { + m_ui->tabSelection->item(i)->setSizeHint(QSize(std::numeric_limits::max(), 64)); // uniform size for all icons } - IpFilterRefreshBtn->setIcon(GuiIconProvider::instance()->getIcon("view-refresh")); + m_ui->IpFilterRefreshBtn->setIcon(GuiIconProvider::instance()->getIcon("view-refresh")); - deleteTorrentWarningIcon->setPixmap(QApplication::style()->standardIcon(QStyle::SP_MessageBoxCritical).pixmap(16, 16)); - deleteTorrentWarningIcon->hide(); - deleteTorrentWarningLabel->hide(); - deleteTorrentWarningLabel->setToolTip(QLatin1String("

") + + m_ui->deleteTorrentWarningIcon->setPixmap(QApplication::style()->standardIcon(QStyle::SP_MessageBoxCritical).pixmap(16, 16)); + m_ui->deleteTorrentWarningIcon->hide(); + m_ui->deleteTorrentWarningLabel->hide(); + m_ui->deleteTorrentWarningLabel->setToolTip(QLatin1String("

") + tr("By enabling these options, you can irrevocably lose your .torrent files!") + QLatin1String("

") + tr("When these options are enabled, qBittorent will delete .torrent files " @@ -105,137 +108,137 @@ options_imp::options_imp(QWidget *parent) "the “Add torrent” dialog") + QLatin1String("

")); - hsplitter->setCollapsible(0, false); - hsplitter->setCollapsible(1, false); + m_ui->hsplitter->setCollapsible(0, false); + m_ui->hsplitter->setCollapsible(1, false); // Get apply button in button box - QList buttons = buttonBox->buttons(); + QList buttons = m_ui->buttonBox->buttons(); foreach (QAbstractButton *button, buttons) { - if (buttonBox->buttonRole(button) == QDialogButtonBox::ApplyRole) { + if (m_ui->buttonBox->buttonRole(button) == QDialogButtonBox::ApplyRole) { applyButton = button; break; } } #ifndef QBT_USES_QT5 - scanFoldersView->header()->setResizeMode(QHeaderView::ResizeToContents); + m_ui->scanFoldersView->header()->setResizeMode(QHeaderView::ResizeToContents); #else - scanFoldersView->header()->setSectionResizeMode(QHeaderView::ResizeToContents); + m_ui->scanFoldersView->header()->setSectionResizeMode(QHeaderView::ResizeToContents); #endif - scanFoldersView->setModel(ScanFoldersModel::instance()); - scanFoldersView->setItemDelegate(new ScanFoldersDelegate(this, scanFoldersView)); + m_ui->scanFoldersView->setModel(ScanFoldersModel::instance()); + m_ui->scanFoldersView->setItemDelegate(new ScanFoldersDelegate(this, m_ui->scanFoldersView)); connect(ScanFoldersModel::instance(), SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(enableApplyButton())); - connect(scanFoldersView->selectionModel(), SIGNAL(selectionChanged(QItemSelection, QItemSelection)), this, SLOT(handleScanFolderViewSelectionChanged())); + connect(m_ui->scanFoldersView->selectionModel(), SIGNAL(selectionChanged(QItemSelection, QItemSelection)), this, SLOT(handleScanFolderViewSelectionChanged())); - connect(buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(applySettings(QAbstractButton*))); + connect(m_ui->buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(applySettings(QAbstractButton*))); // Languages supported initializeLanguageCombo(); // Load week days (scheduler) for (uint i = 1; i <= 7; ++i) - schedule_days->addItem(QDate::longDayName(i, QDate::StandaloneFormat)); + m_ui->schedule_days->addItem(QDate::longDayName(i, QDate::StandaloneFormat)); // Load options loadOptions(); // Disable systray integration if it is not supported by the system if (!QSystemTrayIcon::isSystemTrayAvailable()) { - checkShowSystray->setChecked(false); - checkShowSystray->setEnabled(false); - label_trayIconStyle->setVisible(false); - comboTrayIcon->setVisible(false); + m_ui->checkShowSystray->setChecked(false); + m_ui->checkShowSystray->setEnabled(false); + m_ui->label_trayIconStyle->setVisible(false); + m_ui->comboTrayIcon->setVisible(false); } #if defined(QT_NO_OPENSSL) - checkWebUiHttps->setVisible(false); + m_ui->checkWebUiHttps->setVisible(false); #endif #ifndef Q_OS_WIN - checkStartup->setVisible(false); + m_ui->checkStartup->setVisible(false); #endif #if !(defined(Q_OS_WIN) || defined(Q_OS_MAC)) - groupFileAssociation->setVisible(false); + m_ui->groupFileAssociation->setVisible(false); #endif // Connect signals / slots - connect(comboProxyType, SIGNAL(currentIndexChanged(int)), this, SLOT(enableProxy(int))); - connect(checkRandomPort, SIGNAL(toggled(bool)), spinPort, SLOT(setDisabled(bool))); + connect(m_ui->comboProxyType, SIGNAL(currentIndexChanged(int)), this, SLOT(enableProxy(int))); + connect(m_ui->checkRandomPort, SIGNAL(toggled(bool)), m_ui->spinPort, SLOT(setDisabled(bool))); // Apply button is activated when a value is changed // General tab - connect(comboI18n, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); - connect(confirmDeletion, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkAltRowColors, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkHideZero, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkHideZero, SIGNAL(toggled(bool)), comboHideZero, SLOT(setEnabled(bool))); - connect(comboHideZero, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); - connect(checkShowSystray, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkCloseToSystray, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkMinimizeToSysTray, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkStartMinimized, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->comboI18n, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); + connect(m_ui->confirmDeletion, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkAltRowColors, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkHideZero, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkHideZero, SIGNAL(toggled(bool)), m_ui->comboHideZero, SLOT(setEnabled(bool))); + connect(m_ui->comboHideZero, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); + connect(m_ui->checkShowSystray, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkCloseToSystray, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkMinimizeToSysTray, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkStartMinimized, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); #ifdef Q_OS_WIN - connect(checkStartup, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkStartup, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); #endif - connect(checkShowSplash, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkProgramExitConfirm, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkProgramAutoExitConfirm, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkPreventFromSuspend, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(comboTrayIcon, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); + connect(m_ui->checkShowSplash, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkProgramExitConfirm, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkProgramAutoExitConfirm, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkPreventFromSuspend, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->comboTrayIcon, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); #if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC)) && !defined(QT_DBUS_LIB) - checkPreventFromSuspend->setDisabled(true); + m_ui->checkPreventFromSuspend->setDisabled(true); #endif #if defined(Q_OS_WIN) || defined(Q_OS_MAC) - connect(checkAssociateTorrents, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkAssociateMagnetLinks, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkAssociateTorrents, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkAssociateMagnetLinks, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); #endif - connect(checkFileLog, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(textFileLogPath, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); - connect(checkFileLogBackup, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkFileLogBackup, SIGNAL(toggled(bool)), spinFileLogSize, SLOT(setEnabled(bool))); - connect(checkFileLogDelete, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkFileLogDelete, SIGNAL(toggled(bool)), spinFileLogAge, SLOT(setEnabled(bool))); - connect(checkFileLogDelete, SIGNAL(toggled(bool)), comboFileLogAgeType, SLOT(setEnabled(bool))); - connect(spinFileLogSize, SIGNAL(valueChanged(int)), this, SLOT(enableApplyButton())); - connect(spinFileLogAge, SIGNAL(valueChanged(int)), this, SLOT(enableApplyButton())); - connect(comboFileLogAgeType, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); + connect(m_ui->checkFileLog, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->textFileLogPath, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); + connect(m_ui->checkFileLogBackup, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkFileLogBackup, SIGNAL(toggled(bool)), m_ui->spinFileLogSize, SLOT(setEnabled(bool))); + connect(m_ui->checkFileLogDelete, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkFileLogDelete, SIGNAL(toggled(bool)), m_ui->spinFileLogAge, SLOT(setEnabled(bool))); + connect(m_ui->checkFileLogDelete, SIGNAL(toggled(bool)), m_ui->comboFileLogAgeType, SLOT(setEnabled(bool))); + connect(m_ui->spinFileLogSize, SIGNAL(valueChanged(int)), this, SLOT(enableApplyButton())); + connect(m_ui->spinFileLogAge, SIGNAL(valueChanged(int)), this, SLOT(enableApplyButton())); + connect(m_ui->comboFileLogAgeType, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); // Downloads tab - connect(textSavePath, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); - connect(checkUseSubcategories, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(comboSavingMode, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); - connect(comboTorrentCategoryChanged, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); - connect(comboCategoryDefaultPathChanged, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); - connect(comboCategoryChanged, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); - connect(textTempPath, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); - connect(checkAppendqB, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkPreallocateAll, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkAdditionDialog, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkAdditionDialogFront, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkStartPaused, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(deleteTorrentBox, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(deleteCancelledTorrentBox, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkExportDir, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkExportDir, SIGNAL(toggled(bool)), textExportDir, SLOT(setEnabled(bool))); - connect(checkExportDir, SIGNAL(toggled(bool)), browseExportDirButton, SLOT(setEnabled(bool))); - connect(checkExportDirFin, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkExportDirFin, SIGNAL(toggled(bool)), textExportDirFin, SLOT(setEnabled(bool))); - connect(checkExportDirFin, SIGNAL(toggled(bool)), browseExportDirFinButton, SLOT(setEnabled(bool))); - connect(textExportDir, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); - connect(textExportDirFin, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); - connect(actionTorrentDlOnDblClBox, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); - connect(actionTorrentFnOnDblClBox, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); - connect(checkTempFolder, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkTempFolder, SIGNAL(toggled(bool)), textTempPath, SLOT(setEnabled(bool))); - connect(checkTempFolder, SIGNAL(toggled(bool)), browseTempDirButton, SLOT(setEnabled(bool))); - connect(addScanFolderButton, SIGNAL(clicked()), this, SLOT(enableApplyButton())); - connect(removeScanFolderButton, SIGNAL(clicked()), this, SLOT(enableApplyButton())); - connect(groupMailNotification, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(dest_email_txt, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); - connect(smtp_server_txt, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); - connect(checkSmtpSSL, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(groupMailNotifAuth, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(mailNotifUsername, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); - connect(mailNotifPassword, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); - connect(autoRunBox, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(autoRun_txt, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); + connect(m_ui->textSavePath, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); + connect(m_ui->checkUseSubcategories, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->comboSavingMode, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); + connect(m_ui->comboTorrentCategoryChanged, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); + connect(m_ui->comboCategoryDefaultPathChanged, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); + connect(m_ui->comboCategoryChanged, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); + connect(m_ui->textTempPath, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); + connect(m_ui->checkAppendqB, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkPreallocateAll, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkAdditionDialog, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkAdditionDialogFront, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkStartPaused, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->deleteTorrentBox, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->deleteCancelledTorrentBox, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkExportDir, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkExportDir, SIGNAL(toggled(bool)), m_ui->textExportDir, SLOT(setEnabled(bool))); + connect(m_ui->checkExportDir, SIGNAL(toggled(bool)), m_ui->browseExportDirButton, SLOT(setEnabled(bool))); + connect(m_ui->checkExportDirFin, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkExportDirFin, SIGNAL(toggled(bool)), m_ui->textExportDirFin, SLOT(setEnabled(bool))); + connect(m_ui->checkExportDirFin, SIGNAL(toggled(bool)), m_ui->browseExportDirFinButton, SLOT(setEnabled(bool))); + connect(m_ui->textExportDir, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); + connect(m_ui->textExportDirFin, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); + connect(m_ui->actionTorrentDlOnDblClBox, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); + connect(m_ui->actionTorrentFnOnDblClBox, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); + connect(m_ui->checkTempFolder, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkTempFolder, SIGNAL(toggled(bool)), m_ui->textTempPath, SLOT(setEnabled(bool))); + connect(m_ui->checkTempFolder, SIGNAL(toggled(bool)), m_ui->browseTempDirButton, SLOT(setEnabled(bool))); + connect(m_ui->addScanFolderButton, SIGNAL(clicked()), this, SLOT(enableApplyButton())); + connect(m_ui->removeScanFolderButton, SIGNAL(clicked()), this, SLOT(enableApplyButton())); + connect(m_ui->groupMailNotification, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->dest_email_txt, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); + connect(m_ui->smtp_server_txt, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); + connect(m_ui->checkSmtpSSL, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->groupMailNotifAuth, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->mailNotifUsername, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); + connect(m_ui->mailNotifPassword, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); + connect(m_ui->autoRunBox, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->autoRun_txt, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); const QString autoRunStr = QString::fromUtf8("%1\n %2\n %3\n %4\n %5\n %6\n %7\n %8\n %9\n %10\n%11") .arg(tr("Supported parameters (case sensitive):")) @@ -249,91 +252,91 @@ options_imp::options_imp(QWidget *parent) .arg(tr("%T: Current tracker")) .arg(tr("%I: Info hash")) .arg(tr("Tip: Encapsulate parameter with quotation marks to avoid text being cut off at whitespace (e.g., \"%N\")")); - autoRun_param->setText(autoRunStr); + m_ui->autoRun_param->setText(autoRunStr); // Connection tab - connect(spinPort, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); - connect(checkRandomPort, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkUPnP, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkUploadLimit, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkDownloadLimit, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkUploadLimitAlt, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkDownloadLimitAlt, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(spinUploadLimit, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); - connect(spinDownloadLimit, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); - connect(spinUploadLimitAlt, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); - connect(spinDownloadLimitAlt, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); - connect(check_schedule, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(schedule_from, SIGNAL(timeChanged(QTime)), this, SLOT(enableApplyButton())); - connect(schedule_to, SIGNAL(timeChanged(QTime)), this, SLOT(enableApplyButton())); - connect(schedule_days, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); - connect(checkuTP, SIGNAL(toggled(bool)), SLOT(enableApplyButton())); - connect(checkuTP, SIGNAL(toggled(bool)), checkLimituTPConnections, SLOT(setEnabled(bool))); - connect(checkLimituTPConnections, SIGNAL(toggled(bool)), SLOT(enableApplyButton())); - connect(checkLimitTransportOverhead, SIGNAL(toggled(bool)), SLOT(enableApplyButton())); - connect(checkLimitLocalPeerRate, SIGNAL(toggled(bool)), SLOT(enableApplyButton())); + connect(m_ui->spinPort, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); + connect(m_ui->checkRandomPort, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkUPnP, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkUploadLimit, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkDownloadLimit, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkUploadLimitAlt, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkDownloadLimitAlt, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->spinUploadLimit, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); + connect(m_ui->spinDownloadLimit, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); + connect(m_ui->spinUploadLimitAlt, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); + connect(m_ui->spinDownloadLimitAlt, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); + connect(m_ui->check_schedule, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->schedule_from, SIGNAL(timeChanged(QTime)), this, SLOT(enableApplyButton())); + connect(m_ui->schedule_to, SIGNAL(timeChanged(QTime)), this, SLOT(enableApplyButton())); + connect(m_ui->schedule_days, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); + connect(m_ui->checkuTP, SIGNAL(toggled(bool)), SLOT(enableApplyButton())); + connect(m_ui->checkuTP, SIGNAL(toggled(bool)), m_ui->checkLimituTPConnections, SLOT(setEnabled(bool))); + connect(m_ui->checkLimituTPConnections, SIGNAL(toggled(bool)), SLOT(enableApplyButton())); + connect(m_ui->checkLimitTransportOverhead, SIGNAL(toggled(bool)), SLOT(enableApplyButton())); + connect(m_ui->checkLimitLocalPeerRate, SIGNAL(toggled(bool)), SLOT(enableApplyButton())); // Bittorrent tab - connect(checkMaxConnecs, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkMaxConnecsPerTorrent, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkMaxUploads, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkMaxUploadsPerTorrent, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(spinMaxConnec, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); - connect(spinMaxConnecPerTorrent, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); - connect(spinMaxUploads, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); - connect(spinMaxUploadsPerTorrent, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); - connect(checkDHT, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkAnonymousMode, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkPeX, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkLSD, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(comboEncryption, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); - connect(checkMaxRatio, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(spinMaxRatio, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); - connect(comboRatioLimitAct, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); + connect(m_ui->checkMaxConnecs, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkMaxConnecsPerTorrent, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkMaxUploads, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkMaxUploadsPerTorrent, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->spinMaxConnec, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); + connect(m_ui->spinMaxConnecPerTorrent, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); + connect(m_ui->spinMaxUploads, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); + connect(m_ui->spinMaxUploadsPerTorrent, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); + connect(m_ui->checkDHT, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkAnonymousMode, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkPeX, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkLSD, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->comboEncryption, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); + connect(m_ui->checkMaxRatio, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->spinMaxRatio, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); + connect(m_ui->comboRatioLimitAct, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); // Proxy tab - connect(comboProxyType, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); - connect(textProxyIP, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); - connect(spinProxyPort, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); - connect(checkProxyPeerConnecs, SIGNAL(toggled(bool)), SLOT(enableApplyButton())); - connect(checkForceProxy, SIGNAL(toggled(bool)), SLOT(enableApplyButton())); - connect(isProxyOnlyForTorrents, SIGNAL(toggled(bool)), SLOT(enableApplyButton())); - connect(checkProxyAuth, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(textProxyUsername, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); - connect(textProxyPassword, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); + connect(m_ui->comboProxyType, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); + connect(m_ui->textProxyIP, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); + connect(m_ui->spinProxyPort, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); + connect(m_ui->checkProxyPeerConnecs, SIGNAL(toggled(bool)), SLOT(enableApplyButton())); + connect(m_ui->checkForceProxy, SIGNAL(toggled(bool)), SLOT(enableApplyButton())); + connect(m_ui->isProxyOnlyForTorrents, SIGNAL(toggled(bool)), SLOT(enableApplyButton())); + connect(m_ui->checkProxyAuth, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->textProxyUsername, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); + connect(m_ui->textProxyPassword, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); // Misc tab - connect(checkIPFilter, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkIpFilterTrackers, SIGNAL(toggled(bool)), SLOT(enableApplyButton())); - connect(textFilterPath, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); - connect(checkEnableQueueing, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(spinMaxActiveDownloads, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); - connect(spinMaxActiveUploads, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); - connect(spinMaxActiveTorrents, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); - connect(checkIgnoreSlowTorrentsForQueueing, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkEnableAddTrackers, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(textTrackers, SIGNAL(textChanged()), this, SLOT(enableApplyButton())); + connect(m_ui->checkIPFilter, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkIpFilterTrackers, SIGNAL(toggled(bool)), SLOT(enableApplyButton())); + connect(m_ui->textFilterPath, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); + connect(m_ui->checkEnableQueueing, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->spinMaxActiveDownloads, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); + connect(m_ui->spinMaxActiveUploads, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); + connect(m_ui->spinMaxActiveTorrents, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); + connect(m_ui->checkIgnoreSlowTorrentsForQueueing, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkEnableAddTrackers, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->textTrackers, SIGNAL(textChanged()), this, SLOT(enableApplyButton())); #ifndef DISABLE_WEBUI // Web UI tab - connect(checkWebUi, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(spinWebUiPort, SIGNAL(valueChanged(int)), this, SLOT(enableApplyButton())); - connect(checkWebUIUPnP, SIGNAL(toggled(bool)), SLOT(enableApplyButton())); - connect(checkWebUiHttps, SIGNAL(toggled(bool)), SLOT(enableApplyButton())); - connect(btnWebUiKey, SIGNAL(clicked()), SLOT(enableApplyButton())); - connect(btnWebUiCrt, SIGNAL(clicked()), SLOT(enableApplyButton())); - connect(textWebUiUsername, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); - connect(textWebUiPassword, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); - connect(checkBypassLocalAuth, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkDynDNS, SIGNAL(toggled(bool)), SLOT(enableApplyButton())); - connect(comboDNSService, SIGNAL(currentIndexChanged(int)), SLOT(enableApplyButton())); - connect(domainNameTxt, SIGNAL(textChanged(QString)), SLOT(enableApplyButton())); - connect(DNSUsernameTxt, SIGNAL(textChanged(QString)), SLOT(enableApplyButton())); - connect(DNSPasswordTxt, SIGNAL(textChanged(QString)), SLOT(enableApplyButton())); + connect(m_ui->checkWebUi, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->spinWebUiPort, SIGNAL(valueChanged(int)), this, SLOT(enableApplyButton())); + connect(m_ui->checkWebUIUPnP, SIGNAL(toggled(bool)), SLOT(enableApplyButton())); + connect(m_ui->checkWebUiHttps, SIGNAL(toggled(bool)), SLOT(enableApplyButton())); + connect(m_ui->btnWebUiKey, SIGNAL(clicked()), SLOT(enableApplyButton())); + connect(m_ui->btnWebUiCrt, SIGNAL(clicked()), SLOT(enableApplyButton())); + connect(m_ui->textWebUiUsername, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); + connect(m_ui->textWebUiPassword, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); + connect(m_ui->checkBypassLocalAuth, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); + connect(m_ui->checkDynDNS, SIGNAL(toggled(bool)), SLOT(enableApplyButton())); + connect(m_ui->comboDNSService, SIGNAL(currentIndexChanged(int)), SLOT(enableApplyButton())); + connect(m_ui->domainNameTxt, SIGNAL(textChanged(QString)), SLOT(enableApplyButton())); + connect(m_ui->DNSUsernameTxt, SIGNAL(textChanged(QString)), SLOT(enableApplyButton())); + connect(m_ui->DNSPasswordTxt, SIGNAL(textChanged(QString)), SLOT(enableApplyButton())); #endif // Disable apply Button applyButton->setEnabled(false); // Tab selection mechanism - connect(tabSelection, SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)), this, SLOT(changePage(QListWidgetItem *, QListWidgetItem*))); + connect(m_ui->tabSelection, SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)), this, SLOT(changePage(QListWidgetItem *, QListWidgetItem*))); // Load Advanced settings - advancedSettings = new AdvancedSettings(tabAdvancedPage); - advPageLayout->addWidget(advancedSettings); + advancedSettings = new AdvancedSettings(m_ui->tabAdvancedPage); + m_ui->advPageLayout->addWidget(advancedSettings); connect(advancedSettings, SIGNAL(settingsChanged()), this, SLOT(enableApplyButton())); // Adapt size @@ -358,7 +361,7 @@ void options_imp::initializeLanguageCombo() QLocale locale(localeStr); languageName = languageToLocalizedString(locale); } - comboI18n->addItem(/*QIcon(":/icons/flags/"+country+".png"), */ languageName, localeStr); + m_ui->comboI18n->addItem(/*QIcon(":/icons/flags/"+country+".png"), */ languageName, localeStr); qDebug() << "Supported locale:" << localeStr; } } @@ -370,13 +373,14 @@ options_imp::~options_imp() foreach (const QString &path, addedScanDirs) ScanFoldersModel::instance()->removePath(path); ScanFoldersModel::instance()->configure(); // reloads "removed" paths + delete m_ui; } void options_imp::changePage(QListWidgetItem *current, QListWidgetItem *previous) { if (!current) current = previous; - tabOption->setCurrentIndex(tabSelection->row(current)); + m_ui->tabOption->setCurrentIndex(m_ui->tabSelection->row(current)); } void options_imp::loadWindowState() @@ -397,9 +401,9 @@ void options_imp::loadWindowState() } else { sizes << 116; - sizes << hsplitter->width() - 116; + sizes << m_ui->hsplitter->width() - 116; } - hsplitter->setSizes(sizes); + m_ui->hsplitter->setSizes(sizes); } void options_imp::saveWindowState() const @@ -409,8 +413,8 @@ void options_imp::saveWindowState() const pref->setPrefPos(pos()); // Splitter size QStringList sizes_str; - sizes_str << QString::number(hsplitter->sizes().first()); - sizes_str << QString::number(hsplitter->sizes().last()); + sizes_str << QString::number(m_ui->hsplitter->sizes().first()); + sizes_str << QString::number(m_ui->hsplitter->sizes().last()); pref->setPrefHSplitterSizes(sizes_str); } @@ -450,62 +454,62 @@ void options_imp::saveOptions() // General preferences pref->setLocale(locale); - pref->setConfirmTorrentDeletion(confirmDeletion->isChecked()); - pref->setAlternatingRowColors(checkAltRowColors->isChecked()); - pref->setHideZeroValues(checkHideZero->isChecked()); - pref->setHideZeroComboValues(comboHideZero->currentIndex()); + pref->setConfirmTorrentDeletion(m_ui->confirmDeletion->isChecked()); + pref->setAlternatingRowColors(m_ui->checkAltRowColors->isChecked()); + pref->setHideZeroValues(m_ui->checkHideZero->isChecked()); + pref->setHideZeroComboValues(m_ui->comboHideZero->currentIndex()); pref->setSystrayIntegration(systrayIntegration()); - pref->setTrayIconStyle(TrayIcon::Style(comboTrayIcon->currentIndex())); + pref->setTrayIconStyle(TrayIcon::Style(m_ui->comboTrayIcon->currentIndex())); pref->setCloseToTray(closeToTray()); pref->setMinimizeToTray(minimizeToTray()); pref->setStartMinimized(startMinimized()); pref->setSplashScreenDisabled(isSlashScreenDisabled()); - pref->setConfirmOnExit(checkProgramExitConfirm->isChecked()); - pref->setDontConfirmAutoExit(!checkProgramAutoExitConfirm->isChecked()); + pref->setConfirmOnExit(m_ui->checkProgramExitConfirm->isChecked()); + pref->setDontConfirmAutoExit(!m_ui->checkProgramAutoExitConfirm->isChecked()); pref->setPreventFromSuspend(preventFromSuspend()); #ifdef Q_OS_WIN pref->setWinStartup(WinStartup()); // Windows: file association settings - Preferences::setTorrentFileAssoc(checkAssociateTorrents->isChecked()); - Preferences::setMagnetLinkAssoc(checkAssociateMagnetLinks->isChecked()); + Preferences::setTorrentFileAssoc(m_ui->checkAssociateTorrents->isChecked()); + Preferences::setMagnetLinkAssoc(m_ui->checkAssociateMagnetLinks->isChecked()); #endif #ifdef Q_OS_MAC - if (checkAssociateTorrents->isChecked()) { + if (m_ui->checkAssociateTorrents->isChecked()) { Preferences::setTorrentFileAssoc(); - checkAssociateTorrents->setChecked(Preferences::isTorrentFileAssocSet()); - checkAssociateTorrents->setEnabled(!checkAssociateTorrents->isChecked()); + m_ui->checkAssociateTorrents->setChecked(Preferences::isTorrentFileAssocSet()); + m_ui->checkAssociateTorrents->setEnabled(!m_ui->checkAssociateTorrents->isChecked()); } - if (checkAssociateMagnetLinks->isChecked()) { + if (m_ui->checkAssociateMagnetLinks->isChecked()) { Preferences::setMagnetLinkAssoc(); - checkAssociateMagnetLinks->setChecked(Preferences::isMagnetLinkAssocSet()); - checkAssociateMagnetLinks->setEnabled(!checkAssociateMagnetLinks->isChecked()); + m_ui->checkAssociateMagnetLinks->setChecked(Preferences::isMagnetLinkAssocSet()); + m_ui->checkAssociateMagnetLinks->setEnabled(!m_ui->checkAssociateMagnetLinks->isChecked()); } #endif Application * const app = static_cast(QCoreApplication::instance()); - app->setFileLoggerPath(Utils::Fs::fromNativePath(textFileLogPath->text())); - app->setFileLoggerBackup(checkFileLogBackup->isChecked()); - app->setFileLoggerMaxSize(spinFileLogSize->value()); - app->setFileLoggerAge(spinFileLogAge->value()); - app->setFileLoggerAgeType(comboFileLogAgeType->currentIndex()); - app->setFileLoggerDeleteOld(checkFileLogDelete->isChecked()); - app->setFileLoggerEnabled(checkFileLog->isChecked()); + app->setFileLoggerPath(Utils::Fs::fromNativePath(m_ui->textFileLogPath->text())); + app->setFileLoggerBackup(m_ui->checkFileLogBackup->isChecked()); + app->setFileLoggerMaxSize(m_ui->spinFileLogSize->value()); + app->setFileLoggerAge(m_ui->spinFileLogAge->value()); + app->setFileLoggerAgeType(m_ui->comboFileLogAgeType->currentIndex()); + app->setFileLoggerDeleteOld(m_ui->checkFileLogDelete->isChecked()); + app->setFileLoggerEnabled(m_ui->checkFileLog->isChecked()); // End General preferences auto session = BitTorrent::Session::instance(); // Downloads preferences - session->setDefaultSavePath(Utils::Fs::expandPathAbs(textSavePath->text())); - session->setSubcategoriesEnabled(checkUseSubcategories->isChecked()); - session->setAutoTMMDisabledByDefault(comboSavingMode->currentIndex() == 0); - session->setDisableAutoTMMWhenCategoryChanged(comboTorrentCategoryChanged->currentIndex() == 1); - session->setDisableAutoTMMWhenCategorySavePathChanged(comboCategoryChanged->currentIndex() == 1); - session->setDisableAutoTMMWhenDefaultSavePathChanged(comboCategoryDefaultPathChanged->currentIndex() == 1); - session->setTempPathEnabled(checkTempFolder->isChecked()); - session->setTempPath(Utils::Fs::expandPathAbs(textTempPath->text())); - pref->useIncompleteFilesExtension(checkAppendqB->isChecked()); + session->setDefaultSavePath(Utils::Fs::expandPathAbs(m_ui->textSavePath->text())); + session->setSubcategoriesEnabled(m_ui->checkUseSubcategories->isChecked()); + session->setAutoTMMDisabledByDefault(m_ui->comboSavingMode->currentIndex() == 0); + session->setDisableAutoTMMWhenCategoryChanged(m_ui->comboTorrentCategoryChanged->currentIndex() == 1); + session->setDisableAutoTMMWhenCategorySavePathChanged(m_ui->comboCategoryChanged->currentIndex() == 1); + session->setDisableAutoTMMWhenDefaultSavePathChanged(m_ui->comboCategoryDefaultPathChanged->currentIndex() == 1); + session->setTempPathEnabled(m_ui->checkTempFolder->isChecked()); + session->setTempPath(Utils::Fs::expandPathAbs(m_ui->textTempPath->text())); + pref->useIncompleteFilesExtension(m_ui->checkAppendqB->isChecked()); pref->preAllocateAllFiles(preAllocateAllFiles()); AddNewTorrentDialog::setEnabled(useAdditionDialog()); - AddNewTorrentDialog::setTopLevel(checkAdditionDialogFront->isChecked()); + AddNewTorrentDialog::setTopLevel(m_ui->checkAdditionDialogFront->isChecked()); session->setAddTorrentPaused(addTorrentsInPause()); ScanFoldersModel::instance()->removeFromFSWatcher(removedScanDirs); ScanFoldersModel::instance()->addToFSWatcher(addedScanDirs); @@ -514,46 +518,46 @@ void options_imp::saveOptions() addedScanDirs.clear(); pref->setTorrentExportDir(getTorrentExportDir()); pref->setFinishedTorrentExportDir(getFinishedTorrentExportDir()); - pref->setMailNotificationEnabled(groupMailNotification->isChecked()); - pref->setMailNotificationEmail(dest_email_txt->text()); - pref->setMailNotificationSMTP(smtp_server_txt->text()); - pref->setMailNotificationSMTPSSL(checkSmtpSSL->isChecked()); - pref->setMailNotificationSMTPAuth(groupMailNotifAuth->isChecked()); - pref->setMailNotificationSMTPUsername(mailNotifUsername->text()); - pref->setMailNotificationSMTPPassword(mailNotifPassword->text()); - pref->setAutoRunEnabled(autoRunBox->isChecked()); - pref->setAutoRunProgram(autoRun_txt->text().trimmed()); + pref->setMailNotificationEnabled(m_ui->groupMailNotification->isChecked()); + pref->setMailNotificationEmail(m_ui->dest_email_txt->text()); + pref->setMailNotificationSMTP(m_ui->smtp_server_txt->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->setActionOnDblClOnTorrentDl(getActionOnDblClOnTorrentDl()); pref->setActionOnDblClOnTorrentFn(getActionOnDblClOnTorrentFn()); - TorrentFileGuard::setAutoDeleteMode(!deleteTorrentBox->isChecked() ? TorrentFileGuard::Never - : !deleteCancelledTorrentBox->isChecked() ? TorrentFileGuard::IfAdded + TorrentFileGuard::setAutoDeleteMode(!m_ui->deleteTorrentBox->isChecked() ? TorrentFileGuard::Never + : !m_ui->deleteCancelledTorrentBox->isChecked() ? TorrentFileGuard::IfAdded : TorrentFileGuard::Always); // End Downloads preferences // Connection preferences pref->setSessionPort(getPort()); - pref->setRandomPort(checkRandomPort->isChecked()); + pref->setRandomPort(m_ui->checkRandomPort->isChecked()); pref->setUPnPEnabled(isUPnPEnabled()); const QPair down_up_limit = getGlobalBandwidthLimits(); pref->setGlobalDownloadLimit(down_up_limit.first); pref->setGlobalUploadLimit(down_up_limit.second); - pref->setuTPEnabled(checkuTP->isChecked()); - pref->setuTPRateLimited(checkLimituTPConnections->isChecked()); - pref->includeOverheadInLimits(checkLimitTransportOverhead->isChecked()); - pref->setIgnoreLimitsOnLAN(!checkLimitLocalPeerRate->isChecked()); + pref->setuTPEnabled(m_ui->checkuTP->isChecked()); + pref->setuTPRateLimited(m_ui->checkLimituTPConnections->isChecked()); + pref->includeOverheadInLimits(m_ui->checkLimitTransportOverhead->isChecked()); + pref->setIgnoreLimitsOnLAN(!m_ui->checkLimitLocalPeerRate->isChecked()); const QPair alt_down_up_limit = getAltGlobalBandwidthLimits(); pref->setAltGlobalDownloadLimit(alt_down_up_limit.first); pref->setAltGlobalUploadLimit(alt_down_up_limit.second); - pref->setSchedulerEnabled(check_schedule->isChecked()); - pref->setSchedulerStartTime(schedule_from->time()); - pref->setSchedulerEndTime(schedule_to->time()); - pref->setSchedulerDays((scheduler_days)schedule_days->currentIndex()); + pref->setSchedulerEnabled(m_ui->check_schedule->isChecked()); + pref->setSchedulerStartTime(m_ui->schedule_from->time()); + pref->setSchedulerEndTime(m_ui->schedule_to->time()); + pref->setSchedulerDays((scheduler_days)m_ui->schedule_days->currentIndex()); pref->setProxyType(getProxyType()); pref->setProxyIp(getProxyIp()); pref->setProxyPort(getProxyPort()); - pref->setProxyPeerConnections(checkProxyPeerConnecs->isChecked()); - pref->setForceProxy(checkForceProxy->isChecked()); - pref->setProxyOnlyForTorrents(isProxyOnlyForTorrents->isChecked()); + pref->setProxyPeerConnections(m_ui->checkProxyPeerConnecs->isChecked()); + pref->setForceProxy(m_ui->checkForceProxy->isChecked()); + pref->setProxyOnlyForTorrents(m_ui->isProxyOnlyForTorrents->isChecked()); pref->setProxyAuthEnabled(isProxyAuthEnabled()); pref->setProxyUsername(getProxyUsername()); pref->setProxyPassword(getProxyPassword()); @@ -564,48 +568,48 @@ void options_imp::saveOptions() pref->setMaxUploads(getMaxUploads()); pref->setMaxUploadsPerTorrent(getMaxUploadsPerTorrent()); pref->setDHTEnabled(isDHTEnabled()); - pref->setPeXEnabled(checkPeX->isChecked()); + pref->setPeXEnabled(m_ui->checkPeX->isChecked()); pref->setLSDEnabled(isLSDEnabled()); pref->setEncryptionSetting(getEncryptionSetting()); - pref->enableAnonymousMode(checkAnonymousMode->isChecked()); - pref->setAddTrackersEnabled(checkEnableAddTrackers->isChecked()); - pref->setTrackersList(textTrackers->toPlainText()); + pref->enableAnonymousMode(m_ui->checkAnonymousMode->isChecked()); + pref->setAddTrackersEnabled(m_ui->checkEnableAddTrackers->isChecked()); + pref->setTrackersList(m_ui->textTrackers->toPlainText()); pref->setGlobalMaxRatio(getMaxRatio()); - session->setMaxRatioAction(static_cast(comboRatioLimitAct->currentIndex())); + session->setMaxRatioAction(static_cast(m_ui->comboRatioLimitAct->currentIndex())); // End Bittorrent preferences // Misc preferences // * IPFilter pref->setFilteringEnabled(isFilteringEnabled()); - pref->setFilteringTrackerEnabled(checkIpFilterTrackers->isChecked()); - pref->setFilter(textFilterPath->text()); + pref->setFilteringTrackerEnabled(m_ui->checkIpFilterTrackers->isChecked()); + pref->setFilter(m_ui->textFilterPath->text()); // End IPFilter preferences // Queueing system pref->setQueueingSystemEnabled(isQueueingSystemEnabled()); - pref->setMaxActiveDownloads(spinMaxActiveDownloads->value()); - pref->setMaxActiveUploads(spinMaxActiveUploads->value()); - pref->setMaxActiveTorrents(spinMaxActiveTorrents->value()); - pref->setIgnoreSlowTorrentsForQueueing(checkIgnoreSlowTorrentsForQueueing->isChecked()); + pref->setMaxActiveDownloads(m_ui->spinMaxActiveDownloads->value()); + pref->setMaxActiveUploads(m_ui->spinMaxActiveUploads->value()); + pref->setMaxActiveTorrents(m_ui->spinMaxActiveTorrents->value()); + pref->setIgnoreSlowTorrentsForQueueing(m_ui->checkIgnoreSlowTorrentsForQueueing->isChecked()); // End Queueing system preferences // Web UI pref->setWebUiEnabled(isWebUiEnabled()); if (isWebUiEnabled()) { pref->setWebUiPort(webUiPort()); - pref->setUPnPForWebUIPort(checkWebUIUPnP->isChecked()); - pref->setWebUiHttpsEnabled(checkWebUiHttps->isChecked()); - if (checkWebUiHttps->isChecked()) { + pref->setUPnPForWebUIPort(m_ui->checkWebUIUPnP->isChecked()); + pref->setWebUiHttpsEnabled(m_ui->checkWebUiHttps->isChecked()); + if (m_ui->checkWebUiHttps->isChecked()) { pref->setWebUiHttpsCertificate(m_sslCert); pref->setWebUiHttpsKey(m_sslKey); } pref->setWebUiUsername(webUiUsername()); pref->setWebUiPassword(webUiPassword()); - pref->setWebUiLocalAuthEnabled(!checkBypassLocalAuth->isChecked()); + pref->setWebUiLocalAuthEnabled(!m_ui->checkBypassLocalAuth->isChecked()); // DynDNS - pref->setDynDNSEnabled(checkDynDNS->isChecked()); - pref->setDynDNSService(comboDNSService->currentIndex()); - pref->setDynDomainName(domainNameTxt->text()); - pref->setDynDNSUsername(DNSUsernameTxt->text()); - pref->setDynDNSPassword(DNSPasswordTxt->text()); + pref->setDynDNSEnabled(m_ui->checkDynDNS->isChecked()); + pref->setDynDNSService(m_ui->comboDNSService->currentIndex()); + pref->setDynDomainName(m_ui->domainNameTxt->text()); + pref->setDynDNSUsername(m_ui->DNSUsernameTxt->text()); + pref->setDynDNSPassword(m_ui->DNSPasswordTxt->text()); } // End Web UI // End preferences @@ -618,12 +622,12 @@ void options_imp::saveOptions() bool options_imp::isFilteringEnabled() const { - return checkIPFilter->isChecked(); + return m_ui->checkIPFilter->isChecked(); } int options_imp::getProxyType() const { - switch (comboProxyType->currentIndex()) { + switch (m_ui->comboProxyType->currentIndex()) { case 1: return Proxy::SOCKS4; break; @@ -651,323 +655,323 @@ void options_imp::loadOptions() // General preferences setLocale(pref->getLocale()); - confirmDeletion->setChecked(pref->confirmTorrentDeletion()); - checkAltRowColors->setChecked(pref->useAlternatingRowColors()); - checkHideZero->setChecked(pref->getHideZeroValues()); - comboHideZero->setEnabled(checkHideZero->isChecked()); - comboHideZero->setCurrentIndex(pref->getHideZeroComboValues()); - - checkShowSplash->setChecked(!pref->isSplashScreenDisabled()); - checkStartMinimized->setChecked(pref->startMinimized()); - checkProgramExitConfirm->setChecked(pref->confirmOnExit()); - checkProgramAutoExitConfirm->setChecked(!pref->dontConfirmAutoExit()); - - checkShowSystray->setChecked(pref->systrayIntegration()); - if (checkShowSystray->isChecked()) { - checkMinimizeToSysTray->setChecked(pref->minimizeToTray()); - checkCloseToSystray->setChecked(pref->closeToTray()); - comboTrayIcon->setCurrentIndex(pref->trayIconStyle()); + m_ui->confirmDeletion->setChecked(pref->confirmTorrentDeletion()); + m_ui->checkAltRowColors->setChecked(pref->useAlternatingRowColors()); + m_ui->checkHideZero->setChecked(pref->getHideZeroValues()); + m_ui->comboHideZero->setEnabled(m_ui->checkHideZero->isChecked()); + m_ui->comboHideZero->setCurrentIndex(pref->getHideZeroComboValues()); + + m_ui->checkShowSplash->setChecked(!pref->isSplashScreenDisabled()); + m_ui->checkStartMinimized->setChecked(pref->startMinimized()); + m_ui->checkProgramExitConfirm->setChecked(pref->confirmOnExit()); + m_ui->checkProgramAutoExitConfirm->setChecked(!pref->dontConfirmAutoExit()); + + m_ui->checkShowSystray->setChecked(pref->systrayIntegration()); + if (m_ui->checkShowSystray->isChecked()) { + m_ui->checkMinimizeToSysTray->setChecked(pref->minimizeToTray()); + m_ui->checkCloseToSystray->setChecked(pref->closeToTray()); + m_ui->comboTrayIcon->setCurrentIndex(pref->trayIconStyle()); } - checkPreventFromSuspend->setChecked(pref->preventFromSuspend()); + m_ui->checkPreventFromSuspend->setChecked(pref->preventFromSuspend()); #ifdef Q_OS_WIN - checkStartup->setChecked(pref->WinStartup()); - checkAssociateTorrents->setChecked(Preferences::isTorrentFileAssocSet()); - checkAssociateMagnetLinks->setChecked(Preferences::isMagnetLinkAssocSet()); + m_ui->checkStartup->setChecked(pref->WinStartup()); + m_ui->checkAssociateTorrents->setChecked(Preferences::isTorrentFileAssocSet()); + m_ui->checkAssociateMagnetLinks->setChecked(Preferences::isMagnetLinkAssocSet()); #endif #ifdef Q_OS_MAC - checkAssociateTorrents->setChecked(Preferences::isTorrentFileAssocSet()); - checkAssociateTorrents->setEnabled(!checkAssociateTorrents->isChecked()); - checkAssociateMagnetLinks->setChecked(Preferences::isMagnetLinkAssocSet()); - checkAssociateMagnetLinks->setEnabled(!checkAssociateMagnetLinks->isChecked()); + m_ui->checkAssociateTorrents->setChecked(Preferences::isTorrentFileAssocSet()); + m_ui->checkAssociateTorrents->setEnabled(!m_ui->checkAssociateTorrents->isChecked()); + m_ui->checkAssociateMagnetLinks->setChecked(Preferences::isMagnetLinkAssocSet()); + m_ui->checkAssociateMagnetLinks->setEnabled(!m_ui->checkAssociateMagnetLinks->isChecked()); #endif const Application * const app = static_cast(QCoreApplication::instance()); - checkFileLog->setChecked(app->isFileLoggerEnabled()); - textFileLogPath->setText(Utils::Fs::toNativePath(app->fileLoggerPath())); + m_ui->checkFileLog->setChecked(app->isFileLoggerEnabled()); + m_ui->textFileLogPath->setText(Utils::Fs::toNativePath(app->fileLoggerPath())); fileLogBackup = app->isFileLoggerBackup(); - checkFileLogBackup->setChecked(fileLogBackup); - spinFileLogSize->setEnabled(fileLogBackup); + m_ui->checkFileLogBackup->setChecked(fileLogBackup); + m_ui->spinFileLogSize->setEnabled(fileLogBackup); fileLogDelete = app->isFileLoggerDeleteOld(); - checkFileLogDelete->setChecked(fileLogDelete); - spinFileLogAge->setEnabled(fileLogDelete); - comboFileLogAgeType->setEnabled(fileLogDelete); - spinFileLogSize->setValue(app->fileLoggerMaxSize()); - spinFileLogAge->setValue(app->fileLoggerAge()); - comboFileLogAgeType->setCurrentIndex(app->fileLoggerAgeType()); + m_ui->checkFileLogDelete->setChecked(fileLogDelete); + m_ui->spinFileLogAge->setEnabled(fileLogDelete); + m_ui->comboFileLogAgeType->setEnabled(fileLogDelete); + m_ui->spinFileLogSize->setValue(app->fileLoggerMaxSize()); + m_ui->spinFileLogAge->setValue(app->fileLoggerAge()); + m_ui->comboFileLogAgeType->setCurrentIndex(app->fileLoggerAgeType()); // End General preferences auto session = BitTorrent::Session::instance(); // Downloads preferences - checkAdditionDialog->setChecked(AddNewTorrentDialog::isEnabled()); - checkAdditionDialogFront->setChecked(AddNewTorrentDialog::isTopLevel()); - checkStartPaused->setChecked(session->isAddTorrentPaused()); + m_ui->checkAdditionDialog->setChecked(AddNewTorrentDialog::isEnabled()); + m_ui->checkAdditionDialogFront->setChecked(AddNewTorrentDialog::isTopLevel()); + m_ui->checkStartPaused->setChecked(session->isAddTorrentPaused()); const TorrentFileGuard::AutoDeleteMode autoDeleteMode = TorrentFileGuard::autoDeleteMode(); - deleteTorrentBox->setChecked(autoDeleteMode != TorrentFileGuard::Never); - deleteCancelledTorrentBox->setChecked(autoDeleteMode == TorrentFileGuard::Always); - - textSavePath->setText(Utils::Fs::toNativePath(session->defaultSavePath())); - checkUseSubcategories->setChecked(session->isSubcategoriesEnabled()); - comboSavingMode->setCurrentIndex(!session->isAutoTMMDisabledByDefault()); - comboTorrentCategoryChanged->setCurrentIndex(session->isDisableAutoTMMWhenCategoryChanged()); - comboCategoryChanged->setCurrentIndex(session->isDisableAutoTMMWhenCategorySavePathChanged()); - comboCategoryDefaultPathChanged->setCurrentIndex(session->isDisableAutoTMMWhenDefaultSavePathChanged()); - checkTempFolder->setChecked(session->isTempPathEnabled()); - textTempPath->setEnabled(checkTempFolder->isChecked()); - browseTempDirButton->setEnabled(checkTempFolder->isChecked()); - textTempPath->setText(Utils::Fs::toNativePath(session->tempPath())); - checkAppendqB->setChecked(pref->useIncompleteFilesExtension()); - checkPreallocateAll->setChecked(pref->preAllocateAllFiles()); + m_ui->deleteTorrentBox->setChecked(autoDeleteMode != TorrentFileGuard::Never); + m_ui->deleteCancelledTorrentBox->setChecked(autoDeleteMode == TorrentFileGuard::Always); + + m_ui->textSavePath->setText(Utils::Fs::toNativePath(session->defaultSavePath())); + m_ui->checkUseSubcategories->setChecked(session->isSubcategoriesEnabled()); + m_ui->comboSavingMode->setCurrentIndex(!session->isAutoTMMDisabledByDefault()); + m_ui->comboTorrentCategoryChanged->setCurrentIndex(session->isDisableAutoTMMWhenCategoryChanged()); + m_ui->comboCategoryChanged->setCurrentIndex(session->isDisableAutoTMMWhenCategorySavePathChanged()); + m_ui->comboCategoryDefaultPathChanged->setCurrentIndex(session->isDisableAutoTMMWhenDefaultSavePathChanged()); + m_ui->checkTempFolder->setChecked(session->isTempPathEnabled()); + m_ui->textTempPath->setEnabled(m_ui->checkTempFolder->isChecked()); + m_ui->browseTempDirButton->setEnabled(m_ui->checkTempFolder->isChecked()); + m_ui->textTempPath->setText(Utils::Fs::toNativePath(session->tempPath())); + m_ui->checkAppendqB->setChecked(pref->useIncompleteFilesExtension()); + m_ui->checkPreallocateAll->setChecked(pref->preAllocateAllFiles()); strValue = Utils::Fs::toNativePath(pref->getTorrentExportDir()); if (strValue.isEmpty()) { // Disable - checkExportDir->setChecked(false); - textExportDir->setEnabled(false); - browseExportDirButton->setEnabled(false); + m_ui->checkExportDir->setChecked(false); + m_ui->textExportDir->setEnabled(false); + m_ui->browseExportDirButton->setEnabled(false); } else { // Enable - checkExportDir->setChecked(true); - textExportDir->setEnabled(true); - browseExportDirButton->setEnabled(true); - textExportDir->setText(strValue); + m_ui->checkExportDir->setChecked(true); + m_ui->textExportDir->setEnabled(true); + m_ui->browseExportDirButton->setEnabled(true); + m_ui->textExportDir->setText(strValue); } strValue = Utils::Fs::toNativePath(pref->getFinishedTorrentExportDir()); if (strValue.isEmpty()) { // Disable - checkExportDirFin->setChecked(false); - textExportDirFin->setEnabled(false); - browseExportDirFinButton->setEnabled(false); + m_ui->checkExportDirFin->setChecked(false); + m_ui->textExportDirFin->setEnabled(false); + m_ui->browseExportDirFinButton->setEnabled(false); } else { // Enable - checkExportDirFin->setChecked(true); - textExportDirFin->setEnabled(true); - browseExportDirFinButton->setEnabled(true); - textExportDirFin->setText(strValue); + m_ui->checkExportDirFin->setChecked(true); + m_ui->textExportDirFin->setEnabled(true); + m_ui->browseExportDirFinButton->setEnabled(true); + m_ui->textExportDirFin->setText(strValue); } - groupMailNotification->setChecked(pref->isMailNotificationEnabled()); - dest_email_txt->setText(pref->getMailNotificationEmail()); - smtp_server_txt->setText(pref->getMailNotificationSMTP()); - checkSmtpSSL->setChecked(pref->getMailNotificationSMTPSSL()); - groupMailNotifAuth->setChecked(pref->getMailNotificationSMTPAuth()); - mailNotifUsername->setText(pref->getMailNotificationSMTPUsername()); - mailNotifPassword->setText(pref->getMailNotificationSMTPPassword()); + m_ui->groupMailNotification->setChecked(pref->isMailNotificationEnabled()); + m_ui->dest_email_txt->setText(pref->getMailNotificationEmail()); + m_ui->smtp_server_txt->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()); - autoRunBox->setChecked(pref->isAutoRunEnabled()); - autoRun_txt->setText(pref->getAutoRunProgram()); + m_ui->autoRunBox->setChecked(pref->isAutoRunEnabled()); + m_ui->autoRun_txt->setText(pref->getAutoRunProgram()); intValue = pref->getActionOnDblClOnTorrentDl(); - if (intValue >= actionTorrentDlOnDblClBox->count()) + if (intValue >= m_ui->actionTorrentDlOnDblClBox->count()) intValue = 0; - actionTorrentDlOnDblClBox->setCurrentIndex(intValue); + m_ui->actionTorrentDlOnDblClBox->setCurrentIndex(intValue); intValue = pref->getActionOnDblClOnTorrentFn(); - if (intValue >= actionTorrentFnOnDblClBox->count()) + if (intValue >= m_ui->actionTorrentFnOnDblClBox->count()) intValue = 1; - actionTorrentFnOnDblClBox->setCurrentIndex(intValue); + m_ui->actionTorrentFnOnDblClBox->setCurrentIndex(intValue); // End Downloads preferences // Connection preferences - checkUPnP->setChecked(pref->isUPnPEnabled()); - checkRandomPort->setChecked(pref->useRandomPort()); - spinPort->setValue(pref->getSessionPort()); - spinPort->setDisabled(checkRandomPort->isChecked()); + m_ui->checkUPnP->setChecked(pref->isUPnPEnabled()); + m_ui->checkRandomPort->setChecked(pref->useRandomPort()); + m_ui->spinPort->setValue(pref->getSessionPort()); + m_ui->spinPort->setDisabled(m_ui->checkRandomPort->isChecked()); intValue = pref->getMaxConnecs(); if (intValue > 0) { // enable - checkMaxConnecs->setChecked(true); - spinMaxConnec->setEnabled(true); - spinMaxConnec->setValue(intValue); + m_ui->checkMaxConnecs->setChecked(true); + m_ui->spinMaxConnec->setEnabled(true); + m_ui->spinMaxConnec->setValue(intValue); } else { // disable - checkMaxConnecs->setChecked(false); - spinMaxConnec->setEnabled(false); + m_ui->checkMaxConnecs->setChecked(false); + m_ui->spinMaxConnec->setEnabled(false); } intValue = pref->getMaxConnecsPerTorrent(); if (intValue > 0) { // enable - checkMaxConnecsPerTorrent->setChecked(true); - spinMaxConnecPerTorrent->setEnabled(true); - spinMaxConnecPerTorrent->setValue(intValue); + m_ui->checkMaxConnecsPerTorrent->setChecked(true); + m_ui->spinMaxConnecPerTorrent->setEnabled(true); + m_ui->spinMaxConnecPerTorrent->setValue(intValue); } else { // disable - checkMaxConnecsPerTorrent->setChecked(false); - spinMaxConnecPerTorrent->setEnabled(false); + m_ui->checkMaxConnecsPerTorrent->setChecked(false); + m_ui->spinMaxConnecPerTorrent->setEnabled(false); } intValue = pref->getMaxUploads(); if (intValue > 0) { // enable - checkMaxUploads->setChecked(true); - spinMaxUploads->setEnabled(true); - spinMaxUploads->setValue(intValue); + m_ui->checkMaxUploads->setChecked(true); + m_ui->spinMaxUploads->setEnabled(true); + m_ui->spinMaxUploads->setValue(intValue); } else { // disable - checkMaxUploads->setChecked(false); - spinMaxUploads->setEnabled(false); + m_ui->checkMaxUploads->setChecked(false); + m_ui->spinMaxUploads->setEnabled(false); } intValue = pref->getMaxUploadsPerTorrent(); if (intValue > 0) { // enable - checkMaxUploadsPerTorrent->setChecked(true); - spinMaxUploadsPerTorrent->setEnabled(true); - spinMaxUploadsPerTorrent->setValue(intValue); + m_ui->checkMaxUploadsPerTorrent->setChecked(true); + m_ui->spinMaxUploadsPerTorrent->setEnabled(true); + m_ui->spinMaxUploadsPerTorrent->setValue(intValue); } else { // disable - checkMaxUploadsPerTorrent->setChecked(false); - spinMaxUploadsPerTorrent->setEnabled(false); + m_ui->checkMaxUploadsPerTorrent->setChecked(false); + m_ui->spinMaxUploadsPerTorrent->setEnabled(false); } intValue = pref->getProxyType(); switch (intValue) { case Proxy::SOCKS4: - comboProxyType->setCurrentIndex(1); + m_ui->comboProxyType->setCurrentIndex(1); break; case Proxy::SOCKS5: case Proxy::SOCKS5_PW: - comboProxyType->setCurrentIndex(2); + m_ui->comboProxyType->setCurrentIndex(2); break; case Proxy::HTTP: case Proxy::HTTP_PW: - comboProxyType->setCurrentIndex(3); + m_ui->comboProxyType->setCurrentIndex(3); break; default: - comboProxyType->setCurrentIndex(0); + m_ui->comboProxyType->setCurrentIndex(0); } - enableProxy(comboProxyType->currentIndex()); - textProxyIP->setText(pref->getProxyIp()); - spinProxyPort->setValue(pref->getProxyPort()); - checkProxyPeerConnecs->setChecked(pref->proxyPeerConnections()); - checkForceProxy->setChecked(pref->getForceProxy()); - isProxyOnlyForTorrents->setChecked(pref->isProxyOnlyForTorrents()); - checkProxyAuth->setChecked(pref->isProxyAuthEnabled()); - textProxyUsername->setText(pref->getProxyUsername()); - textProxyPassword->setText(pref->getProxyPassword()); - - checkIPFilter->setChecked(pref->isFilteringEnabled()); - checkIpFilterTrackers->setChecked(pref->isFilteringTrackerEnabled()); - textFilterPath->setText(Utils::Fs::toNativePath(pref->getFilter())); + enableProxy(m_ui->comboProxyType->currentIndex()); + m_ui->textProxyIP->setText(pref->getProxyIp()); + m_ui->spinProxyPort->setValue(pref->getProxyPort()); + m_ui->checkProxyPeerConnecs->setChecked(pref->proxyPeerConnections()); + m_ui->checkForceProxy->setChecked(pref->getForceProxy()); + m_ui->isProxyOnlyForTorrents->setChecked(pref->isProxyOnlyForTorrents()); + m_ui->checkProxyAuth->setChecked(pref->isProxyAuthEnabled()); + m_ui->textProxyUsername->setText(pref->getProxyUsername()); + m_ui->textProxyPassword->setText(pref->getProxyPassword()); + + m_ui->checkIPFilter->setChecked(pref->isFilteringEnabled()); + m_ui->checkIpFilterTrackers->setChecked(pref->isFilteringTrackerEnabled()); + m_ui->textFilterPath->setText(Utils::Fs::toNativePath(pref->getFilter())); // End Connection preferences // Speed preferences intValue = pref->getGlobalDownloadLimit(); if (intValue > 0) { // Enabled - checkDownloadLimit->setChecked(true); - spinDownloadLimit->setEnabled(true); - spinDownloadLimit->setValue(intValue); + m_ui->checkDownloadLimit->setChecked(true); + m_ui->spinDownloadLimit->setEnabled(true); + m_ui->spinDownloadLimit->setValue(intValue); } else { // Disabled - checkDownloadLimit->setChecked(false); - spinDownloadLimit->setEnabled(false); + m_ui->checkDownloadLimit->setChecked(false); + m_ui->spinDownloadLimit->setEnabled(false); } intValue = pref->getGlobalUploadLimit(); if (intValue != -1) { // Enabled - checkUploadLimit->setChecked(true); - spinUploadLimit->setEnabled(true); - spinUploadLimit->setValue(intValue); + m_ui->checkUploadLimit->setChecked(true); + m_ui->spinUploadLimit->setEnabled(true); + m_ui->spinUploadLimit->setValue(intValue); } else { // Disabled - checkUploadLimit->setChecked(false); - spinUploadLimit->setEnabled(false); + m_ui->checkUploadLimit->setChecked(false); + m_ui->spinUploadLimit->setEnabled(false); } intValue = pref->getAltGlobalDownloadLimit(); if (intValue > 0) { // Enabled - checkDownloadLimitAlt->setChecked(true); - spinDownloadLimitAlt->setEnabled(true); - spinDownloadLimitAlt->setValue(intValue); + m_ui->checkDownloadLimitAlt->setChecked(true); + m_ui->spinDownloadLimitAlt->setEnabled(true); + m_ui->spinDownloadLimitAlt->setValue(intValue); } else { // Disabled - checkDownloadLimitAlt->setChecked(false); - spinDownloadLimitAlt->setEnabled(false); + m_ui->checkDownloadLimitAlt->setChecked(false); + m_ui->spinDownloadLimitAlt->setEnabled(false); } intValue = pref->getAltGlobalUploadLimit(); if (intValue != -1) { // Enabled - checkUploadLimitAlt->setChecked(true); - spinUploadLimitAlt->setEnabled(true); - spinUploadLimitAlt->setValue(intValue); + m_ui->checkUploadLimitAlt->setChecked(true); + m_ui->spinUploadLimitAlt->setEnabled(true); + m_ui->spinUploadLimitAlt->setValue(intValue); } else { // Disabled - checkUploadLimitAlt->setChecked(false); - spinUploadLimitAlt->setEnabled(false); + m_ui->checkUploadLimitAlt->setChecked(false); + m_ui->spinUploadLimitAlt->setEnabled(false); } - checkuTP->setChecked(pref->isuTPEnabled()); - checkLimituTPConnections->setEnabled(checkuTP->isChecked()); - checkLimituTPConnections->setChecked(pref->isuTPRateLimited()); - checkLimitTransportOverhead->setChecked(pref->includeOverheadInLimits()); - checkLimitLocalPeerRate->setChecked(!pref->getIgnoreLimitsOnLAN()); + m_ui->checkuTP->setChecked(pref->isuTPEnabled()); + m_ui->checkLimituTPConnections->setEnabled(m_ui->checkuTP->isChecked()); + m_ui->checkLimituTPConnections->setChecked(pref->isuTPRateLimited()); + m_ui->checkLimitTransportOverhead->setChecked(pref->includeOverheadInLimits()); + m_ui->checkLimitLocalPeerRate->setChecked(!pref->getIgnoreLimitsOnLAN()); - check_schedule->setChecked(pref->isSchedulerEnabled()); - schedule_from->setTime(pref->getSchedulerStartTime()); - schedule_to->setTime(pref->getSchedulerEndTime()); - schedule_days->setCurrentIndex((int)pref->getSchedulerDays()); + m_ui->check_schedule->setChecked(pref->isSchedulerEnabled()); + m_ui->schedule_from->setTime(pref->getSchedulerStartTime()); + m_ui->schedule_to->setTime(pref->getSchedulerEndTime()); + m_ui->schedule_days->setCurrentIndex((int)pref->getSchedulerDays()); // End Speed preferences // Bittorrent preferences - checkDHT->setChecked(pref->isDHTEnabled()); - checkPeX->setChecked(pref->isPeXEnabled()); - checkLSD->setChecked(pref->isLSDEnabled()); - comboEncryption->setCurrentIndex(pref->getEncryptionSetting()); - checkAnonymousMode->setChecked(pref->isAnonymousModeEnabled()); - checkEnableAddTrackers->setChecked(pref->isAddTrackersEnabled()); - textTrackers->setPlainText(pref->getTrackersList()); - - checkEnableQueueing->setChecked(pref->isQueueingSystemEnabled()); - spinMaxActiveDownloads->setValue(pref->getMaxActiveDownloads()); - spinMaxActiveUploads->setValue(pref->getMaxActiveUploads()); - spinMaxActiveTorrents->setValue(pref->getMaxActiveTorrents()); - checkIgnoreSlowTorrentsForQueueing->setChecked(pref->ignoreSlowTorrentsForQueueing()); + m_ui->checkDHT->setChecked(pref->isDHTEnabled()); + m_ui->checkPeX->setChecked(pref->isPeXEnabled()); + m_ui->checkLSD->setChecked(pref->isLSDEnabled()); + m_ui->comboEncryption->setCurrentIndex(pref->getEncryptionSetting()); + m_ui->checkAnonymousMode->setChecked(pref->isAnonymousModeEnabled()); + m_ui->checkEnableAddTrackers->setChecked(pref->isAddTrackersEnabled()); + m_ui->textTrackers->setPlainText(pref->getTrackersList()); + + m_ui->checkEnableQueueing->setChecked(pref->isQueueingSystemEnabled()); + m_ui->spinMaxActiveDownloads->setValue(pref->getMaxActiveDownloads()); + m_ui->spinMaxActiveUploads->setValue(pref->getMaxActiveUploads()); + m_ui->spinMaxActiveTorrents->setValue(pref->getMaxActiveTorrents()); + m_ui->checkIgnoreSlowTorrentsForQueueing->setChecked(pref->ignoreSlowTorrentsForQueueing()); floatValue = pref->getGlobalMaxRatio(); if (floatValue >= 0.) { // Enable - checkMaxRatio->setChecked(true); - spinMaxRatio->setEnabled(true); - comboRatioLimitAct->setEnabled(true); - spinMaxRatio->setValue(floatValue); + m_ui->checkMaxRatio->setChecked(true); + m_ui->spinMaxRatio->setEnabled(true); + m_ui->comboRatioLimitAct->setEnabled(true); + m_ui->spinMaxRatio->setValue(floatValue); } else { // Disable - checkMaxRatio->setChecked(false); - spinMaxRatio->setEnabled(false); - comboRatioLimitAct->setEnabled(false); + m_ui->checkMaxRatio->setChecked(false); + m_ui->spinMaxRatio->setEnabled(false); + m_ui->comboRatioLimitAct->setEnabled(false); } - comboRatioLimitAct->setCurrentIndex(session->maxRatioAction()); + m_ui->comboRatioLimitAct->setCurrentIndex(session->maxRatioAction()); // End Bittorrent preferences // Web UI preferences - checkWebUi->setChecked(pref->isWebUiEnabled()); - spinWebUiPort->setValue(pref->getWebUiPort()); - checkWebUIUPnP->setChecked(pref->useUPnPForWebUIPort()); - checkWebUiHttps->setChecked(pref->isWebUiHttpsEnabled()); + m_ui->checkWebUi->setChecked(pref->isWebUiEnabled()); + m_ui->spinWebUiPort->setValue(pref->getWebUiPort()); + m_ui->checkWebUIUPnP->setChecked(pref->useUPnPForWebUIPort()); + m_ui->checkWebUiHttps->setChecked(pref->isWebUiHttpsEnabled()); setSslCertificate(pref->getWebUiHttpsCertificate(), false); setSslKey(pref->getWebUiHttpsKey(), false); - textWebUiUsername->setText(pref->getWebUiUsername()); - textWebUiPassword->setText(pref->getWebUiPassword()); - checkBypassLocalAuth->setChecked(!pref->isWebUiLocalAuthEnabled()); - - checkDynDNS->setChecked(pref->isDynDNSEnabled()); - comboDNSService->setCurrentIndex((int)pref->getDynDNSService()); - domainNameTxt->setText(pref->getDynDomainName()); - DNSUsernameTxt->setText(pref->getDynDNSUsername()); - DNSPasswordTxt->setText(pref->getDynDNSPassword()); + m_ui->textWebUiUsername->setText(pref->getWebUiUsername()); + m_ui->textWebUiPassword->setText(pref->getWebUiPassword()); + m_ui->checkBypassLocalAuth->setChecked(!pref->isWebUiLocalAuthEnabled()); + + m_ui->checkDynDNS->setChecked(pref->isDynDNSEnabled()); + m_ui->comboDNSService->setCurrentIndex((int)pref->getDynDNSService()); + m_ui->domainNameTxt->setText(pref->getDynDomainName()); + m_ui->DNSUsernameTxt->setText(pref->getDynDNSUsername()); + m_ui->DNSPasswordTxt->setText(pref->getDynDNSPassword()); // End Web UI preferences } @@ -975,65 +979,65 @@ void options_imp::loadOptions() // [min, max] int options_imp::getPort() const { - return spinPort->value(); + return m_ui->spinPort->value(); } void options_imp::on_randomButton_clicked() { // Range [1024: 65535] - spinPort->setValue(rand() % 64512 + 1024); + m_ui->spinPort->setValue(rand() % 64512 + 1024); } int options_imp::getEncryptionSetting() const { - return comboEncryption->currentIndex(); + return m_ui->comboEncryption->currentIndex(); } int options_imp::getMaxActiveDownloads() const { - return spinMaxActiveDownloads->value(); + return m_ui->spinMaxActiveDownloads->value(); } int options_imp::getMaxActiveUploads() const { - return spinMaxActiveUploads->value(); + return m_ui->spinMaxActiveUploads->value(); } int options_imp::getMaxActiveTorrents() const { - return spinMaxActiveTorrents->value(); + return m_ui->spinMaxActiveTorrents->value(); } bool options_imp::minimizeToTray() const { - if (!checkShowSystray->isChecked()) return false; - return checkMinimizeToSysTray->isChecked(); + if (!m_ui->checkShowSystray->isChecked()) return false; + return m_ui->checkMinimizeToSysTray->isChecked(); } bool options_imp::closeToTray() const { - if (!checkShowSystray->isChecked()) return false; - return checkCloseToSystray->isChecked(); + if (!m_ui->checkShowSystray->isChecked()) return false; + return m_ui->checkCloseToSystray->isChecked(); } bool options_imp::isQueueingSystemEnabled() const { - return checkEnableQueueing->isChecked(); + return m_ui->checkEnableQueueing->isChecked(); } bool options_imp::isDHTEnabled() const { - return checkDHT->isChecked(); + return m_ui->checkDHT->isChecked(); } bool options_imp::isLSDEnabled() const { - return checkLSD->isChecked(); + return m_ui->checkLSD->isChecked(); } bool options_imp::isUPnPEnabled() const { - return checkUPnP->isChecked(); + return m_ui->checkUPnP->isChecked(); } // Return Download & Upload limits in kbps @@ -1041,10 +1045,10 @@ bool options_imp::isUPnPEnabled() const QPair options_imp::getGlobalBandwidthLimits() const { int DL = -1, UP = -1; - if (checkDownloadLimit->isChecked()) - DL = spinDownloadLimit->value(); - if (checkUploadLimit->isChecked()) - UP = spinUploadLimit->value(); + if (m_ui->checkDownloadLimit->isChecked()) + DL = m_ui->spinDownloadLimit->value(); + if (m_ui->checkUploadLimit->isChecked()) + UP = m_ui->spinUploadLimit->value(); return qMakePair(DL, UP); } @@ -1053,74 +1057,74 @@ QPair options_imp::getGlobalBandwidthLimits() const QPair options_imp::getAltGlobalBandwidthLimits() const { int DL = -1, UP = -1; - if (checkDownloadLimitAlt->isChecked()) - DL = spinDownloadLimitAlt->value(); - if (checkUploadLimitAlt->isChecked()) - UP = spinUploadLimitAlt->value(); + if (m_ui->checkDownloadLimitAlt->isChecked()) + DL = m_ui->spinDownloadLimitAlt->value(); + if (m_ui->checkUploadLimitAlt->isChecked()) + UP = m_ui->spinUploadLimitAlt->value(); return qMakePair(DL, UP); } bool options_imp::startMinimized() const { - return checkStartMinimized->isChecked(); + return m_ui->checkStartMinimized->isChecked(); } bool options_imp::systrayIntegration() const { if (!QSystemTrayIcon::isSystemTrayAvailable()) return false; - return checkShowSystray->isChecked(); + return m_ui->checkShowSystray->isChecked(); } // Return Share ratio qreal options_imp::getMaxRatio() const { - if (checkMaxRatio->isChecked()) - return spinMaxRatio->value(); + if (m_ui->checkMaxRatio->isChecked()) + return m_ui->spinMaxRatio->value(); return -1; } // Return max connections number int options_imp::getMaxConnecs() const { - if (!checkMaxConnecs->isChecked()) + if (!m_ui->checkMaxConnecs->isChecked()) return -1; else - return spinMaxConnec->value(); + return m_ui->spinMaxConnec->value(); } int options_imp::getMaxConnecsPerTorrent() const { - if (!checkMaxConnecsPerTorrent->isChecked()) + if (!m_ui->checkMaxConnecsPerTorrent->isChecked()) return -1; else - return spinMaxConnecPerTorrent->value(); + return m_ui->spinMaxConnecPerTorrent->value(); } int options_imp::getMaxUploads() const { - if (!checkMaxUploads->isChecked()) + if (!m_ui->checkMaxUploads->isChecked()) return -1; else - return spinMaxUploads->value(); + return m_ui->spinMaxUploads->value(); } int options_imp::getMaxUploadsPerTorrent() const { - if (!checkMaxUploadsPerTorrent->isChecked()) + if (!m_ui->checkMaxUploadsPerTorrent->isChecked()) return -1; else - return spinMaxUploadsPerTorrent->value(); + return m_ui->spinMaxUploadsPerTorrent->value(); } void options_imp::on_buttonBox_accepted() { if (applyButton->isEnabled()) { if (!schedTimesOk()) { - tabSelection->setCurrentRow(TAB_SPEED); + m_ui->tabSelection->setCurrentRow(TAB_SPEED); return; } if (!webUIAuthenticationOk()) { - tabSelection->setCurrentRow(TAB_WEBUI); + m_ui->tabSelection->setCurrentRow(TAB_WEBUI); return; } applyButton->setEnabled(false); @@ -1135,11 +1139,11 @@ void options_imp::applySettings(QAbstractButton* button) { if (button == applyButton) { if (!schedTimesOk()) { - tabSelection->setCurrentRow(TAB_SPEED); + m_ui->tabSelection->setCurrentRow(TAB_SPEED); return; } if (!webUIAuthenticationOk()) { - tabSelection->setCurrentRow(TAB_WEBUI); + m_ui->tabSelection->setCurrentRow(TAB_WEBUI); return; } saveOptions(); @@ -1160,7 +1164,7 @@ void options_imp::on_buttonBox_rejected() bool options_imp::useAdditionDialog() const { - return checkAdditionDialog->isChecked(); + return m_ui->checkAdditionDialog->isChecked(); } void options_imp::enableApplyButton() @@ -1172,93 +1176,92 @@ void options_imp::enableProxy(int index) { if (index) { //enable - lblProxyIP->setEnabled(true); - textProxyIP->setEnabled(true); - lblProxyPort->setEnabled(true); - spinProxyPort->setEnabled(true); - checkProxyPeerConnecs->setEnabled(true); - checkForceProxy->setEnabled(true); - isProxyOnlyForTorrents->setEnabled(true); + m_ui->lblProxyIP->setEnabled(true); + m_ui->textProxyIP->setEnabled(true); + m_ui->lblProxyPort->setEnabled(true); + m_ui->spinProxyPort->setEnabled(true); + m_ui->checkProxyPeerConnecs->setEnabled(true); + m_ui->checkForceProxy->setEnabled(true); + m_ui->isProxyOnlyForTorrents->setEnabled(true); if (index > 1) { - checkProxyAuth->setEnabled(true); + m_ui->checkProxyAuth->setEnabled(true); } else { - checkProxyAuth->setEnabled(false); - checkProxyAuth->setChecked(false); + m_ui->checkProxyAuth->setEnabled(false); + m_ui->checkProxyAuth->setChecked(false); } } else { //disable - lblProxyIP->setEnabled(false); - textProxyIP->setEnabled(false); - lblProxyPort->setEnabled(false); - spinProxyPort->setEnabled(false); - checkProxyPeerConnecs->setEnabled(false); - checkForceProxy->setEnabled(false); - isProxyOnlyForTorrents->setEnabled(false); - checkProxyAuth->setEnabled(false); - checkProxyAuth->setChecked(false); + m_ui->lblProxyIP->setEnabled(false); + m_ui->textProxyIP->setEnabled(false); + m_ui->lblProxyPort->setEnabled(false); + m_ui->spinProxyPort->setEnabled(false); + m_ui->checkProxyPeerConnecs->setEnabled(false); + m_ui->checkForceProxy->setEnabled(false); + m_ui->isProxyOnlyForTorrents->setEnabled(false); + m_ui->checkProxyAuth->setEnabled(false); + m_ui->checkProxyAuth->setChecked(false); } } bool options_imp::isSlashScreenDisabled() const { - return !checkShowSplash->isChecked(); + return !m_ui->checkShowSplash->isChecked(); } #ifdef Q_OS_WIN bool options_imp::WinStartup() const { - return checkStartup->isChecked(); + return m_ui->checkStartup->isChecked(); } #endif bool options_imp::preventFromSuspend() const { - return checkPreventFromSuspend->isChecked(); + return m_ui->checkPreventFromSuspend->isChecked(); } bool options_imp::preAllocateAllFiles() const { - return checkPreallocateAll->isChecked(); + return m_ui->checkPreallocateAll->isChecked(); } bool options_imp::addTorrentsInPause() const { - return checkStartPaused->isChecked(); + return m_ui->checkStartPaused->isChecked(); } // Proxy settings bool options_imp::isProxyEnabled() const { - return comboProxyType->currentIndex(); + return m_ui->comboProxyType->currentIndex(); } bool options_imp::isProxyAuthEnabled() const { - return checkProxyAuth->isChecked(); + return m_ui->checkProxyAuth->isChecked(); } QString options_imp::getProxyIp() const { - return textProxyIP->text().trimmed(); + return m_ui->textProxyIP->text().trimmed(); } unsigned short options_imp::getProxyPort() const { - return spinProxyPort->value(); + return m_ui->spinProxyPort->value(); } QString options_imp::getProxyUsername() const { - QString username = textProxyUsername->text(); - username = username.trimmed(); + QString username = m_ui->textProxyUsername->text().trimmed(); return username; } QString options_imp::getProxyPassword() const { - QString password = textProxyPassword->text(); + QString password = m_ui->textProxyPassword->text(); password = password.trimmed(); return password; } @@ -1266,7 +1269,7 @@ QString options_imp::getProxyPassword() const // Locale Settings QString options_imp::getLocale() const { - return comboI18n->itemData(comboI18n->currentIndex(), Qt::UserRole).toString(); + return m_ui->comboI18n->itemData(m_ui->comboI18n->currentIndex(), Qt::UserRole).toString(); } void options_imp::setLocale(const QString &localeStr) @@ -1280,51 +1283,51 @@ void options_imp::setLocale(const QString &localeStr) name = locale.name(); } // Attempt to find exact match - int index = comboI18n->findData(name, Qt::UserRole); + int index = m_ui->comboI18n->findData(name, Qt::UserRole); if (index < 0) { //Attempt to find a language match without a country int pos = name.indexOf('_'); if (pos > -1) { QString lang = name.left(pos); - index = comboI18n->findData(lang, Qt::UserRole); + index = m_ui->comboI18n->findData(lang, Qt::UserRole); } } if (index < 0) { // Unrecognized, use US English - index = comboI18n->findData(QLocale("en").name(), Qt::UserRole); + index = m_ui->comboI18n->findData(QLocale("en").name(), Qt::UserRole); Q_ASSERT(index >= 0); } - comboI18n->setCurrentIndex(index); + m_ui->comboI18n->setCurrentIndex(index); } QString options_imp::getTorrentExportDir() const { - if (checkExportDir->isChecked()) - return Utils::Fs::expandPathAbs(textExportDir->text()); + if (m_ui->checkExportDir->isChecked()) + return Utils::Fs::expandPathAbs(m_ui->textExportDir->text()); return QString(); } QString options_imp::getFinishedTorrentExportDir() const { - if (checkExportDirFin->isChecked()) - return Utils::Fs::expandPathAbs(textExportDirFin->text()); + if (m_ui->checkExportDirFin->isChecked()) + return Utils::Fs::expandPathAbs(m_ui->textExportDirFin->text()); return QString(); } // Return action on double-click on a downloading torrent set in options int options_imp::getActionOnDblClOnTorrentDl() const { - if (actionTorrentDlOnDblClBox->currentIndex() < 1) + if (m_ui->actionTorrentDlOnDblClBox->currentIndex() < 1) return 0; - return actionTorrentDlOnDblClBox->currentIndex(); + return m_ui->actionTorrentDlOnDblClBox->currentIndex(); } // Return action on double-click on a finished torrent set in options int options_imp::getActionOnDblClOnTorrentFn() const { - if (actionTorrentFnOnDblClBox->currentIndex() < 1) + if (m_ui->actionTorrentFnOnDblClBox->currentIndex() < 1) return 0; - return actionTorrentFnOnDblClBox->currentIndex(); + return m_ui->actionTorrentFnOnDblClBox->currentIndex(); } void options_imp::on_addScanFolderButton_clicked() @@ -1349,7 +1352,7 @@ void options_imp::on_addScanFolderButton_clicked() pref->setScanDirsLastPath(dir); addedScanDirs << dir; for (int i = 0; i < ScanFoldersModel::instance()->columnCount(); ++i) - scanFoldersView->resizeColumnToContents(i); + m_ui->scanFoldersView->resizeColumnToContents(i); enableApplyButton(); } @@ -1361,7 +1364,7 @@ void options_imp::on_addScanFolderButton_clicked() void options_imp::on_removeScanFolderButton_clicked() { const QModelIndexList selected - = scanFoldersView->selectionModel()->selectedIndexes(); + = m_ui->scanFoldersView->selectionModel()->selectedIndexes(); if (selected.isEmpty()) return; Q_ASSERT(selected.count() == ScanFoldersModel::instance()->columnCount()); @@ -1374,7 +1377,7 @@ void options_imp::on_removeScanFolderButton_clicked() void options_imp::handleScanFolderViewSelectionChanged() { - removeScanFolderButton->setEnabled(!scanFoldersView->selectionModel()->selectedIndexes().isEmpty()); + m_ui->removeScanFolderButton->setEnabled(!m_ui->scanFoldersView->selectionModel()->selectedIndexes().isEmpty()); } QString options_imp::askForExportDir(const QString& currentExportPath) @@ -1390,7 +1393,7 @@ QString options_imp::askForExportDir(const QString& currentExportPath) void options_imp::on_browseFileLogDir_clicked() { - const QString path = Utils::Fs::expandPathAbs(Utils::Fs::fromNativePath(textFileLogPath->text())); + const QString path = Utils::Fs::expandPathAbs(Utils::Fs::fromNativePath(m_ui->textFileLogPath->text())); QDir pathDir(path); QString dir; if (!path.isEmpty() && pathDir.exists()) @@ -1398,26 +1401,26 @@ void options_imp::on_browseFileLogDir_clicked() else dir = QFileDialog::getExistingDirectory(this, tr("Choose a save directory"), QDir::homePath()); if (!dir.isNull()) - textFileLogPath->setText(Utils::Fs::toNativePath(dir)); + m_ui->textFileLogPath->setText(Utils::Fs::toNativePath(dir)); } void options_imp::on_browseExportDirButton_clicked() { - const QString newExportDir = askForExportDir(textExportDir->text()); + const QString newExportDir = askForExportDir(m_ui->textExportDir->text()); if (!newExportDir.isNull()) - textExportDir->setText(Utils::Fs::toNativePath(newExportDir)); + m_ui->textExportDir->setText(Utils::Fs::toNativePath(newExportDir)); } void options_imp::on_browseExportDirFinButton_clicked() { - const QString newExportDir = askForExportDir(textExportDirFin->text()); + const QString newExportDir = askForExportDir(m_ui->textExportDirFin->text()); if (!newExportDir.isNull()) - textExportDirFin->setText(Utils::Fs::toNativePath(newExportDir)); + m_ui->textExportDirFin->setText(Utils::Fs::toNativePath(newExportDir)); } void options_imp::on_browseFilterButton_clicked() { - const QString filter_path = Utils::Fs::expandPathAbs(textFilterPath->text()); + const QString filter_path = Utils::Fs::expandPathAbs(m_ui->textFilterPath->text()); QDir filterDir(filter_path); QString ipfilter; if (!filter_path.isEmpty() && filterDir.exists()) @@ -1425,13 +1428,13 @@ void options_imp::on_browseFilterButton_clicked() else ipfilter = QFileDialog::getOpenFileName(this, tr("Choose an IP filter file"), QDir::homePath(), tr("Filters") + QString(" (*.dat *.p2p *.p2b)")); if (!ipfilter.isNull()) - textFilterPath->setText(Utils::Fs::toNativePath(ipfilter)); + m_ui->textFilterPath->setText(Utils::Fs::toNativePath(ipfilter)); } // Display dialog to choose save dir void options_imp::on_browseSaveDirButton_clicked() { - const QString save_path = Utils::Fs::expandPathAbs(textSavePath->text()); + const QString save_path = Utils::Fs::expandPathAbs(m_ui->textSavePath->text()); QDir saveDir(save_path); QString dir; if (!save_path.isEmpty() && saveDir.exists()) @@ -1439,12 +1442,12 @@ void options_imp::on_browseSaveDirButton_clicked() else dir = QFileDialog::getExistingDirectory(this, tr("Choose a save directory"), QDir::homePath()); if (!dir.isNull()) - textSavePath->setText(Utils::Fs::toNativePath(dir)); + m_ui->textSavePath->setText(Utils::Fs::toNativePath(dir)); } void options_imp::on_browseTempDirButton_clicked() { - const QString temp_path = Utils::Fs::expandPathAbs(textTempPath->text()); + const QString temp_path = Utils::Fs::expandPathAbs(m_ui->textTempPath->text()); QDir tempDir(temp_path); QString dir; if (!temp_path.isEmpty() && tempDir.exists()) @@ -1452,40 +1455,40 @@ void options_imp::on_browseTempDirButton_clicked() else dir = QFileDialog::getExistingDirectory(this, tr("Choose a save directory"), QDir::homePath()); if (!dir.isNull()) - textTempPath->setText(Utils::Fs::toNativePath(dir)); + m_ui->textTempPath->setText(Utils::Fs::toNativePath(dir)); } // Return Filter object to apply to BT session QString options_imp::getFilter() const { - return Utils::Fs::fromNativePath(textFilterPath->text()); + return Utils::Fs::fromNativePath(m_ui->textFilterPath->text()); } // Web UI bool options_imp::isWebUiEnabled() const { - return checkWebUi->isChecked(); + return m_ui->checkWebUi->isChecked(); } quint16 options_imp::webUiPort() const { - return spinWebUiPort->value(); + return m_ui->spinWebUiPort->value(); } QString options_imp::webUiUsername() const { - return textWebUiUsername->text(); + return m_ui->textWebUiUsername->text(); } QString options_imp::webUiPassword() const { - return textWebUiPassword->text(); + return m_ui->textWebUiPassword->text(); } void options_imp::showConnectionTab() { - tabSelection->setCurrentRow(TAB_CONNECTION); + m_ui->tabSelection->setCurrentRow(TAB_CONNECTION); } void options_imp::on_btnWebUiCrt_clicked() @@ -1514,7 +1517,7 @@ void options_imp::on_btnWebUiKey_clicked() void options_imp::on_registerDNSBtn_clicked() { - QDesktopServices::openUrl(Net::DNSUpdater::getRegistrationUrl(comboDNSService->currentIndex())); + QDesktopServices::openUrl(Net::DNSUpdater::getRegistrationUrl(m_ui->comboDNSService->currentIndex())); } void options_imp::on_IpFilterRefreshBtn_clicked() @@ -1617,11 +1620,11 @@ void options_imp::setSslKey(const QByteArray &key, bool interactive) { #ifndef QT_NO_OPENSSL if (!key.isEmpty() && !QSslKey(key, QSsl::Rsa).isNull()) { - lblSslKeyStatus->setPixmap(QPixmap(":/icons/oxygen/security-high.png").scaledToHeight(20, Qt::SmoothTransformation)); + m_ui->lblSslKeyStatus->setPixmap(QPixmap(":/icons/oxygen/security-high.png").scaledToHeight(20, Qt::SmoothTransformation)); m_sslKey = key; } else { - lblSslKeyStatus->setPixmap(QPixmap(":/icons/oxygen/security-low.png").scaledToHeight(20, Qt::SmoothTransformation)); + m_ui->lblSslKeyStatus->setPixmap(QPixmap(":/icons/oxygen/security-low.png").scaledToHeight(20, Qt::SmoothTransformation)); m_sslKey.clear(); if (interactive) QMessageBox::warning(this, tr("Invalid key"), tr("This is not a valid SSL key.")); @@ -1633,11 +1636,11 @@ void options_imp::setSslCertificate(const QByteArray &cert, bool interactive) { #ifndef QT_NO_OPENSSL if (!cert.isEmpty() && !QSslCertificate(cert).isNull()) { - lblSslCertStatus->setPixmap(QPixmap(":/icons/oxygen/security-high.png").scaledToHeight(20, Qt::SmoothTransformation)); + m_ui->lblSslCertStatus->setPixmap(QPixmap(":/icons/oxygen/security-high.png").scaledToHeight(20, Qt::SmoothTransformation)); m_sslCert = cert; } else { - lblSslCertStatus->setPixmap(QPixmap(":/icons/oxygen/security-low.png").scaledToHeight(20, Qt::SmoothTransformation)); + m_ui->lblSslCertStatus->setPixmap(QPixmap(":/icons/oxygen/security-low.png").scaledToHeight(20, Qt::SmoothTransformation)); m_sslCert.clear(); if (interactive) QMessageBox::warning(this, tr("Invalid certificate"), tr("This is not a valid SSL certificate.")); @@ -1647,7 +1650,7 @@ void options_imp::setSslCertificate(const QByteArray &cert, bool interactive) bool options_imp::schedTimesOk() { - if (schedule_from->time() == schedule_to->time()) { + if (m_ui->schedule_from->time() == m_ui->schedule_to->time()) { QMessageBox::warning(this, tr("Time Error"), tr("The start time and the end time can't be the same.")); return false; } diff --git a/src/gui/options_imp.h b/src/gui/options_imp.h index 6dd3706da..affbde99c 100644 --- a/src/gui/options_imp.h +++ b/src/gui/options_imp.h @@ -31,9 +31,12 @@ #ifndef OPTIONS_IMP_H #define OPTIONS_IMP_H -#include "ui_options.h" +#include +#include +class QAbstractButton; class QCloseEvent; +class QListWidgetItem; class AdvancedSettings; // actions on double-click on torrents @@ -44,7 +47,12 @@ enum DoubleClickAction NO_ACTION }; -class options_imp: public QDialog, private Ui_Preferences +namespace Ui +{ + class OptionsDialog; +} + +class options_imp: public QDialog { Q_OBJECT private: @@ -164,6 +172,7 @@ private: bool webUIAuthenticationOk(); private: + Ui::OptionsDialog *m_ui; QButtonGroup choiceLanguage; QAbstractButton *applyButton; AdvancedSettings *advancedSettings; From c85a0a41ba068356907bc323043baf56827138d3 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Mon, 25 Apr 2016 15:54:38 +0800 Subject: [PATCH 4/7] Rename "options.ui" to "optionsdlg.ui" Rename class name "options_imp" to "OptionsDialog" Rename "options_imp.cpp" to "optionsdlg.h" --- src/gui/CMakeLists.txt | 6 +- src/gui/gui.pri | 6 +- src/gui/mainwindow.cpp | 4 +- src/gui/mainwindow.h | 4 +- src/gui/{options_imp.cpp => optionsdlg.cpp} | 168 ++++++++++---------- src/gui/{options_imp.h => optionsdlg.h} | 10 +- src/gui/{options.ui => optionsdlg.ui} | 0 src/gui/transferlistwidget.cpp | 2 +- 8 files changed, 100 insertions(+), 100 deletions(-) rename src/gui/{options_imp.cpp => optionsdlg.cpp} (94%) rename src/gui/{options_imp.h => optionsdlg.h} (97%) rename src/gui/{options.ui => optionsdlg.ui} (100%) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 7cf5cfbc2..8ed1632bc 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -43,7 +43,7 @@ ico.h loglistwidget.h mainwindow.h messageboxraised.h -options_imp.h +optionsdlg.h previewlistdelegate.h previewselect.h scanfoldersdelegate.h @@ -79,7 +79,7 @@ ico.cpp loglistwidget.cpp mainwindow.cpp messageboxraised.cpp -options_imp.cpp +optionsdlg.cpp previewselect.cpp scanfoldersdelegate.cpp shutdownconfirmdlg.cpp @@ -121,7 +121,7 @@ executionlog.ui addnewtorrentdialog.ui autoexpandabledialog.ui statsdialog.ui -options.ui +optionsdlg.ui torrentcreatordlg.ui shutdownconfirmdlg.ui ) diff --git a/src/gui/gui.pri b/src/gui/gui.pri index a9318344c..c55e74fe3 100644 --- a/src/gui/gui.pri +++ b/src/gui/gui.pri @@ -36,7 +36,7 @@ HEADERS += \ $$PWD/autoexpandabledialog.h \ $$PWD/statsdialog.h \ $$PWD/messageboxraised.h \ - $$PWD/options_imp.h \ + $$PWD/optionsdlg.h \ $$PWD/advancedsettings.h \ $$PWD/shutdownconfirmdlg.h \ $$PWD/torrentmodel.h \ @@ -77,7 +77,7 @@ SOURCES += \ $$PWD/statusbar.cpp \ $$PWD/advancedsettings.cpp \ $$PWD/trackerlogin.cpp \ - $$PWD/options_imp.cpp \ + $$PWD/optionsdlg.cpp \ $$PWD/shutdownconfirmdlg.cpp \ $$PWD/torrentmodel.cpp \ $$PWD/torrentcreatordlg.cpp \ @@ -110,7 +110,7 @@ FORMS += \ $$PWD/addnewtorrentdialog.ui \ $$PWD/autoexpandabledialog.ui \ $$PWD/statsdialog.ui \ - $$PWD/options.ui \ + $$PWD/optionsdlg.ui \ $$PWD/torrentcreatordlg.ui \ $$PWD/search/searchwidget.ui \ $$PWD/search/pluginselectdlg.ui \ diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index d83d3c4df..23bef83b4 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -84,7 +84,7 @@ #include "statusbar.h" #include "rss_imp.h" #include "about_imp.h" -#include "options_imp.h" +#include "optionsdlg.h" #include "trackerlogin.h" #include "lineedit.h" #include "executionlog.h" @@ -1452,7 +1452,7 @@ void MainWindow::on_actionOptions_triggered() if (m_options) m_options->setFocus(); else - m_options = new options_imp(this); + m_options = new OptionsDialog(this); } void MainWindow::on_actionTopToolBar_triggered() diff --git a/src/gui/mainwindow.h b/src/gui/mainwindow.h index 82b78ae05..1a680e31e 100644 --- a/src/gui/mainwindow.h +++ b/src/gui/mainwindow.h @@ -46,7 +46,7 @@ class downloadFromURL; class SearchWidget; class RSSImp; class about; -class options_imp; +class OptionsDialog; class TransferListWidget; class TransferListFiltersWidget; class PropertiesWidget; @@ -208,7 +208,7 @@ private: bool m_posInitialized; QTabWidget *m_tabs; StatusBar *m_statusBar; - QPointer m_options; + QPointer m_options; QPointer m_aboutDlg; QPointer m_statsDlg; QPointer m_createTorrentDlg; diff --git a/src/gui/options_imp.cpp b/src/gui/optionsdlg.cpp similarity index 94% rename from src/gui/options_imp.cpp rename to src/gui/optionsdlg.cpp index e6faccb7c..686d14493 100644 --- a/src/gui/options_imp.cpp +++ b/src/gui/optionsdlg.cpp @@ -28,7 +28,7 @@ * Contact : chris@qbittorrent.org */ -#include "options_imp.h" +#include "optionsdlg.h" #include @@ -61,10 +61,10 @@ #include "guiiconprovider.h" #include "scanfoldersdelegate.h" -#include "ui_options.h" +#include "ui_optionsdlg.h" // Constructor -options_imp::options_imp(QWidget *parent) +OptionsDialog::OptionsDialog(QWidget *parent) : QDialog(parent) , m_refreshingIpFilter(false) , m_ui(new Ui::OptionsDialog) @@ -344,7 +344,7 @@ options_imp::options_imp(QWidget *parent) loadWindowState(); } -void options_imp::initializeLanguageCombo() +void OptionsDialog::initializeLanguageCombo() { // List language files const QDir langDir(":/lang"); @@ -367,7 +367,7 @@ void options_imp::initializeLanguageCombo() } // Main destructor -options_imp::~options_imp() +OptionsDialog::~OptionsDialog() { qDebug("-> destructing Options"); foreach (const QString &path, addedScanDirs) @@ -376,14 +376,14 @@ options_imp::~options_imp() delete m_ui; } -void options_imp::changePage(QListWidgetItem *current, QListWidgetItem *previous) +void OptionsDialog::changePage(QListWidgetItem *current, QListWidgetItem *previous) { if (!current) current = previous; m_ui->tabOption->setCurrentIndex(m_ui->tabSelection->row(current)); } -void options_imp::loadWindowState() +void OptionsDialog::loadWindowState() { const Preferences* const pref = Preferences::instance(); resize(pref->getPrefSize(sizeFittingScreen())); @@ -406,7 +406,7 @@ void options_imp::loadWindowState() m_ui->hsplitter->setSizes(sizes); } -void options_imp::saveWindowState() const +void OptionsDialog::saveWindowState() const { Preferences* const pref = Preferences::instance(); pref->setPrefSize(size()); @@ -418,7 +418,7 @@ void options_imp::saveWindowState() const pref->setPrefHSplitterSizes(sizes_str); } -QSize options_imp::sizeFittingScreen() const +QSize OptionsDialog::sizeFittingScreen() const { int scrn = 0; QWidget *w = this->topLevelWidget(); @@ -437,7 +437,7 @@ QSize options_imp::sizeFittingScreen() const return size(); } -void options_imp::saveOptions() +void OptionsDialog::saveOptions() { applyButton->setEnabled(false); Preferences* const pref = Preferences::instance(); @@ -620,12 +620,12 @@ void options_imp::saveOptions() pref->apply(); } -bool options_imp::isFilteringEnabled() const +bool OptionsDialog::isFilteringEnabled() const { return m_ui->checkIPFilter->isChecked(); } -int options_imp::getProxyType() const +int OptionsDialog::getProxyType() const { switch (m_ui->comboProxyType->currentIndex()) { case 1: @@ -644,7 +644,7 @@ int options_imp::getProxyType() const } } -void options_imp::loadOptions() +void OptionsDialog::loadOptions() { int intValue; qreal floatValue; @@ -977,72 +977,72 @@ void options_imp::loadOptions() // return min & max ports // [min, max] -int options_imp::getPort() const +int OptionsDialog::getPort() const { return m_ui->spinPort->value(); } -void options_imp::on_randomButton_clicked() +void OptionsDialog::on_randomButton_clicked() { // Range [1024: 65535] m_ui->spinPort->setValue(rand() % 64512 + 1024); } -int options_imp::getEncryptionSetting() const +int OptionsDialog::getEncryptionSetting() const { return m_ui->comboEncryption->currentIndex(); } -int options_imp::getMaxActiveDownloads() const +int OptionsDialog::getMaxActiveDownloads() const { return m_ui->spinMaxActiveDownloads->value(); } -int options_imp::getMaxActiveUploads() const +int OptionsDialog::getMaxActiveUploads() const { return m_ui->spinMaxActiveUploads->value(); } -int options_imp::getMaxActiveTorrents() const +int OptionsDialog::getMaxActiveTorrents() const { return m_ui->spinMaxActiveTorrents->value(); } -bool options_imp::minimizeToTray() const +bool OptionsDialog::minimizeToTray() const { if (!m_ui->checkShowSystray->isChecked()) return false; return m_ui->checkMinimizeToSysTray->isChecked(); } -bool options_imp::closeToTray() const +bool OptionsDialog::closeToTray() const { if (!m_ui->checkShowSystray->isChecked()) return false; return m_ui->checkCloseToSystray->isChecked(); } -bool options_imp::isQueueingSystemEnabled() const +bool OptionsDialog::isQueueingSystemEnabled() const { return m_ui->checkEnableQueueing->isChecked(); } -bool options_imp::isDHTEnabled() const +bool OptionsDialog::isDHTEnabled() const { return m_ui->checkDHT->isChecked(); } -bool options_imp::isLSDEnabled() const +bool OptionsDialog::isLSDEnabled() const { return m_ui->checkLSD->isChecked(); } -bool options_imp::isUPnPEnabled() const +bool OptionsDialog::isUPnPEnabled() const { return m_ui->checkUPnP->isChecked(); } // Return Download & Upload limits in kbps // [download,upload] -QPair options_imp::getGlobalBandwidthLimits() const +QPair OptionsDialog::getGlobalBandwidthLimits() const { int DL = -1, UP = -1; if (m_ui->checkDownloadLimit->isChecked()) @@ -1054,7 +1054,7 @@ QPair options_imp::getGlobalBandwidthLimits() const // Return alternate Download & Upload limits in kbps // [download,upload] -QPair options_imp::getAltGlobalBandwidthLimits() const +QPair OptionsDialog::getAltGlobalBandwidthLimits() const { int DL = -1, UP = -1; if (m_ui->checkDownloadLimitAlt->isChecked()) @@ -1064,19 +1064,19 @@ QPair options_imp::getAltGlobalBandwidthLimits() const return qMakePair(DL, UP); } -bool options_imp::startMinimized() const +bool OptionsDialog::startMinimized() const { return m_ui->checkStartMinimized->isChecked(); } -bool options_imp::systrayIntegration() const +bool OptionsDialog::systrayIntegration() const { if (!QSystemTrayIcon::isSystemTrayAvailable()) return false; return m_ui->checkShowSystray->isChecked(); } // Return Share ratio -qreal options_imp::getMaxRatio() const +qreal OptionsDialog::getMaxRatio() const { if (m_ui->checkMaxRatio->isChecked()) return m_ui->spinMaxRatio->value(); @@ -1084,7 +1084,7 @@ qreal options_imp::getMaxRatio() const } // Return max connections number -int options_imp::getMaxConnecs() const +int OptionsDialog::getMaxConnecs() const { if (!m_ui->checkMaxConnecs->isChecked()) return -1; @@ -1092,7 +1092,7 @@ int options_imp::getMaxConnecs() const return m_ui->spinMaxConnec->value(); } -int options_imp::getMaxConnecsPerTorrent() const +int OptionsDialog::getMaxConnecsPerTorrent() const { if (!m_ui->checkMaxConnecsPerTorrent->isChecked()) return -1; @@ -1100,7 +1100,7 @@ int options_imp::getMaxConnecsPerTorrent() const return m_ui->spinMaxConnecPerTorrent->value(); } -int options_imp::getMaxUploads() const +int OptionsDialog::getMaxUploads() const { if (!m_ui->checkMaxUploads->isChecked()) return -1; @@ -1108,7 +1108,7 @@ int options_imp::getMaxUploads() const return m_ui->spinMaxUploads->value(); } -int options_imp::getMaxUploadsPerTorrent() const +int OptionsDialog::getMaxUploadsPerTorrent() const { if (!m_ui->checkMaxUploadsPerTorrent->isChecked()) return -1; @@ -1116,7 +1116,7 @@ int options_imp::getMaxUploadsPerTorrent() const return m_ui->spinMaxUploadsPerTorrent->value(); } -void options_imp::on_buttonBox_accepted() +void OptionsDialog::on_buttonBox_accepted() { if (applyButton->isEnabled()) { if (!schedTimesOk()) { @@ -1135,7 +1135,7 @@ void options_imp::on_buttonBox_accepted() accept(); } -void options_imp::applySettings(QAbstractButton* button) +void OptionsDialog::applySettings(QAbstractButton* button) { if (button == applyButton) { if (!schedTimesOk()) { @@ -1150,29 +1150,29 @@ void options_imp::applySettings(QAbstractButton* button) } } -void options_imp::closeEvent(QCloseEvent *e) +void OptionsDialog::closeEvent(QCloseEvent *e) { setAttribute(Qt::WA_DeleteOnClose); e->accept(); } -void options_imp::on_buttonBox_rejected() +void OptionsDialog::on_buttonBox_rejected() { setAttribute(Qt::WA_DeleteOnClose); reject(); } -bool options_imp::useAdditionDialog() const +bool OptionsDialog::useAdditionDialog() const { return m_ui->checkAdditionDialog->isChecked(); } -void options_imp::enableApplyButton() +void OptionsDialog::enableApplyButton() { applyButton->setEnabled(true); } -void options_imp::enableProxy(int index) +void OptionsDialog::enableProxy(int index) { if (index) { //enable @@ -1205,61 +1205,61 @@ void options_imp::enableProxy(int index) } } -bool options_imp::isSlashScreenDisabled() const +bool OptionsDialog::isSlashScreenDisabled() const { return !m_ui->checkShowSplash->isChecked(); } #ifdef Q_OS_WIN -bool options_imp::WinStartup() const +bool OptionsDialog::WinStartup() const { return m_ui->checkStartup->isChecked(); } #endif -bool options_imp::preventFromSuspend() const +bool OptionsDialog::preventFromSuspend() const { return m_ui->checkPreventFromSuspend->isChecked(); } -bool options_imp::preAllocateAllFiles() const +bool OptionsDialog::preAllocateAllFiles() const { return m_ui->checkPreallocateAll->isChecked(); } -bool options_imp::addTorrentsInPause() const +bool OptionsDialog::addTorrentsInPause() const { return m_ui->checkStartPaused->isChecked(); } // Proxy settings -bool options_imp::isProxyEnabled() const +bool OptionsDialog::isProxyEnabled() const { return m_ui->comboProxyType->currentIndex(); } -bool options_imp::isProxyAuthEnabled() const +bool OptionsDialog::isProxyAuthEnabled() const { return m_ui->checkProxyAuth->isChecked(); } -QString options_imp::getProxyIp() const +QString OptionsDialog::getProxyIp() const { return m_ui->textProxyIP->text().trimmed(); } -unsigned short options_imp::getProxyPort() const +unsigned short OptionsDialog::getProxyPort() const { return m_ui->spinProxyPort->value(); } -QString options_imp::getProxyUsername() const +QString OptionsDialog::getProxyUsername() const { QString username = m_ui->textProxyUsername->text().trimmed(); return username; } -QString options_imp::getProxyPassword() const +QString OptionsDialog::getProxyPassword() const { QString password = m_ui->textProxyPassword->text(); password = password.trimmed(); @@ -1267,12 +1267,12 @@ QString options_imp::getProxyPassword() const } // Locale Settings -QString options_imp::getLocale() const +QString OptionsDialog::getLocale() const { return m_ui->comboI18n->itemData(m_ui->comboI18n->currentIndex(), Qt::UserRole).toString(); } -void options_imp::setLocale(const QString &localeStr) +void OptionsDialog::setLocale(const QString &localeStr) { QString name; if (localeStr.startsWith("eo", Qt::CaseInsensitive)) { @@ -1300,14 +1300,14 @@ void options_imp::setLocale(const QString &localeStr) m_ui->comboI18n->setCurrentIndex(index); } -QString options_imp::getTorrentExportDir() const +QString OptionsDialog::getTorrentExportDir() const { if (m_ui->checkExportDir->isChecked()) return Utils::Fs::expandPathAbs(m_ui->textExportDir->text()); return QString(); } -QString options_imp::getFinishedTorrentExportDir() const +QString OptionsDialog::getFinishedTorrentExportDir() const { if (m_ui->checkExportDirFin->isChecked()) return Utils::Fs::expandPathAbs(m_ui->textExportDirFin->text()); @@ -1315,7 +1315,7 @@ QString options_imp::getFinishedTorrentExportDir() const } // Return action on double-click on a downloading torrent set in options -int options_imp::getActionOnDblClOnTorrentDl() const +int OptionsDialog::getActionOnDblClOnTorrentDl() const { if (m_ui->actionTorrentDlOnDblClBox->currentIndex() < 1) return 0; @@ -1323,14 +1323,14 @@ int options_imp::getActionOnDblClOnTorrentDl() const } // Return action on double-click on a finished torrent set in options -int options_imp::getActionOnDblClOnTorrentFn() const +int OptionsDialog::getActionOnDblClOnTorrentFn() const { if (m_ui->actionTorrentFnOnDblClBox->currentIndex() < 1) return 0; return m_ui->actionTorrentFnOnDblClBox->currentIndex(); } -void options_imp::on_addScanFolderButton_clicked() +void OptionsDialog::on_addScanFolderButton_clicked() { Preferences* const pref = Preferences::instance(); const QString dir = QFileDialog::getExistingDirectory(this, tr("Select folder to monitor"), @@ -1361,7 +1361,7 @@ void options_imp::on_addScanFolderButton_clicked() } } -void options_imp::on_removeScanFolderButton_clicked() +void OptionsDialog::on_removeScanFolderButton_clicked() { const QModelIndexList selected = m_ui->scanFoldersView->selectionModel()->selectedIndexes(); @@ -1375,12 +1375,12 @@ void options_imp::on_removeScanFolderButton_clicked() ScanFoldersModel::instance()->removePath(selected.first().row(), false); } -void options_imp::handleScanFolderViewSelectionChanged() +void OptionsDialog::handleScanFolderViewSelectionChanged() { m_ui->removeScanFolderButton->setEnabled(!m_ui->scanFoldersView->selectionModel()->selectedIndexes().isEmpty()); } -QString options_imp::askForExportDir(const QString& currentExportPath) +QString OptionsDialog::askForExportDir(const QString& currentExportPath) { QDir currentExportDir(Utils::Fs::expandPathAbs(currentExportPath)); QString dir; @@ -1391,7 +1391,7 @@ QString options_imp::askForExportDir(const QString& currentExportPath) return dir; } -void options_imp::on_browseFileLogDir_clicked() +void OptionsDialog::on_browseFileLogDir_clicked() { const QString path = Utils::Fs::expandPathAbs(Utils::Fs::fromNativePath(m_ui->textFileLogPath->text())); QDir pathDir(path); @@ -1404,21 +1404,21 @@ void options_imp::on_browseFileLogDir_clicked() m_ui->textFileLogPath->setText(Utils::Fs::toNativePath(dir)); } -void options_imp::on_browseExportDirButton_clicked() +void OptionsDialog::on_browseExportDirButton_clicked() { const QString newExportDir = askForExportDir(m_ui->textExportDir->text()); if (!newExportDir.isNull()) m_ui->textExportDir->setText(Utils::Fs::toNativePath(newExportDir)); } -void options_imp::on_browseExportDirFinButton_clicked() +void OptionsDialog::on_browseExportDirFinButton_clicked() { const QString newExportDir = askForExportDir(m_ui->textExportDirFin->text()); if (!newExportDir.isNull()) m_ui->textExportDirFin->setText(Utils::Fs::toNativePath(newExportDir)); } -void options_imp::on_browseFilterButton_clicked() +void OptionsDialog::on_browseFilterButton_clicked() { const QString filter_path = Utils::Fs::expandPathAbs(m_ui->textFilterPath->text()); QDir filterDir(filter_path); @@ -1432,7 +1432,7 @@ void options_imp::on_browseFilterButton_clicked() } // Display dialog to choose save dir -void options_imp::on_browseSaveDirButton_clicked() +void OptionsDialog::on_browseSaveDirButton_clicked() { const QString save_path = Utils::Fs::expandPathAbs(m_ui->textSavePath->text()); QDir saveDir(save_path); @@ -1445,7 +1445,7 @@ void options_imp::on_browseSaveDirButton_clicked() m_ui->textSavePath->setText(Utils::Fs::toNativePath(dir)); } -void options_imp::on_browseTempDirButton_clicked() +void OptionsDialog::on_browseTempDirButton_clicked() { const QString temp_path = Utils::Fs::expandPathAbs(m_ui->textTempPath->text()); QDir tempDir(temp_path); @@ -1459,39 +1459,39 @@ void options_imp::on_browseTempDirButton_clicked() } // Return Filter object to apply to BT session -QString options_imp::getFilter() const +QString OptionsDialog::getFilter() const { return Utils::Fs::fromNativePath(m_ui->textFilterPath->text()); } // Web UI -bool options_imp::isWebUiEnabled() const +bool OptionsDialog::isWebUiEnabled() const { return m_ui->checkWebUi->isChecked(); } -quint16 options_imp::webUiPort() const +quint16 OptionsDialog::webUiPort() const { return m_ui->spinWebUiPort->value(); } -QString options_imp::webUiUsername() const +QString OptionsDialog::webUiUsername() const { return m_ui->textWebUiUsername->text(); } -QString options_imp::webUiPassword() const +QString OptionsDialog::webUiPassword() const { return m_ui->textWebUiPassword->text(); } -void options_imp::showConnectionTab() +void OptionsDialog::showConnectionTab() { m_ui->tabSelection->setCurrentRow(TAB_CONNECTION); } -void options_imp::on_btnWebUiCrt_clicked() +void OptionsDialog::on_btnWebUiCrt_clicked() { QString filename = QFileDialog::getOpenFileName(this, QString(), QString(), tr("SSL Certificate") + QString(" (*.crt *.pem)")); if (filename.isNull()) @@ -1503,7 +1503,7 @@ void options_imp::on_btnWebUiCrt_clicked() } } -void options_imp::on_btnWebUiKey_clicked() +void OptionsDialog::on_btnWebUiKey_clicked() { QString filename = QFileDialog::getOpenFileName(this, QString(), QString(), tr("SSL Key") + QString(" (*.key *.pem)")); if (filename.isNull()) @@ -1515,12 +1515,12 @@ void options_imp::on_btnWebUiKey_clicked() } } -void options_imp::on_registerDNSBtn_clicked() +void OptionsDialog::on_registerDNSBtn_clicked() { QDesktopServices::openUrl(Net::DNSUpdater::getRegistrationUrl(m_ui->comboDNSService->currentIndex())); } -void options_imp::on_IpFilterRefreshBtn_clicked() +void OptionsDialog::on_IpFilterRefreshBtn_clicked() { if (m_refreshingIpFilter) return; m_refreshingIpFilter = true; @@ -1534,7 +1534,7 @@ void options_imp::on_IpFilterRefreshBtn_clicked() BitTorrent::Session::instance()->enableIPFilter(getFilter(), true); } -void options_imp::handleIPFilterParsed(bool error, int ruleCount) +void OptionsDialog::handleIPFilterParsed(bool error, int ruleCount) { setCursor(QCursor(Qt::ArrowCursor)); if (error) @@ -1545,7 +1545,7 @@ void options_imp::handleIPFilterParsed(bool error, int ruleCount) disconnect(BitTorrent::Session::instance(), SIGNAL(ipFilterParsed(bool, int)), this, SLOT(handleIPFilterParsed(bool, int))); } -QString options_imp::languageToLocalizedString(const QLocale &locale) +QString OptionsDialog::languageToLocalizedString(const QLocale &locale) { switch (locale.language()) { case QLocale::English: { @@ -1616,7 +1616,7 @@ QString options_imp::languageToLocalizedString(const QLocale &locale) } } -void options_imp::setSslKey(const QByteArray &key, bool interactive) +void OptionsDialog::setSslKey(const QByteArray &key, bool interactive) { #ifndef QT_NO_OPENSSL if (!key.isEmpty() && !QSslKey(key, QSsl::Rsa).isNull()) { @@ -1632,7 +1632,7 @@ void options_imp::setSslKey(const QByteArray &key, bool interactive) #endif } -void options_imp::setSslCertificate(const QByteArray &cert, bool interactive) +void OptionsDialog::setSslCertificate(const QByteArray &cert, bool interactive) { #ifndef QT_NO_OPENSSL if (!cert.isEmpty() && !QSslCertificate(cert).isNull()) { @@ -1648,7 +1648,7 @@ void options_imp::setSslCertificate(const QByteArray &cert, bool interactive) #endif } -bool options_imp::schedTimesOk() +bool OptionsDialog::schedTimesOk() { if (m_ui->schedule_from->time() == m_ui->schedule_to->time()) { QMessageBox::warning(this, tr("Time Error"), tr("The start time and the end time can't be the same.")); @@ -1657,7 +1657,7 @@ bool options_imp::schedTimesOk() return true; } -bool options_imp::webUIAuthenticationOk() +bool OptionsDialog::webUIAuthenticationOk() { if (webUiUsername().length() < 3) { QMessageBox::warning(this, tr("Length Error"), tr("The Web UI username must be at least 3 characters long.")); diff --git a/src/gui/options_imp.h b/src/gui/optionsdlg.h similarity index 97% rename from src/gui/options_imp.h rename to src/gui/optionsdlg.h index affbde99c..672b1ff9e 100644 --- a/src/gui/options_imp.h +++ b/src/gui/optionsdlg.h @@ -28,8 +28,8 @@ * Contact : chris@qbittorrent.org */ -#ifndef OPTIONS_IMP_H -#define OPTIONS_IMP_H +#ifndef OPTIONSDLG_H +#define OPTIONSDLG_H #include #include @@ -52,7 +52,7 @@ namespace Ui class OptionsDialog; } -class options_imp: public QDialog +class OptionsDialog: public QDialog { Q_OBJECT private: @@ -69,8 +69,8 @@ private: public: // Constructor / Destructor - options_imp(QWidget *parent = 0); - ~options_imp(); + OptionsDialog(QWidget *parent = 0); + ~OptionsDialog(); public slots: void showConnectionTab(); diff --git a/src/gui/options.ui b/src/gui/optionsdlg.ui similarity index 100% rename from src/gui/options.ui rename to src/gui/optionsdlg.ui diff --git a/src/gui/transferlistwidget.cpp b/src/gui/transferlistwidget.cpp index 25b1e5932..92287c9de 100644 --- a/src/gui/transferlistwidget.cpp +++ b/src/gui/transferlistwidget.cpp @@ -52,7 +52,7 @@ #include "previewselect.h" #include "speedlimitdlg.h" #include "updownratiodlg.h" -#include "options_imp.h" +#include "optionsdlg.h" #include "mainwindow.h" #include "base/preferences.h" #include "torrentmodel.h" From d32c9470a014bc95b59b7aea9291bf8fffb2e82e Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sat, 7 May 2016 22:47:17 +0800 Subject: [PATCH 5/7] Fix reload button size is not the same size as "..." button. Rename Connection tab page --- src/gui/optionsdlg.ui | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/optionsdlg.ui b/src/gui/optionsdlg.ui index 2390066af..a47479300 100644 --- a/src/gui/optionsdlg.ui +++ b/src/gui/optionsdlg.ui @@ -1339,7 +1339,7 @@
- + 0 @@ -1770,9 +1770,9 @@ - + - 16777215 + 0 25 From 0ad33bf9aca45ad2cbdb93bd683c7b4872db3003 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sat, 7 May 2016 23:27:24 +0800 Subject: [PATCH 6/7] Let user able to specifiy a filter when choosing an IP filter file --- src/gui/optionsdlg.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/gui/optionsdlg.cpp b/src/gui/optionsdlg.cpp index 686d14493..3777ef95e 100644 --- a/src/gui/optionsdlg.cpp +++ b/src/gui/optionsdlg.cpp @@ -1420,15 +1420,11 @@ void OptionsDialog::on_browseExportDirFinButton_clicked() void OptionsDialog::on_browseFilterButton_clicked() { - const QString filter_path = Utils::Fs::expandPathAbs(m_ui->textFilterPath->text()); - QDir filterDir(filter_path); - QString ipfilter; - if (!filter_path.isEmpty() && filterDir.exists()) - ipfilter = QFileDialog::getOpenFileName(this, tr("Choose an IP filter file"), filterDir.absolutePath(), tr("Filters") + QString(" (*.dat *.p2p *.p2b)")); - else - ipfilter = QFileDialog::getOpenFileName(this, tr("Choose an IP filter file"), QDir::homePath(), tr("Filters") + QString(" (*.dat *.p2p *.p2b)")); - if (!ipfilter.isNull()) - m_ui->textFilterPath->setText(Utils::Fs::toNativePath(ipfilter)); + QDir lastDir(Utils::Fs::fromNativePath(m_ui->textFilterPath->text())); + QString lastPath = lastDir.exists() ? lastDir.absolutePath() : QDir::homePath(); + QString newPath = QFileDialog::getOpenFileName(this, tr("Choose an IP filter file"), lastPath, tr("All supported filters") + QString(" (*.dat *.p2p *.p2b);;.dat (*.dat);;.p2p (*.p2p);;.p2b (*.p2b)")); + if (!newPath.isEmpty()) + m_ui->textFilterPath->setText(Utils::Fs::toNativePath(newPath)); } // Display dialog to choose save dir From 5efc45190a9a88e98658d34c79e9db8775b82924 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Fri, 3 Jun 2016 02:00:38 +0800 Subject: [PATCH 7/7] Fix widget name collision. Small cleanup on Downloads page. --- src/gui/optionsdlg.ui | 56 +++++++++++++++---------------------------- 1 file changed, 19 insertions(+), 37 deletions(-) diff --git a/src/gui/optionsdlg.ui b/src/gui/optionsdlg.ui index a47479300..2dad18c0c 100644 --- a/src/gui/optionsdlg.ui +++ b/src/gui/optionsdlg.ui @@ -671,33 +671,17 @@ 0 0 586 - 1127 + 1118 - - - 0 - 0 - - When adding a torrent - - - 9 - - - - - Do not start the download automatically - - - - + + Display torrent content and some options @@ -705,8 +689,11 @@ true - - + + + 0 + + Bring torrent dialog to the front @@ -719,7 +706,14 @@ - + + + + Do not start the download automatically + + + + Should the .torrent file be deleted after adding it @@ -733,7 +727,7 @@ false - + @@ -745,7 +739,7 @@ - + @@ -761,12 +755,6 @@ - - - 0 - 0 - - Warning! Data loss possible! @@ -782,16 +770,10 @@ - - - 0 - 0 - - Saving Management - +