2 * \file xforms/FileDialog.C
3 * Copyright 2001 the LyX Team
4 * Read the file COPYING
6 * \author John Levon, moz@compsoc.man.ac.uk
12 #pragma implementation
15 #include "FormFiledialog.h"
16 #include "frontends/FileDialog.h"
17 // temp. hack until Allow/prohibitInput is not
18 // needed any more in src/ - for now it's simplest
21 #include "bufferview_funcs.h"
23 #include "commandtags.h"
25 #include "support/lstrings.h"
33 FileDialog::FileDialog(LyXView *lv, string const &t, kb_action s, Button b1, Button b2)
34 : private_(0), lv_(lv), title_(t), success_(s)
36 private_ = new FileDialog::Private();
38 private_->SetButton(0, b1.first, b1.second);
39 private_->SetButton(1, b2.first, b2.second);
43 FileDialog::~FileDialog()
50 FileDialog::Result const FileDialog::Select(string const & path, string const & mask, string const & suggested)
57 rsplit(mask, filter, '|');
62 lyxerr[Debug::GUI] << "Select with path \"" << path << "\", mask \"" << filter << "\", suggested \"" << suggested << "\"" << endl;
64 // no support for asynchronous selection yet
68 FileDialog::Result result;
70 result.first = FileDialog::Chosen;
71 result.second = private_->Select(title_, path, filter, suggested);