mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-11 03:03:06 +00:00
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:
parent
7b227d6899
commit
a97f1ddf06
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user