]> git.lyx.org Git - features.git/commitdiff
Attempt to simplify as much as possible Inset parameter dialog creation. We now just...
authorAbdelrazak Younes <younes@lyx.org>
Mon, 15 Feb 2010 23:17:45 +0000 (23:17 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Mon, 15 Feb 2010 23:17:45 +0000 (23:17 +0000)
This new attempt replace the previous attempt with InsetDialog which was still too tight with the older framework.
Status:
float, ert, box, info: migrated
vspace: migrated but buggy. To be fixed later.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33480 a592a061-630c-0410-9148-cb99ea01b6c8

29 files changed:
src/frontends/qt4/Dialog.cpp
src/frontends/qt4/Dialog.h
src/frontends/qt4/FloatPlacement.cpp
src/frontends/qt4/FloatPlacement.h
src/frontends/qt4/GuiBox.cpp
src/frontends/qt4/GuiBox.h
src/frontends/qt4/GuiDocument.h
src/frontends/qt4/GuiERT.cpp
src/frontends/qt4/GuiERT.h
src/frontends/qt4/GuiFloat.cpp [deleted file]
src/frontends/qt4/GuiFloat.h [deleted file]
src/frontends/qt4/GuiInfo.cpp
src/frontends/qt4/GuiInfo.h
src/frontends/qt4/GuiVSpace.cpp
src/frontends/qt4/GuiVSpace.h
src/frontends/qt4/GuiView.cpp
src/frontends/qt4/InsetDialog.cpp [deleted file]
src/frontends/qt4/InsetDialog.h [deleted file]
src/frontends/qt4/InsetParamsDialog.cpp [new file with mode: 0644]
src/frontends/qt4/InsetParamsDialog.h [new file with mode: 0644]
src/frontends/qt4/InsetParamsWidget.cpp [new file with mode: 0644]
src/frontends/qt4/InsetParamsWidget.h [new file with mode: 0644]
src/frontends/qt4/Makefile.am
src/frontends/qt4/ui/BoxUi.ui
src/frontends/qt4/ui/ERTUi.ui
src/frontends/qt4/ui/FloatUi.ui [deleted file]
src/frontends/qt4/ui/InfoUi.ui
src/frontends/qt4/ui/InsetParamsUi.ui [new file with mode: 0644]
src/frontends/qt4/ui/VSpaceUi.ui

index 47db6db5a7bec86a607bfb5065f90aacfd6f8fe2..abc6007deb06393d2c09cb2aebb8de422d9029b0 100644 (file)
@@ -42,17 +42,6 @@ using namespace lyx::support;
 namespace lyx {
 namespace frontend {
 
-bool CheckedLineEdit2::check() const
-{
-       bool const valid = input_->hasAcceptableInput();
-       // Visual feedback.
-       setValid(input_, valid);
-       if (label_)
-               setValid(label_, valid);
-       return valid;
-}
-
-
 Dialog::Dialog(GuiView & lv, QString const & name, QString const & title)
        : name_(name), title_(title), lyxview_(&lv)
 {}
@@ -62,21 +51,6 @@ Dialog::~Dialog()
 {}
 
 
-void Dialog::addCheckedWidget(QLineEdit * input, QWidget * label)
-{
-       checked_line_edits_.append(CheckedLineEdit2(input, label));
-}
-
-
-bool Dialog::checkWidgets() const
-{
-       bool valid = true;
-       Q_FOREACH(CheckedLineEdit2 const & le, checked_line_edits_)
-                       valid &= le.check();
-       return valid;
-}
-
-
 bool Dialog::canApply() const
 {
        FuncRequest const fr(getLfun(), fromqstr(name_));
index 1fd0500636d8709d174340d58a3bc3166d006401..34232d29a2b77d0d6615745d0417e7dcbd8a5db3 100644 (file)
@@ -22,7 +22,6 @@
 #include <QString>
 
 class QWidget;
-class QLineEdit;
 
 namespace lyx {
 
@@ -46,28 +45,6 @@ enum KernelDocType
        DOCBOOK
 };
 
-/// CheckedLineEdit
-// FIXME: Get rid of CheckedLineEdit in ButtonController and rename this one
-// to it.
-class CheckedLineEdit2
-{
-public:
-       CheckedLineEdit2(QLineEdit * input, QWidget * label = 0)
-       : input_(input), label_(label)
-       {}
-       ///     
-       bool check() const;
-
-private:
-       // non-owned
-       QLineEdit * input_;
-       QWidget * label_;
-};
-
-
-typedef QList<CheckedLineEdit2> CheckedLineEdits;
-
-
 /** \c Dialog collects the different parts of a Model-Controller-View
  *  split of a generic dialog together.
  */
@@ -279,11 +256,6 @@ protected:
        void setTitle(QString const & title) { title_ = title; }
        ///
        virtual void apply();
-       /// Add a widget to the list of all widgets whose validity should
-       /// be checked explicitly when the buttons are refreshed.
-       void addCheckedWidget(QLineEdit * input, QWidget * label = 0);
-       /// \return true if all CheckedWidgets are in a valid state.
-       bool checkWidgets() const;
 
 private:
        /** The Dialog's name is the means by which a dialog identifies
@@ -298,9 +270,6 @@ private:
        /// intentionally unimplemented, therefore uncopiable
        Dialog(Dialog const &);
        void operator=(Dialog const &);
-
-       ///
-       CheckedLineEdits checked_line_edits_;
 };
 
 
index 1e3bcbd8ad2a9d7e85723746f5544ac6e48d07d9..c40b3b2ec7b1e80e5dc568216c8c2286a05db566 100644 (file)
@@ -27,8 +27,10 @@ using namespace lyx::support;
 
 namespace lyx {
 
+namespace frontend {
+
 FloatPlacement::FloatPlacement(bool show_options, QWidget * parent)
-       : QWidget(parent), float_list_(0)
+       : InsetParamsWidget(parent), float_list_(0)
 {
        setupUi(this);
 
@@ -244,6 +246,7 @@ void FloatPlacement::checkAllowed()
        }
 }
 
+} // namespace frontend
 } // namespace lyx
 
 #include "moc_FloatPlacement.cpp"
index ba975ad09ff433816580e0a63bccee53c1302f26..dca71b9dbabb8449cbf3e9b48bb3d37ffb18dde6 100644 (file)
 #ifndef FLOATPLACEMENT_H
 #define FLOATPLACEMENT_H
 
+#include "InsetParamsWidget.h"
 #include "ui_FloatPlacementUi.h"
 
-#include <QWidget>
-
 #include "support/docstring.h"
 
 namespace lyx {
@@ -25,15 +24,20 @@ class FloatList;
 class Inset;
 class InsetFloatParams;
 
-class FloatPlacement : public QWidget, public Ui::FloatPlacementUi {
+namespace frontend {
+
+class FloatPlacement : public InsetParamsWidget, public Ui::FloatPlacementUi {
        Q_OBJECT
 public:
        FloatPlacement(bool show_options = false, QWidget * parent = 0);
 
-       ///
+       /// \name DialogView inherited methods
+       //@{
+       InsetCode insetCode() { return FLOAT_CODE; }
+       FuncCode creationCode() { return LFUN_FLOAT_INSERT; }
        void paramsToDialog(Inset const *);
-       ///
        docstring dialogToParams() const;
+       //@}
        ///
        void useWide();
        ///
@@ -47,9 +51,6 @@ private Q_SLOTS:
        void on_defaultsCB_stateChanged(int state);
        void changedSlot();
 
-Q_SIGNALS:
-       void changed();
-
 private:
        ///
        void checkAllowed();
@@ -64,6 +65,7 @@ private:
        FloatList const * float_list_;
 };
 
+} // namespace frontend
 } // namespace lyx
 
 #endif // FLOATPLACEMENT_H
index bd3321e20057cb5ff857222b79efcfd4b197701f..9c6196bbeb7936cacb4b4cc1fd5bc1a08b00c9d6 100644 (file)
@@ -73,8 +73,7 @@ static QStringList boxGuiSpecialLengthNames()
 }
 
 
-GuiBox::GuiBox(GuiView & lv)
-       : InsetDialog(lv, BOX_CODE, LFUN_BOX_INSERT, "box", "Box Settings")
+GuiBox::GuiBox(QWidget * parent) : InsetParamsWidget(parent)
 {
        setupUi(this);
 
@@ -91,15 +90,15 @@ GuiBox::GuiBox(GuiView & lv)
        for (int i = 0; i != ids_spec_.size(); ++i)
                heightUnitsLC->addItem(gui_names_spec_[i], ids_spec_[i]);
 
-       connect(widthED, SIGNAL(textChanged(QString)), this, SLOT(applyView()));
+       connect(widthED, SIGNAL(textChanged(QString)), this, SIGNAL(changed()));
        connect(widthUnitsLC, SIGNAL(selectionChanged(lyx::Length::UNIT)),
-               this, SLOT(applyView()));
-       connect(valignCO, SIGNAL(highlighted(QString)), this, SLOT(applyView()));
-       connect(heightED, SIGNAL(textChanged(QString)), this, SLOT(applyView()));
+               this, SIGNAL(changed()));
+       connect(valignCO, SIGNAL(highlighted(QString)), this, SIGNAL(changed()));
+       connect(heightED, SIGNAL(textChanged(QString)), this, SIGNAL(changed()));
        connect(heightUnitsLC, SIGNAL(selectionChanged(lyx::Length::UNIT)),
-               this, SLOT(applyView()));
-       connect(halignCO, SIGNAL(activated(int)), this, SLOT(applyView()));
-       connect(ialignCO, SIGNAL(activated(int)), this, SLOT(applyView()));
+               this, SIGNAL(changed()));
+       connect(halignCO, SIGNAL(activated(int)), this, SIGNAL(changed()));
+       connect(ialignCO, SIGNAL(activated(int)), this, SIGNAL(changed()));
 
        heightED->setValidator(unsignedLengthValidator(heightED));
        widthED->setValidator(unsignedLengthValidator(widthED));
@@ -112,22 +111,6 @@ GuiBox::GuiBox(GuiView & lv)
 }
 
 
-void GuiBox::enableView(bool enable)
-{
-       typeCO->setEnabled(enable);
-       innerBoxCO->setEnabled(enable);
-       valignCO->setEnabled(enable);
-       ialignCO->setEnabled(enable);
-       halignCO->setEnabled(enable);
-       widthED->setEnabled(enable);
-       widthUnitsLC->setEnabled(enable);
-       heightCB->setEnabled(enable);
-       heightED->setEnabled(enable);
-       heightUnitsLC->setEnabled(enable);
-       pagebreakCB->setEnabled(enable);
-}
-
-
 void GuiBox::on_innerBoxCO_activated(QString const & str)
 {
        bool const ibox = (str != qt_("None"));
@@ -137,7 +120,7 @@ void GuiBox::on_innerBoxCO_activated(QString const & str)
        heightCB->setEnabled(ibox);
        pagebreakCB->setEnabled(!ibox && typeCO->currentIndex() == 1);
        setSpecial(ibox);
-       applyView();
+       changed();
 }
 
 
@@ -160,7 +143,7 @@ void GuiBox::on_typeCO_activated(int index)
        widthED->setEnabled(index != 5);
        widthUnitsLC->setEnabled(index != 5);
        setInnerType(frameless, itype);
-       applyView();
+       changed();
 }
 
 
@@ -181,7 +164,7 @@ void GuiBox::on_heightCB_stateChanged(int state)
                && (state == Qt::Checked);
        heightED->setEnabled(enable);
        heightUnitsLC->setEnabled(enable);
-       applyView();
+       changed();
 }
 
 
@@ -202,7 +185,7 @@ void GuiBox::on_pagebreakCB_stateChanged()
        heightED->setEnabled(false);
        heightUnitsLC->setEnabled(false);
        setSpecial(false);
-       applyView();
+       changed();
 }
 
 
@@ -378,10 +361,6 @@ void GuiBox::setInnerType(bool frameless, int i)
        }
 }
 
-
-Dialog * createGuiBox(GuiView & lv) { return new GuiBox(lv); }
-
-
 } // namespace frontend
 } // namespace lyx
 
index 07a69f030fbc0d7501423ea49b36711e91f40229..25b6bfa9b35fae5c739b465678d9db59eab3a477 100644 (file)
 #ifndef GUIBOX_H
 #define GUIBOX_H
 
-#include "InsetDialog.h"
+#include "InsetParamsWidget.h"
 #include "ui_BoxUi.h"
-#include "insets/InsetBox.h"
 
 
 namespace lyx {
 namespace frontend {
 
-class GuiBox : public InsetDialog, public Ui::BoxUi
+class GuiBox : public InsetParamsWidget, public Ui::BoxUi
 {
        Q_OBJECT
 
 public:
-       GuiBox(GuiView & lv);
+       GuiBox(QWidget * parent = 0);
 
 private Q_SLOTS:
        void on_innerBoxCO_activated(QString const &);
@@ -36,13 +35,10 @@ private Q_SLOTS:
        void on_pagebreakCB_stateChanged();
 
 private:
-       /// \name Dialog inerited methods
-       //@{
-       void enableView(bool enable);
-       //@}
-
-       /// \name InsetDialog inherited methods
+       /// \name DialogView inherited methods
        //@{
+       InsetCode insetCode() { return BOX_CODE; }
+       FuncCode creationCode() { return LFUN_BOX_INSERT; }
        void paramsToDialog(Inset const *);
        docstring dialogToParams() const;
        //@}
index 920e95145d102319956b8c1ddc407bae1b3b3c5e..537dce2749c84bdb77b7d8b05667f29d169b971f 100644 (file)
 namespace lyx {
 
 class BufferParams;
-class FloatPlacement;
 class LayoutModuleList;
 class TextClass;
 
 namespace frontend {
 
+class FloatPlacement;
 class GuiBranches;
 class GuiIndices;
 class ModuleSelectionManager;
index bc65101b6a892e4007d226b275da49bff6bb7a0e..004290b1c9f9f0ac496a099f9554cdd126196b45 100644 (file)
@@ -14,6 +14,9 @@
 
 #include "GuiERT.h"
 
+#include "GuiApplication.h"
+#include "GuiView.h"
+
 #include "insets/InsetERT.h"
 
 #include "FuncRequest.h"
@@ -28,20 +31,12 @@ using namespace std;
 namespace lyx {
 namespace frontend {
 
-GuiERT::GuiERT(GuiView & lv)
-       : InsetDialog(lv, ERT_CODE, LFUN_INSET_INSERT, "ert", "TeX Code Settings")
+GuiERT::GuiERT(QWidget * parent) : InsetParamsWidget(parent)
 {
        setupUi(this);
 
-       connect(collapsedRB, SIGNAL(clicked()), this, SLOT(applyView()));
-       connect(openRB, SIGNAL(clicked()), this, SLOT(applyView()));
-}
-
-
-void GuiERT::enableView(bool enable)
-{
-       collapsedRB->setEnabled(enable);
-       openRB->setEnabled(enable);
+       connect(collapsedRB, SIGNAL(clicked()), this, SIGNAL(changed()));
+       connect(openRB, SIGNAL(clicked()), this, SIGNAL(changed()));
 }
 
 
@@ -56,17 +51,15 @@ docstring GuiERT::dialogToParams() const
 void GuiERT::paramsToDialog(Inset const * inset)
 {
        InsetERT const * ert = static_cast<InsetERT const *>(inset);
-       InsetCollapsable::CollapseStatus status = ert->status(*bufferview());
+       // FIXME: This dialog has absolutely no value...
+       BufferView const * bv = guiApp->currentView()->currentBufferView();
+       InsetCollapsable::CollapseStatus status = ert->status(*bv);
        switch (status) {
                case InsetCollapsable::Open: openRB->setChecked(true); break;
                case InsetCollapsable::Collapsed: collapsedRB->setChecked(true); break;
        }
 }
 
-
-Dialog * createGuiERT(GuiView & lv) { return new GuiERT(lv); }
-
-
 } // namespace frontend
 } // namespace lyx
 
index b9b7cccc033410df822c3da8b32652650b3a4b89..8177b01b8d0b77546fc902c778712447eb3b0c1a 100644 (file)
 #ifndef GUIERT_H
 #define GUIERT_H
 
-#include "InsetDialog.h"
+#include "InsetParamsWidget.h"
 #include "ui_ERTUi.h"
 
 namespace lyx {
 namespace frontend {
 
-class GuiERT : public InsetDialog, public Ui::ERTUi
+class GuiERT : public InsetParamsWidget, public Ui::ERTUi
 {
        Q_OBJECT
 
 public:
-       GuiERT(GuiView & lv);
+       GuiERT(QWidget * parent = 0);
 
 private:
-       /// \name Dialog inerited methods
-       //@{
-       void enableView(bool enable);
-       //@}
-
-       /// \name InsetDialog inherited methods
+       /// \name InsetParamsWidget inherited methods
        //@{
+       InsetCode insetCode() { return ERT_CODE; }
+       FuncCode creationCode() { return LFUN_INSET_INSERT; }
        void paramsToDialog(Inset const *);
        docstring dialogToParams() const;
        //@}
diff --git a/src/frontends/qt4/GuiFloat.cpp b/src/frontends/qt4/GuiFloat.cpp
deleted file mode 100644 (file)
index 832ed83..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * \file GuiFloat.cpp
- * 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 "GuiFloat.h"
-
-#include "FloatPlacement.h"
-
-#include "FuncRequest.h"
-
-#include <QPushButton>
-
-using namespace std;
-
-namespace lyx {
-namespace frontend {
-
-GuiFloat::GuiFloat(GuiView & lv)
-       : InsetDialog(lv, FLOAT_CODE, LFUN_FLOAT_INSERT, "float", "Float Settings")
-{
-       setupUi(this);
-       
-       // enable span columns checkbox
-       floatFP->useWide();
-       // enable sideways checkbox
-       floatFP->useSideways();
-
-       connect(floatFP, SIGNAL(changed()), this, SLOT(applyView()));
-}
-
-
-void GuiFloat::enableView(bool enable)
-{
-       floatFP->setEnabled(enable);
-}
-
-
-void GuiFloat::paramsToDialog(Inset const * inset)
-{
-       floatFP->paramsToDialog(inset);
-}
-
-
-docstring GuiFloat::dialogToParams() const
-{
-       return floatFP->dialogToParams();
-}
-
-Dialog * createGuiFloat(GuiView & lv) { return new GuiFloat(lv); }
-
-} // namespace frontend
-} // namespace lyx
-
-#include "moc_GuiFloat.cpp"
diff --git a/src/frontends/qt4/GuiFloat.h b/src/frontends/qt4/GuiFloat.h
deleted file mode 100644 (file)
index b98ddb0..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-// -*- C++ -*-
-/**
- * \file GuiFloat.h
- * 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.
- */
-
-#ifndef GUIFLOAT_H
-#define GUIFLOAT_H
-
-#include "InsetDialog.h"
-
-#include "ui_FloatUi.h"
-
-
-namespace lyx {
-namespace frontend {
-
-class GuiFloat : public InsetDialog, public Ui::FloatUi
-{
-       Q_OBJECT
-
-public:
-       GuiFloat(GuiView & lv);
-
-private:
-       /// \name Dialog inerited methods
-       //@{
-       void enableView(bool enable);
-       //@}
-
-       /// \name InsetDialog inherited methods
-       //@{
-       void paramsToDialog(Inset const *);
-       docstring dialogToParams() const;
-       //@}
-};
-
-} // namespace frontend
-} // namespace lyx
-
-#endif // GUIFLOAT_H
index fa756303c378316421810d07050bf7770fb0a974..db7efb5d6542b464ff5933bf7780ab0d44da7e18 100644 (file)
@@ -47,8 +47,7 @@ char const * info_types_gui[] =
   N_("menu"), N_("icon"), N_("buffer"), ""};
 
 
-GuiInfo::GuiInfo(GuiView & lv)
-       : InsetDialog(lv, INFO_CODE, LFUN_INFO_INSERT, "info", "Info")
+GuiInfo::GuiInfo(QWidget * parent) : InsetParamsWidget(parent)
 {
        setupUi(this);
 
@@ -57,8 +56,8 @@ GuiInfo::GuiInfo(GuiView & lv)
                typeCO->addItem(qt_(info_types_gui[n]));
        typeCO->blockSignals(false);
 
-       connect(typeCO, SIGNAL(currentIndexChanged(int)), this, SLOT(applyView()));
-       connect(nameLE, SIGNAL(textChanged(QString)), this, SLOT(applyView()));
+       connect(typeCO, SIGNAL(currentIndexChanged(int)), this, SIGNAL(changed()));
+       connect(nameLE, SIGNAL(textChanged(QString)), this, SIGNAL(changed()));
 }
 
 
@@ -91,17 +90,6 @@ docstring GuiInfo::dialogToParams() const
 }
 
 
-void GuiInfo::enableView(bool enable)
-{
-       typeCO->setEnabled(enable);
-       nameLE->setEnabled(enable);
-       newPB->setEnabled(!enable);
-}
-
-
-Dialog * createGuiInfo(GuiView & lv) { return new GuiInfo(lv); }
-
-
 } // namespace frontend
 } // namespace lyx
 
