From: John Levon Date: Sun, 26 Aug 2001 19:19:27 +0000 (+0000) Subject: forgot cvs add ... X-Git-Tag: 1.6.10~20752 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=f1dac2b3eac80b6c3b32895f5d512b97eb29bf02;p=lyx.git forgot cvs add ... git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2593 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt2/QERT.C b/src/frontends/qt2/QERT.C new file mode 100644 index 0000000000..4b56c82026 --- /dev/null +++ b/src/frontends/qt2/QERT.C @@ -0,0 +1,59 @@ +/** + * \file QERT.C + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author John Levon + */ + +#include + +#include "QERTDialog.h" +#include "ControlERT.h" +#include "QERT.h" +#include "Qt2BC.h" +#include "gettext.h" + +#include +#include + +typedef Qt2CB > base_class; + +QERT::QERT(ControlERT & c) + : base_class(c, _("LaTeX ERT")) +{ +} + + +void QERT::build_dialog() +{ + dialog_.reset(new QERTDialog(this)); + + bc().setOK(dialog_->okPB); + bc().setCancel(dialog_->closePB); +} + + +void QERT::apply() +{ + if (dialog_->openRB->isChecked()) + controller().params().status = InsetERT::Open; + else if (dialog_->inlineRB->isChecked()) + controller().params().status = InsetERT::Inlined; + else + controller().params().status = InsetERT::Collapsed; +} + + +void QERT::update_contents() +{ + QRadioButton * rb; + + switch (controller().params().status) { + case InsetERT::Open: rb = dialog_->openRB; break; + case InsetERT::Inlined: rb = dialog_->inlineRB; break; + case InsetERT::Collapsed: rb = dialog_->collapsedRB; break; + } + + rb->setChecked(true); +} diff --git a/src/frontends/qt2/QERT.h b/src/frontends/qt2/QERT.h new file mode 100644 index 0000000000..5c42aff9a4 --- /dev/null +++ b/src/frontends/qt2/QERT.h @@ -0,0 +1,35 @@ +// -*- C++ -*- +/** + * \file QERT.h + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author John Levon + */ + +#ifndef QERT_H +#define QERT_H + +#include "Qt2Base.h" + +class ControlERT; +class QERTDialog; + +class QERT : + public Qt2CB > +{ + friend class QERTDialog; + +public: + QERT(ControlERT &); + +private: + /// Apply changes + virtual void apply(); + /// update + virtual void update_contents(); + /// build the dialog + virtual void build_dialog(); +}; + +#endif // QERT_H diff --git a/src/frontends/qt2/QERTDialog.C b/src/frontends/qt2/QERTDialog.C new file mode 100644 index 0000000000..a2732033e3 --- /dev/null +++ b/src/frontends/qt2/QERTDialog.C @@ -0,0 +1,30 @@ +/** + * \file QERTDialog.C + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author John Levon + */ + +#include "QERTDialog.h" +#include "Dialogs.h" +#include "QERT.h" + +#include + +QERTDialog::QERTDialog(QERT * form) + : QERTDialogBase(0, 0, false, 0), + form_(form) +{ + connect(okPB, SIGNAL(clicked()), + form, SLOT(slotOK())); + connect(closePB, SIGNAL(clicked()), + form, SLOT(slotClose())); +} + + +void QERTDialog::closeEvent(QCloseEvent * e) +{ + form_->slotWMHide(); + e->accept(); +} diff --git a/src/frontends/qt2/QERTDialog.h b/src/frontends/qt2/QERTDialog.h new file mode 100644 index 0000000000..7373a24b5b --- /dev/null +++ b/src/frontends/qt2/QERTDialog.h @@ -0,0 +1,35 @@ +/** + * \file QERTDialog.h + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author John Levon + */ + +#ifndef QERTDIALOG_H +#define QERTDIALOG_H + +#include + +#include "ui/QERTDialogBase.h" +#include "QERT.h" + +class QERTDialog : public QERTDialogBase +{ Q_OBJECT + +public: + QERTDialog(QERT * form); + +protected slots: + void change_adaptor() { + form_->changed(); + } + +protected: + virtual void closeEvent(QCloseEvent * e); + +private: + QERT * form_; +}; + +#endif // QERTDIALOG_H diff --git a/src/frontends/qt2/ui/QERTDialog.ui b/src/frontends/qt2/ui/QERTDialog.ui new file mode 100644 index 0000000000..22387f4352 --- /dev/null +++ b/src/frontends/qt2/ui/QERTDialog.ui @@ -0,0 +1,188 @@ + +QERTDialogBase + + QDialog + + name + QERTDialogBase + + + geometry + + 0 + 0 + 197 + 158 + + + + caption + ERT inset display + + + + margin + 11 + + + spacing + 6 + + + QButtonGroup + + name + ertBG + + + title + ERT inset display + + + + margin + 11 + + + spacing + 6 + + + QRadioButton + + name + inlineRB + + + text + &Inline + + + toolTip + Show ERT inline + + + + QRadioButton + + name + collapsedRB + + + text + &Collapsed + + + toolTip + Show ERT button only + + + + QRadioButton + + name + openRB + + + text + &Open + + + toolTip + Show ERT contents + + + + + + QLayoutWidget + + name + Layout2 + + + + margin + 0 + + + spacing + 6 + + + + name + Spacer3 + + + orientation + Horizontal + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + + + QPushButton + + name + okPB + + + text + OK + + + default + false + + + + QPushButton + + name + closePB + + + text + &Close + + + default + true + + + + + + + + + inlineRB + toggled(bool) + QERTDialogBase + change_adaptor() + + + collapsedRB + toggled(bool) + QERTDialogBase + change_adaptor() + + + openRB + toggled(bool) + QERTDialogBase + change_adaptor() + + change_adaptor() + +