let the "load" button of insetinclude do something useful with nonlyx files

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8985 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2004-09-16 18:03:07 +00:00
parent 723e8dd3c6
commit bcec816212
2 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2004-09-15 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* ControlInclude.C (load): open nonlyx files via formats.edit()
2004-08-15 Lars Gullik Bjonnes <larsbj@gullik.net>
* pch.h: new file

View File

@ -17,6 +17,7 @@
#include "Kernel.h"
#include "buffer.h"
#include "format.h"
#include "funcrequest.h"
#include "gettext.h"
#include "lyxrc.h"
@ -98,7 +99,12 @@ string const ControlInclude::browse(string const & in_name, Type in_type) const
void ControlInclude::load(string const & file)
{
string const ext = support::getExtFromContents(file);
if (ext == "lyx")
kernel().dispatch(FuncRequest(LFUN_CHILDOPEN, file));
else
// tex file or other text file in verbatim mode
formats.edit(kernel().buffer(), file, "text");
}