4 * Copyright 2001 the LyX Team
5 * Read the file COPYING
11 #pragma implementation
18 #include "commandtags.h"
20 #include "support/lstrings.h"
22 // temp. hack until Allow/ProhibitInput is not
23 // needed any more in src/ - for now it's simplest
26 #include "bufferview_funcs.h"
28 #include "frontends/FileDialog.h"
30 #include "FormFiledialog.h"
38 FileDialog::FileDialog(LyXView *lv, string const &t, kb_action s, Button b1, Button b2)
39 : private_(0), lv_(lv), title_(t), success_(s)
41 private_ = new FileDialog::Private();
43 private_->SetButton(0, b1.first, b1.second);
44 private_->SetButton(1, b2.first, b2.second);
48 FileDialog::~FileDialog()
55 FileDialog::Result const FileDialog::Select(string const & path, string const & mask, string const & suggested)
62 rsplit(mask, filter, '|');
67 lyxerr[Debug::GUI] << "Select with path \"" << path << "\", mask \"" << filter << "\", suggested \"" << suggested << "\"" << endl;
69 // no support for asynchronous selection yet
71 ProhibitInput(lv_->view());
73 FileDialog::Result result;
75 result.first = FileDialog::Chosen;
76 result.second = private_->Select(title_, path, filter, suggested);
78 AllowInput(lv_->view());