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.
14 #include "FormFiledialog.h"
15 #include "frontends/FileDialog.h"
16 #include "frontends/LyXView.h"
17 #include "bufferview_funcs.h"
21 #include "support/lstrings.h"
24 using namespace lyx::support;
30 FileDialog::FileDialog(string const &t, kb_action s, Button b1, Button b2)
31 : private_(0), title_(t), success_(s)
33 private_ = new FileDialog::Private();
35 private_->SetButton(0, b1.first, b1.second);
36 private_->SetButton(1, b2.first, b2.second);
40 FileDialog::~FileDialog()
46 FileDialog::Result const FileDialog::save(string const & path, string const & mask, string const & suggested)
48 return open(path, mask, suggested);
52 FileDialog::Result const FileDialog::opendir(string const & path, string const & suggested)
54 lyxerr[Debug::GUI] << "filedialog open with path \"" << path << "\", suggested \""
55 << suggested << '"' << endl;
57 // no support for asynchronous selection yet
59 FileDialog::Result result;
61 result.first = FileDialog::Chosen;
62 result.second = private_->SelectDir(title_, path, suggested);
68 FileDialog::Result const FileDialog::open(string const & path, string const & mask, string const & suggested)
75 rsplit(mask, filter, '|');
80 lyxerr[Debug::GUI] << "filedialog open with path \"" << path << "\", mask \""
81 << filter << "\", suggested \"" << suggested << '"' << endl;
83 // no support for asynchronous selection yet
85 FileDialog::Result result;
87 result.first = FileDialog::Chosen;
88 result.second = private_->Select(title_, path, filter, suggested);