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,11 +3490,13 @@ bool Buffer::loadLyXFile(FileName const & s)
&& !LyXVC::file_not_found_hook(s))
return false;
if (s.isReadableFile()
&& readFileHelper(s)) {
if (s.isReadableFile()){
// InsetInfo needs to know if file is under VCS
lyxvc().file_found_hook(s);
setReadonly(!s.isWritable());
return true;
if (readFileHelper(s)) {
setReadonly(!s.isWritable());
return true;
}
}
return false;
}

View File

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