#include "frontends/FileDialog.h"
#include "support/filetools.h" // OnlyPath, OnlyFilename
+#include "support/globbing.h"
+using lyx::support::FileFilterList;
using lyx::support::MakeAbsPath;
using lyx::support::MakeRelPath;
using lyx::support::OnlyFilename;
string const browseFile(string const & filename,
string const & title,
- string const & pattern,
+ FileFilterList const & filters,
bool save,
pair<string,string> const & dir1,
pair<string,string> const & dir2)
while (true) {
if (save)
- result = fileDlg.save(lastPath, pattern,
+ result = fileDlg.save(lastPath, filters,
OnlyFilename(filename));
else
- result = fileDlg.open(lastPath, pattern,
+ result = fileDlg.open(lastPath, filters,
OnlyFilename(filename));
if (result.second.empty())
string const browseRelFile(string const & filename,
- string const & refpath,
- string const & title,
- string const & pattern,
- bool save,
- pair<string,string> const & dir1,
- pair<string,string> const & dir2)
+ string const & refpath,
+ string const & title,
+ FileFilterList const & filters,
+ bool save,
+ pair<string,string> const & dir1,
+ pair<string,string> const & dir2)
{
string const fname = MakeAbsPath(filename, refpath);
- string const outname = browseFile(fname, title, pattern, save,
+ string const outname = browseFile(fname, title, filters, save,
dir1, dir2);
string const reloutname = MakeRelPath(outname, refpath);
if (prefixIs(reloutname, "../"))