From: Enrico Forestieri Date: Mon, 11 Jan 2010 01:27:15 +0000 (+0000) Subject: Don't use a hourglass cursor while diplaying alerts. X-Git-Tag: 2.0.0~4434 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=8c11a45b993690c5acce0de8060a953adc6507d0;p=lyx.git Don't use a hourglass cursor while diplaying alerts. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32960 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/GuiAlert.cpp b/src/frontends/qt4/GuiAlert.cpp index 9b651d3681..2a8affa33a 100644 --- a/src/frontends/qt4/GuiAlert.cpp +++ b/src/frontends/qt4/GuiAlert.cpp @@ -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(); }