From 2c2638c1fe78c8ad78156a0be80740c028d17278 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Mon, 18 Apr 2016 16:22:48 +0800 Subject: [PATCH] Disable `comboHideZero` when `checkHideZero` is unchecked. Disable `checkLimituTPConnections` when `checkuTP` is unchecked. Minor code formatting --- src/gui/options_imp.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/options_imp.cpp b/src/gui/options_imp.cpp index 430f438ce..4e94b79ea 100644 --- a/src/gui/options_imp.cpp +++ b/src/gui/options_imp.cpp @@ -62,8 +62,8 @@ // Constructor options_imp::options_imp(QWidget *parent) - : QDialog(parent), - m_refreshingIpFilter(false) + : QDialog(parent) + , m_refreshingIpFilter(false) { qDebug("-> Constructing Options"); setupUi(this); @@ -149,6 +149,7 @@ options_imp::options_imp(QWidget *parent) 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())); @@ -242,6 +243,7 @@ options_imp::options_imp(QWidget *parent) 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())); @@ -625,6 +627,7 @@ void options_imp::loadOptions() confirmDeletion->setChecked(pref->confirmTorrentDeletion()); checkAltRowColors->setChecked(pref->useAlternatingRowColors()); checkHideZero->setChecked(pref->getHideZeroValues()); + comboHideZero->setEnabled(checkHideZero->isChecked()); comboHideZero->setCurrentIndex(pref->getHideZeroComboValues()); checkShowSplash->setChecked(!pref->isSplashScreenDisabled()); @@ -866,6 +869,7 @@ void options_imp::loadOptions() } checkuTP->setChecked(pref->isuTPEnabled()); + checkLimituTPConnections->setEnabled(checkuTP->isChecked()); checkLimituTPConnections->setChecked(pref->isuTPRateLimited()); checkLimitTransportOverhead->setChecked(pref->includeOverheadInLimits()); checkLimitLocalPeerRate->setChecked(!pref->getIgnoreLimitsOnLAN());