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 "frontends/FileDialog.h"
14 #include "FormFiledialog.h"
19 #include "support/lstrings.h"
21 using namespace lyx::support;
28 FileDialog::FileDialog(string const &t, kb_action s, Button b1, Button b2)
29 : private_(0), title_(t), success_(s)
31 private_ = new FileDialog::Private();
33 private_->SetButton(0, b1.first, b1.second);
34 private_->SetButton(1, b2.first, b2.second);
38 FileDialog::~FileDialog()
44 FileDialog::Result const FileDialog::save(string const & path, string const & mask, string const & suggested)
46 return open(path, mask, suggested);
50 FileDialog::Result const FileDialog::opendir(string const & path, string const & suggested)
52 lyxerr[Debug::GUI] << "filedialog open with path \"" << path << "\", suggested \""
53 << suggested << '"' << endl;
55 // no support for asynchronous selection yet
57 FileDialog::Result result;
59 result.first = FileDialog::Chosen;
60 result.second = private_->SelectDir(title_, path, suggested);
66 FileDialog::Result const FileDialog::open(string const & path, string const & mask, string const & suggested)
73 rsplit(mask, filter, '|');
78 lyxerr[Debug::GUI] << "filedialog open with path \"" << path << "\", mask \""
79 << filter << "\", suggested \"" << suggested << '"' << endl;
81 // no support for asynchronous selection yet
83 FileDialog::Result result;
85 result.first = FileDialog::Chosen;
86 result.second = private_->Select(title_, path, filter, suggested);