mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Do not show an error if the user tries to quit calibre while editing a cell in the book list. Instead, just silently abort the edit. See #1610539 (Data error when closing calibre)
This commit is contained in:
parent
c4d05d8a36
commit
324a5a2635
@ -1048,6 +1048,9 @@ class BooksModel(QAbstractTableModel): # {{{
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def setData(self, index, value, role):
|
def setData(self, index, value, role):
|
||||||
|
from calibre.gui2.ui import get_gui
|
||||||
|
if get_gui().shutting_down:
|
||||||
|
return False
|
||||||
if role == Qt.EditRole:
|
if role == Qt.EditRole:
|
||||||
from calibre.gui2.ui import get_gui
|
from calibre.gui2.ui import get_gui
|
||||||
try:
|
try:
|
||||||
@ -1633,6 +1636,9 @@ class DeviceBooksModel(BooksModel): # {{{
|
|||||||
return (section+1)
|
return (section+1)
|
||||||
|
|
||||||
def setData(self, index, value, role):
|
def setData(self, index, value, role):
|
||||||
|
from calibre.gui2.ui import get_gui
|
||||||
|
if get_gui().shutting_down:
|
||||||
|
return False
|
||||||
done = False
|
done = False
|
||||||
if role == Qt.EditRole:
|
if role == Qt.EditRole:
|
||||||
row, col = index.row(), index.column()
|
row, col = index.row(), index.column()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user