Example #1
0
void CGUIDialogContentSettings::SetupPage()
{
  if (m_content == CONTENT_NONE)
  {
    m_bShowScanSettings = false;
    SET_CONTROL_HIDDEN(CONTROL_SCRAPER_LIST);
    CONTROL_DISABLE(CONTROL_SCRAPER_SETTINGS);
  }
  else
  {
    FillListControl();
    SET_CONTROL_VISIBLE(CONTROL_SCRAPER_LIST);
    if (m_scraper && m_scraper->Enabled())
    {
      m_bShowScanSettings = true;
      ScraperPtr scraper = boost::dynamic_pointer_cast<CScraper>(m_scraper);
      if (scraper && scraper->Supports(m_content) && scraper->HasSettings())
        CONTROL_ENABLE(CONTROL_SCRAPER_SETTINGS);
    }
    else
      CONTROL_DISABLE(CONTROL_SCRAPER_SETTINGS);
  }

  CreateSettings();
  CGUIDialogSettings::SetupPage();
  SET_CONTROL_VISIBLE(CONTROL_CONTENT_TYPE);
}
void CGUIDialogContentSettings::SetupPage()
{
  CGUIMessage msgReset(GUI_MSG_LABEL_RESET, GetID(), CONTROL_SCRAPER_LIST);
  OnMessage(msgReset);
  m_vecItems->Clear();
  if (m_content == CONTENT_NONE)
  {
    m_bShowScanSettings = false;
    SET_CONTROL_HIDDEN(CONTROL_SCRAPER_LIST);
    CONTROL_DISABLE(CONTROL_SCRAPER_SETTINGS);
  }
  else
  {
    FillListControl();
    SET_CONTROL_VISIBLE(CONTROL_SCRAPER_LIST);
    if (m_scraper && m_scraper->Enabled())
    {
      m_bShowScanSettings = true;
      ScraperPtr scraper = boost::dynamic_pointer_cast<CScraper>(m_scraper);
      if (scraper && scraper->Supports(m_content) && scraper->HasSettings())
        CONTROL_ENABLE(CONTROL_SCRAPER_SETTINGS);
    }
    else
      CONTROL_DISABLE(CONTROL_SCRAPER_SETTINGS);
  }

  CreateSettings();
  CGUIDialogSettings::SetupPage();
  SET_CONTROL_VISIBLE(CONTROL_CONTENT_TYPE);
}