| 43 | } |
| 44 | |
| 45 | void SupportDialog::buildUI() |
| 46 | { |
| 47 | auto* layout = new QVBoxLayout(this); |
| 48 | layout->setSpacing(8); |
| 49 | |
| 50 | // ── Diagnostic Logging group ────────────────────────────────────────── |
| 51 | auto* logGroup = new QGroupBox("Diagnostic Logging"); |
| 52 | auto* gridLayout = new QGridLayout(logGroup); |
| 53 | gridLayout->setSpacing(4); |
| 54 | |
| 55 | auto& mgr = LogManager::instance(); |
| 56 | const auto cats = mgr.categories(); |
| 57 | int col = 0, row = 0; |
| 58 | constexpr int COLS = 3; |
| 59 | |
| 60 | for (const auto& cat : cats) { |
| 61 | auto* cb = new QCheckBox(cat.label); |
| 62 | cb->setToolTip(cat.description); |
| 63 | cb->setChecked(cat.enabled); |
| 64 | AetherSDR::ThemeManager::instance().applyStyleSheet(cb, "QCheckBox { color: {{color.text.primary}}; }"); |
| 65 | gridLayout->addWidget(cb, row, col); |
| 66 | |
| 67 | connect(cb, &QCheckBox::toggled, this, [id = cat.id](bool on) { |
| 68 | LogManager::instance().setEnabled(id, on); |
| 69 | }); |
| 70 | |
| 71 | m_checkboxes[cat.id] = cb; |
| 72 | if (++col >= COLS) { col = 0; ++row; } |
| 73 | } |
| 74 | |
| 75 | auto* btnRow = new QHBoxLayout; |
| 76 | auto* enableAllBtn = new QPushButton("Enable All"); |
| 77 | auto* disableAllBtn = new QPushButton("Disable All"); |
| 78 | enableAllBtn->setFixedHeight(24); |
| 79 | disableAllBtn->setFixedHeight(24); |
| 80 | connect(enableAllBtn, &QPushButton::clicked, this, &SupportDialog::enableAll); |
| 81 | connect(disableAllBtn, &QPushButton::clicked, this, &SupportDialog::disableAll); |
| 82 | btnRow->addWidget(enableAllBtn); |
| 83 | btnRow->addWidget(disableAllBtn); |
| 84 | btnRow->addStretch(); |
| 85 | |
| 86 | auto* groupLayout = new QVBoxLayout; |
| 87 | groupLayout->addLayout(gridLayout); |
| 88 | groupLayout->addLayout(btnRow); |
| 89 | logGroup->setLayout(groupLayout); |
| 90 | layout->addWidget(logGroup); |
| 91 | |
| 92 | // ── Log file info ───────────────────────────────────────────────────── |
| 93 | auto* fileRow = new QHBoxLayout; |
| 94 | auto* pathLabel = new QLabel(QString("Log: <code>%1</code>").arg( |
| 95 | LogManager::instance().logFilePath())); |
| 96 | pathLabel->setTextFormat(Qt::RichText); |
| 97 | pathLabel->setStyleSheet("color: #8898a8; font-size: 11px;"); |
| 98 | m_sizeLabel = new QLabel; |
| 99 | m_sizeLabel->setStyleSheet("color: #8898a8; font-size: 11px;"); |
| 100 | fileRow->addWidget(pathLabel); |
| 101 | fileRow->addStretch(); |
| 102 | fileRow->addWidget(m_sizeLabel); |
nothing calls this directly
no test coverage detected