![]() |
Getting the current selection - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93) +--- Thread: Getting the current selection (/showthread.php?tid=135205) Pages:
1
2
|
RE: Getting the current selection - LehighBri - 2012-12-20 Thought I'd bump this. I noticed the following was committed yesterday and wasn't sure if that was to address this or not. https://github.com/xbmc/xbmc/commit/283ec639b3cda6365d015f90631aa34debd82091 jmarshall - does the above address the ability to get the selected item or is that for something else? Would still love some way to get the selected list item via python and then manipulate it (e.g. update it's label, update it's context menu items) RE: Getting the current selection - belese - 2013-10-10 It's a bit late, but i was looking to do this also, i've done a mix of info of this page and it work for label and property describe here : http://wiki.xbmc.org/?title=InfoLabels : for container with id 9000: print xbmc.getInfoLabel('Container(9000).ListItem(0).Label') RE: Getting the current selection - EtgarDizz - 2013-11-10 BUMP exact same problem. It seems like such a basic thing!.. to be able to get the currently selected ListItem as an object?? c'mon, that's really basic stuff that should be supported. From what I understand, the first call gets the correct window, but then the getFocus() method returns the wrong control. In my case, I'm calling the script from within a list item's context menu, so I'm guessing it's referencing either the listgroup or one of the buttons (I can't seem to find a human-readable data field to identify for sure). All I need is to be able to return the currently selected ListItem as an object... should be simple enough! (frustrated) RE: Getting the current selection - EtgarDizz - 2013-11-13 bump! Wow, this thread has been around for more than a year and still not addressed in the code?? I've found many ways to do:
Personally, I'm not looking to manipulate the list-item itself (in the GUI, that is). I want to manipulate database information of that list-item. So in theory, I wouldn't need to get the actual Code: activeWindow.activeControl.activeListItem I would be very happy to just create an item on the fly to be able to access the database: PHP Code: import xbmc Help, anyone! ![]() RE: Getting the current selection - tim619 - 2015-11-07 Is there already a solution for getting the active listitem? I want to add 'CastAndRole' but when I first get this information I dont have access to my listitem anymore... RE: Getting the current selection - bigretromike - 2016-02-13 dump for interest RE: Getting the current selection - Torben - 2016-04-02 Bumpetybumpbump! RE: Getting the current selection - Demonstratorz - 2016-09-19 Bump RE: Getting the current selection - woodside - 2016-09-19 Not sure if these are what you're looking for... Code: xbmc.getInfoLabel('System.CurrentControl') Code: getSelectedItem(...) RE: Getting the current selection - drinfernoo - 2020-05-25 (2016-09-19, 12:23)woodside Wrote: Not sure if these are what you're looking for... Unfortunately, this will give the currently focused list, but not the ListItem ...Quote: And this whole thread is about how this method doesn't work (still ![]() For my usage, that doesn't work. I am filling a list control in an XML dialog with items via a <content> tag, but am unable to retrieve the actual ListItem s through any means, as far as I can tell.I can use JSON-RPC to get various information (basically the same as the standard InfoLabels) for all the files in a directory, or I can access the InfoLabels the way that I am now ( Container(id).ListItem(position).xxxxx ). Unfortunately, neither of these methods gives the ability to get the original ListItem .To add to the matter, it appears that most of the API for ControlList (and probably other controls) is broken when dealing with XML windows. I'm unable to use really any of the methods related to items in a ControlList , like size() or getListItem(index) , the latter of which really seemed like the ticket here.Honestly, it's not really surprising that this hasn't ever been fully addressed (or addressed at all, maybe?), but it certainly is disappointing ![]() |