#ifdef USE_NATIVE_FILEDIALOG
string const startsWith = makeAbsPath(suggested, path);
result.second = fromqstr(QFileDialog::getSaveFileName(
#ifdef USE_NATIVE_FILEDIALOG
string const startsWith = makeAbsPath(suggested, path);
result.second = fromqstr(QFileDialog::getSaveFileName(
- qApp->focusWidget() ? qApp->focusWidget() : qApp->mainWidget(),
title_.c_str(), toqstr(startsWith), toqstr(filters.as_string()) ));
#else
LyXFileDialog dlg(title_, path, filters, private_->b1, private_->b2);
title_.c_str(), toqstr(startsWith), toqstr(filters.as_string()) ));
#else
LyXFileDialog dlg(title_, path, filters, private_->b1, private_->b2);
int res = dlg.exec();
lyxerr[Debug::GUI] << "result " << res << endl;
if (res == QDialog::Accepted)
int res = dlg.exec();
lyxerr[Debug::GUI] << "result " << res << endl;
if (res == QDialog::Accepted)
- result.second = fromqstr(dlg.selectedFile());
+ result.second = fromqstr(dlg.selectedFiles()[0]);
dlg.hide();
#endif
return result;
dlg.hide();
#endif
return result;
#ifdef USE_NATIVE_FILEDIALOG
string const startsWith = makeAbsPath(suggested, path);
result.second = fromqstr(QFileDialog::getOpenFileName(
#ifdef USE_NATIVE_FILEDIALOG
string const startsWith = makeAbsPath(suggested, path);
result.second = fromqstr(QFileDialog::getOpenFileName(
- qApp->focusWidget() ? qApp->focusWidget() : qApp->mainWidget(),
title_.c_str(), toqstr(startsWith), toqstr(filters.as_string()) ));
#else
LyXFileDialog dlg(title_, path, filters, private_->b1, private_->b2);
title_.c_str(), toqstr(startsWith), toqstr(filters.as_string()) ));
#else
LyXFileDialog dlg(title_, path, filters, private_->b1, private_->b2);
int res = dlg.exec();
lyxerr[Debug::GUI] << "result " << res << endl;
if (res == QDialog::Accepted)
int res = dlg.exec();
lyxerr[Debug::GUI] << "result " << res << endl;
if (res == QDialog::Accepted)
- result.second = fromqstr(dlg.selectedFile());
+ result.second = fromqstr(dlg.selectedFiles()[0]);
dlg.hide();
#endif
return result;
dlg.hide();
#endif
return result;
#ifdef USE_NATIVE_FILEDIALOG
string const startsWith = makeAbsPath(suggested, path);
result.second = fromqstr(QFileDialog::getExistingDirectory(
#ifdef USE_NATIVE_FILEDIALOG
string const startsWith = makeAbsPath(suggested, path);
result.second = fromqstr(QFileDialog::getExistingDirectory(
- qApp->focusWidget() ? qApp->focusWidget() : qApp->mainWidget(),
title_.c_str(),toqstr(startsWith) ));
#else
FileFilterList const filter(_("Directories"));
title_.c_str(),toqstr(startsWith) ));
#else
FileFilterList const filter(_("Directories"));
int res = dlg.exec();
lyxerr[Debug::GUI] << "result " << res << endl;
if (res == QDialog::Accepted)
int res = dlg.exec();
lyxerr[Debug::GUI] << "result " << res << endl;
if (res == QDialog::Accepted)
- result.second = fromqstr(dlg.selectedFile());
+ result.second = fromqstr(dlg.selectedFiles()[0]);
dlg.hide();
#endif
return result;
dlg.hide();
#endif
return result;
#include <config.h>
#include "FileDialog_private.h"
#include <config.h>
#include "FileDialog_private.h"
#include "qt_helpers.h"
#include "support/filefilterlist.h"
#include "qt_helpers.h"
#include "support/filefilterlist.h"
lyx::support::FileFilterList const & filters,
FileDialog::Button const & b1,
FileDialog::Button const & b2)
lyx::support::FileFilterList const & filters,
FileDialog::Button const & b1,
FileDialog::Button const & b2)
- : QFileDialog(qApp->focusWidget() ? qApp->focusWidget() : qApp->mainWidget(),
+ // FIXME replace that with theApp->gui()->currentView()
+ : QFileDialog(qApp->focusWidget(),
toqstr(t), toqstr(p), toqstr(filters.as_string())),
b1_(0), b2_(0)
{
toqstr(t), toqstr(p), toqstr(filters.as_string())),
b1_(0), b2_(0)
{
+ setWindowTitle(toqstr(t));
QList<QHBoxLayout *> layout = findChildren<QHBoxLayout *>();
QList<QHBoxLayout *> layout = findChildren<QHBoxLayout *>();
void LyXFileDialog::buttonClicked()
{
if (sender() == b1_)
void LyXFileDialog::buttonClicked()
{
if (sender() == b1_)
- setDir(toqstr(b1_dir_));
+ setDirectory(toqstr(b1_dir_));
else if (sender() == b2_)
else if (sender() == b2_)
- setDir(toqstr(b2_dir_));
+ setDirectory(toqstr(b2_dir_));
}
#include "FileDialog_private_moc.cpp"
}
#include "FileDialog_private_moc.cpp"
#ifndef FILEDIALOG_PRIVATE_H
#define FILEDIALOG_PRIVATE_H
#ifndef FILEDIALOG_PRIVATE_H
#define FILEDIALOG_PRIVATE_H
#include "frontends/FileDialog.h"
#include "frontends/FileDialog.h"
#include <QFileDialog>
namespace lyx {
#include <QFileDialog>
namespace lyx {