From c629639eee0b6e4282adec808984ae396cee7bc1 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Wed, 12 Feb 2003 16:36:17 +0000 Subject: [PATCH] fix bug 844, and more git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_3_X@6128 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt2/ChangeLog | 10 ++++++++++ src/frontends/qt2/QDocument.C | 4 ++++ src/frontends/qt2/QDocumentDialog.C | 10 +++++++++- src/frontends/qt2/QDocumentDialog.h | 1 + src/frontends/xforms/ChangeLog | 5 +++++ src/frontends/xforms/FormDocument.C | 6 +++++- status.13x | 4 ++-- 7 files changed, 36 insertions(+), 4 deletions(-) diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 22c944e9d2..0cce6e1c7e 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,13 @@ +2003-02-10 Juergen Spitzmueller + + * QDocument.C: Allow qt users actually to use another + papersize than default (set params.paperpackage). + +2003-02-09 Juergen Spitzmueller + + * QDocumentDialog.[Ch]: Show A4 packages also when default + papersize is A4 (and default chosen) and only in portrait mode. + 2003-02-10 Joćo Luis Meloni Assirati * ui/QMathMatrixDialogBase.ui: Fix horizontal alignment tooltip diff --git a/src/frontends/qt2/QDocument.C b/src/frontends/qt2/QDocument.C index cf8da76e9b..5484dcddd6 100644 --- a/src/frontends/qt2/QDocument.C +++ b/src/frontends/qt2/QDocument.C @@ -331,6 +331,10 @@ void QDocument::apply() margin = margin - 1; } params.paperpackage = char(margin); + + // set params.papersize from params.papersize2 + // and params.paperpackage + params.setPaperStuff(); MarginsModuleBase const * m(dialog_->marginsModule); diff --git a/src/frontends/qt2/QDocumentDialog.C b/src/frontends/qt2/QDocumentDialog.C index 369b389e98..d87d088587 100644 --- a/src/frontends/qt2/QDocumentDialog.C +++ b/src/frontends/qt2/QDocumentDialog.C @@ -218,6 +218,8 @@ QDocumentDialog::QDocumentDialog(QDocument * form) this , SLOT(setCustomPapersize(int))); connect(paperModule->papersizeCO, SIGNAL(activated(int)), this , SLOT(setCustomPapersize(int))); + connect(paperModule->portraitRB, SIGNAL(toggled(bool)), + this , SLOT(portraitChanged())); connect(paperModule->papersizeCO, SIGNAL(activated(int)), this , SLOT(change_adaptor())); @@ -333,6 +335,10 @@ void QDocumentDialog::enableSkip(bool skip) setSkip(layoutModule->skipCO->currentItem()); } +void QDocumentDialog::portraitChanged() +{ + setMargins(paperModule->papersizeCO->currentItem()); +} void QDocumentDialog::setMargins(int papersize) { @@ -340,7 +346,9 @@ void QDocumentDialog::setMargins(int papersize) marginsModule->marginCO->clear(); marginsModule->marginCO->insertItem(qt_("Default")); marginsModule->marginCO->insertItem(qt_("Custom")); - if (papersize == 6) { + bool a4size = (papersize == 6 || papersize == 0 + && lyxrc.default_papersize == BufferParams::PAPER_A4PAPER); + if (a4size && paperModule->portraitRB->isChecked()) { marginsModule->marginCO->insertItem(qt_("Small margins")); marginsModule->marginCO->insertItem(qt_("Very small margins")); marginsModule->marginCO->insertItem(qt_("Very wide margins")); diff --git a/src/frontends/qt2/QDocumentDialog.h b/src/frontends/qt2/QDocumentDialog.h index 3e93638951..ca7010733b 100644 --- a/src/frontends/qt2/QDocumentDialog.h +++ b/src/frontends/qt2/QDocumentDialog.h @@ -57,6 +57,7 @@ protected slots: void setCustomMargins(int); void setSkip(int); void enableSkip(bool); + void portraitChanged(); void classChanged(); protected: diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index f15d62ce47..a2c77c908f 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,8 @@ +2003-02-10 Juergen Spitzmueller + + * FormDocument.C: Reset paperpackage to NONE when + papersize != A4 (bug 844) + 2003-01-31 Michael Schmitt * FormDocument.C: diff --git a/src/frontends/xforms/FormDocument.C b/src/frontends/xforms/FormDocument.C index 39ad431d95..94050e11c6 100644 --- a/src/frontends/xforms/FormDocument.C +++ b/src/frontends/xforms/FormDocument.C @@ -584,7 +584,11 @@ ButtonPolicy::SMInput FormDocument::input(FL_OBJECT * ob, long) bool const enable = ( fl_get_choice(paper_->choice_papersize) == 1 && lyxrc.default_papersize == BufferParams::PAPER_A4PAPER ) || fl_get_choice(paper_->choice_papersize) == 7; - setEnabled(paper_->choice_paperpackage, enable && fl_get_button(paper_->radio_portrait)); + if (!enable) + fl_set_choice(paper_->choice_paperpackage, + BufferParams::PACKAGE_NONE + 1); + setEnabled(paper_->choice_paperpackage, + enable && fl_get_button(paper_->radio_portrait)); } return ButtonPolicy::SMI_VALID; diff --git a/status.13x b/status.13x index 0eee8c7c4a..54cfbf9f29 100644 --- a/status.13x +++ b/status.13x @@ -42,11 +42,11 @@ What's new - delete lyxserver pipes on exit [bug #865, Qt only] +- fix various problems with paper size selection [bug #844 and more] + - in the dialogs, replace LaTeX font size names by LyX names for consistency reasons and to resolve a translation conflict - enable the debug level to be set in lyx2lyx - fix strerror() build problem with some gcc/glibc versions [bug #874] - -- enable the lyx2lyx debug level to be set