Addon Menu Refresh ?

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
k_zeon Offline
Senior Member
Posts: 204
Joined: Aug 2011
Reputation: 0
Post: #1
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.

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
find quote