Skip to content

Commit

Permalink
Merge pull request #3842 from Black09/directoryprovider
Browse files Browse the repository at this point in the history
Add setArt() for python listitems
  • Loading branch information
jmarshallnz committed Dec 21, 2013
2 parents a5aff71 + 6ff66e2 commit e5c9656
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
2 changes: 1 addition & 1 deletion addons/xbmc.python/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon id="xbmc.python" version="2.13.0" provider-name="Team XBMC">
<addon id="xbmc.python" version="2.14.0" provider-name="Team XBMC">
<backwards-compatibility abi="2.1.0"/>
<requires>
<import addon="xbmc.core" version="0.1.0"/>
Expand Down
15 changes: 15 additions & 0 deletions xbmc/interfaces/legacy/ListItem.cpp
Expand Up @@ -129,6 +129,21 @@ namespace XBMCAddon
}
}

void ListItem::setArt(const Dictionary& dictionary)
{
if (!item) return;
{
LOCKGUI;
for (Dictionary::const_iterator it = dictionary.begin(); it != dictionary.end(); ++it)
{
CStdString artName = it->first;
StringUtils::ToLower(artName);
const CStdString artFilename(it->second.c_str());
item->SetArt(artName, artFilename);
}
}
}

void ListItem::select(bool selected)
{
if (!item) return;
Expand Down
19 changes: 19 additions & 0 deletions xbmc/interfaces/legacy/ListItem.h
Expand Up @@ -124,6 +124,25 @@ namespace XBMCAddon
*/
void setThumbnailImage(const String& thumbFilename);

/**
* setArt(values) -- Sets the listitem's art
* \n
* values : dictionary - pairs of { label: value }.\n
*
* - Some default art values (any string possible):
* - thumb : string - image filename
* - poster : string - image filename
* - banner : string - image filename
* - fanart : string - image filename
* - clearart : string - image filename
* - clearlogo : string - image filename
* - landscape : string - image filename
*
* example:
* - self.list.getSelectedItem().setArt({ 'poster': 'poster.png', 'banner' : 'banner.png' })
*/
void setArt(const Dictionary& dictionary);

/**
* select(selected) -- Sets the listitem's selected status.\n
* \n
Expand Down
2 changes: 1 addition & 1 deletion xbmc/interfaces/python/PythonSwig.cpp.template
Expand Up @@ -827,7 +827,7 @@ namespace PythonBindings
// constants
PyModule_AddStringConstant(module, (char*)"__author__", (char*)"Team XBMC <http://xbmc.org>");
PyModule_AddStringConstant(module, (char*)"__date__", (char*)"${new Date().toString()}");
PyModule_AddStringConstant(module, (char*)"__version__", (char*)"2.13.0");
PyModule_AddStringConstant(module, (char*)"__version__", (char*)"2.14.0");
PyModule_AddStringConstant(module, (char*)"__credits__", (char*)"Team XBMC");
PyModule_AddStringConstant(module, (char*)"__platform__", (char*)"ALL");

Expand Down

0 comments on commit e5c9656

Please sign in to comment.