mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Edit book: Show diff dialogs as independent windows so they dont stay on top and can be used with the editor simultaneously
This commit is contained in:
parent
cee4b97e2e
commit
801d90028a
@ -395,10 +395,10 @@ class Boss(QObject):
|
|||||||
def create_diff_dialog(self, revert_msg=_('&Revert changes'), show_open_in_editor=True):
|
def create_diff_dialog(self, revert_msg=_('&Revert changes'), show_open_in_editor=True):
|
||||||
global _diff_dialogs
|
global _diff_dialogs
|
||||||
from calibre.gui2.tweak_book.diff.main import Diff
|
from calibre.gui2.tweak_book.diff.main import Diff
|
||||||
d = Diff(revert_button_msg=revert_msg, parent=self.gui, show_open_in_editor=show_open_in_editor)
|
d = Diff(revert_button_msg=revert_msg, show_open_in_editor=show_open_in_editor)
|
||||||
[x.break_cycles() for x in _diff_dialogs if not x.isVisible()]
|
[x.break_cycles() for x in _diff_dialogs if not x.isVisible()]
|
||||||
_diff_dialogs = [x for x in _diff_dialogs if x.isVisible()] + [d]
|
_diff_dialogs = [x for x in _diff_dialogs if x.isVisible()] + [d]
|
||||||
d.show(), d.raise_(), d.setFocus(Qt.OtherFocusReason)
|
d.show(), d.raise_(), d.setFocus(Qt.OtherFocusReason), d.setWindowModality(Qt.NonModal)
|
||||||
return d
|
return d
|
||||||
|
|
||||||
def show_current_diff(self, allow_revert=True):
|
def show_current_diff(self, allow_revert=True):
|
||||||
@ -1215,6 +1215,8 @@ class Boss(QObject):
|
|||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
self.gui.preview.stop_refresh_timer()
|
self.gui.preview.stop_refresh_timer()
|
||||||
self.save_state()
|
self.save_state()
|
||||||
|
[x.reject() for x in _diff_dialogs]
|
||||||
|
del _diff_dialogs[:]
|
||||||
self.save_manager.shutdown()
|
self.save_manager.shutdown()
|
||||||
parse_worker.shutdown()
|
parse_worker.shutdown()
|
||||||
self.save_manager.wait(0.1)
|
self.save_manager.wait(0.1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user