void AbiWidget::setCustomAbi(const Abi ¤t) { bool blocked = blockSignals(true); d->m_architectureComboBox->setCurrentIndex(static_cast<int>(current.architecture())); d->m_osComboBox->setCurrentIndex(static_cast<int>(current.os())); osChanged(); for (int i = 0; i < d->m_osFlavorComboBox->count(); ++i) { if (d->m_osFlavorComboBox->itemData(i).toInt() == current.osFlavor()) { d->m_osFlavorComboBox->setCurrentIndex(i); break; } } d->m_binaryFormatComboBox->setCurrentIndex(static_cast<int>(current.binaryFormat())); for (int i = 0; i < d->m_wordWidthComboBox->count(); ++i) { if (d->m_wordWidthComboBox->itemData(i).toInt() == current.wordWidth()) { d->m_wordWidthComboBox->setCurrentIndex(i); break; } } if (d->isCustom()) d->m_abi->setItemData(0, current.toString()); blockSignals(blocked); emit abiChanged(); }
void AbiWidget::osChanged() { d->m_osFlavorComboBox->blockSignals(true); d->m_osFlavorComboBox->clear(); Abi::OS os = static_cast<Abi::OS>(d->m_osComboBox->itemData(d->m_osComboBox->currentIndex()).toInt()); QList<Abi::OSFlavor> flavors = Abi::flavorsForOs(os); foreach (Abi::OSFlavor f, flavors) d->m_osFlavorComboBox->addItem(Abi::toString(f), static_cast<int>(f)); d->m_osFlavorComboBox->setCurrentIndex(0); // default to generic flavor d->m_osFlavorComboBox->blockSignals(false); emit abiChanged(); }
void AbiWidget::customAbiChanged() { if (signalsBlocked()) return; Abi current(static_cast<Abi::Architecture>(d->m_architectureComboBox->currentIndex()), static_cast<Abi::OS>(d->m_osComboBox->currentIndex()), static_cast<Abi::OSFlavor>(d->m_osFlavorComboBox->itemData(d->m_osFlavorComboBox->currentIndex()).toInt()), static_cast<Abi::BinaryFormat>(d->m_binaryFormatComboBox->currentIndex()), d->m_wordWidthComboBox->itemData(d->m_wordWidthComboBox->currentIndex()).toInt()); d->m_abi->setItemData(0, current.toString()); emit abiChanged(); }