Results 1 to 4 of 4

Thread: Get selected list item from button in media action dialog

  1. #1
    Join Date
    Nov 2010
    Posts
    5

    Default Get selected list item from button in media action dialog

    This isn't really an app question per se, but I'm not really sure where else to get help with it.

    I'm trying to customize my Boxee installation by adding an extra button to the media action dialog - the one that pops up when you click on a media file and has buttons to play, mark watched, etc. The XML file for the dialog is boxee_media_action.xml.

    I can add the button to the XML just fine, and I can get it to run a Python script, but I haven't been able to get it to reference the selected list item correctly.

    In the skin XML, the data is pulled out by referencing
    Code:
    container(5000).ListItem
    so I thought I would be able to access the list item in Python with
    Code:
    mc.GetActiveWindow().GetList(5000).GetFocusedItem()
    but this only gives me a script error. The error is at the GetList stage. I can use GetControl(5000) without error, but that doesn't help me get at the list item.

    What am I missing?

  2. #2
    Join Date
    Feb 2009
    Posts
    427

    Default

    getfocuseditem is an integer of the item in the list try this:
    Code:
    i = mc.GetActiveWindow().GetList(5000).GetFocusedItem()
    item = mc.GetActiveWindow().GetList(5000).GetItem(i)

  3. #3
    Join Date
    Nov 2010
    Posts
    5

    Default

    I should clarify - the failure occurs already at the GetList call. Simply doing this causes a script failure:
    Code:
    list = mc.GetActiveWindow().GetList(5000)
    So it's as if id 5000 isn't recognized as a list or something... GetControl works but doesn't provide me with any useful functions.

  4. #4
    Join Date
    Nov 2010
    Posts
    5

    Default

    I figured it out now, posting here in case anyone else is interested.

    Through playing around with boxee_browse_views.xml, I discovered that the proper list ID for movies is 50, and tv shows is 52. So I was able to use those numbers instead of 5000 to get the list and the appropriate list item.

Similar Threads

  1. How to get the ListIndex of a selected item?
    By Severus in forum boxee applications
    Replies: 5
    Last Post: October 28th, 2011, 02:44 PM
  2. Setting panel selected item
    By xmcnuggetx in forum boxee applications
    Replies: 3
    Last Post: May 14th, 2009, 09:09 AM
  3. Button visibility while selected
    By xmcnuggetx in forum boxee applications
    Replies: 4
    Last Post: May 14th, 2009, 07:15 AM
  4. Forget selected item...
    By xmcnuggetx in forum boxee applications
    Replies: 1
    Last Post: May 11th, 2009, 03:39 PM
  5. (Library) Selected item is hidden
    By iBeech in forum bugs? what bugs?
    Replies: 1
    Last Post: December 29th, 2008, 06:25 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •