X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiAlert.cpp;h=2a8affa33a6cfc1b2927bf28d23695d49487892c;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=fdb2065c084f1fa40ad9ad1902cf472b2b77b44a;hpb=dd4cbb3591d20498e6410f1156f4f99e306ad73f;p=lyx.git diff --git a/src/frontends/qt4/GuiAlert.cpp b/src/frontends/qt4/GuiAlert.cpp index fdb2065c08..2a8affa33a 100644 --- a/src/frontends/qt4/GuiAlert.cpp +++ b/src/frontends/qt4/GuiAlert.cpp @@ -19,7 +19,6 @@ #include "qt_helpers.h" #include "LyX.h" // for lyx::use_gui -#include "ui_AskForTextUi.h" #include "support/gettext.h" #include "support/debug.h" @@ -145,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()); @@ -160,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; @@ -184,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), @@ -194,6 +197,8 @@ void warning(docstring const & title0, docstring const & message, toqstr(message), toqstr(formatted(message))); } + + qApp->restoreOverrideCursor(); } @@ -213,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(); } @@ -236,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(); }