diff --git a/lib/ui/stdtoolbars.inc b/lib/ui/stdtoolbars.inc index 550f1b266b..8aec1b1663 100644 --- a/lib/ui/stdtoolbars.inc +++ b/lib/ui/stdtoolbars.inc @@ -205,8 +205,8 @@ ToolbarSet Toolbar "view/update" "View/Update" Item "View DVI" "buffer-view dvi" Item "Update DVI" "buffer-update dvi" - Item "View PDF (pdflatex)" "buffer-view pdf2" - Item "Update PDF (pdflatex)" "buffer-update pdf2" + Item "View PDF (pdflatex)" "command-alternatives buffer-view pdf2;buffer-view pdf4" + Item "Update PDF (pdflatex)" "command-alternatives buffer-update pdf2;buffer-view pdf4" Item "View PostScript" "buffer-view ps" Item "Update PostScript" "buffer-update ps" End diff --git a/src/LyXFunc.cpp b/src/LyXFunc.cpp index d42b70b5b5..96302aef7a 100644 --- a/src/LyXFunc.cpp +++ b/src/LyXFunc.cpp @@ -588,6 +588,23 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const break; } + case LFUN_BUFFER_UPDATE: + case LFUN_BUFFER_VIEW: + case LFUN_MASTER_BUFFER_UPDATE: + case LFUN_MASTER_BUFFER_VIEW: { + typedef vector Formats; + Formats formats; + formats = buf->exportableFormats(true); + Formats::const_iterator fit = formats.begin(); + Formats::const_iterator end = formats.end(); + enable = false; + for (; fit != end ; ++fit) { + if ((*fit)->name() == to_utf8(cmd.argument())) + enable = true; + } + break; + } + case LFUN_WORD_FIND_FORWARD: case LFUN_WORD_FIND_BACKWARD: case LFUN_WORD_FINDADV: @@ -596,10 +613,6 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const case LFUN_CANCEL: case LFUN_META_PREFIX: case LFUN_BUFFER_CLOSE: - case LFUN_BUFFER_UPDATE: - case LFUN_BUFFER_VIEW: - case LFUN_MASTER_BUFFER_UPDATE: - case LFUN_MASTER_BUFFER_VIEW: case LFUN_BUFFER_IMPORT: case LFUN_BUFFER_AUTO_SAVE: case LFUN_RECONFIGURE: