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"
19 #include "commandtags.h"
21 #include "support/lstrings.h"
29 FileDialog::FileDialog(string const &t, kb_action s, Button b1, Button b2)
30 : private_(0), title_(t), success_(s)
32 private_ = new FileDialog::Private();
34 private_->SetButton(0, b1.first, b1.second);
35 private_->SetButton(1, b2.first, b2.second);
39 FileDialog::~FileDialog()
45 FileDialog::Result const FileDialog::save(string const & path, string const & mask, string const & suggested)
47 return open(path, mask, suggested);
51 FileDialog::Result const FileDialog::opendir(string const & path, string const & suggested)
53 lyxerr[Debug::GUI] << "filedialog open with path \"" << path << "\", suggested \""
54 << suggested << '"' << endl;
56 // no support for asynchronous selection yet
58 FileDialog::Result result;
60 result.first = FileDialog::Chosen;
61 result.second = private_->SelectDir(title_, path, suggested);
67 FileDialog::Result const FileDialog::open(string const & path, string const & mask, string const & suggested)
74 rsplit(mask, filter, '|');
79 lyxerr[Debug::GUI] << "filedialog open with path \"" << path << "\", mask \""
80 << filter << "\", suggested \"" << suggested << '"' << endl;
82 // no support for asynchronous selection yet
84 FileDialog::Result result;
86 result.first = FileDialog::Chosen;
87 result.second = private_->Select(title_, path, filter, suggested);