3 * Copyright 2001 the LyX Team
4 * Read the file COPYING
10 #pragma implementation
17 #include "commandtags.h"
21 #include "frontends/FileDialog.h"
23 #include "FileDialog_private.h"
31 FileDialog::FileDialog(LyXView *lv, string const &t, kb_action s, Button b1, Button b2)
32 : private_(0), lv_(lv), title_(t), success_(s)
38 FileDialog::~FileDialog()
43 FileDialog::Result const FileDialog::Select(string const & path, string const & mask, string const & suggested)
48 filter = _("*|All files");
50 LyXKFileDialog * dlg = new LyXKFileDialog(lv_, success_, path, filter, title_);
52 lyxerr[Debug::GUI] << "Select with path \"" << path << "\", mask \"" << filter << "\", suggested \"" << suggested << endl;
54 if (!suggested.empty())
55 dlg->setSelection(suggested.c_str());
57 if (success_ == LFUN_SELECT_FILE_SYNC) {
58 FileDialog::Result result;
60 lyxerr[Debug::GUI] << "Synchronous FileDialog : " << endl;
62 result.first = FileDialog::Chosen;
64 int res = dlg->exec();
66 lyxerr[Debug::GUI] << "result " << res << endl;
68 if (res == QDialog::Accepted)
69 result.second = string(dlg->selectedFile().data());
78 return make_pair(FileDialog::Later, string());