2012-01-29, 16:01
I have an addon that when searching save the last seached text.
New Search
Remove Search History
Text1
text2
text3
text4
to remove a text i click on Remove Search History which loads a menu with all the texts. If I click one it is removed from the Seach History.
I then use code below to remove it from current menu.
But when i return to inital serch menu the text is still there till i go out and then back in again.
How can i remove the text.
I did see another addon use a Long Button push on ATV2 to open Context menu and Delete but could not get it working in my addon
would appreciate any help
New Search
Remove Search History
Text1
text2
text3
text4
to remove a text i click on Remove Search History which loads a menu with all the texts. If I click one it is removed from the Seach History.
I then use code below to remove it from current menu.
Code:
def search_remove(search):
util.remove_search(xaddon,'search_history',search)
xbmc.executebuiltin('Container.Refresh')
But when i return to inital serch menu the text is still there till i go out and then back in again.
How can i remove the text.
I did see another addon use a Long Button push on ATV2 to open Context menu and Delete but could not get it working in my addon
Code:
def search_list():
util.add_dir(__language__(30004),{'search':''},util.icon('search.png'))
for what in util.get_searches(__addon__,'search_history'):
util.add_dir(what,{'search':what},menuItems={xbmc.getLocalizedString(117):{'search-remove':what}})
xbmcplugin.endOfDirectory(int(sys.argv[1]))
def search_remove(search):
util.remove_search(__addon__,'search_history',search)
xbmc.executebuiltin('Container.Refresh')
p = util.params() <<<< This Keeps script erroring
if 'search-remove' in p.keys():
search_remove(p['search-remove'])
would appreciate any help