mirror of
https://github.com/kovidgoyal/calibre.git
synced 2026-02-03 01:23:31 -05:00
Fix drag and drop of books into bookshelf view not working. Fixes #2139529 [Drag & Drop of new books not working when in new Bookshelf View](https://bugs.launchpad.net/calibre/+bug/2139529)
This commit is contained in:
parent
38a6cc4a5d
commit
e3e9df79b6
@ -468,9 +468,12 @@ def setup_dnd_interface(cls_or_self):
|
||||
self = cls_or_self
|
||||
self.drag_allowed = True
|
||||
self.drag_start_pos = None
|
||||
self.setDragEnabled(True)
|
||||
self.setDragDropOverwriteMode(False)
|
||||
self.setDragDropMode(QAbstractItemView.DragDropMode.DragDrop)
|
||||
if isinstance(self, QAbstractItemView):
|
||||
self.setDragEnabled(True)
|
||||
self.setDragDropOverwriteMode(False)
|
||||
self.setDragDropMode(QAbstractItemView.DragDropMode.DragDrop)
|
||||
else:
|
||||
self.setAcceptDrops(True)
|
||||
# }}}
|
||||
|
||||
|
||||
|
||||
@ -1527,9 +1527,8 @@ class BookshelfView(MomentumScrollMixin, QAbstractScrollArea):
|
||||
self.second_line_renderer = self.build_template_renderer('authors', '')
|
||||
|
||||
# Initialize drag and drop
|
||||
# so we set the attributes manually
|
||||
self.drag_allowed = True
|
||||
self.drag_start_pos = None
|
||||
setup_dnd_interface(self)
|
||||
|
||||
self.bookcase = BookCase(self)
|
||||
self.bookcase.shelf_added.connect(self.on_shelf_layout_done, type=Qt.ConnectionType.QueuedConnection)
|
||||
self.bookcase.num_of_groups_changed.connect(self.update_scrollbar_ranges, type=Qt.ConnectionType.QueuedConnection)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user