index a25d61944de64816481fdca869e4e159b6535ce0..5b8259ba7cc96f09708b758acccb2e85d4c22ec0 100644 (file)
@@ -12,7 +12,7 @@
 #ifndef GUI_INFO_H
 #define GUI_INFO_H
 
-#include "InsetDialog.h"
+#include "InsetParamsWidget.h"
 #include "ui_InfoUi.h"
 
 namespace lyx {
@@ -21,21 +21,18 @@ class Inset;
 
 namespace frontend {
 
-class GuiInfo : public InsetDialog, public Ui::InfoUi
+class GuiInfo : public InsetParamsWidget, public Ui::InfoUi
 {
        Q_OBJECT
 
 public:
-       GuiInfo(GuiView & lv);
-
-       /// \name Dialog inherited methods
-       //@{
-       void enableView(bool enable);
-       //@}
+       GuiInfo(QWidget * parent = 0);
 
 private:
-       /// \name InsetDialog inherited methods
+       /// \name InsetParamsWidget inherited methods
        //@{
+       InsetCode insetCode() { return INFO_CODE; }
+       FuncCode creationCode() { return LFUN_INFO_INSERT; }
        void paramsToDialog(Inset const *);
        docstring dialogToParams() const;
        //@}
index 70d2ba7e6e4f7ffc642969da6645207bf8024ccf..984464a9b83593193dfd802da33418bb0de72f91 100644 (file)
@@ -21,8 +21,9 @@
 #include "qt_helpers.h"
 #include "Validator.h"
 
-#include "Spacing.h"
 #include "FuncRequest.h"
+#include "Spacing.h"
+#include "VSpace.h"
 
 #include "insets/InsetVSpace.h"
 
@@ -39,48 +40,24 @@ using namespace std;
 namespace lyx {
 namespace frontend {
 
-GuiVSpace::GuiVSpace(GuiView & lv)
-       : GuiDialog(lv, "vspace", qt_("Vertical Space Settings"))
+GuiVSpace::GuiVSpace(QWidget * parent) : InsetParamsWidget(parent)
 {
        setupUi(this);
 
-       connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
-       connect(applyPB, SIGNAL(clicked()), this, SLOT(slotApply()));
-       connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
-
-       connect(spacingCO, SIGNAL(highlighted(QString)),
-               this, SLOT(change_adaptor()));
        connect(valueLE, SIGNAL(textChanged(QString)),
-               this, SLOT(change_adaptor()));
-       connect(spacingCO, SIGNAL(activated(int)),
-               this, SLOT(enableCustom(int)));
+               this, SIGNAL(changed()));
        connect(keepCB, SIGNAL(clicked()),
-               this, SLOT(change_adaptor()));
+               this, SIGNAL(changed()));
        connect(unitCO, SIGNAL(selectionChanged(lyx::Length::UNIT)),
-               this, SLOT(change_adaptor()));
-
-       valueLE->setValidator(unsignedGlueLengthValidator(valueLE));
+               this, SIGNAL(changed()));
 
-       // Manage the ok, apply, restore and cancel/close buttons
-       bc().setPolicy(ButtonPolicy::OkApplyCancelReadOnlyPolicy);
-       bc().setOK(okPB);
-       bc().setApply(applyPB);
-       bc().setCancel(closePB);
+       connect(spacingCO, SIGNAL(activated(int)),
+               this, SLOT(enableCustom(int)));
 
-       // disable for read-only documents
-       bc().addReadOnly(spacingCO);
-       bc().addReadOnly(valueLE);
-       bc().addReadOnly(unitCO);
-       bc().addReadOnly(keepCB);
+       valueLE->setValidator(unsignedGlueLengthValidator(valueLE));
 
        // initialize the length validator
-       bc().addCheckedLineEdit(valueLE, valueL);
-}
-
-
-void GuiVSpace::change_adaptor()
-{
-       changed();
+       addCheckedWidget(valueLE, valueL);
 }
 
 
@@ -144,47 +121,26 @@ static VSpace setVSpaceFromWidgets(int spacing,
 }
 
 
-void GuiVSpace::applyView()
+docstring GuiVSpace::dialogToParams() const
 {
        // If a vspace choice is "Length" but there's no text in
        // the input field, do not insert a vspace at all.
        if (spacingCO->currentIndex() == 5 && valueLE->text().isEmpty())
-               return;
+               return docstring();
 
-       params_ = setVSpaceFromWidgets(spacingCO->currentIndex(),
-                       valueLE, unitCO, keepCB->isChecked()); 
+       VSpace const params = setVSpaceFromWidgets(spacingCO->currentIndex(),
+                       valueLE, unitCO, keepCB->isChecked());
+       return from_ascii(InsetVSpace::params2string(params));
 }
 
 
-void GuiVSpace::updateContents()
+void GuiVSpace::paramsToDialog(Inset const * inset)
 {
-       setWidgetsFromVSpace(params_, spacingCO, valueLE, unitCO, keepCB);
+       InsetVSpace const * vs = static_cast<InsetVSpace const *>(inset);
+       VSpace const & params = vs->space();
+       setWidgetsFromVSpace(params, spacingCO, valueLE, unitCO, keepCB);
 }
 
-
-bool GuiVSpace::initialiseParams(string const & data)
-{
-       InsetVSpace::string2params(data, params_);
-       setButtonsValid(true);
-       return true;
-}
-
-
-void GuiVSpace::clearParams()
-{
-       params_ = VSpace();
-}
-
-
-void GuiVSpace::dispatchParams()
-{
-       dispatch(FuncRequest(getLfun(), InsetVSpace::params2string(params_)));
-}
-
-
-Dialog * createGuiVSpace(GuiView & lv) { return new GuiVSpace(lv); }
-
-
 } // namespace frontend
 } // namespace lyx
 
