Skip to content

Commit f6f9a52

Browse files
committed
fix(ui): update StatusTab to conditionally display fields
* Adjusted the display of GnuPG Offline Mode and Pinentry Program Path to only show when the OpenPGP engine is supported. * Improved the logic for secure level string creation.
1 parent a51bdac commit f6f9a52

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

src/ui/dialog/help/AboutDialog.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ StatusTab::StatusTab(QWidget* parent) : QWidget(parent) {
316316
main_layout->setContentsMargins(18, 18, 18, 18);
317317
main_layout->setSpacing(14);
318318

319-
const QString secure_level_str = [this, secure_level]() {
319+
const QString secure_level_str = [secure_level]() {
320320
switch (secure_level) {
321321
case 0:
322322
return tr("Default");
@@ -354,11 +354,14 @@ StatusTab::StatusTab(QWidget* parent) : QWidget(parent) {
354354
CreateValueLabel(portable_mode_str, status_widget));
355355
status_form->addRow(tr("Self-Check Status:"),
356356
CreateValueLabel(self_check_str, status_widget));
357-
status_form->addRow(tr("GnuPG Offline Mode:"),
358-
CreateValueLabel(gnupg_offline_mode_str, status_widget));
359-
status_form->addRow(
360-
tr("Pinentry Program Path:"),
361-
CreateValueLabel(pinentry_program_path_str, status_widget));
357+
if (GetGSS().IsEngineSupported(OpenPGPEngine::kGNUPG)) {
358+
status_form->addRow(
359+
tr("GnuPG Offline Mode:"),
360+
CreateValueLabel(gnupg_offline_mode_str, status_widget));
361+
status_form->addRow(
362+
tr("Pinentry Program Path:"),
363+
CreateValueLabel(pinentry_program_path_str, status_widget));
364+
}
362365

363366
main_layout->addWidget(
364367
CreateCard(tr("Application Status"), status_widget, content));

0 commit comments

Comments
 (0)