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 lyx::support::rsplit;
26 FileDialog::FileDialog(string const &t, kb_action s, Button b1, Button b2)
27 : private_(0), title_(t), success_(s)
29 private_ = new FileDialog::Private();
31 private_->SetButton(0, b1.first, b1.second);
32 private_->SetButton(1, b2.first, b2.second);
36 FileDialog::~FileDialog()
42 FileDialog::Result const FileDialog::save(string const & path, string const & mask, string const & suggested)
44 return open(path, mask, suggested);
48 FileDialog::Result const FileDialog::opendir(string const & path, string const & suggested)
50 lyxerr[Debug::GUI] << "filedialog open with path \"" << path << "\", suggested \""
51 << suggested << '"' << endl;
53 // no support for asynchronous selection yet
55 FileDialog::Result result;
57 result.first = FileDialog::Chosen;
58 result.second = private_->SelectDir(title_, path, suggested);
64 FileDialog::Result const FileDialog::open(string const & path, string const & mask, string const & suggested)
71 rsplit(mask, filter, '|');
76 lyxerr[Debug::GUI] << "filedialog open with path \"" << path << "\", mask \""
77 << filter << "\", suggested \"" << suggested << '"' << endl;
79 // no support for asynchronous selection yet
81 FileDialog::Result result;
83 result.first = FileDialog::Chosen;
84 result.second = private_->Select(title_, path, filter, suggested);