ui.setupUi(this);
// hide SASL options for older cores
- if (!(Client::coreFeatures() & Quassel::SaslAuthentication))
+ if (!Client::isCoreFeatureEnabled(Quassel::Feature::SaslAuthentication))
ui.sasl->hide();
- if (!(Client::coreFeatures() & Quassel::SaslExternal))
+ if (!Client::isCoreFeatureEnabled(Quassel::Feature::SaslExternal))
ui.saslExtInfo->hide();
#ifndef HAVE_SSL
ui.saslExtInfo->hide();
reset();
// Handle UI dependent on core feature flags here
- if (Client::coreFeatures() & Quassel::CustomRateLimits) {
+ if (Client::isCoreFeatureEnabled(Quassel::Feature::CustomRateLimits)) {
// Custom rate limiting supported, allow toggling
ui.useCustomMessageRate->setEnabled(true);
// Reset tooltip to default.
void NetworksSettingsPage::setNetworkCapStates(NetworkId id)
{
const Network *net = Client::network(id);
- if ((Client::coreFeatures() & Quassel::CapNegotiation) && net) {
+ if (Client::isCoreFeatureEnabled(Quassel::Feature::CapNegotiation) && net) {
// Capability negotiation is supported, network exists.
// Check if the network is connected. Don't use net->isConnected() as that won't be true
// during capability negotiation when capabilities are added and removed.
#ifdef HAVE_SSL
// this is only needed when the core supports SASL EXTERNAL
- if (Client::coreFeatures() & Quassel::SaslExternal) {
+ if (Client::isCoreFeatureEnabled(Quassel::Feature::SaslExternal)) {
if (_cid) {
disconnect(_cid, SIGNAL(sslSettingsUpdated()), this, SLOT(sslUpdated()));
delete _cid;
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);
}
}
// Do NOT call updateSslPort when loading settings, otherwise port settings may be overriden.
// If useSSL is later changed to be checked by default, change port's default value, too.
- if (Client::coreFeatures() & Quassel::VerifyServerSSL) {
+ if (Client::isCoreFeatureEnabled(Quassel::Feature::VerifyServerSSL)) {
// Synchronize requiring SSL with the use SSL checkbox
ui.sslVerify->setEnabled(ui.useSSL->isChecked());
connect(ui.useSSL, SIGNAL(toggled(bool)), ui.sslVerify, SLOT(setEnabled(bool)));
// Do NOT call updateSslPort when loading settings, otherwise port settings may be overriden.
// If useSSL is later changed to be checked by default, change port's default value, too.
- if (Client::coreFeatures() & Quassel::VerifyServerSSL) {
+ if (Client::isCoreFeatureEnabled(Quassel::Feature::VerifyServerSSL)) {
// Synchronize requiring SSL with the use SSL checkbox
ui.sslVerify->setEnabled(ui.useSSL->isChecked());
connect(ui.useSSL, SIGNAL(toggled(bool)), ui.sslVerify, SLOT(setEnabled(bool)));