本文整理汇总了C++中CFileItemPtr::HasAddonInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileItemPtr::HasAddonInfo方法的具体用法?C++ CFileItemPtr::HasAddonInfo怎么用?C++ CFileItemPtr::HasAddonInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileItemPtr
的用法示例。
在下文中一共展示了CFileItemPtr::HasAddonInfo方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetService
bool CGUIDialogSubtitles::SetService(const std::string &service)
{
if (service != m_currentService)
{
m_currentService = service;
CLog::Log(LOGDEBUG, "New Service [%s] ", m_currentService.c_str());
CFileItemPtr currentService = GetService();
// highlight this item in the skin
for (int i = 0; i < m_serviceItems->Size(); i++)
{
CFileItemPtr pItem = m_serviceItems->Get(i);
pItem->Select(pItem == currentService);
}
SET_CONTROL_LABEL(CONTROL_NAMELABEL, currentService->GetLabel());
if (currentService->HasAddonInfo())
{
std::string icon = URIUtils::AddFileToFolder(currentService->GetAddonInfo()->Path(), "logo.png");
SET_CONTROL_FILENAME(CONTROL_NAMELOGO, icon);
}
if (g_application.m_pPlayer->GetSubtitleCount() == 0)
SET_CONTROL_HIDDEN(CONTROL_SUBSEXIST);
else
SET_CONTROL_VISIBLE(CONTROL_SUBSEXIST);
return true;
}
return false;
}
示例2: GetContextButtons
void CGUIWindowGames::GetContextButtons(int itemNumber, CContextButtons &buttons)
{
CFileItemPtr item = m_vecItems->Get(itemNumber);
if (item && !item->GetProperty("pluginreplacecontextitems").asBoolean())
{
if (m_vecItems->IsVirtualDirectoryRoot() || m_vecItems->IsSourcesPath())
{
// Context buttons for a sources path, like "Add source", "Remove Source", etc.
CGUIDialogContextMenu::GetContextButtons("games", item, buttons);
}
else
{
if (item->IsGame())
{
buttons.Add(CONTEXT_BUTTON_PLAY_ITEM, 208); // Play
}
if (!m_vecItems->IsPlugin() && item->HasAddonInfo())
buttons.Add(CONTEXT_BUTTON_INFO, 24003); // Add-on information
if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_ALLOWFILEDELETION) && !item->IsReadOnly())
{
buttons.Add(CONTEXT_BUTTON_DELETE, 117);
buttons.Add(CONTEXT_BUTTON_RENAME, 118);
}
}
}
CGUIMediaWindow::GetContextButtons(itemNumber, buttons);
}
示例3: SetItem
bool CGUIDialogAddonInfo::SetItem(const CFileItemPtr& item)
{
if (!item || !item->HasAddonInfo())
return false;
m_item = item;
m_localAddon.reset();
CAddonMgr::GetInstance().GetAddon(item->GetAddonInfo()->ID(), m_localAddon, ADDON_UNKNOWN, false);
return true;
}
示例4: SetItem
bool CGUIDialogAddonInfo::SetItem(const CFileItemPtr& item)
{
if (!item || !item->HasAddonInfo())
return false;
m_item = std::make_shared<CFileItem>(*item);
m_localAddon.reset();
CServiceBroker::GetAddonMgr().GetAddon(item->GetAddonInfo()->ID(), m_localAddon, ADDON_UNKNOWN, false);
return true;
}
示例5: OnClickMsg
bool CGUIWindowGames::OnClickMsg(int controlId, int actionId)
{
if (!m_viewControl.HasControl(controlId)) // list/thumb control
return false;
const int iItem = m_viewControl.GetSelectedItem();
CFileItemPtr pItem = m_vecItems->Get(iItem);
if (!pItem)
return false;
switch (actionId)
{
case ACTION_DELETE_ITEM:
{
// Is delete allowed?
if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_ALLOWFILEDELETION))
{
OnDeleteItem(iItem);
return true;
}
break;
}
case ACTION_PLAYER_PLAY:
{
if (OnClick(iItem))
return true;
break;
}
case ACTION_SHOW_INFO:
{
if (!m_vecItems->IsPlugin())
{
if (pItem->HasAddonInfo())
{
CGUIDialogAddonInfo::ShowForItem(pItem);
return true;
}
}
break;
}
default:
break;
}
return false;
}