mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Fix #2037172 [[Enhancement] "Find item in the Tag browser" input field should have a "Clear search history" context menu item](https://bugs.launchpad.net/calibre/+bug/2037172)
This commit is contained in:
parent
34b3ee1138
commit
3d045fb230
@ -733,6 +733,16 @@ class HistoryLineEdit(QComboBox): # {{{
|
|||||||
def setPlaceholderText(self, txt):
|
def setPlaceholderText(self, txt):
|
||||||
return self.lineEdit().setPlaceholderText(txt)
|
return self.lineEdit().setPlaceholderText(txt)
|
||||||
|
|
||||||
|
def contextMenuEvent(self, event):
|
||||||
|
menu = self.lineEdit().createStandardContextMenu()
|
||||||
|
menu.addSeparator()
|
||||||
|
menu.addAction(_('Clear history'), self.clear_history_default_impl)
|
||||||
|
menu.exec(event.globalPos())
|
||||||
|
|
||||||
|
def clear_history_default_impl(self):
|
||||||
|
self.clear()
|
||||||
|
history.set(self.store_name, [])
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def store_name(self):
|
def store_name(self):
|
||||||
return 'lineedit_history_'+self._name
|
return 'lineedit_history_'+self._name
|
||||||
|
Loading…
x
Reference in New Issue
Block a user