aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspiff_ <spiff_@svn>2010-11-09 23:20:14 +0000
committerspiff_ <spiff_@svn>2010-11-09 23:20:14 +0000
commit1cde66cc28823980cb72333c09cd7301ecb29990 (patch)
treec4787c1cc8426fd0c38c245b985a4c3d34845474
parent6a1a6e6a06ae3e82b617c9e2e26d053410fb94df (diff)
added: system.addontitle(id) info label. returns the title of the specified plugin (by id)
(cherry picked from commit 5ee37ae22327737102fc75ba2f7f895d9455672e) git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/branches/Dharma@35236 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
-rw-r--r--xbmc/utils/GUIInfoManager.cpp9
-rw-r--r--xbmc/utils/GUIInfoManager.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/xbmc/utils/GUIInfoManager.cpp b/xbmc/utils/GUIInfoManager.cpp
index 09e3efed72..77a512ba47 100644
--- a/xbmc/utils/GUIInfoManager.cpp
+++ b/xbmc/utils/GUIInfoManager.cpp
@@ -416,6 +416,8 @@ int CGUIInfoManager::TranslateSingleString(const CStdString &strCondition)
else if (strTest.Equals("system.canreboot")) ret = SYSTEM_CAN_REBOOT;
else if (strTest.Left(16).Equals("system.hasaddon("))
return AddMultiInfo(GUIInfo(bNegate ? -SYSTEM_HAS_ADDON: SYSTEM_HAS_ADDON, ConditionalStringParameter(strTest.Mid(16,strTest.size()-17)), 0));
+ else if (strTest.Left(18).Equals("system.addontitle("))
+ return AddMultiInfo(GUIInfo(bNegate ? -SYSTEM_ADDON_TITLE: SYSTEM_ADDON_TITLE, ConditionalStringParameter(strTest.Mid(18,strTest.size()-19)), 0));
}
// library test conditions
else if (strTest.Left(7).Equals("library"))
@@ -2578,6 +2580,13 @@ CStdString CGUIInfoManager::GetMultiInfoLabel(const GUIInfo &info, int contextWi
if (window)
return window->GetProperty(m_stringParameters[info.GetData2()]);
}
+ else if (info.m_info == SYSTEM_ADDON_TITLE)
+ {
+ AddonPtr addon;
+ CAddonMgr::Get().GetAddon(m_stringParameters[info.GetData1()],addon);
+ if (addon)
+ return addon->Name();
+ }
return StringUtils::EmptyString;
}
diff --git a/xbmc/utils/GUIInfoManager.h b/xbmc/utils/GUIInfoManager.h
index bec4953d12..4fcb9b5ac7 100644
--- a/xbmc/utils/GUIInfoManager.h
+++ b/xbmc/utils/GUIInfoManager.h
@@ -382,6 +382,7 @@ class CDateTime;
#define SYSTEM_RENDER_VERSION 709
#define SYSTEM_SETTING 710
#define SYSTEM_HAS_ADDON 711
+#define SYSTEM_ADDON_TITLE 712
#define LIBRARY_HAS_MUSIC 720
#define LIBRARY_HAS_VIDEO 721