mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-01-06 15:04:34 +08:00
Don't apply some settings again if they weren't changed. Closes #4278.
This commit is contained in:
parent
2d25edd4d6
commit
82e02f7118
@ -104,6 +104,7 @@ MainWindow::MainWindow(QWidget *parent)
|
|||||||
, m_posInitialized(false)
|
, m_posInitialized(false)
|
||||||
, force_exit(false)
|
, force_exit(false)
|
||||||
, unlockDlgShowing(false)
|
, unlockDlgShowing(false)
|
||||||
|
, m_wasUpdateCheckEnabled(false)
|
||||||
, has_python(false)
|
, has_python(false)
|
||||||
{
|
{
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
@ -337,6 +338,8 @@ MainWindow::MainWindow(QWidget *parent)
|
|||||||
connect(transferList->getSourceModel(), SIGNAL(rowsInserted(QModelIndex, int, int)), this, SLOT(updateNbTorrents()));
|
connect(transferList->getSourceModel(), SIGNAL(rowsInserted(QModelIndex, int, int)), this, SLOT(updateNbTorrents()));
|
||||||
connect(transferList->getSourceModel(), SIGNAL(rowsRemoved(QModelIndex, int, int)), this, SLOT(updateNbTorrents()));
|
connect(transferList->getSourceModel(), SIGNAL(rowsRemoved(QModelIndex, int, int)), this, SLOT(updateNbTorrents()));
|
||||||
|
|
||||||
|
connect(pref, SIGNAL(changed()), this, SLOT(optionsSaved()));
|
||||||
|
|
||||||
qDebug("GUI Built");
|
qDebug("GUI Built");
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
if (!pref->neverCheckFileAssoc() && (!Preferences::isTorrentFileAssocSet() || !Preferences::isMagnetLinkAssocSet())) {
|
if (!pref->neverCheckFileAssoc() && (!Preferences::isTorrentFileAssocSet() || !Preferences::isMagnetLinkAssocSet())) {
|
||||||
@ -1108,7 +1111,7 @@ void MainWindow::loadPreferences(bool configure_session)
|
|||||||
toolBar->setVisible(false);
|
toolBar->setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pref->preventFromSuspend()) {
|
if (pref->preventFromSuspend() && !preventTimer->isActive()) {
|
||||||
preventTimer->start(PREVENT_SUSPEND_INTERVAL);
|
preventTimer->start(PREVENT_SUSPEND_INTERVAL);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -1149,10 +1152,14 @@ void MainWindow::loadPreferences(bool configure_session)
|
|||||||
properties->reloadPreferences();
|
properties->reloadPreferences();
|
||||||
|
|
||||||
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
|
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
|
||||||
if (pref->isUpdateCheckEnabled())
|
if (pref->isUpdateCheckEnabled() && !m_wasUpdateCheckEnabled) {
|
||||||
|
m_wasUpdateCheckEnabled = true;
|
||||||
checkProgramUpdate();
|
checkProgramUpdate();
|
||||||
else
|
}
|
||||||
|
else if (!pref->isUpdateCheckEnabled() && m_wasUpdateCheckEnabled) {
|
||||||
|
m_wasUpdateCheckEnabled = false;
|
||||||
programUpdateTimer.stop();
|
programUpdateTimer.stop();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
qDebug("GUI settings loaded");
|
qDebug("GUI settings loaded");
|
||||||
@ -1336,14 +1343,10 @@ void MainWindow::createTrayIcon()
|
|||||||
// Display Program Options
|
// Display Program Options
|
||||||
void MainWindow::on_actionOptions_triggered()
|
void MainWindow::on_actionOptions_triggered()
|
||||||
{
|
{
|
||||||
if (options) {
|
if (options)
|
||||||
// Get focus
|
|
||||||
options->setFocus();
|
options->setFocus();
|
||||||
}
|
else
|
||||||
else {
|
|
||||||
options = new options_imp(this);
|
options = new options_imp(this);
|
||||||
connect(options, SIGNAL(status_changed()), this, SLOT(optionsSaved()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_actionTop_tool_bar_triggered()
|
void MainWindow::on_actionTop_tool_bar_triggered()
|
||||||
|
@ -202,6 +202,7 @@ private:
|
|||||||
QTimer *preventTimer;
|
QTimer *preventTimer;
|
||||||
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
|
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
|
||||||
QTimer programUpdateTimer;
|
QTimer programUpdateTimer;
|
||||||
|
bool m_wasUpdateCheckEnabled;
|
||||||
#endif
|
#endif
|
||||||
bool has_python;
|
bool has_python;
|
||||||
QMenu* toolbarMenu;
|
QMenu* toolbarMenu;
|
||||||
|
@ -1000,10 +1000,9 @@ void options_imp::on_buttonBox_accepted()
|
|||||||
tabSelection->setCurrentRow(TAB_SPEED);
|
tabSelection->setCurrentRow(TAB_SPEED);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
saveOptions();
|
|
||||||
applyButton->setEnabled(false);
|
applyButton->setEnabled(false);
|
||||||
this->hide();
|
this->hide();
|
||||||
emit status_changed();
|
saveOptions();
|
||||||
}
|
}
|
||||||
saveWindowState();
|
saveWindowState();
|
||||||
accept();
|
accept();
|
||||||
@ -1017,7 +1016,6 @@ void options_imp::applySettings(QAbstractButton* button)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
saveOptions();
|
saveOptions();
|
||||||
emit status_changed();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,10 +70,6 @@ public:
|
|||||||
public slots:
|
public slots:
|
||||||
void showConnectionTab();
|
void showConnectionTab();
|
||||||
|
|
||||||
signals:
|
|
||||||
void status_changed() const;
|
|
||||||
void exitWithCancel();
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void enableProxy(int comboIndex);
|
void enableProxy(int comboIndex);
|
||||||
void on_buttonBox_accepted();
|
void on_buttonBox_accepted();
|
||||||
|
Loading…
Reference in New Issue
Block a user