From 4077030da1fcaf4044450863510fd627d1afcbca Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 26 Nov 2013 19:15:42 +0530 Subject: [PATCH] Busy cursor when fixing/prettying all files --- src/calibre/gui2/tweak_book/boss.py | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/calibre/gui2/tweak_book/boss.py b/src/calibre/gui2/tweak_book/boss.py index c5c0a82af6..74028529e7 100644 --- a/src/calibre/gui2/tweak_book/boss.py +++ b/src/calibre/gui2/tweak_book/boss.py @@ -319,10 +319,14 @@ class Boss(QObject): else: if not self.check_dirtied(): return - self.add_savepoint(_('Fix HTML')) - fix_all_html(current_container()) - self.update_editors_from_container() - self.set_modified() + QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) + try: + self.add_savepoint(_('Fix HTML')) + fix_all_html(current_container()) + self.update_editors_from_container() + self.set_modified() + finally: + QApplication.restoreOverrideCursor() def pretty_print(self, current): if current: @@ -334,10 +338,14 @@ class Boss(QObject): else: if not self.check_dirtied(): return - self.add_savepoint(_('Beautify files')) - pretty_all(current_container()) - self.update_editors_from_container() - self.set_modified() + QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) + try: + self.add_savepoint(_('Beautify files')) + pretty_all(current_container()) + self.update_editors_from_container() + self.set_modified() + finally: + QApplication.restoreOverrideCursor() def mark_selected_text(self): ed = self.gui.central.current_editor