Refreshing a directory
#1
I added a context menu item to my SageTv plugin to delete a show. That part was pretty straightforward, but after you delete it it still shows up in the list unless you back out of the directory and go back in. Is there a way to force the directory to refresh when the user selects "Delete" from the menu? I was thinking maybe I could have two commands that get called when you hit delete, one to do the deleting and one to force the refresh. Is this possible?
Reply
#2
hey I just read something about replaceWindow

ReplaceWindow(window,dir)

http://wiki.xbmc.org/index.php?title=Lis..._Functions

maybe?
Reply
#3
http://wiki.xbmc.org/?title=List_of_Built_In_Functions

Look at Container.Refresh or Container.Update
Reply
#4
Thanks guys, I think those are the functions I need. But the harder part is figuring out how to call that function, since the action taken when the user hits delete is to delete the file. Can you have two actions run from the context menu?
Reply
#5
aaronb Wrote:Thanks guys, I think those are the functions I need. But the harder part is figuring out how to call that function, since the action taken when the user hits delete is to delete the file. Can you have two actions run from the context menu?

Just have the function you call with the context menu do whatever it is you want it to. i.e. after your done deleting the file then call one of the Container functions like xbmc.executebuiltin("Container.Refresh"). There are other posts in the forum that explain this better.
Reply

Logout Mark Read Team Forum Stats Members Help
Refreshing a directory0