From: Shane Synan Date: Sat, 7 Jan 2017 01:52:01 +0000 (-0600) Subject: Fix SASL appearing active when Use SASL unchecked X-Git-Tag: travis-deploy-test~315 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=1e936d5f780e6fd410f114980057d48477435d83;hp=8265e0f7f750f7ae7a4a8a163b2bd42e8edb4998 Fix SASL appearing active when Use SASL unchecked Workaround SASL contents getting enabled irrespective of Use SASL checkbox whenever sslUpdated() determines the identity does not have an SSL key. Simplify SASL EXTERNAL UI hide/show logic by adding an invisible frame inside sasl QGroupBox containing all child widgets. Only the frame is enabled and disabled. Fixes SASL account and password showing up as enabled when Use SASL was not checked. Resolves GH-267. --- diff --git a/src/qtui/settingspages/networkssettingspage.cpp b/src/qtui/settingspages/networkssettingspage.cpp index db51da3e..cc8dda2a 100644 --- a/src/qtui/settingspages/networkssettingspage.cpp +++ b/src/qtui/settingspages/networkssettingspage.cpp @@ -746,16 +746,21 @@ void NetworksSettingsPage::setSASLStatus(const CapSupportStatus saslStatus) void NetworksSettingsPage::sslUpdated() { if (_cid && !_cid->sslKey().isNull()) { - ui.saslAccount->setDisabled(true); - ui.saslAccountLabel->setDisabled(true); - ui.saslPassword->setDisabled(true); - ui.saslPasswordLabel->setDisabled(true); + ui.saslContents->setDisabled(true); ui.saslExtInfo->setHidden(false); } else { - ui.saslAccount->setDisabled(false); - ui.saslAccountLabel->setDisabled(false); - ui.saslPassword->setDisabled(false); - ui.saslPasswordLabel->setDisabled(false); + ui.saslContents->setDisabled(false); + // Directly re-enabling causes the widgets to ignore the parent "Use SASL Authentication" + // state to indicate whether or not it's disabled. To workaround this, keep track of + // whether or not "Use SASL Authentication" is enabled, then quickly uncheck/recheck the + // group box. + if (!ui.sasl->isChecked()) { + // SASL is not enabled, uncheck/recheck the group box to re-disable saslContents. + // Leaving saslContents disabled doesn't work as that prevents it from re-enabling if + // sasl is later checked. + ui.sasl->setChecked(true); + ui.sasl->setChecked(false); + } ui.saslExtInfo->setHidden(true); } } diff --git a/src/qtui/settingspages/networkssettingspage.ui b/src/qtui/settingspages/networkssettingspage.ui index 5598e9a6..8426dd0c 100644 --- a/src/qtui/settingspages/networkssettingspage.ui +++ b/src/qtui/settingspages/networkssettingspage.ui @@ -682,85 +682,112 @@ Note that Quassel IRC automatically rejoins channels, so /join will rarely be ne - - - - - true - - - Account name, often the same as your nickname - - - - - - - - - - true - - - Account: - - - - - - - true - - - Account password - - - QLineEdit::Password - - - - - - - true - - - Password: - - - - - - - - - - - [icon] - - - - - - - - 0 - 0 - - - - Could not detect if supported by server - - - - - - - Details... - - - - + + + QFrame::NoFrame + + + QFrame::Plain + + + 0 + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + true + + + Account name, often the same as your nickname + + + + + + + + + + true + + + Account: + + + + + + + true + + + Account password + + + QLineEdit::Password + + + + + + + true + + + Password: + + + + + + + + + + + [icon] + + + + + + + + 0 + 0 + + + + Could not detect if supported by server + + + + + + + Details... + + + + + + +