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/filefilterlist.h"
20 #include "support/lstrings.h"
22 using lyx::support::rsplit;
23 using lyx::support::FileFilterList;
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,
46 FileFilterList const & filters,
47 string const & suggested)
49 return open(path, filters, suggested);
53 FileDialog::Result const FileDialog::opendir(string const & path, string const & suggested)
55 lyxerr[Debug::GUI] << "filedialog open with path \"" << path << "\", suggested \""
56 << suggested << '"' << endl;
58 // no support for asynchronous selection yet
60 FileDialog::Result result;
62 result.first = FileDialog::Chosen;
63 result.second = private_->SelectDir(title_, path, suggested);
69 FileDialog::Result const FileDialog::open(string const & path,
70 FileFilterList const & filters,
71 string const & suggested)
73 lyxerr[Debug::GUI] << "filedialog open with path \"" << path
74 << "\", mask \"" << filters.as_string()
75 << "\", suggested \"" << suggested << '"' << endl;
77 // no support for asynchronous selection yet
79 FileDialog::Result result;
81 result.first = FileDialog::Chosen;
82 result.second = private_->Select(title_, path, filters, suggested);