From 5862b252db7e7f7d48c9f0441fa6cd8cdee9bcdc Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Thu, 16 Jul 2009 08:39:22 +0000 Subject: [PATCH] Fix the enabling of the custom page size field in GuiDocument. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30624 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiDocument.cpp | 14 +++++++++----- src/frontends/qt4/GuiDocument.h | 4 +++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp index 0a96469935..5b560160c9 100644 --- a/src/frontends/qt4/GuiDocument.cpp +++ b/src/frontends/qt4/GuiDocument.cpp @@ -658,9 +658,9 @@ GuiDocument::GuiDocument(GuiView & lv) pageLayoutModule = new UiWidget; // page layout connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)), - this, SLOT(setCustomPapersize(int))); + this, SLOT(papersizeChanged(int))); connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)), - this, SLOT(setCustomPapersize(int))); + this, SLOT(papersizeChanged(int))); connect(pageLayoutModule->portraitRB, SIGNAL(clicked()), this, SLOT(portraitChanged())); connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)), @@ -1154,10 +1154,14 @@ void GuiDocument::setMargins(bool custom) } -void GuiDocument::setCustomPapersize(int papersize) +void GuiDocument::papersizeChanged(int paper_size) { - bool const custom = (papersize == 1); + setCustomPapersize(paper_size == 1); +} + +void GuiDocument::setCustomPapersize(bool custom) +{ pageLayoutModule->paperwidthL->setEnabled(custom); pageLayoutModule->paperwidthLE->setEnabled(custom); pageLayoutModule->paperwidthUnitCO->setEnabled(custom); @@ -2366,7 +2370,7 @@ void GuiDocument::paramsToDialog() documentClass().provides("geometry"); int const psize = bp_.papersize; pageLayoutModule->papersizeCO->setCurrentIndex(psize); - setCustomPapersize(!extern_geometry && psize); + setCustomPapersize(!extern_geometry && psize == 1); pageLayoutModule->papersizeCO->setEnabled(!extern_geometry); bool const landscape = diff --git a/src/frontends/qt4/GuiDocument.h b/src/frontends/qt4/GuiDocument.h index b485a6061c..00665eba73 100644 --- a/src/frontends/qt4/GuiDocument.h +++ b/src/frontends/qt4/GuiDocument.h @@ -87,7 +87,7 @@ private Q_SLOTS: void useDefaultsClicked(); void setLSpacing(int); void setMargins(bool); - void setCustomPapersize(int); + void papersizeChanged(int); void setColSep(); void setCustomMargins(bool); void romanChanged(int); @@ -214,6 +214,8 @@ private: bool providesScale(std::string const & font) const; /// void executeBranchRenaming() const; + /// + void setCustomPapersize(bool custom); private: /// void loadModuleInfo();