当前位置: 首页>>代码示例>>C++>>正文


C++ CFileItemPtr::GetIconImage方法代码示例

本文整理汇总了C++中CFileItemPtr::GetIconImage方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileItemPtr::GetIconImage方法的具体用法?C++ CFileItemPtr::GetIconImage怎么用?C++ CFileItemPtr::GetIconImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CFileItemPtr的用法示例。


在下文中一共展示了CFileItemPtr::GetIconImage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ChooseAndSetNewThumbnail

bool CGUIDialogFavourites::ChooseAndSetNewThumbnail(const CFileItemPtr &item)
{
  CFileItemList prefilledItems;
  if (item->HasArt("thumb"))
  {
    const CFileItemPtr current(std::make_shared<CFileItem>("thumb://Current", false));
    current->SetArt("thumb", item->GetArt("thumb"));
    current->SetLabel(g_localizeStrings.Get(20016)); // Current thumb
    prefilledItems.Add(current);
  }

  const CFileItemPtr none(std::make_shared<CFileItem>("thumb://None", false));
  none->SetIconImage(item->GetIconImage());
  none->SetLabel(g_localizeStrings.Get(20018)); // No thumb
  prefilledItems.Add(none);

  std::string thumb;
  VECSOURCES sources;
  g_mediaManager.GetLocalDrives(sources);
  if (CGUIDialogFileBrowser::ShowAndGetImage(prefilledItems, sources, g_localizeStrings.Get(1030), thumb)) // Browse for image
  {
    item->SetArt("thumb", thumb);
    return true;
  }
  return false;
}
开发者ID:68foxboris,项目名称:xbmc,代码行数:26,代码来源:GUIDialogFavourites.cpp

示例2: OnSetThumb

void CGUIDialogFavourites::OnSetThumb(int item)
{
  if (item < 0 || item >= m_favourites->Size())
    return;

  CFileItemPtr pItem = (*m_favourites)[item];

  CFileItemList items;

  // Current
  if (pItem->HasArt("thumb"))
  {
    CFileItemPtr current(new CFileItem("thumb://Current", false));
    current->SetArt("thumb", pItem->GetArt("thumb"));
    current->SetLabel(g_localizeStrings.Get(20016));
    items.Add(current);
  }

  // None
  CFileItemPtr none(new CFileItem("thumb://None", false));
  none->SetIconImage(pItem->GetIconImage());
  none->SetLabel(g_localizeStrings.Get(20018));
  items.Add(none);

  CStdString thumb;
  VECSOURCES sources;
  g_mediaManager.GetLocalDrives(sources);
  if (!CGUIDialogFileBrowser::ShowAndGetImage(items, sources, g_localizeStrings.Get(1030), thumb))
    return;

  (*m_favourites)[item]->SetArt("thumb", thumb);
  CFavourites::Save(*m_favourites);
  UpdateList();
}
开发者ID:2BReality,项目名称:xbmc,代码行数:34,代码来源:GUIDialogFavourites.cpp

示例3: OnClickButtonChannelLogo

bool CGUIDialogPVRChannelManager::OnClickButtonChannelLogo(CGUIMessage &message)
{
  CFileItemPtr pItem = m_channelItems->Get(m_iSelected);
  if (!pItem)
    return false;
  if (g_settings.GetCurrentProfile().canWriteSources() && !g_passwordManager.IsProfileLockUnlocked())
    return false;
  else if (!g_passwordManager.IsMasterLockUnlocked(true))
    return false;

  // setup our thumb list
  CFileItemList items;

  // add the current thumb, if available
  if (!pItem->GetProperty("Icon").asString().empty())
  {
    CFileItemPtr current(new CFileItem("thumb://Current", false));
    current->SetArt("thumb", pItem->GetPVRChannelInfoTag()->IconPath());
    current->SetLabel(g_localizeStrings.Get(20016));
    items.Add(current);
  }
  else if (pItem->HasArt("thumb"))
  { // already have a thumb that the share doesn't know about - must be a local one, so we mayaswell reuse it.
    CFileItemPtr current(new CFileItem("thumb://Current", false));
    current->SetArt("thumb", pItem->GetArt("thumb"));
    current->SetLabel(g_localizeStrings.Get(20016));
    items.Add(current);
  }

  // and add a "no thumb" entry as well
  CFileItemPtr nothumb(new CFileItem("thumb://None", false));
  nothumb->SetIconImage(pItem->GetIconImage());
  nothumb->SetLabel(g_localizeStrings.Get(20018));
  items.Add(nothumb);

  CStdString strThumb;
  VECSOURCES shares;
  if (g_guiSettings.GetString("pvrmenu.iconpath") != "")
  {
    CMediaSource share1;
    share1.strPath = g_guiSettings.GetString("pvrmenu.iconpath");
    share1.strName = g_localizeStrings.Get(19018);
    shares.push_back(share1);
  }
  g_mediaManager.GetLocalDrives(shares);
  if (!CGUIDialogFileBrowser::ShowAndGetImage(items, shares, g_localizeStrings.Get(1030), strThumb))
    return false;

  if (strThumb == "thumb://Current")
    return true;

  if (strThumb == "thumb://None")
    strThumb = "";

  pItem->SetProperty("Icon", strThumb);
  pItem->SetProperty("Changed", true);
  m_bContainsChanges = true;
  return true;
}
开发者ID:AFFLUENTSOCIETY,项目名称:SPMC,代码行数:59,代码来源:GUIDialogPVRChannelManager.cpp

示例4: OnContextButton


