def handleAction(self, action, query=None):
"""Handle action from context menu on query."""
if action == 'remove':
if query and query in self.history:
index = self.history.index(query)
del self.history[index]
self.updateHistory(select=index-1)
elif action == 'rename':
if query and query in self.history:
text = self.inputText(text=query, title=_('Edit search'))
if text and text != query:
index = self.history.index(query)
self.history[index] = text
self.updateHistory(select=index)
elif action == 'clean':
if self.history:
self.history = []
self.updateHistory()
else:
xbmcgui.Dialog().ok('Action', 'Unknown action', action)
return True
评论列表
文章目录