Changes to External controller for GTK implementation

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13693 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
John Spray 2006-04-19 09:11:25 +00:00
parent 9db70c5346
commit 35948be234
3 changed files with 25 additions and 10 deletions

View File

@ -1,3 +1,7 @@
2006-04-19 Bernhard Reiter <ockham@gmx.net>
* ControlExternal.[Ch]: Split browse(...) half, introducing
getTemplateFilters(...)
2006-03-10 Martin Vermeer <martin.vermeer@hut.fi>
* ControlChanges.C: fix bug 2212: First change is skipped in

View File

@ -140,22 +140,30 @@ external::Template ControlExternal::getTemplate(int i) const
}
string const ControlExternal::browse(string const & input,
string const & template_name) const
string const
ControlExternal::getTemplateFilters(string const & template_name) const
{
string const title = _("Select external file");
string const bufpath = kernel().bufferFilepath();
/// Determine the template file extension
external::TemplateManager const & etm =
external::TemplateManager::get();
external::Template const * const et_ptr =
etm.getTemplateByName(template_name);
FileFilterList const filter = et_ptr ?
FileFilterList(et_ptr->fileRegExp) :
FileFilterList();
if (et_ptr)
return et_ptr->fileRegExp;
return string();
}
string const ControlExternal::browse(string const & input,
string const & template_name) const
{
string const title = _("Select external file");
string const bufpath = kernel().bufferFilepath();
FileFilterList const filter =
FileFilterList(getTemplateFilters(template_name));
std::pair<string, string> dir1(N_("Documents|#o#O"),
string(lyxrc.document_path));

View File

@ -65,8 +65,11 @@ public:
///
external::Template getTemplate(int) const;
///
std::string const
getTemplateFilters(std::string const & template_name) const;
///
std::string const browse(std::string const & input_file,
std::string const & tempalate_name) const;
std::string const & template_name) const;
/// Read the Bounding Box from a eps or ps-file
std::string const readBB(std::string const & file);