From 7bebc36cd5eef4d08f89b1ab84b157e6f60b4a67 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Mon, 18 Apr 2016 15:31:27 +0800 Subject: [PATCH 1/6] Fix path to resource --- src/gui/rss/rsssettingsdlg.ui | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/rss/rsssettingsdlg.ui b/src/gui/rss/rsssettingsdlg.ui index 720177be0..1ed8cb8a6 100644 --- a/src/gui/rss/rsssettingsdlg.ui +++ b/src/gui/rss/rsssettingsdlg.ui @@ -22,7 +22,7 @@ - :/icons/oxygen/application-rss+xml.png + :/icons/oxygen/application-rss+xml.png @@ -94,7 +94,7 @@ - + From 513e8f246bcee7f497da38a297f0b565bbed519c Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Mon, 18 Apr 2016 15:41:22 +0800 Subject: [PATCH 2/6] Morph QToolButton to QPushButton --- src/gui/rss/rss.ui | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/gui/rss/rss.ui b/src/gui/rss/rss.ui index f3108a6f8..c9315d357 100644 --- a/src/gui/rss/rss.ui +++ b/src/gui/rss/rss.ui @@ -20,36 +20,27 @@ - + New subscription - - Qt::ToolButtonTextBesideIcon - - + Mark items read - - Qt::ToolButtonTextBesideIcon - - + Refresh RSS streams Update all - - Qt::ToolButtonTextBesideIcon - From 2c2638c1fe78c8ad78156a0be80740c028d17278 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Mon, 18 Apr 2016 16:22:48 +0800 Subject: [PATCH 3/6] 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()); From c52a964a8a12d7dd56068d0a07b95c491e0815ad Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Mon, 18 Apr 2016 18:34:14 +0800 Subject: [PATCH 4/6] Fix toolbar resizing when m_searchFilter appears/disappears. Closes #5120. --- src/gui/lineedit/src/lineedit.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/gui/lineedit/src/lineedit.cpp b/src/gui/lineedit/src/lineedit.cpp index 0335944bf..2552c03af 100644 --- a/src/gui/lineedit/src/lineedit.cpp +++ b/src/gui/lineedit/src/lineedit.cpp @@ -16,17 +16,15 @@ LineEdit::LineEdit(QWidget *parent) : QLineEdit(parent) { - int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth); - QPixmap pixmap1(":/lineeditimages/search.png"); searchButton = new QToolButton(this); searchButton->setIcon(QIcon(pixmap1)); searchButton->setIconSize(pixmap1.size()); searchButton->setCursor(Qt::ArrowCursor); searchButton->setStyleSheet("QToolButton { border: none; padding: 2px; }"); + QSize searchButtonHint = searchButton->sizeHint(); - int clearButtonSizeHintWidth = 0; - int clearButtonSizeHintHeight = 0; + QSize clearButtonHint(0, 0); #ifndef QBT_USES_QT5 QPixmap pixmap2(":/lineeditimages/clear_left.png"); clearButton = new QToolButton(this); @@ -39,17 +37,17 @@ LineEdit::LineEdit(QWidget *parent) connect(clearButton, SIGNAL(clicked()), this, SLOT(clear())); connect(this, SIGNAL(textChanged(const QString &)), this, SLOT(updateCloseButton(const QString &))); - clearButtonSizeHintWidth = clearButton->sizeHint().width(); - clearButtonSizeHintHeight = clearButton->sizeHint().height(); - setStyleSheet(QString("QLineEdit { padding-left: %1px; padding-right: %2px; }").arg(searchButton->sizeHint().width()).arg(clearButtonSizeHintWidth)); + clearButtonHint = clearButton->sizeHint(); + setStyleSheet(QString("QLineEdit { padding-left: %1px; padding-right: %2px; }").arg(searchButtonHint.width()).arg(clearButtonHint.width())); #else setClearButtonEnabled(true); - setStyleSheet(QString("QLineEdit { padding-left: %1px; }").arg(searchButton->sizeHint().width())); // padding between text and widget borders + setStyleSheet(QString("QLineEdit { padding-left: %1px; }").arg(searchButtonHint.width())); // padding between text and widget borders #endif - QSize msz = sizeHint(); - setMinimumSize(qMax(msz.width(), searchButton->sizeHint().width() + clearButtonSizeHintWidth), - std::max({ msz.height(), searchButton->sizeHint().height(), clearButtonSizeHintHeight }) + frameWidth * 2); + QSize widgetHint = sizeHint(); + int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth); + setMaximumHeight(std::max({ widgetHint.height(), searchButtonHint.height(), clearButtonHint.height() }) + frameWidth * 2); + setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); } void LineEdit::resizeEvent(QResizeEvent *e) From 96ce409cd18c074880922e8a317a6c548149921c Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Tue, 19 Apr 2016 16:43:17 +0800 Subject: [PATCH 5/6] Enable word wrap for "Run external program" help text --- src/gui/options.ui | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/options.ui b/src/gui/options.ui index 89653b42b..11c8e6d9c 100644 --- a/src/gui/options.ui +++ b/src/gui/options.ui @@ -1319,7 +1319,11 @@ - + + + true + + From 8366fced96d494c33ceb1297547d14c49e7e4b1b Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Wed, 20 Apr 2016 09:06:15 +0800 Subject: [PATCH 6/6] Fix mutually exclusive radio buttons can be unselected. --- src/gui/options.ui | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gui/options.ui b/src/gui/options.ui index 11c8e6d9c..2250351b5 100644 --- a/src/gui/options.ui +++ b/src/gui/options.ui @@ -754,6 +754,9 @@ true + + buttonGroup_2 + @@ -761,6 +764,9 @@ Advanced + + buttonGroup_2 + @@ -3248,5 +3254,6 @@ +