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

View file

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