]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiAlert.cpp
On Mac, moving down a paragraph should place the cursor at the end of the current...
[lyx.git] / src / frontends / qt4 / GuiAlert.cpp
index a7bb480094f28b8547eee97a2d18a69a31b6ba52..0113389a9ab4ab68f20d77eeb960ba35999c81cd 100644 (file)
@@ -92,6 +92,11 @@ int doPrompt(docstring const & title0, docstring const & question,
 
        docstring const title = bformat(_("LyX: %1$s"), title0);
 
+       /// Long operation in progress prevents user from Ok-ing the error dialog
+       bool long_op = theApp()->longOperationStarted();
+       if (long_op)
+               theApp()->stopLongOperation();
+
        // For some reason, sometimes Qt uses a hourglass or watch cursor when
        // displaying the alert. Hence, we ask for the standard cursor shape.
        qApp->setOverrideCursor(Qt::ArrowCursor);
@@ -116,6 +121,9 @@ int doPrompt(docstring const & title0, docstring const & question,
 
        qApp->restoreOverrideCursor();
 
+       if (long_op)
+               theApp()->startLongOperation();
+
        // Qt bug: can return -1 on cancel or WM close, despite the docs.
        if (res == -1)
                res = cancel_button;
@@ -197,6 +205,11 @@ void doError(docstring const & title0, docstring const & message)
                return;
        }
 
+       /// Long operation in progress prevents user from Ok-ing the error dialog
+       bool long_op = theApp()->longOperationStarted();
+       if (long_op)
+               theApp()->stopLongOperation();
+
        // Don't use a hourglass cursor while displaying the alert
        qApp->setOverrideCursor(Qt::ArrowCursor);
 
@@ -205,6 +218,9 @@ void doError(docstring const & title0, docstring const & message)
                toqstr(message));
 
        qApp->restoreOverrideCursor();
+
+       if (long_op)
+               theApp()->startLongOperation();
 }
 
 void error(docstring const & title0, docstring const & message)