mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-03 07:25:53 +01:00
Fix #4529 (Support delete key for fomat deletion in metadata window)
This commit is contained in:
commit
63a1434d62
2 changed files with 9 additions and 1 deletions
|
|
@ -171,7 +171,7 @@ def formats_dropped(self, event, paths):
|
|||
if self._add_formats(paths):
|
||||
event.accept()
|
||||
|
||||
def remove_format(self, x):
|
||||
def remove_format(self, *args):
|
||||
rows = self.formats.selectionModel().selectedRows(0)
|
||||
for row in rows:
|
||||
self.formats.takeItem(row.row())
|
||||
|
|
@ -327,6 +327,7 @@ def __init__(self, window, row, db, accepted_callback=None, cancel_all=False):
|
|||
self.deduce_author_sort)
|
||||
self.connect(self.formats, SIGNAL('itemDoubleClicked(QListWidgetItem*)'),
|
||||
self.show_format)
|
||||
self.connect(self.formats, SIGNAL('delete_format()'), self.remove_format)
|
||||
self.connect(self.button_set_cover, SIGNAL('clicked()'), self.set_cover)
|
||||
self.connect(self.button_set_metadata, SIGNAL('clicked()'),
|
||||
self.set_metadata_from_format)
|
||||
|
|
|
|||
|
|
@ -137,6 +137,13 @@ def dropEvent(self, event):
|
|||
def dragMoveEvent(self, event):
|
||||
event.acceptProposedAction()
|
||||
|
||||
def keyPressEvent(self, event):
|
||||
if event.key() == Qt.Key_Delete:
|
||||
self.emit(SIGNAL('delete_format()'))
|
||||
else:
|
||||
return QListWidget.keyPressEvent(self, event)
|
||||
|
||||
|
||||
class ImageView(QLabel):
|
||||
|
||||
MAX_WIDTH = 400
|
||||
|
|
|
|||
Loading…
Reference in a new issue