index 93a6319fe92fc9317657877791ce399bb899d9e6..1c28142ffad6e326d2d63fcd29278205b44a2d66 100644 (file)
 #ifndef GUIVSPACE_H
 #define GUIVSPACE_H
 
-#include "GuiDialog.h"
+#include "InsetParamsWidget.h"
 #include "ui_VSpaceUi.h"
-#include "VSpace.h"
 
 namespace lyx {
 namespace frontend {
 
-class GuiVSpace : public GuiDialog, public Ui::VSpaceUi
+class GuiVSpace : public InsetParamsWidget, public Ui::VSpaceUi
 {
        Q_OBJECT
 
 public:
-       GuiVSpace(GuiView & lv);
+       GuiVSpace(QWidget * parent = 0);
 
 private Q_SLOTS:
-       ///
-       void change_adaptor();
        ///
        void enableCustom(int);
 
 private:
-       /// Apply from dialog
-       void applyView();
-       /// Update the dialog
-       void updateContents();
-       ///
-       bool initialiseParams(std::string const & data);
-       /// clean-up on hide.
-       void clearParams();
-       /// clean-up on hide.
-       void dispatchParams();
-       ///
-       bool isBufferDependent() const { return true; }
-
-       ///
-       VSpace params_;
+       /// \name DialogView inherited methods
+       //@{
+       InsetCode insetCode() { return VSPACE_CODE; }
+       FuncCode creationCode() { return LFUN_INSET_INSERT; }
+       void paramsToDialog(Inset const *);
+       docstring dialogToParams() const;
+       //@}
 };
 
 } // namespace frontend
index eeb8b47aa88b104cb3ddb4eb754626af1af8e64f..c5f51c5b2346c8f2223ecd6628bfa3a0a0c62501 100644 (file)
@@ -3437,12 +3437,12 @@ void GuiView::updateDialogs()
        updateLayoutList();
 }
 
