Skip to content

Commit dd702ef

Browse files
authored
Clear "busy" cursor when file error from ppcomp (#1724)
If file has been moved, or user manually types a filename incorrectly in the ppcomp dialog, it now displays an error and clears the busy cursor. Fixes #1721
1 parent 452b7e1 commit dd702ef

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/guiguts/tools/ppcomp.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,16 +335,26 @@ def run(self) -> None:
335335
PPcompChecker.files.append(PgdpFileText(empty_args))
336336
fname = preferences.get(PrefKey.PPCOMP_HTML_FILE)
337337
if not (fname and os.path.isfile(fname)):
338+
Busy.unbusy()
339+
logger.error(f"File {fname} does not exist")
338340
return
339341
try:
340342
PPcompChecker.files[0].load(fname)
341343
except (FileNotFoundError, SyntaxError) as exc:
344+
Busy.unbusy()
342345
logger.error(exc)
343346
return
344347
fname = preferences.get(PrefKey.PPCOMP_TEXT_FILE)
345348
if not (fname and os.path.isfile(fname)):
349+
Busy.unbusy()
350+
logger.error(f"File {fname} does not exist")
351+
return
352+
try:
353+
PPcompChecker.files[1].load(fname)
354+
except (FileNotFoundError, SyntaxError) as exc:
355+
Busy.unbusy()
356+
logger.error(exc)
346357
return
347-
PPcompChecker.files[1].load(fname)
348358
for f in PPcompChecker.files:
349359
f.cleanup()
350360
# perform common cleanup for both files

0 commit comments

Comments
 (0)