| 152 | } |
| 153 | |
| 154 | void QEFIDPEditorView::dpTypeComboBoxCurrentIndexChanged(int index) |
| 155 | { |
| 156 | if (m_dpSubtypeSelector != nullptr && m_dpTypeSelected != index) { |
| 157 | // Change the subtype |
| 158 | m_dpSubtypeSelector->clear(); |
| 159 | int type = (m_dpTypeSelector != nullptr ? m_dpTypeSelector->itemData(index).toInt() : 0); |
| 160 | QList<quint8> subtypes = enum_device_path_subtype((enum QEFIDevicePathType)type); |
| 161 | for (const auto &subtype : std::as_const(subtypes)) { |
| 162 | m_dpSubtypeSelector->addItem(convert_device_path_subtype_to_name((enum QEFIDevicePathType)type, subtype), QVariant(subtype)); |
| 163 | } |
| 164 | |
| 165 | // If we have subtypes, select the first one and create fields |
| 166 | if (!subtypes.isEmpty()) { |
| 167 | m_dpSubtypeSelector->setCurrentIndex(0); |
| 168 | // Manually trigger field creation since setCurrentIndex might not emit signal if already at 0 |
| 169 | int subtype = m_dpSubtypeSelector->itemData(0).toInt(); |
| 170 | QList<QPair<QString, QWidget *>> widgets = constructDPEditView((QEFIDevicePathType)type, (quint8)subtype & 0xFF); |
| 171 | while (m_topLevelLayout->rowCount() > 2) |
| 172 | m_topLevelLayout->removeRow(2); |
| 173 | m_currentWidgets = widgets; |
| 174 | for (const auto &w : std::as_const(m_currentWidgets)) { |
| 175 | m_topLevelLayout->addRow(w.first, w.second); |
| 176 | } |
| 177 | m_dpSubtypeSelected = 0; |
| 178 | } |
| 179 | } |
| 180 | m_dpTypeSelected = index; |
| 181 | } |
| 182 | |
| 183 | void QEFIDPEditorView::dpSubtypeComboBoxCurrentIndexChanged(int index) |
| 184 | { |
nothing calls this directly
no test coverage detected