| 1809 | #endif |
| 1810 | |
| 1811 | QWidget* NetworkDiagnosticsDialog::buildLogsTab() |
| 1812 | { |
| 1813 | auto* page = new QWidget(this); |
| 1814 | auto* layout = new QVBoxLayout(page); |
| 1815 | layout->setContentsMargins(8, 8, 8, 8); |
| 1816 | layout->setSpacing(8); |
| 1817 | |
| 1818 | auto* filterGroup = makeDiagnosticsPanel("Filter Categories", page); |
| 1819 | auto* filterGrid = new QGridLayout; |
| 1820 | filterGrid->setContentsMargins(0, 0, 0, 0); |
| 1821 | filterGrid->setHorizontalSpacing(12); |
| 1822 | filterGrid->setVerticalSpacing(4); |
| 1823 | addDiagnosticsPanelContent(filterGroup, filterGrid); |
| 1824 | |
| 1825 | auto* allCategories = new QCheckBox("General", filterGroup); |
| 1826 | allCategories->setProperty("logCategory", QStringLiteral("default")); |
| 1827 | allCategories->setChecked(true); |
| 1828 | allCategories->setToolTip("Uncategorized Qt log output"); |
| 1829 | filterGrid->addWidget(allCategories, 0, 0); |
| 1830 | m_logCategoryCheckboxes.push_back(allCategories); |
| 1831 | m_visibleLogCategories.insert(QStringLiteral("default")); |
| 1832 | connect(allCategories, &QCheckBox::toggled, this, [this](bool on) { |
| 1833 | if (on) { |
| 1834 | m_visibleLogCategories.insert(QStringLiteral("default")); |
| 1835 | } else { |
| 1836 | m_visibleLogCategories.remove(QStringLiteral("default")); |
| 1837 | } |
| 1838 | rebuildLogView(); |
| 1839 | }); |
| 1840 | |
| 1841 | const QList<LogManager::Category> categories = LogManager::instance().categories(); |
| 1842 | constexpr int kColumns = 4; |
| 1843 | int index = 1; |
| 1844 | for (const LogManager::Category& category : categories) { |
| 1845 | auto* checkbox = new QCheckBox(category.label, filterGroup); |
| 1846 | checkbox->setProperty("logCategory", category.id); |
| 1847 | checkbox->setChecked(true); |
| 1848 | checkbox->setToolTip(QString("%1\nCategory: %2").arg(category.description, category.id)); |
| 1849 | m_logCategoryCheckboxes.push_back(checkbox); |
| 1850 | m_visibleLogCategories.insert(category.id); |
| 1851 | filterGrid->addWidget(checkbox, index / kColumns, index % kColumns); |
| 1852 | connect(checkbox, &QCheckBox::toggled, this, [this, id = category.id](bool on) { |
| 1853 | if (on) { |
| 1854 | m_visibleLogCategories.insert(id); |
| 1855 | } else { |
| 1856 | m_visibleLogCategories.remove(id); |
| 1857 | } |
| 1858 | rebuildLogView(); |
| 1859 | }); |
| 1860 | ++index; |
| 1861 | } |
| 1862 | layout->addWidget(filterGroup); |
| 1863 | |
| 1864 | auto* filterButtonRow = new QHBoxLayout; |
| 1865 | auto* selectAllBtn = new QPushButton("Select All", page); |
| 1866 | auto* deselectAllBtn = new QPushButton("Deselect All", page); |
| 1867 | selectAllBtn->setMinimumHeight(32); |
| 1868 | deselectAllBtn->setMinimumHeight(32); |
nothing calls this directly
no test coverage detected