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
This commit is contained in:
Enrico Forestieri 2010-01-11 01:27:15 +00:00
parent 598daa7c71
commit 8c11a45b99

View File

@ -144,10 +144,9 @@ int prompt(docstring const & title0, docstring const & question,
docstring const title = bformat(_("LyX: %1$s"), title0); 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. // displaying the alert. Hence, we ask for the standard cursor shape.
// This call has no effect if the cursor has not been overridden. qApp->setOverrideCursor(Qt::ArrowCursor);
qApp->changeOverrideCursor(Qt::ArrowCursor);
// FIXME replace that with guiApp->currentView() // FIXME replace that with guiApp->currentView()
//LYXERR0("FOCUS: " << qApp->focusWidget()); //LYXERR0("FOCUS: " << qApp->focusWidget());
@ -159,6 +158,8 @@ int prompt(docstring const & title0, docstring const & question,
b3.empty() ? QString::null : toqstr(b3), b3.empty() ? QString::null : toqstr(b3),
default_button, cancel_button); default_button, cancel_button);
qApp->restoreOverrideCursor();
// Qt bug: can return -1 on cancel or WM close, despite the docs. // Qt bug: can return -1 on cancel or WM close, despite the docs.
if (res == -1) if (res == -1)
res = cancel_button; res = cancel_button;
@ -183,6 +184,9 @@ void warning(docstring const & title0, docstring const & message,
return; return;
} }
// Don't use a hourglass cursor while displaying the alert
qApp->setOverrideCursor(Qt::ArrowCursor);
if (!askshowagain) { if (!askshowagain) {
ProgressInterface::instance()->warning( ProgressInterface::instance()->warning(
toqstr(title), toqstr(title),
@ -193,6 +197,8 @@ void warning(docstring const & title0, docstring const & message,
toqstr(message), toqstr(message),
toqstr(formatted(message))); toqstr(formatted(message)));
} }
qApp->restoreOverrideCursor();
} }
@ -212,9 +218,14 @@ void error(docstring const & title0, docstring const & message)
return; return;
} }
// Don't use a hourglass cursor while displaying the alert
qApp->setOverrideCursor(Qt::ArrowCursor);
ProgressInterface::instance()->error( ProgressInterface::instance()->error(
toqstr(title), toqstr(title),
toqstr(formatted(message))); toqstr(formatted(message)));
qApp->restoreOverrideCursor();
} }
@ -235,9 +246,14 @@ void information(docstring const & title0, docstring const & message)
return; return;
} }
// Don't use a hourglass cursor while displaying the alert
qApp->setOverrideCursor(Qt::ArrowCursor);
ProgressInterface::instance()->information( ProgressInterface::instance()->information(
toqstr(title), toqstr(title),
toqstr(formatted(message))); toqstr(formatted(message)));
qApp->restoreOverrideCursor();
} }