+Dialog * createDialog(GuiView & lv, string const & name);
 
 // will be replaced by a proper factory...
 Dialog * createGuiAbout(GuiView & lv);
 Dialog * createGuiBibitem(GuiView & lv);
 Dialog * createGuiBibtex(GuiView & lv);
-Dialog * createGuiBox(GuiView & lv);
 Dialog * createGuiBranch(GuiView & lv);
 Dialog * createGuiChanges(GuiView & lv);
 Dialog * createGuiCharacter(GuiView & lv);
@@ -3451,13 +3451,10 @@ Dialog * createGuiCompare(GuiView & lv);
 Dialog * createGuiDelimiter(GuiView & lv);
 Dialog * createGuiDocument(GuiView & lv);
 Dialog * createGuiErrorList(GuiView & lv);
-Dialog * createGuiERT(GuiView & lv);
 Dialog * createGuiExternal(GuiView & lv);
-Dialog * createGuiFloat(GuiView & lv);
 Dialog * createGuiGraphics(GuiView & lv);
 Dialog * createGuiInclude(GuiView & lv);
 Dialog * createGuiIndex(GuiView & lv);
-Dialog * createGuiInfo(GuiView & lv);
 Dialog * createGuiLabel(GuiView & lv);
 Dialog * createGuiListings(GuiView & lv);
 Dialog * createGuiLog(GuiView & lv);
@@ -3485,7 +3482,6 @@ Dialog * createGuiTextHSpace(GuiView & lv);
 Dialog * createGuiToc(GuiView & lv);
 Dialog * createGuiThesaurus(GuiView & lv);
 Dialog * createGuiHyperlink(GuiView & lv);
-Dialog * createGuiVSpace(GuiView & lv);
 Dialog * createGuiViewSource(GuiView & lv);
 Dialog * createGuiWrap(GuiView & lv);
 Dialog * createGuiProgressView(GuiView & lv);
