lyx_mirror/src/frontends/qt4/QDocument.C
Abdelrazak Younes e6fea4b844 Patch 1 Log:
* controllers/Dialog.[Ch]
  - View::title_ is now a docstring (ctor and access functions changed)

* controllers/ControlLog.[Ch]
  - title() now returns a docstring

* controllers/ControlLog.[Ch]
  - title() now returns a docstring

* qt4/*: adapted to above changes.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15283 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-09 10:35:14 +00:00

102 lines
1.7 KiB
C

/**
* \file QDocument.C
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author Edwin Leuven
*
* Full author contact details are available in file CREDITS.
*/
#include <config.h>
#include "QDocument.h"
#include "QDocumentDialog.h"
#include "Qt2BC.h"
#include "qt_helpers.h"
#include "bufferparams.h"
#include "FloatPlacement.h"
#include "gettext.h"
#include "helper_funcs.h" // getSecond()
#include "language.h"
#include "lyxrc.h" // defaultUnit
#include "lyxtextclasslist.h"
#include "support/lstrings.h"
#include "controllers/ControlDocument.h"
#include "controllers/frnt_lang.h"
#include "lengthcombo.h"
using lyx::support::bformat;
using lyx::support::getVectorFromString;
using std::distance;
using std::vector;
using std::string;
namespace lyx {
namespace frontend {
typedef QController<ControlDocument, QView<QDocumentDialog> > base_class;
QDocument::QDocument(Dialog & parent)
: base_class(parent, _("Document Settings"))
{}
void QDocument::build_dialog()
{
dialog_.reset(new QDocumentDialog(this));
}
void QDocument::showPreamble()
{
dialog_->showPreamble();
}
void QDocument::apply()
{
if (!dialog_.get())
return;
dialog_->apply(controller().params());
}
void QDocument::update_contents()
{
if (!dialog_.get())
return;
dialog_->update(controller().params());
}
void QDocument::saveDocDefault()
{
// we have to apply the params first
apply();
controller().saveAsDefault();
}
void QDocument::useClassDefaults()
{
BufferParams & params = controller().params();
///\todo verify the use of below with lyx-devel:
params.textclass = dialog_->latexModule->classCO->currentIndex();
params.useClassDefaults();
update_contents();
}
} // namespace frontend
} // namespace lyx