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 // temp. hack until Allow/prohibitInput is not
17 // needed any more in src/ - for now it's simplest
19 #include "frontends/LyXView.h"
20 #include "bufferview_funcs.h"
22 #include "commandtags.h"
24 #include "support/lstrings.h"
32 FileDialog::FileDialog(LyXView *lv, string const &t, kb_action s, Button b1, Button b2)
33 : private_(0), lv_(lv), title_(t), success_(s)
35 private_ = new FileDialog::Private(lv->getDialogs());
37 private_->SetButton(0, b1.first, b1.second);
38 private_->SetButton(1, b2.first, b2.second);
42 FileDialog::~FileDialog()
48 FileDialog::Result const FileDialog::save(string const & path, string const & mask, string const & suggested)
50 return open(path, mask, suggested);
54 FileDialog::Result const FileDialog::opendir(string const & path, string const & suggested)
56 lyxerr[Debug::GUI] << "filedialog open with path \"" << path << "\", suggested \""
57 << suggested << '"' << endl;
59 // no support for asynchronous selection yet
63 FileDialog::Result result;
65 result.first = FileDialog::Chosen;
66 result.second = private_->SelectDir(title_, path, suggested);
74 FileDialog::Result const FileDialog::open(string const & path, string const & mask, string const & suggested)
81 rsplit(mask, filter, '|');
86 lyxerr[Debug::GUI] << "filedialog open with path \"" << path << "\", mask \""
87 << filter << "\", suggested \"" << suggested << '"' << endl;
89 // no support for asynchronous selection yet
93 FileDialog::Result result;
95 result.first = FileDialog::Chosen;
96 result.second = private_->Select(title_, path, filter, suggested);