void QmitkServiceListWidget::OnServiceEvent(const us::ServiceEvent event){
  //MITK_INFO << "ServiceEvent" << event.GetType();
  switch (event.GetType())
  {
    case us::ServiceEvent::MODIFIED:
      emit(ServiceModified(event.GetServiceReference()));

      // Change service; add a new entry if service wasn't on list before
      if ( ! this->ChangeServiceOnList(event.GetServiceReference()) )
      {
        this->AddServiceToList(event.GetServiceReference());
      }
      break;
    case us::ServiceEvent::REGISTERED:
      emit(ServiceRegistered(event.GetServiceReference()));
      AddServiceToList(event.GetServiceReference());
      break;
    case us::ServiceEvent::UNREGISTERING:
      emit(ServiceUnregistering(event.GetServiceReference()));
      RemoveServiceFromList(event.GetServiceReference());
      break;
    case us::ServiceEvent::MODIFIED_ENDMATCH:
      emit(ServiceModifiedEndMatch(event.GetServiceReference()));
      RemoveServiceFromList(event.GetServiceReference());
      break;
  }
}
示例#2
0
void QmitkServiceListWidget::OnServiceEvent(const mitk::ServiceEvent event){

  //MITK_INFO << "ServiceEvent" << event.GetType();
  switch (event.GetType())
  {
    case mitk::ServiceEvent::MODIFIED:
      emit(ServiceModified(event.GetServiceReference()));
      RemoveServiceFromList(event.GetServiceReference());
      AddServiceToList(event.GetServiceReference());
      break;
    case mitk::ServiceEvent::REGISTERED:
      emit(ServiceRegistered(event.GetServiceReference()));
      AddServiceToList(event.GetServiceReference());
      break;
    case mitk::ServiceEvent::UNREGISTERING:
      emit(ServiceUnregistering(event.GetServiceReference()));
      RemoveServiceFromList(event.GetServiceReference());
      break;
    case mitk::ServiceEvent::MODIFIED_ENDMATCH:
      emit(ServiceModifiedEndMatch(event.GetServiceReference()));
      RemoveServiceFromList(event.GetServiceReference());
      break;
  }
}