本文整理汇总了C++中addon::AddonPtr::HasSettings方法的典型用法代码示例。如果您正苦于以下问题:C++ AddonPtr::HasSettings方法的具体用法?C++ AddonPtr::HasSettings怎么用?C++ AddonPtr::HasSettings使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类addon::AddonPtr
的用法示例。
在下文中一共展示了AddonPtr::HasSettings方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShowForAddon
bool CGUIDialogAddonSettings::ShowForAddon(const ADDON::AddonPtr &addon, bool saveToDisk /* = true */)
{
if (addon == nullptr)
return false;
if (!g_passwordManager.CheckMenuLock(WINDOW_ADDON_BROWSER))
return false;
if (!addon->HasSettings())
{
// addon does not support settings, inform user
CGUIDialogOK::ShowAndGetInput(CVariant{ 24000 }, CVariant{ 24030 });
return false;
}
// Create the dialog
CGUIDialogAddonSettings* dialog = g_windowManager.GetWindow<CGUIDialogAddonSettings>(WINDOW_DIALOG_ADDON_SETTINGS);
if (dialog == nullptr)
return false;
dialog->m_addon = addon;
dialog->Open();
if (!dialog->IsConfirmed())
return false;
if (saveToDisk)
addon->SaveSettings();
return true;
}
示例2: AddonHasSettings
bool AddonHasSettings(const std::string &condition, const std::string &value, const std::string &settingId)
{
if (settingId.empty())
return false;
CSettingAddon *setting = (CSettingAddon*)CSettings::Get().GetSetting(settingId);
if (setting == NULL)
return false;
ADDON::AddonPtr addon;
if (!ADDON::CAddonMgr::Get().GetAddon(setting->GetValue(), addon, setting->GetAddonType()) || addon == NULL)
return false;
return addon->HasSettings();
}
示例3: AddonHasSettings
bool AddonHasSettings(const std::string &condition, const std::string &value, const CSetting *setting, void *data)
{
if (setting == NULL)
return false;
const CSettingAddon *settingAddon = dynamic_cast<const CSettingAddon*>(setting);
if (settingAddon == NULL)
return false;
ADDON::AddonPtr addon;
if (!ADDON::CAddonMgr::GetInstance().GetAddon(settingAddon->GetValue(), addon, settingAddon->GetAddonType()) || addon == NULL)
return false;
if (addon->Type() == ADDON::ADDON_SKIN)
return ((ADDON::CSkinInfo*)addon.get())->HasSkinFile("SkinSettings.xml");
return addon->HasSettings();
}
示例4: AddonHasSettings
bool AddonHasSettings(const std::string &condition, const std::string &value, SettingConstPtr setting, void *data)
{
if (setting == NULL)
return false;
std::shared_ptr<const CSettingAddon> settingAddon = std::dynamic_pointer_cast<const CSettingAddon>(setting);
if (settingAddon == NULL)
return false;
ADDON::AddonPtr addon;
if (!CServiceBroker::GetAddonMgr().GetAddon(settingAddon->GetValue(), addon, settingAddon->GetAddonType()) || addon == NULL)
return false;
if (addon->Type() == ADDON::ADDON_SKIN)
return ((ADDON::CSkinInfo*)addon.get())->HasSkinFile("SkinSettings.xml");
return addon->HasSettings();
}
示例5: GetContextButtons
void CGUIDialogContextMenu::GetContextButtons(const std::string &type, const CFileItemPtr& item, CContextButtons &buttons)
{
// Add buttons to the ContextMenu that should be visible for both sources and autosourced items
if (item && item->IsRemovable())
{
if (item->IsDVD() || item->IsCDDA())
{
// We need to check if there is a detected is inserted!
buttons.Add(CONTEXT_BUTTON_PLAY_DISC, 341); // Play CD/DVD!
if (CGUIWindowVideoBase::HasResumeItemOffset(item.get()))
buttons.Add(CONTEXT_BUTTON_RESUME_DISC, CGUIWindowVideoBase::GetResumeString(*(item.get()))); // Resume Disc
buttons.Add(CONTEXT_BUTTON_EJECT_DISC, 13391); // Eject/Load CD/DVD!
}
else // Must be HDD
{
buttons.Add(CONTEXT_BUTTON_EJECT_DRIVE, 13420); // Eject Removable HDD!
}
}
// Next, Add buttons to the ContextMenu that should ONLY be visible for sources and not autosourced items
CMediaSource *share = GetShare(type, item.get());
if (CProfilesManager::Get().GetCurrentProfile().canWriteSources() || g_passwordManager.bMasterUser)
{
if (share)
{
// Note. from now on, remove source & disable plugin should mean the same thing
//TODO might be smart to also combine editing source & plugin settings into one concept/dialog
// Note. Temporarily disabled ability to remove plugin sources until installer is operational
CURL url(share->strPath);
bool isAddon = ADDON::TranslateContent(url.GetProtocol()) != CONTENT_NONE;
if (!share->m_ignore && !isAddon)
buttons.Add(CONTEXT_BUTTON_EDIT_SOURCE, 1027); // Edit Source
else
{
ADDON::AddonPtr plugin;
if (ADDON::CAddonMgr::Get().GetAddon(url.GetHostName(), plugin))
if (plugin->HasSettings())
buttons.Add(CONTEXT_BUTTON_PLUGIN_SETTINGS, 1045); // Plugin Settings
}
if (type != "video")
buttons.Add(CONTEXT_BUTTON_SET_DEFAULT, 13335); // Set as Default
if (!share->m_ignore && !isAddon)
buttons.Add(CONTEXT_BUTTON_REMOVE_SOURCE, 522); // Remove Source
buttons.Add(CONTEXT_BUTTON_SET_THUMB, 20019);
}
if (!GetDefaultShareNameByType(type).empty())
buttons.Add(CONTEXT_BUTTON_CLEAR_DEFAULT, 13403); // Clear Default
}
if (share && LOCK_MODE_EVERYONE != CProfilesManager::Get().GetMasterProfile().getLockMode())
{
if (share->m_iHasLock == 0 && (CProfilesManager::Get().GetCurrentProfile().canWriteSources() || g_passwordManager.bMasterUser))
buttons.Add(CONTEXT_BUTTON_ADD_LOCK, 12332);
else if (share->m_iHasLock == 1)
buttons.Add(CONTEXT_BUTTON_REMOVE_LOCK, 12335);
else if (share->m_iHasLock == 2)
{
buttons.Add(CONTEXT_BUTTON_REMOVE_LOCK, 12335);
bool maxRetryExceeded = false;
if (CSettings::Get().GetInt("masterlock.maxretries") != 0)
maxRetryExceeded = (share->m_iBadPwdCount >= CSettings::Get().GetInt("masterlock.maxretries"));
if (maxRetryExceeded)
buttons.Add(CONTEXT_BUTTON_RESET_LOCK, 12334);
else
buttons.Add(CONTEXT_BUTTON_CHANGE_LOCK, 12356);
}
}
if (share && !g_passwordManager.bMasterUser && item->m_iHasLock == 1)
buttons.Add(CONTEXT_BUTTON_REACTIVATE_LOCK, 12353);
}
示例6: AddonHasSettings
bool AddonHasSettings(const std::string &condition, const std::string &value, const std::string &settingId)
{
if (settingId.empty())
return false;
CSettingAddon *setting = (CSettingAddon*)CSettings::Get().GetSetting(settingId);
if (setting == NULL)
return false;
ADDON::AddonPtr addon;
if (!ADDON::CAddonMgr::Get().GetAddon(setting->GetValue(), addon, setting->GetAddonType()) || addon == NULL)
return false;
if (addon->Type() == ADDON::ADDON_SKIN)
return ((ADDON::CSkinInfo*)addon.get())->HasSkinFile("SkinSettings.xml");
return addon->HasSettings();
}