From fca9ccc67d87647363d436742a7c02795f15183d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 18 Jan 2011 10:17:56 -0700 Subject: [PATCH] Fix for shortcuts and combobox delegates --- src/calibre/gui2/library/delegates.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/library/delegates.py b/src/calibre/gui2/library/delegates.py index ea614aa817..e9b9255c64 100644 --- a/src/calibre/gui2/library/delegates.py +++ b/src/calibre/gui2/library/delegates.py @@ -353,6 +353,17 @@ class CcCommentsDelegate(QStyledItemDelegate): # {{{ model.setData(index, QVariant(editor.textbox.html), Qt.EditRole) # }}} +class DelegateCB(QComboBox): # {{{ + + def __init__(self, parent): + QComboBox.__init__(self, parent) + + def event(self, e): + if e.type() == e.ShortcutOverride: + e.accept() + return QComboBox.event(self, e) +# }}} + class CcBoolDelegate(QStyledItemDelegate): # {{{ def __init__(self, parent): ''' @@ -361,7 +372,7 @@ class CcBoolDelegate(QStyledItemDelegate): # {{{ QStyledItemDelegate.__init__(self, parent) def createEditor(self, parent, option, index): - editor = QComboBox(parent) + editor = DelegateCB(parent) items = [_('Y'), _('N'), ' '] icons = [I('ok.png'), I('list_remove.png'), I('blank.png')] if tweaks['bool_custom_columns_are_tristate'] == 'no':