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 #pragma implementation
17 #include "FormFiledialog.h"
18 #include "frontends/FileDialog.h"
19 // temp. hack until Allow/prohibitInput is not
20 // needed any more in src/ - for now it's simplest
22 #include "frontends/LyXView.h"
23 #include "bufferview_funcs.h"
25 #include "commandtags.h"
27 #include "support/lstrings.h"
35 FileDialog::FileDialog(LyXView *lv, string const &t, kb_action s, Button b1, Button b2)
36 : private_(0), lv_(lv), title_(t), success_(s)
38 private_ = new FileDialog::Private(lv->getDialogs());
40 private_->SetButton(0, b1.first, b1.second);
41 private_->SetButton(1, b2.first, b2.second);
45 FileDialog::~FileDialog()
51 FileDialog::Result const FileDialog::save(string const & path, string const & mask, string const & suggested)
53 return open(path, mask, suggested);
57 FileDialog::Result const FileDialog::open(string const & path, string const & mask, string const & suggested)
64 rsplit(mask, filter, '|');
69 lyxerr[Debug::GUI] << "filedialog open with path \"" << path << "\", mask \""
70 << filter << "\", suggested \"" << suggested << "\"" << endl;
72 // no support for asynchronous selection yet
76 FileDialog::Result result;
78 result.first = FileDialog::Chosen;
79 result.second = private_->Select(title_, path, filter, suggested);