From c0f6c82b98f2a321489b557df2b5f3b9357c2874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20M=C3=BCller?= Date: Mon, 15 Feb 2021 11:18:22 +0100 Subject: [PATCH] enh: show wait cursor when computing lme4 (#55) --- shapeout2/gui/compute/comp_lme4.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/shapeout2/gui/compute/comp_lme4.py b/shapeout2/gui/compute/comp_lme4.py index 043c950..e727b22 100644 --- a/shapeout2/gui/compute/comp_lme4.py +++ b/shapeout2/gui/compute/comp_lme4.py @@ -7,6 +7,8 @@ from .comp_lme4_dataset import LME4Dataset from .comp_lme4_results import Rlme4ResultsDialog +from ..widgets import ShowWaitCursor + class ComputeSignificance(QtWidgets.QDialog): def __init__(self, parent, pipeline, *args, **kwargs): @@ -74,10 +76,13 @@ def on_lme4(self, ret_dlg=False): If set to True, then the dialog is returned without `_exec`uting it (used for testing). """ - rlme4 = lme4.Rlme4(model=self.model, feature=self.feature) - for wds in self.datasets: - wds.add_to_rlme4(self.pipeline, rlme4) - result = rlme4.fit() + self.setEnabled(False) + with ShowWaitCursor(): + rlme4 = lme4.Rlme4(model=self.model, feature=self.feature) + for wds in self.datasets: + wds.add_to_rlme4(self.pipeline, rlme4) + result = rlme4.fit() + self.setEnabled(True) dlg = Rlme4ResultsDialog(self, result) if ret_dlg: return dlg