X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiVSpace.cpp;h=70d2ba7e6e4f7ffc642969da6645207bf8024ccf;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=51b1672e467585e4ff990740d49d5ceb818329b5;hpb=9383f4c3c6f9cfab2d658701ba66e2b54cd68bea;p=lyx.git diff --git a/src/frontends/qt4/GuiVSpace.cpp b/src/frontends/qt4/GuiVSpace.cpp index 51b1672e46..70d2ba7e6e 100644 --- a/src/frontends/qt4/GuiVSpace.cpp +++ b/src/frontends/qt4/GuiVSpace.cpp @@ -3,12 +3,12 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author André Pönitz - * \author Jürgen Vigna + * \author André Pönitz + * \author Jürgen Vigna * \author Rob Lahaye * \author Angus Leeming * \author Edwin Leuven - * \author Jürgen Spitzmüller + * \author Jürgen Spitzmüller * * Full author contact details are available in file CREDITS. */ @@ -21,15 +21,15 @@ #include "qt_helpers.h" #include "Validator.h" -#include "LyXRC.h" // to set the default length values #include "Spacing.h" #include "FuncRequest.h" + #include "insets/InsetVSpace.h" +#include "support/gettext.h" #include "support/lstrings.h" #include -#include #include #include #include @@ -40,10 +40,9 @@ namespace lyx { namespace frontend { GuiVSpace::GuiVSpace(GuiView & lv) - : GuiDialog(lv, "vspace") + : GuiDialog(lv, "vspace", qt_("Vertical Space Settings")) { setupUi(this); - setViewTitle(_("Vertical Space Settings")); connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK())); connect(applyPB, SIGNAL(clicked()), this, SLOT(slotApply())); @@ -60,7 +59,7 @@ GuiVSpace::GuiVSpace(GuiView & lv) connect(unitCO, SIGNAL(selectionChanged(lyx::Length::UNIT)), this, SLOT(change_adaptor())); - valueLE->setValidator(unsignedLengthValidator(valueLE)); + valueLE->setValidator(unsignedGlueLengthValidator(valueLE)); // Manage the ok, apply, restore and cancel/close buttons bc().setPolicy(ButtonPolicy::OkApplyCancelReadOnlyPolicy); @@ -76,16 +75,6 @@ GuiVSpace::GuiVSpace(GuiView & lv) // initialize the length validator bc().addCheckedLineEdit(valueLE, valueL); - - // remove the %-items from the unit choice - unitCO->noPercents(); -} - - -void GuiVSpace::closeEvent(QCloseEvent * e) -{ - slotClose(); - e->accept(); } @@ -121,8 +110,7 @@ static void setWidgetsFromVSpace(VSpace const & space, spacing->setCurrentIndex(item); keep->setChecked(space.keep()); - Length::UNIT default_unit = - (lyxrc.default_papersize > 3) ? Length::CM : Length::IN; + Length::UNIT const default_unit = Length::defaultUnit(); bool const custom_vspace = space.kind() == VSpace::LENGTH; if (custom_vspace) { value->setEnabled(true); @@ -176,9 +164,8 @@ void GuiVSpace::updateContents() bool GuiVSpace::initialiseParams(string const & data) { - InsetVSpaceMailer::string2params(data, params_); + InsetVSpace::string2params(data, params_); setButtonsValid(true); - return true; } @@ -191,7 +178,7 @@ void GuiVSpace::clearParams() void GuiVSpace::dispatchParams() { - dispatch(FuncRequest(getLfun(), InsetVSpaceMailer::params2string(params_))); + dispatch(FuncRequest(getLfun(), InsetVSpace::params2string(params_))); } @@ -202,4 +189,4 @@ Dialog * createGuiVSpace(GuiView & lv) { return new GuiVSpace(lv); } } // namespace lyx -#include "GuiVSpace_moc.cpp" +#include "moc_GuiVSpace.cpp"