|
|
@ -38,6 +38,7 @@ |
|
|
|
#include <QDesktopServices> |
|
|
|
#include <QDesktopServices> |
|
|
|
#include <QDesktopWidget> |
|
|
|
#include <QDesktopWidget> |
|
|
|
#include <QDialogButtonBox> |
|
|
|
#include <QDialogButtonBox> |
|
|
|
|
|
|
|
#include <QEvent> |
|
|
|
#include <QFileDialog> |
|
|
|
#include <QFileDialog> |
|
|
|
#include <QMessageBox> |
|
|
|
#include <QMessageBox> |
|
|
|
#include <QSystemTrayIcon> |
|
|
|
#include <QSystemTrayIcon> |
|
|
@ -50,6 +51,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
#include "app/application.h" |
|
|
|
#include "app/application.h" |
|
|
|
#include "base/bittorrent/session.h" |
|
|
|
#include "base/bittorrent/session.h" |
|
|
|
|
|
|
|
#include "base/global.h" |
|
|
|
#include "base/net/dnsupdater.h" |
|
|
|
#include "base/net/dnsupdater.h" |
|
|
|
#include "base/net/portforwarder.h" |
|
|
|
#include "base/net/portforwarder.h" |
|
|
|
#include "base/net/proxyconfigurationmanager.h" |
|
|
|
#include "base/net/proxyconfigurationmanager.h" |
|
|
@ -72,6 +74,18 @@ |
|
|
|
|
|
|
|
|
|
|
|
#include "ui_optionsdlg.h" |
|
|
|
#include "ui_optionsdlg.h" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class WheelEventEater : public QObject |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
public: |
|
|
|
|
|
|
|
using QObject::QObject; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
|
|
|
|
bool eventFilter(QObject *, QEvent *event) override |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return (event->type() == QEvent::Wheel); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// Constructor
|
|
|
|
// Constructor
|
|
|
|
OptionsDialog::OptionsDialog(QWidget *parent) |
|
|
|
OptionsDialog::OptionsDialog(QWidget *parent) |
|
|
|
: QDialog(parent) |
|
|
|
: QDialog(parent) |
|
|
@ -425,6 +439,13 @@ OptionsDialog::OptionsDialog(QWidget *parent) |
|
|
|
m_ui->textTempPath->setDialogCaption(tr("Choose a save directory")); |
|
|
|
m_ui->textTempPath->setDialogCaption(tr("Choose a save directory")); |
|
|
|
m_ui->textTempPath->setMode(FileSystemPathEdit::Mode::DirectorySave); |
|
|
|
m_ui->textTempPath->setMode(FileSystemPathEdit::Mode::DirectorySave); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// disable mouse wheel event on widgets to avoid mis-selection
|
|
|
|
|
|
|
|
WheelEventEater *wheelEventEater = new WheelEventEater(this); |
|
|
|
|
|
|
|
for (QComboBox *widget : copyAsConst(findChildren<QComboBox *>())) |
|
|
|
|
|
|
|
widget->installEventFilter(wheelEventEater); |
|
|
|
|
|
|
|
for (QSpinBox *widget : copyAsConst(findChildren<QSpinBox *>())) |
|
|
|
|
|
|
|
widget->installEventFilter(wheelEventEater); |
|
|
|
|
|
|
|
|
|
|
|
loadWindowState(); |
|
|
|
loadWindowState(); |
|
|
|
show(); |
|
|
|
show(); |
|
|
|
// Have to be called after show(), because splitter width needed
|
|
|
|
// Have to be called after show(), because splitter width needed
|
|
|
|