merge QERT and QERTDialog

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17946 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2007-04-24 13:47:33 +00:00
parent 822fbb710c
commit 90e03494bb
5 changed files with 66 additions and 99 deletions

View File

@ -100,7 +100,7 @@ MOCFILES = \
QDelimiterDialog.C QDelimiterDialog.h \
QDocumentDialog.C QDocumentDialog.h \
QErrorListDialog.C QErrorListDialog.h \
QERTDialog.C QERTDialog.h \
QERT.C QERT.h \
QExternalDialog.C QExternalDialog.h \
QFloatDialog.C QFloatDialog.h \
QGraphicsDialog.C QGraphicsDialog.h \

View File

@ -11,23 +11,61 @@
#include <config.h>
#include "QERT.h"
#include "QERTDialog.h"
#include "Qt2BC.h"
#include "controllers/ControlERT.h"
#include <qradiobutton.h>
#include <qpushbutton.h>
#include <QRadioButton>
#include <QPushButton>
#include <QCloseEvent>
namespace lyx {
namespace frontend {
typedef QController<ControlERT, QView<QERTDialog> > ert_base_class;
/////////////////////////////////////////////////////////////////////
//
// QERTDialog
//
/////////////////////////////////////////////////////////////////////
QERTDialog::QERTDialog(QERT * form)
: form_(form)
{
setupUi(this);
connect(okPB, SIGNAL(clicked()), form, SLOT(slotOK()));
connect(closePB, SIGNAL(clicked()), form, SLOT(slotClose()));
connect(inlineRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(collapsedRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(openRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
}
void QERTDialog::closeEvent(QCloseEvent * e)
{
form_->slotWMHide();
e->accept();
}
void QERTDialog::change_adaptor()
{
form_->changed();
}
/////////////////////////////////////////////////////////////////////
//
// QERT
//
/////////////////////////////////////////////////////////////////////
typedef QController<ControlERT, QView<QERTDialog> > ERTBase;
QERT::QERT(Dialog & parent)
: ert_base_class(parent, _("TeX Code Settings"))
: ERTBase(parent, _("TeX Code Settings"))
{
}
@ -67,3 +105,5 @@ void QERT::update_contents()
} // namespace frontend
} // namespace lyx
#include "QERT_moc.cpp"

View File

@ -13,11 +13,30 @@
#define QERT_H
#include "QDialogView.h"
#include "QERTDialog.h"
#include "ui/ERTUi.h"
#include <QCloseEvent>
#include <QDialog>
namespace lyx {
namespace frontend {
class QERT;
class QERTDialog : public QDialog, public Ui::QERTUi {
Q_OBJECT
public:
QERTDialog(QERT * form);
protected Q_SLOTS:
virtual void change_adaptor();
protected:
virtual void closeEvent(QCloseEvent * e);
private:
QERT * form_;
};
class ControlERT;
class QERT : public QController<ControlERT, QView<QERTDialog> >

View File

@ -1,52 +0,0 @@
/**
* \file QERTDialog.C
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author John Levon
*
* Full author contact details are available in file CREDITS.
*/
#include <config.h>
#include "QERTDialog.h"
#include "QERT.h"
#include <QPushButton>
#include <QCloseEvent>
namespace lyx {
namespace frontend {
QERTDialog::QERTDialog(QERT * form)
: form_(form)
{
setupUi(this);
connect(okPB, SIGNAL(clicked()),
form, SLOT(slotOK()));
connect(closePB, SIGNAL(clicked()),
form, SLOT(slotClose()));
connect( inlineRB, SIGNAL( clicked() ), this, SLOT( change_adaptor() ) );
connect( collapsedRB, SIGNAL( clicked() ), this, SLOT( change_adaptor() ) );
connect( openRB, SIGNAL( clicked() ), this, SLOT( change_adaptor() ) );
}
void QERTDialog::closeEvent(QCloseEvent * e)
{
form_->slotWMHide();
e->accept();
}
void QERTDialog::change_adaptor()
{
form_->changed();
}
} // namespace frontend
} // namespace lyx
#include "QERTDialog_moc.cpp"

View File

@ -1,40 +0,0 @@
// -*- C++ -*-
/**
* \file QERTDialog.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author John Levon
*
* Full author contact details are available in file CREDITS.
*/
#ifndef QERTDIALOG_H
#define QERTDIALOG_H
#include "ui/ERTUi.h"
#include <QCloseEvent>
#include <QDialog>
namespace lyx {
namespace frontend {
class QERT;
class QERTDialog : public QDialog, public Ui::QERTUi {
Q_OBJECT
public:
QERTDialog(QERT * form);
protected Q_SLOTS:
virtual void change_adaptor();
protected:
virtual void closeEvent(QCloseEvent * e);
private:
QERT * form_;
};
} // namespace frontend
} // namespace lyx
#endif // QERTDIALOG_H