bool UIFirstRunWzdPage3::validatePage() { startProcessing(); bool fResult = insertDevice(); endProcessing(); return fResult; }
void LinuxDeviceManager::processDeviceInsertion(struct udev_device *dev) { log->debug("Processing device insertion"); Pointer<LinuxDevice> device = makePointer<LinuxDevice>(dev); insertDevice(device); DeviceInserted(device); return; }
//-------------------------------------------------------------------------------------- //! Update the list of devices when a device changes //-------------------------------------------------------------------------------------- void tNDP2kDevicePage::OnDeviceChanged(const tN2kName &N2kName) { tNDP2kDevice *pDevice; if(tGlobal<tNDP2k>::Instance()->DeviceManager().NameToDevice(N2kName, &pDevice)) { if(pDevice->IsAlive()) { if (m_DeviceList.contains(pDevice)) { // Search for device in table for (int row=0; row < m_pTableWidget->rowCount(); ++row) { if (m_pTableWidget->item(row, m_NameColumn)->text() == pDevice->HexName()) { rowChanged(row, pDevice); if (m_SortOption >= 0) { if ( m_pTableWidget->IsScrolling() == false ) { Sort(); } } break; } } } else { // Add the device if missing from the list m_DeviceList.prepend(pDevice); // Insert device at the beginning of the table (they are sorted anyhow) insertDevice(pDevice, 0); if( pDevice->ProductCode() == N2K_PRESSURE_ID ) { tPressureSensorProxy proxy( pDevice->N2kName() ); proxy.RequestPressureConfiguration( ); } if ( m_pTableWidget->IsScrolling() == false ) { Sort(); //always update the selection, even if the sortOption is < 0 } } } else // Device IsALive == false { if (m_DeviceList.contains(pDevice)) // Device Lost { // Search for device in table for (int row=0; row < m_pTableWidget->rowCount(); ++row) { if (m_pTableWidget->item(row, m_NameColumn)->text() == pDevice->HexName()) { m_pTableWidget->removeRow(row); m_DeviceList.removeOne(pDevice); break; } } } } } }