mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Multiple inheritance makes me nervous
This commit is contained in:
parent
773a5206b3
commit
5da6c49d8f
@ -67,7 +67,7 @@ from calibre.gui2.library.delegates import (
|
||||
TextDelegate,
|
||||
)
|
||||
from calibre.gui2.library.models import BooksModel, DeviceBooksModel
|
||||
from calibre.gui2.pin_columns import CustomEditTabbingBehavior, PinTableView
|
||||
from calibre.gui2.pin_columns import PinTableView, TableView
|
||||
from calibre.gui2.preferences.create_custom_column import CreateNewCustomColumn
|
||||
from calibre.utils.config import prefs, tweaks
|
||||
from calibre.utils.icu import primary_sort_key
|
||||
@ -356,7 +356,7 @@ class AdjustColumnSize(QDialog): # {{{
|
||||
|
||||
|
||||
@setup_dnd_interface
|
||||
class BooksView(QTableView, CustomEditTabbingBehavior): # {{{
|
||||
class BooksView(TableView): # {{{
|
||||
|
||||
files_dropped = pyqtSignal(object)
|
||||
books_dropped = pyqtSignal(object)
|
||||
|
@ -8,7 +8,7 @@ from calibre.gui2 import gprefs
|
||||
from calibre.gui2.library import DEFAULT_SORT
|
||||
|
||||
|
||||
class CustomEditTabbingBehavior:
|
||||
class TableView(QTableView):
|
||||
|
||||
def closeEditor(self, editor, hint):
|
||||
# We want to implement our own go to next/previous cell behavior
|
||||
@ -18,7 +18,7 @@ class CustomEditTabbingBehavior:
|
||||
delta = 1
|
||||
elif hint is QAbstractItemDelegate.EndEditHint.EditPreviousItem:
|
||||
delta = -1
|
||||
QTableView.closeEditor(self, editor, QAbstractItemDelegate.EndEditHint.NoHint if delta else hint)
|
||||
super().closeEditor(editor, QAbstractItemDelegate.EndEditHint.NoHint if delta else hint)
|
||||
if not delta:
|
||||
return
|
||||
current = self.currentIndex()
|
||||
@ -59,7 +59,7 @@ class CustomEditTabbingBehavior:
|
||||
self.edit(idx)
|
||||
|
||||
|
||||
class PinTableView(QTableView, CustomEditTabbingBehavior):
|
||||
class PinTableView(TableView):
|
||||
|
||||
disable_save_state = False
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user