lyx_mirror/src/frontends/qt2/FileDialog_private.C
Angus Leeming c10dfd15cd * LyXView: the accessor methods now return a reference to the member
variables, not a pointer.
* WordLangTuple: you can forward-declare a return type you know ;-)
* Qt: get it to compile again, having broken it yesterday.
* Everything else? See above.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4957 a592a061-630c-0410-9148-cb99ea01b6c8
2002-08-13 14:40:38 +00:00

46 lines
903 B
C

/**
* \file FileDialog_private.C
* Copyright 2001 the LyX Team
* Read the file COPYING
*
* \author John Levon
*/
#include <config.h>
#include "LString.h"
#include <qapplication.h>
#include <qfiledialog.h>
#include "QtLyXView.h"
#include "debug.h"
#include "funcrequest.h"
#include "FileDialog_private.h"
LyXFileDialog::LyXFileDialog(LyXView * lv, kb_action a,
string const & p, string const & m, string const & t)
: QFileDialog(p.c_str(), m.c_str(), qApp->mainWidget(), t.c_str(),
a == LFUN_SELECT_FILE_SYNC),
lv_(lv), action_(a)
{
setCaption(t.c_str());
}
void LyXFileDialog::done(int what)
{
lyxerr[Debug::GUI] << "Done FileDialog, value " << what << std::endl;
if (action_ == LFUN_SELECT_FILE_SYNC) {
QDialog::done(what);
return;
}
if (what == QDialog::Accepted)
lv_->getLyXFunc().dispatch(FuncRequest(action_, selectedFile().data()));
delete this;
}