Add setArt() for python listitems
authorBl4ck09 <bl4ck09@me.com>
Tue, 10 Dec 2013 21:44:04 +0000 (22:44 +0100)
committerBl4ck09 <bl4ck09@me.com>
Sun, 15 Dec 2013 21:33:17 +0000 (22:33 +0100)
Python version bump to 2.14.0

addons/xbmc.python/addon.xml
xbmc/interfaces/legacy/ListItem.cpp
xbmc/interfaces/legacy/ListItem.h
xbmc/interfaces/python/PythonSwig.cpp.template

index 86cb77a..8b24f0e 100644 (file)
@@ -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"/>
index 2222921..f19574f 100644 (file)
@@ -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;
index f88bbdf..40fa95c 100644 (file)
@@ -125,6 +125,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
        * selected        : bool - True=selected/False=not selected\n
index 5550113..9e1d66c 100644 (file)
@@ -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");