New LFUN buffer-external-modification-clear

This commit is contained in:
Guillaume Munch 2017-03-01 21:16:37 +01:00
parent 656bc46892
commit 299242bb16
3 changed files with 20 additions and 0 deletions

View File

@ -468,6 +468,7 @@ enum FuncCode
LFUN_BRANCH_INVERT, // rgheck, 20160712
LFUN_LYX_ACTIVATE, // skostysh, 20160804
LFUN_ICON_SIZE, // daniel, 20160712
LFUN_BUFFER_EXTERNAL_MODIFICATION_CLEAR,// gm, 20170302
LFUN_LASTACTION // end of the table
};

View File

@ -878,6 +878,16 @@ void LyXAction::init()
*/
{ LFUN_BUFFER_WRITE_AS, "buffer-write-as", ReadOnly, Buffer },
/*!
* \var lyx::FuncCode lyx::LFUN_BUFFER_EXTERNAL_MODIFICATION_CLEAR
* \li Action: Clear the external modification flag on the current buffer.
* \li Syntax: buffer-external-modification-clear
* \li Origin: gm, 2 March 2017
* \endvar
*/
{ LFUN_BUFFER_EXTERNAL_MODIFICATION_CLEAR,
"buffer-external-modification-clear", ReadOnly, Buffer },
/*!
* \var lyx::FuncCode lyx::LFUN_BUFFER_ZOOM_IN
* \li Action: Increases the zoom of the screen fonts.

View File

@ -1848,6 +1848,10 @@ bool GuiView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
break;
}
case LFUN_BUFFER_EXTERNAL_MODIFICATION_CLEAR:
enable = doc_buffer && doc_buffer->notifiesExternalModification();
break;
case LFUN_BUFFER_WRITE_AS:
case LFUN_BUFFER_EXPORT_AS:
enable = doc_buffer != 0;
@ -3773,6 +3777,11 @@ void GuiView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
break;
}
case LFUN_BUFFER_EXTERNAL_MODIFICATION_CLEAR:
LASSERT(doc_buffer, break);
doc_buffer->clearExternalModification();
break;
case LFUN_BUFFER_CLOSE:
closeBuffer();
break;