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)
{}
{}
-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_));
#include <QString>
class QWidget;
-class QLineEdit;
namespace lyx {
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.
*/
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
/// intentionally unimplemented, therefore uncopiable
Dialog(Dialog const &);
void operator=(Dialog const &);
-
- ///
- CheckedLineEdits checked_line_edits_;
};
namespace lyx {
+namespace frontend {
+
FloatPlacement::FloatPlacement(bool show_options, QWidget * parent)
- : QWidget(parent), float_list_(0)
+ : InsetParamsWidget(parent), float_list_(0)
{
setupUi(this);
}
}
+} // namespace frontend
} // namespace lyx
#include "moc_FloatPlacement.cpp"
#ifndef FLOATPLACEMENT_H
#define FLOATPLACEMENT_H
+#include "InsetParamsWidget.h"
#include "ui_FloatPlacementUi.h"
-#include <QWidget>
-
#include "support/docstring.h"
namespace lyx {
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();
///
void on_defaultsCB_stateChanged(int state);
void changedSlot();
-Q_SIGNALS:
- void changed();
-
private:
///
void checkAllowed();
FloatList const * float_list_;
};
+} // namespace frontend
} // namespace lyx
#endif // FLOATPLACEMENT_H
}
-GuiBox::GuiBox(GuiView & lv)
- : InsetDialog(lv, BOX_CODE, LFUN_BOX_INSERT, "box", "Box Settings")
+GuiBox::GuiBox(QWidget * parent) : InsetParamsWidget(parent)
{
setupUi(this);
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));
}
-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"));
heightCB->setEnabled(ibox);
pagebreakCB->setEnabled(!ibox && typeCO->currentIndex() == 1);
setSpecial(ibox);
- applyView();
+ changed();
}
widthED->setEnabled(index != 5);
widthUnitsLC->setEnabled(index != 5);
setInnerType(frameless, itype);
- applyView();
+ changed();
}
&& (state == Qt::Checked);
heightED->setEnabled(enable);
heightUnitsLC->setEnabled(enable);
- applyView();
+ changed();
}
heightED->setEnabled(false);
heightUnitsLC->setEnabled(false);
setSpecial(false);
- applyView();
+ changed();
}
}
}
-
-Dialog * createGuiBox(GuiView & lv) { return new GuiBox(lv); }
-
-
} // namespace frontend
} // namespace lyx
#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 &);
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;
//@}
namespace lyx {
class BufferParams;
-class FloatPlacement;
class LayoutModuleList;
class TextClass;
namespace frontend {
+class FloatPlacement;
class GuiBranches;
class GuiIndices;
class ModuleSelectionManager;
#include "GuiERT.h"
+#include "GuiApplication.h"
+#include "GuiView.h"
+
#include "insets/InsetERT.h"
#include "FuncRequest.h"
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()));
}
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
#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;
//@}
+++ /dev/null
-/**
- * \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"
+++ /dev/null
-// -*- 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
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);
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()));
}
}
-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
#ifndef GUI_INFO_H
#define GUI_INFO_H
-#include "InsetDialog.h"
+#include "InsetParamsWidget.h"
#include "ui_InfoUi.h"
namespace lyx {
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;
//@}
#include "qt_helpers.h"
#include "Validator.h"
-#include "Spacing.h"
#include "FuncRequest.h"
+#include "Spacing.h"
+#include "VSpace.h"
#include "insets/InsetVSpace.h"
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);
}
}
-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
#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
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);
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);
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);
{
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")
return createGuiDocument(*this);
if (name == "errorlist")
return createGuiErrorList(*this);
- if (name == "ert")
- return createGuiERT(*this);
if (name == "external")
return createGuiExternal(*this);
if (name == "file")
return createGuiSearch(*this);
if (name == "findreplaceadv")
return createGuiSearchAdv(*this);
- if (name == "float")
- return createGuiFloat(*this);
if (name == "graphics")
return createGuiGraphics(*this);
if (name == "href")
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")
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")
+++ /dev/null
-/**\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
+++ /dev/null
-// -*- 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
--- /dev/null
+/**\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
--- /dev/null
+// -*- 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
--- /dev/null
+// -*- 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
--- /dev/null
+// -*- 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
GuiWrap.cpp \
IconPalette.cpp \
InsertTableWidget.cpp \
- InsetDialog.cpp \
+ InsetParamsDialog.cpp \
+ InsetParamsWidget.cpp \
LengthCombo.cpp \
LyXFileDialog.cpp \
LaTeXHighlighter.cpp \
GuiWrap.h \
IconPalette.h \
InsertTableWidget.h \
- InsetDialog.h \
+ InsetParamsDialog.h \
+ InsetParamsWidget.h \
LayoutBox.h \
LengthCombo.h \
LyXFileDialog.h \
ExternalUi.ui \
FindAndReplaceUi.ui \
FloatPlacementUi.ui \
- FloatUi.ui \
FontUi.ui \
GraphicsUi.ui \
HSpaceUi.ui \
IndexUi.ui \
IndicesUi.ui \
InfoUi.ui \
+ InsetParamsUi.ui \
LabelUi.ui \
LanguageUi.ui \
LaTeXUi.ui \
+<?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>&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="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>
+<?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>&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>
+++ /dev/null
-<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>&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>
- </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>
-<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>&New</string>
- </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 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/>
--- /dev/null
+<?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&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>&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>&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>&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>&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
-<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>&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>&Apply</string>
- </property>
- <property name="autoDefault" >
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="closePB" >
- <property name="text" >
- <string>&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>&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>&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 "Custom".</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>&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/>