本文整理汇总了C++中AddonPtr::HasSettings方法的典型用法代码示例。如果您正苦于以下问题:C++ AddonPtr::HasSettings方法的具体用法?C++ AddonPtr::HasSettings怎么用?C++ AddonPtr::HasSettings使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AddonPtr
的用法示例。
在下文中一共展示了AddonPtr::HasSettings方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShowAndGetInput
// \brief Show CGUIDialogOK dialog, then wait for user to dismiss it.
bool CGUIDialogAddonSettings::ShowAndGetInput(const AddonPtr &addon, bool saveToDisk /* = true */)
{
if (!addon)
return false;
if (!g_passwordManager.CheckMenuLock(WINDOW_ADDON_BROWSER))
return false;
bool ret(false);
if (addon->HasSettings())
{
// Create the dialog
CGUIDialogAddonSettings* pDialog = NULL;
pDialog = (CGUIDialogAddonSettings*) g_windowManager.GetWindow(WINDOW_DIALOG_ADDON_SETTINGS);
if (!pDialog)
return false;
// Set the heading
std::string heading = StringUtils::Format("$LOCALIZE[10004] - %s", addon->Name().c_str()); // "Settings - AddonName"
pDialog->m_strHeading = heading;
pDialog->m_addon = addon;
pDialog->m_saveToDisk = saveToDisk;
pDialog->DoModal();
ret = true;
}
else
{ // addon does not support settings, inform user
CGUIDialogOK::ShowAndGetInput(24000,0,24030,0);
}
return ret;
}
示例2: HaveMenuHooks
//@{
bool CActiveAEDSP::HaveMenuHooks(AE_DSP_MENUHOOK_CAT cat, int iDSPAddonID)
{
CSingleLock lock(m_critSection);
for (AE_DSP_ADDONMAP_CITR citr = m_addonMap.begin(); citr != m_addonMap.end(); ++citr)
{
if (citr->second->ReadyToUse())
{
if (citr->second->HaveMenuHooks(cat))
{
if (iDSPAddonID > 0 && citr->second->GetID() == iDSPAddonID)
return true;
else if (iDSPAddonID < 0)
return true;
}
else if (cat == AE_DSP_MENUHOOK_SETTING)
{
AddonPtr addon;
if (CServiceBroker::GetAddonMgr().GetAddon(citr->second->ID(), addon) && addon->HasSettings())
return true;
}
}
}
return false;
}
示例3: GetContextButtons
void CGUIWindowAddonBrowser::GetContextButtons(int itemNumber, CContextButtons& buttons)
{
if (itemNumber < 0 || itemNumber >= m_vecItems->Size())
return;
CFileItemPtr pItem = m_vecItems->Get(itemNumber);
std::string addonId = pItem->GetProperty("Addon.ID").asString();
if (!addonId.empty())
{
buttons.Add(CONTEXT_BUTTON_INFO, 24003);
AddonPtr addon;
if (CAddonMgr::Get().GetAddon(addonId, addon, ADDON_UNKNOWN, false) && addon->HasSettings())
buttons.Add(CONTEXT_BUTTON_SETTINGS, 24020);
}
CContextMenuManager::Get().AddVisibleItems(pItem, buttons);
}
示例4: GetContextButtons
void CGUIWindowAddonBrowser::GetContextButtons(int itemNumber,
CContextButtons& buttons)
{
CFileItemPtr pItem = m_vecItems->Get(itemNumber);
if (pItem->GetPath().Equals("addons://enabled/"))
buttons.Add(CONTEXT_BUTTON_SCAN,24034);
AddonPtr addon;
if (!CAddonMgr::Get().GetAddon(pItem->GetProperty("Addon.ID").asString(), addon, ADDON_UNKNOWN, false)) // allow disabled addons
return;
if (addon->Type() == ADDON_REPOSITORY && pItem->m_bIsFolder)
{
buttons.Add(CONTEXT_BUTTON_SCAN,24034);
buttons.Add(CONTEXT_BUTTON_UPDATE_LIBRARY,24035);
}
buttons.Add(CONTEXT_BUTTON_INFO,24003);
if (addon->HasSettings())
buttons.Add(CONTEXT_BUTTON_SETTINGS,24020);
}