Connect to InsetInfo

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33426 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Pavel Sanda 2010-02-12 01:44:04 +00:00
parent 7b227d6899
commit a97f1ddf06
2 changed files with 12 additions and 5 deletions

View File

@ -3490,12 +3490,14 @@ bool Buffer::loadLyXFile(FileName const & s)
&& !LyXVC::file_not_found_hook(s)) && !LyXVC::file_not_found_hook(s))
return false; return false;
if (s.isReadableFile() if (s.isReadableFile()){
&& readFileHelper(s)) { // InsetInfo needs to know if file is under VCS
lyxvc().file_found_hook(s); lyxvc().file_found_hook(s);
if (readFileHelper(s)) {
setReadonly(!s.isWritable()); setReadonly(!s.isWritable());
return true; return true;
} }
}
return false; return false;
} }

View File

@ -23,6 +23,7 @@
#include "LayoutFile.h" #include "LayoutFile.h"
#include "LyXAction.h" #include "LyXAction.h"
#include "LyXRC.h" #include "LyXRC.h"
#include "LyXVC.h"
#include "Lexer.h" #include "Lexer.h"
#include "MetricsInfo.h" #include "MetricsInfo.h"
#include "ParagraphParameters.h" #include "ParagraphParameters.h"
@ -173,7 +174,8 @@ bool InsetInfo::validateModifyArgument(docstring const & arg) const
case TEXTCLASS_INFO: case TEXTCLASS_INFO:
return true; return true;
case BUFFER_INFO: case BUFFER_INFO:
return name == "name" || name == "path" || name == "class"; return name == "name" || name == "path" || name == "class" ||
name == "file-revision";
} }
return false; return false;
} }
@ -371,6 +373,9 @@ void InsetInfo::updateInfo()
setText(from_utf8(buffer().filePath())); setText(from_utf8(buffer().filePath()));
else if (name_ == "class") else if (name_ == "class")
setText(from_utf8(bp.documentClass().name())); setText(from_utf8(bp.documentClass().name()));
else if (name_ == "file-revision" && buffer().lyxvc().inUse() &&
!buffer().lyxvc().revisionInfo(LyXVC::File).empty())
setText(from_utf8(buffer().lyxvc().revisionInfo(LyXVC::File)));
else else
setText(_("Unknown buffer info")); setText(_("Unknown buffer info"));
break; break;