@@ -3496,14 +3492,16 @@ Dialog * GuiView::build(string const & name)
 {
        LASSERT(isValidName(name), return 0);
 
+       Dialog * dialog = createDialog(*this, name);
+       if (dialog)
+               return dialog;
+
        if (name == "aboutlyx")
                return createGuiAbout(*this);
        if (name == "bibitem")
                return createGuiBibitem(*this);
        if (name == "bibtex")
                return createGuiBibtex(*this);
-       if (name == "box")
-               return createGuiBox(*this);
        if (name == "branch")
                return createGuiBranch(*this);
        if (name == "changes")
@@ -3518,8 +3516,6 @@ Dialog * GuiView::build(string const & name)
                return createGuiDocument(*this);
        if (name == "errorlist")
                return createGuiErrorList(*this);
-       if (name == "ert")
-               return createGuiERT(*this);
        if (name == "external")
                return createGuiExternal(*this);
        if (name == "file")
@@ -3528,8 +3524,6 @@ Dialog * GuiView::build(string const & name)
                return createGuiSearch(*this);
        if (name == "findreplaceadv")
                return createGuiSearchAdv(*this);
-       if (name == "float")
-               return createGuiFloat(*this);
        if (name == "graphics")
                return createGuiGraphics(*this);
        if (name == "href")
@@ -3540,8 +3534,6 @@ Dialog * GuiView::build(string const & name)
                return createGuiIndex(*this);
        if (name == "index_print")
                return createGuiPrintindex(*this);
-       if (name == "info")
-               return createGuiInfo(*this);
        if (name == "label")
                return createGuiLabel(*this);
        if (name == "listings")
@@ -3590,8 +3582,6 @@ Dialog * GuiView::build(string const & name)
                return createGuiToc(*this);
        if (name == "view-source")
                return createGuiViewSource(*this);
-       if (name == "vspace")
-               return createGuiVSpace(*this);
        if (name == "wrap")
                return createGuiWrap(*this);
        if (name == "progress")
diff --git a/src/frontends/qt4/InsetDialog.cpp b/src/frontends/qt4/InsetDialog.cpp
deleted file mode 100644 (file)
index ce2056a..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/**\r
- * \file InsetDialog.cpp\r
- * This file is part of LyX, the document processor.\r
- * Licence details can be found in the file COPYING.\r
- *\r
- * \author Abdelrazak Younes\r
- *\r
- * Full author contact details are available in file CREDITS.\r
- */\r
-\r
-#include <config.h>\r
-\r
-#include "InsetDialog.h"\r
-\r
-#include "qt_helpers.h"\r
-\r
-#include "Buffer.h"\r
-#include "buffer_funcs.h"\r
-#include "BufferParams.h"\r
-#include "BufferView.h"\r
-#include "Cursor.h"\r
-#include "FuncRequest.h"\r
-\r
-#include "support/debug.h"\r
-#include "support/lstrings.h"\r
-\r
-using namespace std;\r
-using namespace lyx::support;\r
-\r
-namespace lyx {\r
-namespace frontend {\r
-\r
-/////////////////////////////////////////////////////////////////\r
-//\r
-// InsetDialog::Private\r
-//\r
-/////////////////////////////////////////////////////////////////\r
-\r
-struct InsetDialog::Private\r
-{\r
-       Private(InsetCode code, FuncCode creation_code)\r
-               : inset_code_(code), creation_code_(creation_code)\r
-       {\r
-       }\r
-\r
-       ///\r
-       InsetCode inset_code_;\r
-       ///\r
-       FuncCode creation_code_;\r
-};\r
-\r
-/////////////////////////////////////////////////////////////////\r
-//\r
-// InsetDialog\r
-//\r
-/////////////////////////////////////////////////////////////////\r
-\r
-InsetDialog::InsetDialog(GuiView & lv, InsetCode code, FuncCode creation_code,\r
-               char const * name, char const * display_name)\r
-       : DialogView(lv, name, qt_(display_name)), d(new Private(code, creation_code))\r
-{\r
-}\r
-\r
-\r
-void InsetDialog::on_closePB_clicked()\r
-{\r
-       hide();\r
-}\r
-\r
-\r
-void InsetDialog::on_newPB_clicked()\r
-{\r
-       docstring const argument = dialogToParams();\r
-       dispatch(FuncRequest(d->creation_code_, argument));\r
-}\r
-\r
-\r
-void InsetDialog::applyView()\r
-{\r
-       if (!checkWidgets())\r
-               return;\r
-\r
-       Inset const * i = inset(d->inset_code_);\r
-       if (!i)\r
-               return;\r
-       \r
-       docstring const argument = dialogToParams();\r
-       if (!i->validateModifyArgument(argument))\r
-               return;\r
-\r
-       dispatch(FuncRequest(LFUN_INSET_MODIFY, argument));\r
-}\r
-\r
-\r
-void InsetDialog::updateView()\r
-{\r
-       Inset const * i = inset(d->inset_code_);\r
-       if (i)\r
-               paramsToDialog(i);\r
-       else\r
-               enableView(false);\r
-\r
-       //FIXME: the newPB push button cannot be accessed here and so cannot be\r
-       // disabled...\r
-       /*\r
-       docstring const argument = dialogToParams();\r
-       newPB->setEnabled(\r
-               getStatus(FuncRequest(LFUN_INSET_MODIFY, argument).enabled());\r
-       */\r
-}\r
-\r
-} // namespace frontend\r
-} // namespace lyx\r
-\r
-#include "moc_InsetDialog.cpp"\r
diff --git a/src/frontends/qt4/InsetDialog.h b/src/frontends/qt4/InsetDialog.h
deleted file mode 100644 (file)
index 7a38f25..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-// -*- C++ -*-\r
-/**\r
- * \file InsetDialog.h\r
- * This file is part of LyX, the document processor.\r
- * Licence details can be found in the file COPYING.\r
- *\r
- * \author Abdelrazak Younes\r
- *\r
- * Full author contact details are available in file CREDITS.\r
- */\r
-\r
-#ifndef INSET_DIALOG_H\r
-#define INSET_DIALOG_H\r
-\r
-#include "DialogView.h"\r
-\r
-#include "qt_i18n.h"\r
-\r
-namespace lyx {\r
-\r
-class Inset;\r
-\r
-namespace frontend {\r
-\r
-\r
-class InsetDialog : public DialogView\r
-{\r
-       Q_OBJECT\r
-\r
-public:\r
-       InsetDialog(GuiView & lv, InsetCode code, FuncCode creation_code,\r
-               char const * name, char const * display_name);\r
-\r
-       /// \name DialogView inherited methods\r
-       //@{\r
-       void updateView();\r
-       void dispatchParams() {}\r
-       bool isBufferDependent() const { return true; }\r
-       bool canApply() const { return true; }\r
-       //@}\r
-\r
-protected Q_SLOTS:\r
-       void applyView();\r
-       void on_newPB_clicked();\r
-       void on_closePB_clicked();\r
-\r
-protected:\r
-       ///\r
-       virtual void paramsToDialog(Inset const *) = 0;\r
-       ///\r
-       virtual docstring dialogToParams() const = 0;\r
-\r
-private:\r
-       /// pimpl\r
-       struct Private;\r
-       Private * d;\r
-};\r
-\r
-} // namespace frontend\r
-} // namespace lyx\r
-\r
-#endif // INSET_DIALOG_H\r
diff --git a/src/frontends/qt4/InsetParamsDialog.cpp b/src/frontends/qt4/InsetParamsDialog.cpp
new file mode 100644 (file)
index 0000000..0448d26
--- /dev/null
@@ -0,0 +1,200 @@
+/**\r
+ * \file InsetParamsDialog.cpp\r
+ * This file is part of LyX, the document processor.\r
+ * Licence details can be found in the file COPYING.\r
+ *\r
+ * \author Abdelrazak Younes\r
+ *\r
+ * Full author contact details are available in file CREDITS.\r
+ */\r
+\r
+#include <config.h>\r
+\r
+#include "InsetParamsDialog.h"\r
+\r
+#include "GuiBox.h"\r
+#include "GuiERT.h"\r
+#include "GuiInfo.h"\r
+#include "GuiVSpace.h"\r
+#include "FloatPlacement.h"\r
+\r
+#include "InsetParamsWidget.h"\r
+#include "qt_helpers.h"\r
+\r
+#include "Buffer.h"\r
+#include "buffer_funcs.h"\r
+#include "BufferParams.h"\r
+#include "BufferView.h"\r
+#include "Cursor.h"\r
+#include "FuncRequest.h"\r
+#include "FuncStatus.h"\r
+#include "LyX.h"\r
+\r
+#include "support/debug.h"\r
+#include "support/lstrings.h"\r
+\r
+using namespace std;\r
+using namespace lyx::support;\r
+\r
+namespace lyx {\r
+namespace frontend {\r
+\r
+/////////////////////////////////////////////////////////////////\r
+//\r
+// InsetParamsDialog::Private\r
+//\r
+/////////////////////////////////////////////////////////////////\r
+\r
+struct InsetParamsDialog::Private\r
+{\r
+       ///\r
+       InsetParamsWidget * widget_;\r
+};\r
+\r
+/////////////////////////////////////////////////////////////////\r
+//\r
+// InsetParamsDialog\r
+//\r
+/////////////////////////////////////////////////////////////////\r
+\r
+InsetParamsDialog::InsetParamsDialog(GuiView & lv, InsetParamsWidget * widget)\r
+       : DialogView(lv, toqstr(insetName(widget->insetCode())),\r
+       toqstr(insetName(widget->insetCode()))), d(new Private)\r
+{\r
+       setupUi(this);\r
+       setInsetParamsWidget(widget);\r
+       synchronizedViewCB->setChecked(false);\r
+       on_synchronizedViewCB_stateChanged(false);\r
+}\r
+\r
+InsetParamsDialog::~InsetParamsDialog()\r
+{\r
+       delete d;\r
+}\r
+\r
+\r
+void InsetParamsDialog::setInsetParamsWidget(InsetParamsWidget * widget)\r
+{\r
+       d->widget_ = widget;\r
+       stackedWidget->addWidget(widget);\r
+       stackedWidget->setCurrentWidget(widget);\r
+}\r
+\r
+\r
+void InsetParamsDialog::on_restorePB_clicked()\r
+{\r
+       updateView();\r
+}\r
+\r
+\r
+void InsetParamsDialog::on_okPB_clicked()\r
+{\r
+       applyView();\r
+       hide();\r
+}\r
+\r
+\r
+void InsetParamsDialog::on_applyPB_clicked()\r
+{\r
+       if (synchronizedViewCB->isChecked()) {\r
+               docstring const argument = d->widget_->dialogToParams();\r
+               dispatch(FuncRequest(d->widget_->creationCode(), argument));\r
+       } else {\r
+               applyView();\r
+       }\r
+}\r
+\r
+\r
+void InsetParamsDialog::on_closePB_clicked()\r
+{\r
+       hide();\r
+}\r
+\r
+\r
+void InsetParamsDialog::on_synchronizedViewCB_stateChanged(int state)\r
+{\r
+       bool const sync = (state == Qt::Checked);\r
+       QString const label = sync ? qt_("&New") :  qt_("&Apply");\r
+       applyPB->setText(label);\r
+       okPB->setEnabled(!sync);\r
+       restorePB->setEnabled(!sync);\r
+       if (sync)\r
+               connect(d->widget_, SIGNAL(changed()), this, SLOT(applyView()));\r
+       else\r
+               QObject::disconnect(d->widget_, SIGNAL(changed()), this, SLOT(applyView()));\r
+}\r
+\r
+\r
+void InsetParamsDialog::applyView()\r
+{\r
+       if (!d->widget_->checkWidgets())\r
+               return;\r
+\r
+       Inset const * i = inset(d->widget_->insetCode());\r
+       if (!i)\r
+               return;\r
+       \r
+       docstring const argument = d->widget_->dialogToParams();\r
+\r
+       if (argument.empty() || !i->validateModifyArgument(argument)) {\r
+               //FIXME: newPB is not accessible\r
+               //newPB->setEnabled(false);\r
+               return;\r
+       }\r
+       //FIXME: newPB is not accessible\r
+       //newPB->setEnabled(true);\r
+       dispatch(FuncRequest(LFUN_INSET_MODIFY, argument));\r
+}\r
+\r
+\r
+void InsetParamsDialog::updateView()\r
+{\r
+       Inset const * i = inset(d->widget_->insetCode());\r
+       if (i)\r
+               d->widget_->paramsToDialog(i);\r
+       else\r
+               d->widget_->setEnabled(false);\r
+\r
+       docstring const argument = d->widget_->dialogToParams();\r
+       FuncCode const code = synchronizedViewCB->isChecked()\r
+               ? d->widget_->creationCode() : LFUN_INSET_MODIFY;\r
+       applyPB->setEnabled(\r
+               lyx::getStatus(FuncRequest(code, argument)).enabled());\r
+}\r
+\r
+\r
+Dialog * createDialog(GuiView & lv, InsetCode code)\r
+{\r
+       InsetParamsWidget * widget;\r
+       switch (code) {\r
+       case ERT_CODE:\r
+               widget = new GuiERT;\r
+               break;\r
+       case FLOAT_CODE:\r
+               widget = new FloatPlacement(true);\r
+               break;\r
+       case BOX_CODE:\r
+               widget = new GuiBox;\r
+               break;\r
+       case INFO_CODE:\r
+               widget = new GuiInfo;\r
+               break;\r
+       case VSPACE_CODE:\r
+               widget = new GuiVSpace;\r
+               break;\r
+       default: return 0;\r
+       }\r
+       InsetParamsDialog * dialog = new InsetParamsDialog(lv, widget);\r
+       return dialog;\r
+}\r
+\r
+\r
+Dialog * createDialog(GuiView & lv, string const & name)\r
+{\r
+       return createDialog(lv, insetCode(name));\r
+}\r
+\r
+} // namespace frontend\r
+} // namespace lyx\r
+\r
+#include "moc_InsetParamsDialog.cpp"\r
diff --git a/src/frontends/qt4/InsetParamsDialog.h b/src/frontends/qt4/InsetParamsDialog.h
new file mode 100644 (file)
index 0000000..d0d5e55
--- /dev/null
@@ -0,0 +1,62 @@
+// -*- C++ -*-\r
+/**\r
+ * \file InsetParamsDialog.h\r
+ * This file is part of LyX, the document processor.\r
+ * Licence details can be found in the file COPYING.\r
+ *\r
+ * \author Abdelrazak Younes\r
+ *\r
+ * Full author contact details are available in file CREDITS.\r
+ */\r
+\r
+#ifndef INSET_PARAMS_DIALOG_H\r
+#define INSET_PARAMS_DIALOG_H\r
+\r
+#include "DialogView.h"\r
+#include "ui_InsetParamsUi.h"\r
+\r
+#include "qt_i18n.h"\r
+\r
+namespace lyx {\r
+\r
+class Inset;\r
+\r
+namespace frontend {\r
+\r
+class InsetParamsWidget;\r
+\r
+class InsetParamsDialog : public DialogView, public Ui::InsetParamsUi\r
+{\r
+       Q_OBJECT\r
+public:\r
+       InsetParamsDialog(GuiView & lv, InsetParamsWidget * widget);\r
+       ~InsetParamsDialog();\r
+\r
+       ///\r
+       void setInsetParamsWidget(InsetParamsWidget * widget);\r
+\r
+protected Q_SLOTS:\r
+       void applyView();\r
+       void on_restorePB_clicked();\r
+       void on_okPB_clicked();\r
+       void on_applyPB_clicked();\r
+       void on_closePB_clicked();\r
+       void on_synchronizedViewCB_stateChanged(int state);\r
+\r
+private:\r
+       /// \name DialogView inherited methods\r
+       //@{\r
+       void updateView();\r
+       void dispatchParams() {}\r
+       bool isBufferDependent() const { return true; }\r
+       bool canApply() const { return true; }\r
+       //@}\r
+       /// pimpl\r
+       struct Private;\r
+       Private * d;\r
+};\r
+\r
+} // namespace frontend\r
+} // namespace lyx\r
+\r
+#endif // INSET_PARAMS_DIALOG_H\r
diff --git a/src/frontends/qt4/InsetParamsWidget.cpp b/src/frontends/qt4/InsetParamsWidget.cpp
new file mode 100644 (file)
index 0000000..5eae61c
--- /dev/null
@@ -0,0 +1,64 @@
+// -*- C++ -*-\r
+/**\r
+ * \file InsetParamsWidget.cpp\r
+ * This file is part of LyX, the document processor.\r
+ * Licence details can be found in the file COPYING.\r
+ *\r
+ * \author Abdelrazak Younes\r
+ *\r
+ * Full author contact details are available in file CREDITS.\r
+ */\r
+\r
+#include <config.h>\r
+\r
+#include "InsetParamsWidget.h"\r
+\r
+#include "qt_helpers.h"\r
+\r
+#include <QLineEdit>\r
+\r
+namespace lyx {\r
+\r
+namespace frontend {\r
+\r
+CheckedWidget::CheckedWidget(QLineEdit * input, QWidget * label)\r
+       : input_(input), label_(label)\r
+{\r
+}\r
+\r
+\r
+bool CheckedWidget::check() const\r
+{\r
+       bool const valid = input_->hasAcceptableInput();\r
+       // Visual feedback.\r
+       setValid(input_, valid);\r
+       if (label_)\r
+               setValid(label_, valid);\r
+       return valid;\r
+}\r
+\r
+\r
+\r
+InsetParamsWidget::InsetParamsWidget(QWidget * parent) : QWidget(parent)\r
+{\r
+}\r
+\r
+\r
+void InsetParamsWidget::addCheckedWidget(QLineEdit * input, QWidget * label)\r
+{\r
+       checked_widgets_.append(CheckedWidget(input, label));\r
+}\r
+\r
+\r
+bool InsetParamsWidget::checkWidgets() const\r
+{\r
+       bool valid = true;\r
+       Q_FOREACH(CheckedWidget const & le, checked_widgets_)\r
+                       valid &= le.check();\r
+       return valid;\r
+}\r
+\r
+} // namespace frontend\r
+} // namespace lyx\r
+\r
+#include "moc_InsetParamsWidget.cpp"\r
diff --git a/src/frontends/qt4/InsetParamsWidget.h b/src/frontends/qt4/InsetParamsWidget.h
new file mode 100644 (file)
index 0000000..0e989c7
--- /dev/null
@@ -0,0 +1,84 @@
+// -*- C++ -*-\r
+/**\r
+ * \file InsetParamsWidget.h\r
+ * This file is part of LyX, the document processor.\r
+ * Licence details can be found in the file COPYING.\r
+ *\r
+ * \author Abdelrazak Younes\r
+ *\r
+ * Full author contact details are available in file CREDITS.\r
+ */\r
+\r
+#ifndef INSET_PARAMS_WIDGET_H\r
+#define INSET_PARAMS_WIDGET_H\r
+\r
+#include "insets/InsetCode.h"\r
+\r
+#include "FuncCode.h"\r
+\r
+#include "support/strfwd.h"\r
+\r
+#include <QWidget>\r
+\r
+class QLineEdit;\r
+\r
+namespace lyx {\r
+\r
+class Inset;\r
+\r
+namespace frontend {\r
+\r
+/// CheckedWidget\r
+// FIXME: Get rid of CheckedLineEdit in ButtonController and rename this one\r
+// to it.\r
+class CheckedWidget\r
+{\r
+public:\r
+       CheckedWidget(QLineEdit * input, QWidget * label = 0);\r
+       ///     \r
+       bool check() const;\r
+\r
+private:\r
+       // non-owned\r
+       QLineEdit * input_;\r
+       QWidget * label_;\r
+};\r
+\r
+\r
+typedef QList<CheckedWidget> CheckedWidgets;\r
+\r
+class InsetParamsWidget : public QWidget\r
+{\r
+       Q_OBJECT\r
+\r
+Q_SIGNALS:\r
+       void changed();\r
+public:\r
+       InsetParamsWidget(QWidget * parent);\r
+       /// This is a base class; destructor must exist and be virtual.\r
+       virtual ~InsetParamsWidget() {}\r
+       ///\r
+       virtual InsetCode insetCode() = 0;\r
+       ///\r
+       virtual FuncCode creationCode() = 0;\r
+       ///\r
+       virtual void paramsToDialog(Inset const *) = 0;\r
+       ///\r
+       virtual docstring dialogToParams() const = 0;\r
+\r
+       /// \return true if all CheckedWidgets are in a valid state.\r
+       bool checkWidgets() const;\r
+\r
+protected:\r
+       /// Add a widget to the list of all widgets whose validity should\r
+       /// be checked explicitly when the buttons are refreshed.\r
+       void addCheckedWidget(QLineEdit * input, QWidget * label = 0);\r
+private:\r
+       ///\r
+       CheckedWidgets checked_widgets_;\r
+};\r
+\r
+} // namespace frontend\r
+} // namespace lyx\r
+\r
+#endif // INSET_PARAMS_WIDGET_H\r
index 936bc2d827e3641b510f9c8200226e64f41f2f47..8b8a40b6d0e702152df6049950d8502b0871c707 100644 (file)
@@ -132,7 +132,8 @@ SOURCEFILES = \
        GuiWrap.cpp \
        IconPalette.cpp \
        InsertTableWidget.cpp \
-       InsetDialog.cpp \
+       InsetParamsDialog.cpp \
+       InsetParamsWidget.cpp \
        LengthCombo.cpp \
        LyXFileDialog.cpp \
        LaTeXHighlighter.cpp \
@@ -235,7 +236,8 @@ MOCHEADER = \
        GuiWrap.h \
        IconPalette.h \
        InsertTableWidget.h \
-       InsetDialog.h \
+       InsetParamsDialog.h \
+       InsetParamsWidget.h \
        LayoutBox.h \
        LengthCombo.h \
        LyXFileDialog.h \
@@ -267,7 +269,6 @@ UIFILES = \
        ExternalUi.ui \
        FindAndReplaceUi.ui \
        FloatPlacementUi.ui \
-       FloatUi.ui \
        FontUi.ui \
        GraphicsUi.ui \
        HSpaceUi.ui \
@@ -276,6 +277,7 @@ UIFILES = \
        IndexUi.ui \
        IndicesUi.ui \
        InfoUi.ui \
+       InsetParamsUi.ui \
        LabelUi.ui \
        LanguageUi.ui \
        LaTeXUi.ui \
index b36638c70e8509e3c8aff2433f1c67a4a7b20bb2..2d786eee67407e64a0da53b091f9ffb672a59e97 100644 (file)
@@ -1,18 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
  <class>BoxUi</class>
- <widget class="QDialog" name="BoxUi">
+ <widget class="QWidget" name="BoxUi">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>356</width>
-    <height>288</height>
+    <width>261</width>
+    <height>245</height>
    </rect>
   </property>
   <property name="windowTitle">
    <string/>
   </property>
-  <property name="sizeGripEnabled">
+  <property name="sizeGripEnabled" stdset="0">
    <bool>true</bool>
   </property>
   <layout class="QGridLayout">
      </layout>
     </widget>
    </item>
-   <item row="6" column="0" colspan="3">
-    <layout class="QHBoxLayout">
-     <property name="spacing">
-      <number>6</number>
-     </property>
-     <property name="margin">
-      <number>0</number>
-     </property>
-     <item>
-      <spacer>
-       <property name="orientation">
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeType">
-        <enum>QSizePolicy::Expanding</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>20</width>
-         <height>20</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item>
-      <widget class="QPushButton" name="newPB">
-       <property name="toolTip">
-        <string/>
-       </property>
-       <property name="text">
-        <string>&amp;New</string>
-       </property>
-       <property name="autoDefault">
-        <bool>false</bool>
-       </property>
-       <property name="default">
-        <bool>false</bool>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QPushButton" name="closePB">
-       <property name="text">
-        <string>&amp;Close</string>
-       </property>
-       <property name="autoDefault">
-        <bool>false</bool>
-       </property>
-       <property name="default">
-        <bool>false</bool>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
    <item row="3" column="2">
     <widget class="LengthCombo" name="heightUnitsLC">
      <property name="enabled">
   <tabstop>ialignCO</tabstop>
   <tabstop>halignCO</tabstop>
   <tabstop>valignCO</tabstop>
-  <tabstop>closePB</tabstop>
-  <tabstop>newPB</tabstop>
  </tabstops>
  <includes>
   <include location="local">qt_i18n.h</include>
index 671d40f0e075a96ebdc997fca989e8cb8675fff5..648d155d04d02e3c90f20ce787cd077609d5ddf0 100644 (file)
@@ -1,18 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
  <class>ERTUi</class>
- <widget class="QDialog" name="ERTUi">
+ <widget class="QWidget" name="ERTUi">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>197</width>
-    <height>135</height>
+    <width>175</width>
+    <height>99</height>
    </rect>
   </property>
   <property name="windowTitle">
    <string/>
   </property>
-  <property name="sizeGripEnabled">
+  <property name="sizeGripEnabled" stdset="0">
    <bool>true</bool>
   </property>
   <layout class="QVBoxLayout">
      </layout>
     </widget>
    </item>
-   <item>
-    <layout class="QHBoxLayout">
-     <property name="spacing">
-      <number>6</number>
-     </property>
-     <property name="margin">
-      <number>0</number>
-     </property>
-     <item>
-      <spacer>
-       <property name="orientation">
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeType">
-        <enum>QSizePolicy::Expanding</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>20</width>
-         <height>20</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item>
-      <widget class="QPushButton" name="newPB">
-       <property name="toolTip">
-        <string/>
-       </property>
-       <property name="text">
-        <string>&amp;New</string>
-       </property>
-       <property name="autoDefault">
-        <bool>false</bool>
-       </property>
-       <property name="default">
-        <bool>false</bool>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QPushButton" name="closePB">
-       <property name="text">
-        <string>Close</string>
-       </property>
-       <property name="default">
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
   </layout>
  </widget>
  <includes>
diff --git a/src/frontends/qt4/ui/FloatUi.ui b/src/frontends/qt4/ui/FloatUi.ui
deleted file mode 100644 (file)
index bfddc8f..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-<ui version="4.0">
- <class>FloatUi</class>
- <widget class="QDialog" name="FloatUi">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>410</width>
-    <height>336</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string/>
-  </property>
-  <property name="sizeGripEnabled">
-   <bool>true</bool>
-  </property>
-  <layout class="QVBoxLayout">
-   <property name="spacing">
-    <number>6</number>
-   </property>
-   <property name="margin">
-    <number>11</number>
-   </property>
-   <item>
-    <widget class="lyx::FloatPlacement" name="floatFP" native="true"/>
-   </item>
-   <item>
-    <layout class="QHBoxLayout">
-     <property name="spacing">
-      <number>6</number>
-     </property>
-     <property name="margin">
-      <number>0</number>
-     </property>
-     <item>
-      <spacer>
-       <property name="orientation">
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeType">
-        <enum>QSizePolicy::Expanding</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>20</width>
-         <height>20</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item>
-      <widget class="QPushButton" name="newPB">
-       <property name="toolTip">
-        <string/>
-       </property>
-       <property name="text">
-        <string>&amp;New</string>
-       </property>
-       <property name="autoDefault">
-        <bool>false</bool>
-       </property>
-       <property name="default">
-        <bool>false</bool>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QPushButton" name="closePB">
-       <property name="text">
-        <string>&amp;Close</string>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>lyx::FloatPlacement</class>
-   <extends></extends>
-   <header>FloatPlacement.h</header>
-   <container>1</container>
-  </customwidget>
- </customwidgets>
- <tabstops>
-  <tabstop>closePB</tabstop>
- </tabstops>
- <includes>
-  <include location="local">qt_i18n.h</include>
- </includes>
- <resources/>
- <connections/>
-</ui>
index 13aa181e13e24727c3a43a4c9130560e14b78e41..7d30fb75e623285869f646d67505880f5a93b07c 100644 (file)
@@ -1,86 +1,50 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
  <class>InfoUi</class>
- <widget class="QDialog" name="InfoUi" >
-  <property name="geometry" >
+ <widget class="QWidget" name="InfoUi">
+  <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>320</width>
-    <height>131</height>
+    <height>75</height>
    </rect>
   </property>
-  <property name="windowTitle" >
+  <property name="windowTitle">
    <string/>
   </property>
-  <property name="sizeGripEnabled" >
+  <property name="sizeGripEnabled" stdset="0">
    <bool>true</bool>
   </property>
-  <layout class="QVBoxLayout" >
+  <layout class="QVBoxLayout">
    <item>
-    <layout class="QGridLayout" >
-     <item row="0" column="0" >
-      <widget class="QLabel" name="typeLBL" >
-       <property name="text" >
+    <layout class="QGridLayout">
+     <item row="0" column="0">
+      <widget class="QLabel" name="typeLBL">
+       <property name="text">
         <string>Information Type:</string>
        </property>
       </widget>
      </item>
-     <item row="0" column="1" >
-      <widget class="QComboBox" name="typeCO" />
+     <item row="0" column="1">
+      <widget class="QComboBox" name="typeCO"/>
      </item>
-     <item row="1" column="0" >
-      <widget class="QLabel" name="nameLBL" >
-       <property name="text" >
+     <item row="1" column="0">
+      <widget class="QLabel" name="nameLBL">
+       <property name="text">
         <string>Information Name:</string>
        </property>
       </widget>
      </item>
-     <item row="1" column="1" >
-      <widget class="QLineEdit" name="nameLE" />
-     </item>
-    </layout>
-   </item>
-   <item>
-    <layout class="QHBoxLayout" >
-     <item>
-      <spacer>
-       <property name="orientation" >
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeType" >
-        <enum>QSizePolicy::Expanding</enum>
-       </property>
-       <property name="sizeHint" stdset="0" >
-        <size>
-         <width>84</width>
-         <height>20</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item>
-      <widget class="QPushButton" name="newPB" >
-       <property name="text" >
-        <string>&amp;New</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QPushButton" name="closePB" >
-       <property name="text" >
-        <string>&amp;Close</string>
-       </property>
-       <property name="default" >
-        <bool>true</bool>
-       </property>
-      </widget>
+     <item row="1" column="1">
+      <widget class="QLineEdit" name="nameLE"/>
      </item>
     </layout>
    </item>
   </layout>
  </widget>
  <includes>
-  <include location="local" >qt_i18n.h</include>
+  <include location="local">qt_i18n.h</include>
  </includes>
  <resources/>
  <connections/>
diff --git a/src/frontends/qt4/ui/InsetParamsUi.ui b/src/frontends/qt4/ui/InsetParamsUi.ui
new file mode 100644 (file)
index 0000000..57e0fd7
--- /dev/null
@@ -0,0 +1,148 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<ui version="4.0">\r
+ <class>InsetParamsUi</class>\r
+ <widget class="QDialog" name="InsetParamsUi">\r
+  <property name="geometry">\r
+   <rect>\r
+    <x>0</x>\r
+    <y>0</y>\r
+    <width>438</width>\r
+    <height>292</height>\r
+   </rect>\r
+  </property>\r
+  <property name="focusPolicy">\r
+   <enum>Qt::NoFocus</enum>\r
+  </property>\r
+  <property name="windowTitle">\r
+   <string>Inset Parameter Configuration</string>\r
+  </property>\r
+  <layout class="QGridLayout">\r
+   <property name="margin">\r
+    <number>9</number>\r
+   </property>\r
+   <property name="spacing">\r
+    <number>6</number>\r
+   </property>\r
+   <item row="2" column="0" colspan="2">\r
+    <spacer>\r
+     <property name="orientation">\r
+      <enum>Qt::Horizontal</enum>\r
+     </property>\r
+     <property name="sizeHint" stdset="0">\r
+      <size>\r
+       <width>281</width>\r
+       <height>31</height>\r
+      </size>\r
+     </property>\r
+    </spacer>\r
+   </item>\r
+   <item row="2" column="2">\r
+    <widget class="QCheckBox" name="synchronizedViewCB">\r
+     <property name="layoutDirection">\r
+      <enum>Qt::LeftToRight</enum>\r
+     </property>\r
+     <property name="text">\r
+      <string>I&amp;mmediate Apply</string>\r
+     </property>\r
+    </widget>\r
+   </item>\r
+   <item row="3" column="0" colspan="3">\r
+    <layout class="QHBoxLayout">\r
+     <property name="spacing">\r
+      <number>6</number>\r
+     </property>\r
+     <property name="margin">\r
+      <number>0</number>\r
+     </property>\r
+     <item>\r
+      <widget class="QPushButton" name="restorePB">\r
+       <property name="text">\r
+        <string>&amp;Restore</string>\r
+       </property>\r
+       <property name="autoDefault">\r
+        <bool>false</bool>\r
+       </property>\r
+      </widget>\r
+     </item>\r
+     <item>\r
+      <spacer>\r
+       <property name="orientation">\r
+        <enum>Qt::Horizontal</enum>\r
+       </property>\r
+       <property name="sizeHint" stdset="0">\r
+        <size>\r
+         <width>31</width>\r
+         <height>27</height>\r
+        </size>\r
+       </property>\r
+      </spacer>\r
+     </item>\r
+     <item>\r
+      <widget class="QPushButton" name="okPB">\r
+       <property name="text">\r
+        <string>&amp;OK</string>\r
+       </property>\r
+       <property name="default">\r
+        <bool>true</bool>\r
+       </property>\r
+      </widget>\r
+     </item>\r
+     <item>\r
+      <widget class="QPushButton" name="applyPB">\r
+       <property name="text">\r
+        <string>&amp;Apply</string>\r
+       </property>\r
+       <property name="autoDefault">\r
+        <bool>false</bool>\r
+       </property>\r
+      </widget>\r
+     </item>\r
+     <item>\r
+      <widget class="QPushButton" name="closePB">\r
+       <property name="text">\r
+        <string>&amp;Close</string>\r
+       </property>\r
+       <property name="autoDefault">\r
+        <bool>false</bool>\r
+       </property>\r
+      </widget>\r
+     </item>\r
+    </layout>\r
+   </item>\r
+   <item row="1" column="0" colspan="3">\r
+    <spacer>\r
+     <property name="orientation">\r
+      <enum>Qt::Vertical</enum>\r
+     </property>\r
+     <property name="sizeHint" stdset="0">\r
+      <size>\r
+       <width>351</width>\r
+       <height>16</height>\r
+      </size>\r
+     </property>\r
+    </spacer>\r
+   </item>\r
+   <item row="0" column="0" colspan="2">\r
+    <widget class="QStackedWidget" name="stackedWidget">\r
+     <property name="currentIndex">\r
+      <number>1</number>\r
+     </property>\r
+     <widget class="QWidget" name="page"/>\r
+     <widget class="QWidget" name="page_2"/>\r
+    </widget>\r
+   </item>\r
+  </layout>\r
+ </widget>\r
+ <tabstops>\r
+  <tabstop>synchronizedViewCB</tabstop>\r
+  <tabstop>restorePB</tabstop>\r
+  <tabstop>okPB</tabstop>\r
+  <tabstop>applyPB</tabstop>\r
+  <tabstop>closePB</tabstop>\r
+ </tabstops>\r
+ <includes>\r
+  <include location="local">qt_i18n.h</include>\r
+ </includes>\r
+ <resources/>\r
+ <connections/>\r
+</ui>\r
index 3cf902ed9091bf6c3a501ef9f7d6307b2bcf62aa..083dc170da9e5ab447fe649613436faa20dd2bd0 100644 (file)
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
  <class>VSpaceUi</class>
- <widget class="QDialog" name="VSpaceUi" >
-  <property name="geometry" >
+ <widget class="QWidget" name="VSpaceUi">
+  <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>259</width>
-    <height>120</height>
+    <width>215</width>
+    <height>96</height>
    </rect>
   </property>
-  <property name="windowTitle" >
+  <property name="windowTitle">
    <string/>
   </property>
-  <property name="sizeGripEnabled" >
+  <property name="sizeGripEnabled" stdset="0">
    <bool>true</bool>
   </property>
-  <layout class="QGridLayout" >
-   <item row="3" column="0" colspan="3" >
-    <layout class="QHBoxLayout" >
-     <item>
-      <widget class="QPushButton" name="okPB" >
-       <property name="text" >
-        <string>&amp;OK</string>
-       </property>
-       <property name="autoDefault" >
-        <bool>false</bool>
-       </property>
-       <property name="default" >
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QPushButton" name="applyPB" >
-       <property name="text" >
-        <string>&amp;Apply</string>
-       </property>
-       <property name="autoDefault" >
-        <bool>false</bool>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QPushButton" name="closePB" >
-       <property name="text" >
-        <string>&amp;Close</string>
-       </property>
-       <property name="autoDefault" >
-        <bool>false</bool>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item row="0" column="0" >
-    <widget class="QLabel" name="spacingL" >
-     <property name="text" >
+  <layout class="QGridLayout">
+   <item row="0" column="0">
+    <widget class="QLabel" name="spacingL">
+     <property name="text">
       <string>&amp;Spacing:</string>
      </property>
-     <property name="buddy" >
+     <property name="buddy">
       <cstring>spacingCO</cstring>
      </property>
     </widget>
    </item>
-   <item row="2" column="1" colspan="2" >
-    <widget class="QCheckBox" name="keepCB" >
-     <property name="toolTip" >
+   <item row="2" column="1" colspan="2">
+    <widget class="QCheckBox" name="keepCB">
+     <property name="toolTip">
       <string>Insert the spacing even after a page break</string>
      </property>
-     <property name="text" >
+     <property name="text">
       <string/>
      </property>
     </widget>
    </item>
-   <item row="2" column="0" >
-    <widget class="QLabel" name="keepL" >
-     <property name="toolTip" >
+   <item row="2" column="0">
+    <widget class="QLabel" name="keepL">
+     <property name="toolTip">
       <string/>
      </property>
-     <property name="text" >
+     <property name="text">
       <string>&amp;Protect:</string>
      </property>
-     <property name="buddy" >
+     <property name="buddy">
       <cstring>keepCB</cstring>
      </property>
     </widget>
    </item>
-   <item row="1" column="2" >
-    <widget class="LengthCombo" name="unitCO" />
+   <item row="1" column="2">
+    <widget class="LengthCombo" name="unitCO"/>
    </item>
-   <item row="1" column="1" >
-    <widget class="QLineEdit" name="valueLE" >
-     <property name="enabled" >
+   <item row="1" column="1">
+    <widget class="QLineEdit" name="valueLE">
+     <property name="enabled">
       <bool>false</bool>
      </property>
-     <property name="toolTip" >
-      <string>Custom value. Needs spacing type "Custom".</string>
+     <property name="toolTip">
+      <string>Custom value. Needs spacing type &quot;Custom&quot;.</string>
      </property>
     </widget>
    </item>
-   <item row="1" column="0" >
-    <widget class="QLabel" name="valueL" >
-     <property name="text" >
+   <item row="1" column="0">
+    <widget class="QLabel" name="valueL">
+     <property name="text">
       <string>&amp;Value:</string>
      </property>
-     <property name="buddy" >
+     <property name="buddy">
       <cstring>valueLE</cstring>
      </property>
     </widget>
    </item>
-   <item row="0" column="1" colspan="2" >
-    <widget class="QComboBox" name="spacingCO" >
-     <property name="toolTip" >
+   <item row="0" column="1" colspan="2">
+    <widget class="QComboBox" name="spacingCO">
+     <property name="toolTip">
       <string>Supported spacing types</string>
      </property>
      <item>
-      <property name="text" >
+      <property name="text">
        <string>DefSkip</string>
       </property>
      </item>
      <item>
-      <property name="text" >
+      <property name="text">
        <string>SmallSkip</string>
       </property>
      </item>
      <item>
-      <property name="text" >
+      <property name="text">
        <string>MedSkip</string>
       </property>
      </item>
      <item>
-      <property name="text" >
+      <property name="text">
        <string>BigSkip</string>
       </property>
      </item>
      <item>
-      <property name="text" >
+      <property name="text">
        <string>VFill</string>
       </property>
      </item>
      <item>
-      <property name="text" >
+      <property name="text">
        <string>Custom</string>
       </property>
      </item>
   <tabstop>valueLE</tabstop>
   <tabstop>unitCO</tabstop>
   <tabstop>keepCB</tabstop>
-  <tabstop>okPB</tabstop>
-  <tabstop>applyPB</tabstop>
-  <tabstop>closePB</tabstop>
  </tabstops>
  <includes>
-  <include location="local" >qt_i18n.h</include>
+  <include location="local">qt_i18n.h</include>
  </includes>
  <resources/>
  <connections/>