//.........这里部分代码省略.........
        return false;
      else if (!g_passwordManager.IsMasterLockUnlocked(true))
        return false;

      // setup our thumb list
      CFileItemList items;

      // add the current thumb, if available
      if (!share->m_strThumbnailImage.empty())
      {
        CFileItemPtr current(new CFileItem("thumb://Current", false));
        current->SetArt("thumb", share->m_strThumbnailImage);
        current->SetLabel(g_localizeStrings.Get(20016));
        items.Add(current);
      }
      else if (item->HasArt("thumb"))
      { // already have a thumb that the share doesn't know about - must be a local one, so we mayaswell reuse it.
        CFileItemPtr current(new CFileItem("thumb://Current", false));
        current->SetArt("thumb", item->GetArt("thumb"));
        current->SetLabel(g_localizeStrings.Get(20016));
        items.Add(current);
      }
      // see if there's a local thumb for this item
      std::string folderThumb = item->GetFolderThumb();
      if (XFILE::CFile::Exists(folderThumb))
      {
        CFileItemPtr local(new CFileItem("thumb://Local", false));
        local->SetArt("thumb", folderThumb);
        local->SetLabel(g_localizeStrings.Get(20017));
        items.Add(local);
      }
      // and add a "no thumb" entry as well
      CFileItemPtr nothumb(new CFileItem("thumb://None", false));
      nothumb->SetIconImage(item->GetIconImage());
      nothumb->SetLabel(g_localizeStrings.Get(20018));
      items.Add(nothumb);

      std::string strThumb;
      VECSOURCES shares;
      g_mediaManager.GetLocalDrives(shares);
      if (!CGUIDialogFileBrowser::ShowAndGetImage(items, shares, g_localizeStrings.Get(1030), strThumb))
        return false;

      if (strThumb == "thumb://Current")
        return true;

      if (strThumb == "thumb://Local")
        strThumb = folderThumb;

      if (strThumb == "thumb://None")
        strThumb = "";

      if (!share->m_ignore)
      {
        CMediaSourceSettings::GetInstance().UpdateSource(type,share->strName,"thumbnail",strThumb);
        CMediaSourceSettings::GetInstance().Save();
      }
      else if (!strThumb.empty())
      { // this is some sort of an auto-share, so store in the texture database
        CTextureDatabase db;
        if (db.Open())
          db.SetTextureForPath(item->GetPath(), "thumb", strThumb);
      }

      CGUIMessage msg(GUI_MSG_NOTIFY_ALL,0,0,GUI_MSG_UPDATE_SOURCES);
      g_windowManager.SendThreadMessage(msg);
开发者ID:anaconda,项目名称:xbmc,代码行数:67,代码来源:GUIDialogContextMenu.cpp

示例5: OnContextButton


//.........这里部分代码省略.........

      // setup our thumb list
      CFileItemList items;

      // add the current thumb, if available
      if (!share->m_strThumbnailImage.IsEmpty())
      {
        CFileItemPtr current(new CFileItem("thumb://Current", false));
        current->SetThumbnailImage(share->m_strThumbnailImage);
        current->SetLabel(g_localizeStrings.Get(20016));
        items.Add(current);
      }
      else if (item->HasThumbnail())
      { // already have a thumb that the share doesn't know about - must be a local one, so we mayaswell reuse it.
        CFileItemPtr current(new CFileItem("thumb://Current", false));
        current->SetThumbnailImage(item->GetThumbnailImage());
        current->SetLabel(g_localizeStrings.Get(20016));
        items.Add(current);
      }
      // see if there's a local thumb for this item
      CStdString folderThumb = item->GetFolderThumb();
      if (XFILE::CFile::Exists(folderThumb))
      { // cache it
        if (CPicture::CreateThumbnail(folderThumb, item->GetCachedProgramThumb()))
        {
          CFileItemPtr local(new CFileItem("thumb://Local", false));
          local->SetThumbnailImage(item->GetCachedProgramThumb());
          local->SetLabel(g_localizeStrings.Get(20017));
          items.Add(local);
        }
      }
      // and add a "no thumb" entry as well
      CFileItemPtr nothumb(new CFileItem("thumb://None", false));
      nothumb->SetIconImage(item->GetIconImage());
      nothumb->SetLabel(g_localizeStrings.Get(20018));
      items.Add(nothumb);

      CStdString strThumb;
      VECSOURCES shares;
      g_mediaManager.GetLocalDrives(shares);
      if (!CGUIDialogFileBrowser::ShowAndGetImage(items, shares, g_localizeStrings.Get(1030), strThumb))
        return false;

      if (strThumb == "thumb://Current")
        return true;

      if (strThumb == "thumb://None")
        strThumb = "";

      if (!share->m_ignore)
      {
        g_settings.UpdateSource(type,share->strName,"thumbnail",strThumb);
        g_settings.SaveSources();
      }
      else if (!strThumb.IsEmpty())
      { // this is icky as we have to cache using a bunch of different criteria
        CStdString cachedThumb;
        if (type == "music")
        {
          cachedThumb = item->m_strPath;
          CUtil::RemoveSlashAtEnd(cachedThumb);
          cachedThumb = CUtil::GetCachedMusicThumb(cachedThumb);
    }
        else if (type == "video")
          cachedThumb = item->GetCachedVideoThumb();
        else if (type == "pictures")
开发者ID:Kr0nZ,项目名称:boxee,代码行数:67,代码来源:GUIDialogContextMenu.cpp


注:本文中的CFileItemPtr::GetIconImage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。