fix bug 1941: toolbars disabled after dialog action

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10472 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2005-09-21 13:18:15 +00:00
parent 68a101a8ae
commit 3781da95c0
2 changed files with 17 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2005-09-12 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* lyxfunc.C (sendDispatchMessage): do not update menubar/toolbar
when command is internal. (bug 1941)
2005-09-20 Jean-Marc Lasgouttes <lasgouttes@lyx.org> 2005-09-20 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* text2.C (cursorRight): do not honor boundary when at the end of * text2.C (cursorRight): do not honor boundary when at the end of

View File

@ -338,6 +338,9 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
application can still be accessed without giving focus to application can still be accessed without giving focus to
the main window. In this case, we want to disable the menu the main window. In this case, we want to disable the menu
entries that are buffer-related. entries that are buffer-related.
Note that this code is not perfect, as bug 1941 attests:
http://bugzilla.lyx.org/show_bug.cgi?id=1941#c4
*/ */
Buffer * buf; Buffer * buf;
if (cmd.origin == FuncRequest::UI && !owner->hasFocus()) if (cmd.origin == FuncRequest::UI && !owner->hasFocus())
@ -1577,8 +1580,15 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
void LyXFunc::sendDispatchMessage(string const & msg, FuncRequest const & cmd) void LyXFunc::sendDispatchMessage(string const & msg, FuncRequest const & cmd)
{ {
owner->updateMenubar(); /* When an action did not originate from the UI/kbd, it makes
owner->updateToolbars(); * sense to avoid updating the GUI. It turns out that this
* fixes bug 1941, for reasons that are described here:
* http://bugzilla.lyx.org/show_bug.cgi?id=1941#c4
*/
if (cmd.origin != FuncRequest::INTERNAL) {
owner->updateMenubar();
owner->updateToolbars();
}
const bool verbose = (cmd.origin == FuncRequest::UI const bool verbose = (cmd.origin == FuncRequest::UI
|| cmd.origin == FuncRequest::COMMANDBUFFER); || cmd.origin == FuncRequest::COMMANDBUFFER);