From: Abdelrazak Younes Date: Tue, 22 Sep 2009 21:46:16 +0000 (+0000) Subject: Move LFUN_BUFFER_WRITE_ALL status to GuiView with a FIXME. I believe this LFUN should... X-Git-Tag: 2.0.0~5458 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=b379d68d21000cfec935c683d9a74949648b7fcb;p=features.git Move LFUN_BUFFER_WRITE_ALL status to GuiView with a FIXME. I believe this LFUN should go to GuiApplication. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31447 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/LyXFunc.cpp b/src/LyXFunc.cpp index 1a68452d2e..48f3647db7 100644 --- a/src/LyXFunc.cpp +++ b/src/LyXFunc.cpp @@ -474,24 +474,6 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const } */ - case LFUN_BUFFER_WRITE_ALL: { - // We enable the command only if there are some modified buffers - Buffer * first = theBufferList().first(); - enable = false; - if (!first) - break; - Buffer * b = first; - // We cannot use a for loop as the buffer list is a cycle. - do { - if (!b->isClean()) { - enable = true; - break; - } - b = theBufferList().next(b); - } while (b != first); - break; - } - case LFUN_BOOKMARK_GOTO: { const unsigned int num = convert(to_utf8(cmd.argument())); enable = theSession().bookmarks().isValid(num); diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 12f270b24a..71b7a2080b 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -1211,6 +1211,25 @@ bool GuiView::getStatus(FuncRequest const & cmd, FuncStatus & flag) enable = doc_buffer && (doc_buffer->isUnnamed() || !doc_buffer->isClean()); break; + //FIXME: This LFUN should be moved to GuiApplication. + case LFUN_BUFFER_WRITE_ALL: { + // We enable the command only if there are some modified buffers + Buffer * first = theBufferList().first(); + enable = false; + if (!first) + break; + Buffer * b = first; + // We cannot use a for loop as the buffer list is a cycle. + do { + if (!b->isClean()) { + enable = true; + break; + } + b = theBufferList().next(b); + } while (b != first); + break; + } + case LFUN_BUFFER_WRITE_AS: enable = doc_buffer; break;