bool CGUIWindowManager::HasModalDialog(const std::vector<DialogModalityType>& types) const
{
  CSingleLock lock(g_graphicsContext);
  for (ciDialog it = m_activeDialogs.begin(); it != m_activeDialogs.end(); ++it)
  {
    if ((*it)->IsDialog() &&
        (*it)->IsModalDialog() &&
        !(*it)->IsAnimating(ANIM_TYPE_WINDOW_CLOSE))
    {
      if (!types.empty())
      {
        CGUIDialog *dialog = static_cast<CGUIDialog*>(*it);
        for (const auto &type : types)
        {
          if (dialog->GetModalityType() == type)
            return true;
        }
      }
      else
        return true;
    }
  }
  return false;
}
Example #2
0
bool CGUIWindowManager::HasModalDialog(const std::vector<DialogModalityType>& types, bool ignoreClosing /* = true */) const
{
  CSingleLock lock(g_graphicsContext);
  for (const auto& window : m_activeDialogs)
  {
    if (window->IsDialog() &&
        window->IsModalDialog() &&
        (!ignoreClosing || !window->IsAnimating(ANIM_TYPE_WINDOW_CLOSE)))
    {
      if (!types.empty())
      {
        CGUIDialog *dialog = static_cast<CGUIDialog*>(window);
        for (const auto &type : types)
        {
          if (dialog->GetModalityType() == type)
            return true;
        }
      }
      else
        return true;
    }
  }
  return false;
}