void BuildingComponentDialogCentralWidget::componentDownloadComplete(const std::string& uid, const boost::optional<BCLComponent>& component)
{
  QObject* sender = this->sender();
  if (sender){
    sender->deleteLater();
  }

  if (component){
    // good
    // remove old component
    boost::optional<BCLComponent> oldComponent = LocalBCL::instance().getComponent(component->uid());
    if (oldComponent && oldComponent->versionId() != component->versionId()){
      LocalBCL::instance().removeComponent(*oldComponent);
    }
  }else{
    // error downloading component
    // find component in list by uid and re-enable
    for (Component* component : m_collapsibleComponentList->components()) {
      if (component->uid() == uid){
        component->checkBox()->setEnabled(true);
        break;
      }
    }
  }

  m_pendingDownloads.erase(uid);
  if (m_pendingDownloads.empty()){
    // show not busy
    m_progressBar->setValue(0);
    m_progressBar->setMinimum(0);
    m_progressBar->setMaximum(0);
    m_progressBar->setVisible(false);
    m_showNewComponents = true;
  }
}