From eca7848597e2f6b170c7268a2c1974e8a6524356 Mon Sep 17 00:00:00 2001 From: John Levon Date: Wed, 13 Nov 2002 00:52:15 +0000 Subject: [PATCH] fix some document dialog ui and add some FIXMEs git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5620 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt2/ChangeLog | 9 + src/frontends/qt2/QDocument.C | 102 +- src/frontends/qt2/QDocument.h | 9 +- src/frontends/qt2/QDocumentDialog.C | 366 ++++--- src/frontends/qt2/QDocumentDialog.h | 10 +- src/frontends/qt2/ui/BulletsModuleBase.ui | 1131 ++++++++++++--------- src/frontends/qt2/ui/QDocumentDialog.ui | 17 +- src/frontends/qt2/ui/QWrapDialog.ui | 2 +- 8 files changed, 892 insertions(+), 754 deletions(-) diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 8829eba9bc..624aa28eb3 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,12 @@ +2002-11-13 John Levon + + * QDocument.h: + * QDocument.C: + * QDocumentDialog.h: + * QDocumentDialog.C: + * ui/QDocumentDialog.ui: + * ui/BulletsModuleBase.ui: some UI fixes + 2002-11-12 Edwin Leuven * QDocumentDialog.C: enable apply on change diff --git a/src/frontends/qt2/QDocument.C b/src/frontends/qt2/QDocument.C index 75c7802ce6..d2c255925d 100644 --- a/src/frontends/qt2/QDocument.C +++ b/src/frontends/qt2/QDocument.C @@ -285,6 +285,7 @@ void QDocument::apply() } default: // DocumentDefskipCB assures that this never happens + // so Assert then !!! - jbl params.setDefSkip(VSpace(VSpace::MEDSKIP)); break; } @@ -334,46 +335,42 @@ void QDocument::apply() } params.paperpackage = char(margin); + MarginsModuleBase const * m(dialog_->marginsModule); + params.leftmargin = - LyXLength(dialog_->marginsModule->innerLE->text().toDouble(), - dialog_->marginsModule->innerUnit->currentLengthItem() + LyXLength(m->innerLE->text().toDouble(), + m->innerUnit->currentLengthItem() ).asString(); params.topmargin = - LyXLength(dialog_->marginsModule->topLE->text().toDouble(), - dialog_->marginsModule->topUnit->currentLengthItem() + LyXLength(m->topLE->text().toDouble(), + m->topUnit->currentLengthItem() ).asString(); - params.rightmargin = - LyXLength(dialog_->marginsModule->outerLE->text().toDouble(), - dialog_->marginsModule->outerUnit->currentLengthItem() + LyXLength(m->outerLE->text().toDouble(), + m->outerUnit->currentLengthItem() ).asString(); - params.bottommargin = - LyXLength(dialog_->marginsModule->bottomLE->text().toDouble(), - dialog_->marginsModule->bottomUnit->currentLengthItem() + LyXLength(m->bottomLE->text().toDouble(), + m->bottomUnit->currentLengthItem() ).asString(); - params.headheight = - LyXLength(dialog_->marginsModule->headheightLE->text().toDouble(), - dialog_->marginsModule->headheightUnit->currentLengthItem() + LyXLength(m->headheightLE->text().toDouble(), + m->headheightUnit->currentLengthItem() ).asString(); - params.headsep = - LyXLength(dialog_->marginsModule->headsepLE->text().toDouble(), - dialog_->marginsModule->headsepUnit->currentLengthItem() + LyXLength(m->headsepLE->text().toDouble(), + m->headsepUnit->currentLengthItem() ).asString(); - params.footskip = - LyXLength(dialog_->marginsModule->footskipLE->text().toDouble(), - dialog_->marginsModule->footskipUnit->currentLengthItem() + LyXLength(m->footskipLE->text().toDouble(), + m->footskipUnit->currentLengthItem() ).asString(); - } @@ -452,7 +449,6 @@ void QDocument::update_contents() dialog_->bulletsModule->bulletsize4CO->setCurrentItem( params.user_defined_bullets[3].getSize() + 1); - // packages QStringList enc; enc << "default" << "auto" << "latin1" << "latin2" << "latin3" << @@ -481,6 +477,9 @@ void QDocument::update_contents() dialog_->packagesModule->amsCB->setChecked( params.use_amsmath); + // FIXME: this is wrong + // QComboBox::setCurrentItem: (lspacingCO) Index 4 out of range + dialog_->packagesModule->lspacingCO-> setCurrentItem(params.spacing.getSpace()); if (params.spacing.getSpace() == Spacing::Other) { @@ -581,49 +580,38 @@ void QDocument::update_contents() tostr(LyXLength(params.paperheight).value()).c_str()); // margins + + MarginsModuleBase * m(dialog_->marginsModule); + int item = params.paperpackage; if (params.use_geometry) { item = 1; } else if (item > 0) { item = item + 1; } - dialog_->marginsModule->marginCO->setCurrentItem(item); + m->marginCO->setCurrentItem(item); dialog_->setCustomMargins(item); - dialog_->marginsModule->topUnit->setCurrentItem( - LyXLength(params.topmargin).unit()); - dialog_->marginsModule->topLE->setText( - tostr(LyXLength(params.topmargin).value()).c_str()); - - dialog_->marginsModule->bottomUnit->setCurrentItem( - LyXLength(params.bottommargin).unit()); - dialog_->marginsModule->bottomLE->setText( - tostr(LyXLength(params.bottommargin).value()).c_str()); - - dialog_->marginsModule->innerUnit->setCurrentItem( - LyXLength(params.leftmargin).unit()); - dialog_->marginsModule->innerLE->setText( - tostr(LyXLength(params.leftmargin).value()).c_str()); - - dialog_->marginsModule->outerUnit->setCurrentItem( - LyXLength(params.rightmargin).unit()); - dialog_->marginsModule->outerLE->setText( - tostr(LyXLength(params.rightmargin).value()).c_str()); - - dialog_->marginsModule->headheightUnit->setCurrentItem( - LyXLength(params.headheight).unit()); - dialog_->marginsModule->headheightLE->setText( - tostr(LyXLength(params.headheight).value()).c_str()); - - dialog_->marginsModule->headsepUnit->setCurrentItem( - LyXLength(params.headsep).unit()); - dialog_->marginsModule->headsepLE->setText( - tostr(LyXLength(params.headsep).value()).c_str()); - - dialog_->marginsModule->footskipUnit->setCurrentItem( - LyXLength(params.footskip).unit()); - dialog_->marginsModule->footskipLE->setText( - tostr(LyXLength(params.footskip).value()).c_str()); + m->topUnit->setCurrentItem(LyXLength(params.topmargin).unit()); + m->topLE->setText(tostr(LyXLength(params.topmargin).value()).c_str()); + + m->bottomUnit->setCurrentItem(LyXLength(params.bottommargin).unit()); + m->bottomLE->setText(tostr(LyXLength(params.bottommargin).value()).c_str()); + + m->innerUnit->setCurrentItem(LyXLength(params.leftmargin).unit()); + m->innerLE->setText(tostr(LyXLength(params.leftmargin).value()).c_str()); + + m->outerUnit->setCurrentItem(LyXLength(params.rightmargin).unit()); + m->outerLE->setText(tostr(LyXLength(params.rightmargin).value()).c_str()); + + m->headheightUnit->setCurrentItem(LyXLength(params.headheight).unit()); + m->headheightLE->setText(tostr(LyXLength(params.headheight).value()).c_str()); + + m->headsepUnit->setCurrentItem(LyXLength(params.headsep).unit()); + m->headsepLE->setText(tostr(LyXLength(params.headsep).value()).c_str()); + + m->footskipUnit->setCurrentItem(LyXLength(params.footskip).unit()); + m->footskipLE->setText(tostr(LyXLength(params.footskip).value()).c_str()); } @@ -634,6 +622,7 @@ void QDocument::saveDocDefault() controller().saveAsDefault(); } + void QDocument::useClassDefaults() { BufferParams & params = controller().params(); @@ -642,4 +631,3 @@ void QDocument::useClassDefaults() params.useClassDefaults(); update_contents(); } - diff --git a/src/frontends/qt2/QDocument.h b/src/frontends/qt2/QDocument.h index d9decb7f5e..070431d949 100644 --- a/src/frontends/qt2/QDocument.h +++ b/src/frontends/qt2/QDocument.h @@ -19,7 +19,6 @@ #include "Qt2Base.h" #include "Qt2BC.h" -//#include "QtLyXView.h" #include @@ -30,9 +29,9 @@ class QDocument : public Qt2CB > { public: - /// + friend class QDocumentDialog; - /// + QDocument(); private: /// Apply changes @@ -45,9 +44,9 @@ private: void saveDocDefault(); /// reset to default params void useClassDefaults(); - /// + + /// FIXME std::vector lang_; }; - #endif // QDOCUMENT_H diff --git a/src/frontends/qt2/QDocumentDialog.C b/src/frontends/qt2/QDocumentDialog.C index fe9d4bc4d0..6c0d258cf7 100644 --- a/src/frontends/qt2/QDocumentDialog.C +++ b/src/frontends/qt2/QDocumentDialog.C @@ -31,14 +31,10 @@ #include "ui/MarginsModuleBase.h" #include "ui/PreambleModuleBase.h" -#include "QBrowseBox.h" #include "Spacing.h" -#include "support/filetools.h" #include "support/lstrings.h" -#include "Alert.h" #include "lyxrc.h" #include "buffer.h" -#include "lyx_main.h" // for user_lyxdir #include #include @@ -53,15 +49,8 @@ #include "lengthcombo.h" -/* - * Constructs a DocumentDialog which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' - * - * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. - */ -QDocumentDialog::QDocumentDialog( QDocument * form) - : QDocumentDialogBase( 0, 0, false, 0 ), form_(form) +QDocumentDialog::QDocumentDialog(QDocument * form) + : QDocumentDialogBase(0, 0, false, 0), form_(form) { connect(okPB, SIGNAL(clicked()), form, SLOT(slotOK())); @@ -73,16 +62,17 @@ QDocumentDialog::QDocumentDialog( QDocument * form) form, SLOT(slotRestore())); moduleLB->clear(); - moduleLB->insertItem( _("Layout"), LAYOUT ); - moduleLB->insertItem( _("Packages"), PACKAGES ); - moduleLB->insertItem( _("Paper"), PAPER ); - moduleLB->insertItem( _("Margins"), MARGINS ); - moduleLB->insertItem( _("Language"), LANGUAGE ); - moduleLB->insertItem( _("Bullets"), BULLETS ); - moduleLB->insertItem( _("Numbering"), NUMBERING ); - moduleLB->insertItem( _("Bibliography"), BIBLIOGRAPHY ); - moduleLB->insertItem( _("Preamble"), PREAMBLE ); + moduleLB->insertItem(_("Layout"), LAYOUT); + moduleLB->insertItem(_("Packages"), PACKAGES); + moduleLB->insertItem(_("Paper"), PAPER); + moduleLB->insertItem(_("Margins"), MARGINS); + moduleLB->insertItem(_("Language"), LANGUAGE); + moduleLB->insertItem(_("Bullets"), BULLETS); + moduleLB->insertItem(_("Numbering"), NUMBERING); + moduleLB->insertItem(_("Bibliography"), BIBLIOGRAPHY); + moduleLB->insertItem(_("Preamble"), PREAMBLE); moduleLB->setCurrentItem(LAYOUT); + moduleLB->setMinimumSize(moduleLB->sizeHint()); layoutModule = new ClassModuleBase(this); paperModule = new PaperModuleBase(this); @@ -107,183 +97,177 @@ QDocumentDialog::QDocumentDialog( QDocument * form) moduleStack->raiseWidget(LAYOUT); - //QPixmap image("standard.xpm"); - //bulletsModule->bulletsBB->insertItem(image); - //bulletsModule->bulletsBB->resize(image.width(),image.height()); // take care of title QFont f = titleL->font(); - f.setWeight( QFont::Bold ); - titleL->setFont( f ); + f.setWeight(QFont::Bold); + titleL->setFont(f); setTitle(LAYOUT); - /* preamble */ - connect( preambleModule->preambleMLE, SIGNAL( textChanged() ), - this , SLOT( change_adaptor() ) ); - /* biblio */ - connect( biblioModule->natbibCB, SIGNAL( toggled(bool) ), - this , SLOT( change_adaptor() ) ); - connect( biblioModule->citeStyleCO, SIGNAL( activated(int) ), - this , SLOT( change_adaptor() ) ); - /* language & quote */ - connect( langModule->singleQuoteRB, SIGNAL( toggled(bool) ), - this , SLOT( change_adaptor() ) ); - connect( langModule->doubleQuoteRB, SIGNAL( toggled(bool) ), - this , SLOT( change_adaptor() ) ); - connect( langModule->languageCO, SIGNAL( activated(int) ), - this , SLOT( change_adaptor() ) ); - connect( langModule->quoteStyleCO, SIGNAL( activated(int) ), - this , SLOT( change_adaptor() ) ); - /* numbering */ - connect( numberingModule->sectionnrDepthSB, - SIGNAL( valueChanged(int) ), - this , SLOT( change_adaptor() ) ); - connect( numberingModule->tocDepthSB, - SIGNAL( valueChanged(int) ), - this , SLOT( change_adaptor() ) ); - /* packages */ - connect( packagesModule->lspacingCO, SIGNAL( activated(int) ), - this , SLOT( change_adaptor() ) ); - connect( packagesModule->lspacingCO, SIGNAL( activated(int) ), - this , SLOT( setLSpacing(int) ) ); - connect( packagesModule->lspacingLE, - SIGNAL( textChanged(const QString&) ), - this , SLOT( change_adaptor() ) ); - connect( packagesModule->encodingCO, SIGNAL( activated(int) ), - this , SLOT( change_adaptor() ) ); - connect( packagesModule->amsCB, SIGNAL( toggled(bool) ), - this , SLOT( change_adaptor() ) ); - connect( packagesModule->psdriverCO, SIGNAL( activated(int) ), - this , SLOT( change_adaptor() ) ); - /* layout */ - connect( layoutModule->classCO, SIGNAL( activated(int) ), - this , SLOT( change_adaptor() ) ); - connect( layoutModule->optionsLE, - SIGNAL( textChanged(const QString&) ), - this , SLOT( change_adaptor() ) ); - connect( layoutModule->pagestyleCO, SIGNAL( activated(int) ), - this , SLOT( change_adaptor() ) ); - connect( layoutModule->fontsCO, SIGNAL( activated(int) ), - this , SLOT( change_adaptor() ) ); - connect( layoutModule->fontsizeCO, SIGNAL( activated(int) ), - this , SLOT( change_adaptor() ) ); - connect( layoutModule->floatPlacementLE, - SIGNAL( textChanged(const QString&) ), - this , SLOT( change_adaptor() ) ); - connect( layoutModule->skipRB, SIGNAL( toggled(bool) ), - this , SLOT( change_adaptor() ) ); - connect( layoutModule->indentRB, SIGNAL( toggled(bool) ), - this , SLOT( change_adaptor() ) ); - connect( layoutModule->skipCO, SIGNAL( activated(int) ), - this , SLOT( change_adaptor() ) ); - connect( layoutModule->skipLE, - SIGNAL( textChanged(const QString&) ), - this , SLOT( change_adaptor() ) ); - connect( layoutModule->skipLengthCO, SIGNAL( activated(int) ), - this , SLOT( change_adaptor() ) ); - - connect( layoutModule->classCO, SIGNAL( activated(int) ), - this , SLOT( classChanged() ) ); - connect( layoutModule->skipCO, SIGNAL( activated(int) ), - this , SLOT( setSkip(int) ) ); - connect( layoutModule->skipRB, SIGNAL( toggled(bool) ), - this , SLOT( enableSkip(bool) ) ); - - /* margins */ - connect( marginsModule->marginCO, SIGNAL( activated(int) ), - this , SLOT( setCustomMargins(int) ) ); - - connect( marginsModule->marginCO, SIGNAL( activated(int) ), - this , SLOT( change_adaptor() ) ); - connect( marginsModule->topLE, SIGNAL( textChanged(const QString&) ), - this , SLOT( change_adaptor() ) ); - connect( marginsModule->topUnit, SIGNAL( activated(int) ), - this , SLOT( change_adaptor() ) ); - connect( marginsModule->bottomLE, SIGNAL( textChanged(const QString&) ), - this , SLOT( change_adaptor() ) ); - connect( marginsModule->bottomUnit, SIGNAL( activated(int) ), - this , SLOT( change_adaptor() ) ); - connect( marginsModule->innerLE, SIGNAL( textChanged(const QString&) ), - this , SLOT( change_adaptor() ) ); - connect( marginsModule->innerUnit, SIGNAL( activated(int) ), - this , SLOT( change_adaptor() ) ); - connect( marginsModule->outerLE, SIGNAL( textChanged(const QString&) ), - this , SLOT( change_adaptor() ) ); - connect( marginsModule->outerUnit, SIGNAL( activated(int) ), - this , SLOT( change_adaptor() ) ); - connect( marginsModule->headheightLE, SIGNAL( textChanged(const QString&) ), - this , SLOT( change_adaptor() ) ); - connect( marginsModule->headheightUnit, SIGNAL( activated(int) ), - this , SLOT( change_adaptor() ) ); - connect( marginsModule->headsepLE, SIGNAL( textChanged(const QString&) ), - this , SLOT( change_adaptor() ) ); - connect( marginsModule->headsepUnit, SIGNAL( activated(int) ), - this , SLOT( change_adaptor() ) ); - connect( marginsModule->footskipLE, SIGNAL( textChanged(const QString&) ), - this , SLOT( change_adaptor() ) ); - connect( marginsModule->footskipUnit, SIGNAL( activated(int) ), - this , SLOT( change_adaptor() ) ); - - /* paper */ - connect( paperModule->papersizeCO, SIGNAL( activated(int) ), - this , SLOT( setMargins(int) ) ); - connect( paperModule->papersizeCO, SIGNAL( activated(int) ), - this , SLOT( setCustomPapersize(int) ) ); - connect( paperModule->papersizeCO, SIGNAL( activated(int) ), - this , SLOT( setCustomPapersize(int) ) ); - - connect( paperModule->papersizeCO, SIGNAL( activated(int) ), - this , SLOT( change_adaptor() ) ); - connect( paperModule->paperheightLE, SIGNAL( textChanged(const QString&) ), - this , SLOT( change_adaptor() ) ); - connect( paperModule->paperwidthLE, SIGNAL( textChanged(const QString&) ), - this , SLOT( change_adaptor() ) ); - connect( paperModule->paperwidthUnitCO, SIGNAL( activated(int) ), - this , SLOT( change_adaptor() ) ); - connect( paperModule->paperheightUnitCO, SIGNAL( activated(int) ), - this , SLOT( change_adaptor() ) ); - connect( paperModule->portraitRB, SIGNAL( toggled(bool) ), - this , SLOT( change_adaptor() ) ); - connect( paperModule->landscapeRB, SIGNAL( toggled(bool) ), - this , SLOT( change_adaptor() ) ); - connect( paperModule->twoColumnCB, SIGNAL( toggled(bool) ), - this , SLOT( change_adaptor() ) ); - connect( paperModule->facingPagesCB, SIGNAL( toggled(bool) ), - this , SLOT( change_adaptor() ) ); - - /* bullets */ - connect( bulletsModule->bullet1LE, SIGNAL( textChanged(const QString&) ), - this , SLOT( change_adaptor() ) ); - connect( bulletsModule->bulletsize1CO, SIGNAL( activated(int) ), - this , SLOT( change_adaptor() ) ); - connect( bulletsModule->bullet2LE, SIGNAL( textChanged(const QString&) ), - this , SLOT( change_adaptor() ) ); - connect( bulletsModule->bulletsize2CO, SIGNAL( activated(int) ), - this , SLOT( change_adaptor() ) ); - connect( bulletsModule->bullet3LE, SIGNAL( textChanged(const QString&) ), - this , SLOT( change_adaptor() ) ); - connect( bulletsModule->bulletsize3CO, SIGNAL( activated(int) ), - this , SLOT( change_adaptor() ) ); - connect( bulletsModule->bullet4LE, SIGNAL( textChanged(const QString&) ), - this , SLOT( change_adaptor() ) ); - connect( bulletsModule->bulletsize4CO, SIGNAL( activated(int) ), - this , SLOT( change_adaptor() ) ); + // FIXME: Edwin, please change this by making each module have + // a change_adaptor(), and connecting inside designer; then + // connect each module's change_adaptor to the main form's + // one here. + + // preamble + connect(preambleModule->preambleMLE, SIGNAL(textChanged()), + this , SLOT(change_adaptor())); + // biblio + connect(biblioModule->natbibCB, SIGNAL(toggled(bool)), + this , SLOT(change_adaptor())); + connect(biblioModule->citeStyleCO, SIGNAL(activated(int)), + this , SLOT(change_adaptor())); + // language & quote + connect(langModule->singleQuoteRB, SIGNAL(toggled(bool)), + this , SLOT(change_adaptor())); + connect(langModule->doubleQuoteRB, SIGNAL(toggled(bool)), + this , SLOT(change_adaptor())); + connect(langModule->languageCO, SIGNAL(activated(int)), + this , SLOT(change_adaptor())); + connect(langModule->quoteStyleCO, SIGNAL(activated(int)), + this , SLOT(change_adaptor())); + // numbering + connect(numberingModule->sectionnrDepthSB, + SIGNAL(valueChanged(int)), + this , SLOT(change_adaptor())); + connect(numberingModule->tocDepthSB, + SIGNAL(valueChanged(int)), + this , SLOT(change_adaptor())); + // packages + connect(packagesModule->lspacingCO, SIGNAL(activated(int)), + this , SLOT(change_adaptor())); + connect(packagesModule->lspacingCO, SIGNAL(activated(int)), + this , SLOT(setLSpacing(int))); + connect(packagesModule->lspacingLE, + SIGNAL(textChanged(const QString&)), + this , SLOT(change_adaptor())); + connect(packagesModule->encodingCO, SIGNAL(activated(int)), + this , SLOT(change_adaptor())); + connect(packagesModule->amsCB, SIGNAL(toggled(bool)), + this , SLOT(change_adaptor())); + connect(packagesModule->psdriverCO, SIGNAL(activated(int)), + this , SLOT(change_adaptor())); + // layout + connect(layoutModule->classCO, SIGNAL(activated(int)), + this , SLOT(change_adaptor())); + connect(layoutModule->optionsLE, + SIGNAL(textChanged(const QString&)), + this , SLOT(change_adaptor())); + connect(layoutModule->pagestyleCO, SIGNAL(activated(int)), + this , SLOT(change_adaptor())); + connect(layoutModule->fontsCO, SIGNAL(activated(int)), + this , SLOT(change_adaptor())); + connect(layoutModule->fontsizeCO, SIGNAL(activated(int)), + this , SLOT(change_adaptor())); + connect(layoutModule->floatPlacementLE, + SIGNAL(textChanged(const QString&)), + this , SLOT(change_adaptor())); + connect(layoutModule->skipRB, SIGNAL(toggled(bool)), + this , SLOT(change_adaptor())); + connect(layoutModule->indentRB, SIGNAL(toggled(bool)), + this , SLOT(change_adaptor())); + connect(layoutModule->skipCO, SIGNAL(activated(int)), + this , SLOT(change_adaptor())); + connect(layoutModule->skipLE, + SIGNAL(textChanged(const QString&)), + this , SLOT(change_adaptor())); + connect(layoutModule->skipLengthCO, SIGNAL(activated(int)), + this , SLOT(change_adaptor())); + + connect(layoutModule->classCO, SIGNAL(activated(int)), + this , SLOT(classChanged())); + connect(layoutModule->skipCO, SIGNAL(activated(int)), + this , SLOT(setSkip(int))); + connect(layoutModule->skipRB, SIGNAL(toggled(bool)), + this , SLOT(enableSkip(bool))); + + // margins + connect(marginsModule->marginCO, SIGNAL(activated(int)), + this , SLOT(setCustomMargins(int))); + + connect(marginsModule->marginCO, SIGNAL(activated(int)), + this , SLOT(change_adaptor())); + connect(marginsModule->topLE, SIGNAL(textChanged(const QString&)), + this , SLOT(change_adaptor())); + connect(marginsModule->topUnit, SIGNAL(activated(int)), + this , SLOT(change_adaptor())); + connect(marginsModule->bottomLE, SIGNAL(textChanged(const QString&)), + this , SLOT(change_adaptor())); + connect(marginsModule->bottomUnit, SIGNAL(activated(int)), + this , SLOT(change_adaptor())); + connect(marginsModule->innerLE, SIGNAL(textChanged(const QString&)), + this , SLOT(change_adaptor())); + connect(marginsModule->innerUnit, SIGNAL(activated(int)), + this , SLOT(change_adaptor())); + connect(marginsModule->outerLE, SIGNAL(textChanged(const QString&)), + this , SLOT(change_adaptor())); + connect(marginsModule->outerUnit, SIGNAL(activated(int)), + this , SLOT(change_adaptor())); + connect(marginsModule->headheightLE, SIGNAL(textChanged(const QString&)), + this , SLOT(change_adaptor())); + connect(marginsModule->headheightUnit, SIGNAL(activated(int)), + this , SLOT(change_adaptor())); + connect(marginsModule->headsepLE, SIGNAL(textChanged(const QString&)), + this , SLOT(change_adaptor())); + connect(marginsModule->headsepUnit, SIGNAL(activated(int)), + this , SLOT(change_adaptor())); + connect(marginsModule->footskipLE, SIGNAL(textChanged(const QString&)), + this , SLOT(change_adaptor())); + connect(marginsModule->footskipUnit, SIGNAL(activated(int)), + this , SLOT(change_adaptor())); + + // paper + connect(paperModule->papersizeCO, SIGNAL(activated(int)), + this , SLOT(setMargins(int))); + connect(paperModule->papersizeCO, SIGNAL(activated(int)), + this , SLOT(setCustomPapersize(int))); + connect(paperModule->papersizeCO, SIGNAL(activated(int)), + this , SLOT(setCustomPapersize(int))); + + connect(paperModule->papersizeCO, SIGNAL(activated(int)), + this , SLOT(change_adaptor())); + connect(paperModule->paperheightLE, SIGNAL(textChanged(const QString&)), + this , SLOT(change_adaptor())); + connect(paperModule->paperwidthLE, SIGNAL(textChanged(const QString&)), + this , SLOT(change_adaptor())); + connect(paperModule->paperwidthUnitCO, SIGNAL(activated(int)), + this , SLOT(change_adaptor())); + connect(paperModule->paperheightUnitCO, SIGNAL(activated(int)), + this , SLOT(change_adaptor())); + connect(paperModule->portraitRB, SIGNAL(toggled(bool)), + this , SLOT(change_adaptor())); + connect(paperModule->landscapeRB, SIGNAL(toggled(bool)), + this , SLOT(change_adaptor())); + connect(paperModule->twoColumnCB, SIGNAL(toggled(bool)), + this , SLOT(change_adaptor())); + connect(paperModule->facingPagesCB, SIGNAL(toggled(bool)), + this , SLOT(change_adaptor())); + + // bullets + connect(bulletsModule->bullet1LE, SIGNAL(textChanged(const QString&)), + this , SLOT(change_adaptor())); + connect(bulletsModule->bulletsize1CO, SIGNAL(activated(int)), + this , SLOT(change_adaptor())); + connect(bulletsModule->bullet2LE, SIGNAL(textChanged(const QString&)), + this , SLOT(change_adaptor())); + connect(bulletsModule->bulletsize2CO, SIGNAL(activated(int)), + this , SLOT(change_adaptor())); + connect(bulletsModule->bullet3LE, SIGNAL(textChanged(const QString&)), + this , SLOT(change_adaptor())); + connect(bulletsModule->bulletsize3CO, SIGNAL(activated(int)), + this , SLOT(change_adaptor())); + connect(bulletsModule->bullet4LE, SIGNAL(textChanged(const QString&)), + this , SLOT(change_adaptor())); + connect(bulletsModule->bulletsize4CO, SIGNAL(activated(int)), + this , SLOT(change_adaptor())); } -/* - * Destroys the object and frees any allocated resources - */ QDocumentDialog::~QDocumentDialog() { - // no need to delete child widgets, Qt does it all for us } -/* - * public slot - */ - void QDocumentDialog::setTitle(int item) { switch(item) { @@ -318,18 +302,12 @@ void QDocumentDialog::setTitle(int item) } -/* - * public slot - */ void QDocumentDialog::saveDefaultClicked() { form_->saveDocDefault(); } -/* - * public slot - */ void QDocumentDialog::useDefaultsClicked() { form_->useClassDefaults(); @@ -357,7 +335,7 @@ void QDocumentDialog::setLSpacing(int item) void QDocumentDialog::setSkip(int item) { - bool enable = (item == 3); + bool const enable = (item == 3); layoutModule->skipLE->setEnabled(enable); layoutModule->skipLengthCO->setEnabled(enable); } @@ -377,7 +355,7 @@ void QDocumentDialog::setMargins(int papersize) { QStringList a4only; QStringList normal; - a4only << _("Small Margins") << _( "Very small Margins") + a4only << _("Small Margins") << _("Very small Margins") << _("Very wide Margins "); normal << _("Default") << _("Custom"); diff --git a/src/frontends/qt2/QDocumentDialog.h b/src/frontends/qt2/QDocumentDialog.h index f58be9703e..7b5e710b61 100644 --- a/src/frontends/qt2/QDocumentDialog.h +++ b/src/frontends/qt2/QDocumentDialog.h @@ -41,13 +41,15 @@ public: QDocumentDialog(QDocument *); ~QDocumentDialog(); - void updateFontsize(string const & , string const &); - void updatePagestyle(string const & , string const &); + void updateFontsize(string const &, string const &); + void updatePagestyle(string const &, string const &); + public slots: void setTitle(int); void change_adaptor(); void saveDefaultClicked(); void useDefaultsClicked(); + protected slots: void setLSpacing(int); void setMargins(int); @@ -56,8 +58,10 @@ protected slots: void setSkip(int); void enableSkip(bool); void classChanged(); + protected: - void closeEvent(QCloseEvent * e); + void closeEvent(QCloseEvent * e); + private: enum Module { LAYOUT, diff --git a/src/frontends/qt2/ui/BulletsModuleBase.ui b/src/frontends/qt2/ui/BulletsModuleBase.ui index d300277cc0..1e70e074f4 100644 --- a/src/frontends/qt2/ui/BulletsModuleBase.ui +++ b/src/frontends/qt2/ui/BulletsModuleBase.ui @@ -13,8 +13,8 @@ 0 0 - 308 - 176 + 335 + 216 @@ -25,7 +25,7 @@ mouseTracking true - + margin 11 @@ -34,7 +34,628 @@ spacing 6 - + + QLayoutWidget + + name + Layout5 + + + + margin + 0 + + + spacing + 6 + + + QComboBox + + + text + default + + + + + text + tiny + + + + + text + script + + + + + text + footnote + + + + + text + small + + + + + text + normal + + + + + text + large + + + + + text + Large + + + + + text + LARGE + + + + + text + huge + + + + + text + Huge + + + + name + bulletsize4CO + + + toolTip + Level 4 bullet size + + + + QLineEdit + + name + bullet3LE + + + sizePolicy + + 3 + 0 + + + + toolTip + Level 3 bullet + + + + QToolButton + + name + setbullet2TB + + + focusPolicy + TabFocus + + + text + Choose + + + popupDelay + 1 + + + toolTip + Shows menu with bullet options + + + + QToolButton + + name + setbullet1TB + + + focusPolicy + TabFocus + + + text + Choose + + + popupDelay + 1 + + + toolTip + Shows menu with bullet options + + + + QLineEdit + + name + bullet1LE + + + sizePolicy + + 3 + 0 + + + + toolTip + Level 1 bullet + + + + QComboBox + + + text + default + + + + + text + tiny + + + + + text + script + + + + + text + footnote + + + + + text + small + + + + + text + normal + + + + + text + large + + + + + text + Large + + + + + text + LARGE + + + + + text + huge + + + + + text + Huge + + + + name + bulletsize1CO + + + toolTip + Level 1 bullet size + + + + + name + Spacer3 + + + orientation + Vertical + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + + + QLabel + + name + sizeL + + + text + Si&ze: + + + buddy + bulletsize1CO + + + + QToolButton + + name + setbullet4TB + + + focusPolicy + TabFocus + + + text + Choose + + + popupDelay + 1 + + + toolTip + Shows menu with bullet options + + + + QLabel + + name + latexL + + + text + Name + + + buddy + bullet1LE + + + + QLabel + + name + TextLabel1_3 + + + text + Level &3 : + + + buddy + bullet3LE + + + + QLabel + + name + TextLabel1 + + + text + Level &1 : + + + buddy + bullet1LE + + + + + name + Spacer2 + + + orientation + Vertical + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + + + QLabel + + name + TextLabel1_4 + + + text + Level &4 : + + + buddy + bullet4LE + + + + QLineEdit + + name + bullet2LE + + + sizePolicy + + 3 + 0 + + + + toolTip + Level 2 bullet + + + + QLineEdit + + name + bullet4LE + + + sizePolicy + + 3 + 0 + + + + toolTip + Level 4 bullet + + + + QToolButton + + name + setbullet3TB + + + focusPolicy + TabFocus + + + text + Choose + + + popupDelay + 1 + + + toolTip + Shows menu with bullet options + + + + QComboBox + + + text + default + + + + + text + tiny + + + + + text + script + + + + + text + footnote + + + + + text + small + + + + + text + normal + + + + + text + large + + + + + text + Large + + + + + text + LARGE + + + + + text + huge + + + + + text + Huge + + + + name + bulletsize3CO + + + toolTip + Level 3 bullet size + + + + QComboBox + + + text + default + + + + + text + tiny + + + + + text + script + + + + + text + footnote + + + + + text + small + + + + + text + normal + + + + + text + large + + + + + text + Large + + + + + text + LARGE + + + + + text + huge + + + + + text + Huge + + + + name + bulletsize2CO + + + toolTip + Level 2 bullet size + + + + QLabel + + name + TextLabel1_2 + + + text + Level &2 : + + + buddy + bullet2LE + + + + + name Spacer25 @@ -55,492 +676,20 @@ - - QLabel - - name - latexL - - - text - &Bullet (LaTeX): - - - buddy - bullet1LE - - - - QLabel - - name - sizeL - - - text - Si&ze: - - - buddy - bulletsize1CO - - - - QLineEdit - - name - bullet1LE - - - sizePolicy - - 3 - 0 - - - - toolTip - Level 1 bullet - - - - QLineEdit - - name - bullet2LE - - - sizePolicy - - 3 - 0 - - - - toolTip - Level 2 bullet - - - - QLineEdit - - name - bullet3LE - - - sizePolicy - - 3 - 0 - - - - toolTip - Level 3 bullet - - - - QLineEdit - - name - bullet4LE - - - sizePolicy - - 3 - 0 - - - - toolTip - Level 4 bullet - - - - QComboBox - - - text - default - - - - - text - tiny - - - - - text - script - - - - - text - footnote - - - - - text - small - - - - - text - normal - - - - - text - large - - - - - text - Large - - - - - text - LARGE - - - - - text - huge - - - - - text - Huge - - - - name - bulletsize1CO - - - toolTip - Level 1 bullet size - - - - QComboBox - - - text - default - - - - - text - tiny - - - - - text - script - - - - - text - footnote - - - - - text - small - - - - - text - normal - - - - - text - large - - - - - text - Large - - - - - text - LARGE - - - - - text - huge - - - - - text - Huge - - - - name - bulletsize2CO - - - toolTip - Level 2 bullet size - - - - QComboBox - - - text - default - - - - - text - tiny - - - - - text - script - - - - - text - footnote - - - - - text - small - - - - - text - normal - - - - - text - large - - - - - text - Large - - - - - text - LARGE - - - - - text - huge - - - - - text - Huge - - - - name - bulletsize3CO - - - toolTip - Level 3 bullet size - - - - QComboBox - - - text - default - - - - - text - tiny - - - - - text - script - - - - - text - footnote - - - - - text - small - - - - - text - normal - - - - - text - large - - - - - text - Large - - - - - text - LARGE - - - - - text - huge - - - - - text - Huge - - - - name - bulletsize4CO - - - toolTip - Level 4 bullet size - - - - QToolButton - - name - setbullet1TB - - - text - Set Level &1... - - - popupDelay - 1 - - - toolTip - Shows menu with bullet options - - - - QToolButton - - name - setbullet2TB - - - text - Set Level &2... - - - popupDelay - 1 - - - toolTip - Shows menu with bullet options - - - - QToolButton - - name - setbullet3TB - - - text - Set Level &3... - - - popupDelay - 1 - - - toolTip - Shows menu with bullet options - - - - QToolButton - - name - setbullet4TB - - - text - Set Level &4... - - - popupDelay - 1 - - - toolTip - Shows menu with bullet options - - - + + + bullet1LE + setbullet1TB + bulletsize1CO + bullet2LE + setbullet2TB + bulletsize2CO + bullet3LE + setbullet3TB + bulletsize3CO + bullet4LE + setbullet4TB + bulletsize4CO + diff --git a/src/frontends/qt2/ui/QDocumentDialog.ui b/src/frontends/qt2/ui/QDocumentDialog.ui index 247949dc9a..22987fab1f 100644 --- a/src/frontends/qt2/ui/QDocumentDialog.ui +++ b/src/frontends/qt2/ui/QDocumentDialog.ui @@ -21,6 +21,10 @@ caption Form1 + + sizeGripEnabled + true + margin @@ -186,7 +190,7 @@ sizePolicy - 1 + 5 7 @@ -216,7 +220,7 @@ sizePolicy 7 - 1 + 0 @@ -248,6 +252,13 @@ name moduleStack + + sizePolicy + + 7 + 7 + + @@ -258,7 +269,7 @@ QWidgetStack
qwidgetstack.h
- 0 + -1 -1 0 diff --git a/src/frontends/qt2/ui/QWrapDialog.ui b/src/frontends/qt2/ui/QWrapDialog.ui index 7b1ee9aa89..d85b64957b 100644 --- a/src/frontends/qt2/ui/QWrapDialog.ui +++ b/src/frontends/qt2/ui/QWrapDialog.ui @@ -375,8 +375,8 @@ unitsLC valignCO restorePB - applyPB okPB + applyPB closePB -- 2.39.2