From 6ba3aba70d0044e082f4729ef1b2319c09ee8fb2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 9 Mar 2021 20:43:32 +0530 Subject: [PATCH] Use a busy cursor so user knows something is happening while editor is loaded --- src/calibre/gui2/viewer/ui.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/viewer/ui.py b/src/calibre/gui2/viewer/ui.py index 936b857c58..3f19c828b1 100644 --- a/src/calibre/gui2/viewer/ui.py +++ b/src/calibre/gui2/viewer/ui.py @@ -2,11 +2,11 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2018, Kovid Goyal - import json import os import re import sys +import time from collections import defaultdict, namedtuple from hashlib import sha256 from qt.core import ( @@ -643,6 +643,7 @@ class EbookViewer(MainWindow): def edit_book(self, file_name, progress_frac, selected_text): import subprocess + from calibre.ebooks.oeb.polish.main import SUPPORTED from calibre.utils.ipc.launch import exe_path, macos_edit_book_bundle_path try: @@ -664,8 +665,11 @@ class EbookViewer(MainWindow): cmd = [exe] if selected_text: cmd += ['--select-text', selected_text] + from calibre.gui2.tweak_book.widgets import BusyCursor with sanitize_env_vars(): subprocess.Popen(cmd + [path, file_name]) + with BusyCursor(): + time.sleep(2) def save_state(self): with vprefs: