mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 05:25:26 +00:00
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:
parent
723e8dd3c6
commit
bcec816212
@ -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
|
||||
|
@ -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)
|
||||
{
|
||||
kernel().dispatch(FuncRequest(LFUN_CHILDOPEN, 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");
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user