2 * \file xforms/FileDialog.C
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "FormFiledialog.h"
18 #include "support/lstrings.h"
20 using namespace lyx::support;
27 FileDialog::FileDialog(string const &t, kb_action s, Button b1, Button b2)
28 : private_(0), title_(t), success_(s)
30 private_ = new FileDialog::Private();
32 private_->SetButton(0, b1.first, b1.second);
33 private_->SetButton(1, b2.first, b2.second);
37 FileDialog::~FileDialog()
43 FileDialog::Result const FileDialog::save(string const & path, string const & mask, string const & suggested)
45 return open(path, mask, suggested);
49 FileDialog::Result const FileDialog::opendir(string const & path, string const & suggested)
51 lyxerr[Debug::GUI] << "filedialog open with path \"" << path << "\", suggested \""
52 << suggested << '"' << endl;
54 // no support for asynchronous selection yet
56 FileDialog::Result result;
58 result.first = FileDialog::Chosen;
59 result.second = private_->SelectDir(title_, path, suggested);
65 FileDialog::Result const FileDialog::open(string const & path, string const & mask, string const & suggested)
72 rsplit(mask, filter, '|');
77 lyxerr[Debug::GUI] << "filedialog open with path \"" << path << "\", mask \""
78 << filter << "\", suggested \"" << suggested << '"' << endl;
80 // no support for asynchronous selection yet
82 FileDialog::Result result;
84 result.first = FileDialog::Chosen;
85 result.second = private_->Select(title_, path, filter, suggested);