]> git.lyx.org Git - features.git/commitdiff
Fix the enabling of the custom page size field in GuiDocument.
authorVincent van Ravesteijn <vfr@lyx.org>
Thu, 16 Jul 2009 08:39:22 +0000 (08:39 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Thu, 16 Jul 2009 08:39:22 +0000 (08:39 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30624 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiDocument.cpp
src/frontends/qt4/GuiDocument.h

index 0a96469935b7f29f82ae6c92a6cb962ae837c754..5b560160c91278577f6bfc2f0ef90d3a02e4ff20 100644 (file)
@@ -658,9 +658,9 @@ GuiDocument::GuiDocument(GuiView & lv)
        pageLayoutModule = new UiWidget<Ui::PageLayoutUi>;
        // 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 =
index b485a6061ce131ee42ed13b30d5a0c49e90d9644..00665eba73d6f0eded3860cc47a7d17475b490ee 100644 (file)
@@ -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();