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
This commit is contained in:
Vincent van Ravesteijn 2009-07-16 08:39:22 +00:00
parent 408b96bb92
commit 5862b252db
2 changed files with 12 additions and 6 deletions

View 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 =

View 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();