]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiAlert.cpp
* fix spelling in comments to please John.
[lyx.git] / src / frontends / qt4 / GuiAlert.cpp
index 9b651d3681580244faf905e060dfe66f0e92897d..2a8affa33a6cfc1b2927bf28d23695d49487892c 100644 (file)
@@ -144,10 +144,9 @@ int prompt(docstring const & title0, docstring const & question,
 
        docstring const title = bformat(_("LyX: %1$s"), title0);
 
-       // For some reason, sometimes Qt uses an hourglass or watch cursor when
+       // For some reason, sometimes Qt uses a hourglass or watch cursor when
        // displaying the alert. Hence, we ask for the standard cursor shape.
-       // This call has no effect if the cursor has not been overridden.
-       qApp->changeOverrideCursor(Qt::ArrowCursor);
+       qApp->setOverrideCursor(Qt::ArrowCursor);
 
        // FIXME replace that with guiApp->currentView()
        //LYXERR0("FOCUS: " << qApp->focusWidget());
@@ -159,6 +158,8 @@ int prompt(docstring const & title0, docstring const & question,
                                           b3.empty() ? QString::null : toqstr(b3),
                                           default_button, cancel_button);
 
+       qApp->restoreOverrideCursor();
+
        // Qt bug: can return -1 on cancel or WM close, despite the docs.
        if (res == -1)
                res = cancel_button;
@@ -183,6 +184,9 @@ void warning(docstring const & title0, docstring const & message,
                return;
        }
 
+       // Don't use a hourglass cursor while displaying the alert
+       qApp->setOverrideCursor(Qt::ArrowCursor);
+
        if (!askshowagain) {
                ProgressInterface::instance()->warning(
                                toqstr(title),
@@ -193,6 +197,8 @@ void warning(docstring const & title0, docstring const & message,
                                toqstr(message),
                                toqstr(formatted(message)));
        }
+
+       qApp->restoreOverrideCursor();
 }
 
 
@@ -212,9 +218,14 @@ void error(docstring const & title0, docstring const & message)
                return;
        }
 
+       // Don't use a hourglass cursor while displaying the alert
+       qApp->setOverrideCursor(Qt::ArrowCursor);
+
        ProgressInterface::instance()->error(
                toqstr(title),
                toqstr(formatted(message)));
+
+       qApp->restoreOverrideCursor();
 }
 
 
@@ -235,9 +246,14 @@ void information(docstring const & title0, docstring const & message)
                return;
        }
 
+       // Don't use a hourglass cursor while displaying the alert
+       qApp->setOverrideCursor(Qt::ArrowCursor);
+
        ProgressInterface::instance()->information(
                toqstr(title),
                toqstr(formatted(message)));
+
+       qApp->restoreOverrideCursor();
 }