mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Edit book: Fix regression in previous release causing applying any container update marking all open image editors as modified.
No choice but to implement only_if_different and hope that it is accurate.
This commit is contained in:
parent
9e008a62bc
commit
6ff213ff0c
@ -293,7 +293,9 @@ class Canvas(QWidget):
|
|||||||
self.redo_action = a = self.undo_stack.createRedoAction(self, _('Redo') + ' ')
|
self.redo_action = a = self.undo_stack.createRedoAction(self, _('Redo') + ' ')
|
||||||
a.setIcon(QIcon.ic('edit-redo.png'))
|
a.setIcon(QIcon.ic('edit-redo.png'))
|
||||||
|
|
||||||
def load_image(self, data):
|
def load_image(self, data, only_if_different=False):
|
||||||
|
if only_if_different and self.original_image_data and not self.is_modified and self.original_image_data == data:
|
||||||
|
return
|
||||||
self.is_valid = False
|
self.is_valid = False
|
||||||
try:
|
try:
|
||||||
fmt = identify(data)[0].encode('ascii')
|
fmt = identify(data)[0].encode('ascii')
|
||||||
|
@ -163,9 +163,7 @@ class Editor(QMainWindow):
|
|||||||
self._is_modified = False # The image_changed signal will have been triggered causing this editor to be incorrectly marked as modified
|
self._is_modified = False # The image_changed signal will have been triggered causing this editor to be incorrectly marked as modified
|
||||||
|
|
||||||
def replace_data(self, raw, only_if_different=True):
|
def replace_data(self, raw, only_if_different=True):
|
||||||
# We ignore only_if_different as it is useless in our case, and
|
self.canvas.load_image(raw, only_if_different=only_if_different)
|
||||||
# there is no easy way to check two images for equality
|
|
||||||
self.canvas.load_image(raw)
|
|
||||||
|
|
||||||
def apply_settings(self, prefs=None, dictionaries_changed=False):
|
def apply_settings(self, prefs=None, dictionaries_changed=False):
|
||||||
pass
|
pass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user