fix: settings dialog can have tls options enabled when they should not be leading to a case where tls gen fails as it not enabled fixes 7883

This commit is contained in:
sithlord48 2025-02-24 19:13:03 -05:00 committed by Chris Rizzitello
parent 5b54849fd6
commit 193c28af53
2 changed files with 72 additions and 64 deletions

View file

@ -240,6 +240,7 @@ void SettingsDialog::loadFromConfig()
else
ui->rb_icon_mono->setChecked(true);
qDebug() << "load from config done";
updateTlsControls();
}
@ -255,12 +256,18 @@ void SettingsDialog::updateTlsControls()
const auto tlsEnabled = m_tlsUtility.isEnabled();
const auto writable = m_appConfig.isActiveScopeWritable();
const auto enabled = writable && tlsEnabled;
ui->m_pLineEditTlsCertPath->setText(m_appConfig.tlsCertPath());
ui->chkRequireClientCert->setChecked(m_appConfig.requireClientCerts());
ui->m_pCheckBoxEnableTls->setChecked(tlsEnabled);
ui->m_pCheckBoxEnableTls->setEnabled(writable);
ui->m_pCheckBoxEnableTls->setChecked(writable && tlsEnabled);
ui->m_pLineEditTlsCertPath->setText(m_appConfig.tlsCertPath());
ui->chkRequireClientCert->setEnabled(writable);
ui->chkRequireClientCert->setChecked(m_appConfig.requireClientCerts());
ui->m_pComboBoxTlsKeyLength->setEnabled(enabled);
ui->widgetTlsCert->setEnabled(enabled);
ui->m_pLabelTlsKeyLength->setEnabled(enabled);
ui->m_pPushButtonTlsRegenCert->setEnabled(enabled);
ui->chkRequireClientCert->setEnabled(enabled);
}
void SettingsDialog::updateTlsControlsEnabled()
@ -273,8 +280,7 @@ void SettingsDialog::updateTlsControlsEnabled()
ui->m_pLabelTlsKeyLength->setEnabled(enabled);
ui->m_pComboBoxTlsKeyLength->setEnabled(enabled);
ui->m_pLabelTlsCert->setEnabled(enabled);
ui->m_pLineEditTlsCertPath->setEnabled(enabled);
ui->m_pPushButtonTlsCertPath->setEnabled(enabled);
ui->widgetTlsCert->setEnabled(enabled);
ui->m_pPushButtonTlsRegenCert->setEnabled(enabled);
ui->chkRequireClientCert->setEnabled(enabled);
}

View file

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>550</width>
<height>652</height>
<height>684</height>
</rect>
</property>
<property name="windowTitle">
@ -275,63 +275,65 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<property name="topMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="m_pLabelTlsCert">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Certificate</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Policy::Minimum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>30</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLineEdit" name="m_pLineEditTlsCertPath">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="m_pPushButtonTlsCertPath">
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="text">
<string/>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
<widget class="QWidget" name="widgetTlsCert" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_6">
<property name="topMargin">
<number>1</number>
</property>
<item>
<widget class="QLabel" name="m_pLabelTlsCert">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Certificate</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Policy::Minimum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>30</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLineEdit" name="m_pLineEditTlsCertPath">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="m_pPushButtonTlsCertPath">
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="text">
<string/>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_7">