Factorize some code in getStatus() for LFUN_DIALOG_SHOW.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30812 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2009-08-01 16:55:15 +00:00
parent 76a7314279
commit 6b6cb3fe18

View File

@ -1277,7 +1277,7 @@ bool GuiView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
else if (name == "print")
enable = buf->isExportable("dvi")
&& lyxrc.print_command != "none";
else if (name == "character") {
else if (name == "character" || name == "symbols") {
if (!view() || !view()->cursor().inTexted())
enable = false;
else {
@ -1287,24 +1287,10 @@ bool GuiView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
enable = !in.getLayout().isPassThru();
}
}
else if (name == "symbols") {
if (!view() || view()->cursor().inMathed())
enable = false;
else {
// FIXME we should consider passthru
// paragraphs too.
Inset const & in = view()->cursor().inset();
enable = !in.getLayout().isPassThru();
}
}
else if (name == "latexlog")
enable = FileName(buf->logName()).isReadableFile();
else if (name == "spellchecker")
#if defined (USE_ASPELL)
enable = !buf->isReadonly();
#else
enable = false;
#endif
enable = theSpellChecker() && !buf->isReadonly();
else if (name == "vclog")
enable = buf->lyxvc().inUse();
break;