branch: Fix the enabling of the custom page size field in GuiDocument.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@30626 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2009-07-16 12:35:31 +00:00
parent a8446e64c5
commit 1fda2e4577
3 changed files with 15 additions and 6 deletions

View File

@ -641,9 +641,9 @@ GuiDocument::GuiDocument(GuiView & lv)
pageLayoutModule = new UiWidget<Ui::PageLayoutUi>; pageLayoutModule = new UiWidget<Ui::PageLayoutUi>;
// page layout // page layout
connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)), connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)),
this, SLOT(setCustomPapersize(int))); this, SLOT(papersizeChanged(int)));
connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)), connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)),
this, SLOT(setCustomPapersize(int))); this, SLOT(papersizeChanged(int)));
connect(pageLayoutModule->portraitRB, SIGNAL(clicked()), connect(pageLayoutModule->portraitRB, SIGNAL(clicked()),
this, SLOT(portraitChanged())); this, SLOT(portraitChanged()));
connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)), connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)),
@ -1108,10 +1108,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->paperwidthL->setEnabled(custom);
pageLayoutModule->paperwidthLE->setEnabled(custom); pageLayoutModule->paperwidthLE->setEnabled(custom);
pageLayoutModule->paperwidthUnitCO->setEnabled(custom); pageLayoutModule->paperwidthUnitCO->setEnabled(custom);
@ -2101,7 +2105,7 @@ void GuiDocument::paramsToDialog()
documentClass().provides("geometry"); documentClass().provides("geometry");
int const psize = bp_.papersize; int const psize = bp_.papersize;
pageLayoutModule->papersizeCO->setCurrentIndex(psize); pageLayoutModule->papersizeCO->setCurrentIndex(psize);
setCustomPapersize(!extern_geometry && psize); setCustomPapersize(!extern_geometry && psize == 1);
pageLayoutModule->papersizeCO->setEnabled(!extern_geometry); pageLayoutModule->papersizeCO->setEnabled(!extern_geometry);
bool const landscape = bool const landscape =

View File

@ -82,7 +82,7 @@ private Q_SLOTS:
void useDefaultsClicked(); void useDefaultsClicked();
void setLSpacing(int); void setLSpacing(int);
void setMargins(bool); void setMargins(bool);
void setCustomPapersize(int); void papersizeChanged(int);
void setColSep(); void setColSep();
void setCustomMargins(bool); void setCustomMargins(bool);
void romanChanged(int); void romanChanged(int);
@ -201,6 +201,8 @@ private:
bool providesSC(std::string const & font) const; bool providesSC(std::string const & font) const;
/// does this font provide size adjustment? /// does this font provide size adjustment?
bool providesScale(std::string const & font) const; bool providesScale(std::string const & font) const;
///
void setCustomPapersize(bool custom);
private: private:
/// ///
void loadModuleInfo(); void loadModuleInfo();

View File

@ -228,6 +228,9 @@ What's new
- Fix unitialized variable in Dialog code (bug 6081). - Fix unitialized variable in Dialog code (bug 6081).
- Fix the enabling of the page height and width fields in the Document
Settings dialog.
* DOCUMENTATION AND LOCALIZATION * DOCUMENTATION AND LOCALIZATION