MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / buildUI

Method buildUI

src/gui/SupportDialog.cpp:45–306  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45void 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);

Callers

nothing calls this directly

Calls 13

applyStyleSheetMethod · 0.80
serialMethod · 0.80
QUrlClass · 0.50
categoriesMethod · 0.45
setEnabledMethod · 0.45
logFilePathMethod · 0.45
isConnectedMethod · 0.45
modelMethod · 0.45
versionMethod · 0.45
callsignMethod · 0.45
toStringMethod · 0.45
radioAddressMethod · 0.45

Tested by

no test coverage detected