-
-QDocumentDialog::QDocumentDialog(QDocument * form, QWidget * parent, const char * name, bool modal, WFlags fl)
- : QDocumentDialogBase(parent, name, modal, fl),
- form_(form)
-{
-#if 0
- // Copy the pointers to the bullet buttons into an array so that
- // they can all be manipulated together.
- bulletbuttons[0] = bullet00PB;
- bulletbuttons[1] = bullet01PB;
- bulletbuttons[2] = bullet02PB;
- bulletbuttons[3] = bullet03PB;
- bulletbuttons[4] = bullet04PB;
- bulletbuttons[5] = bullet05PB;
- bulletbuttons[6] = bullet10PB;
- bulletbuttons[7] = bullet11PB;
- bulletbuttons[8] = bullet12PB;
- bulletbuttons[9] = bullet13PB;
- bulletbuttons[10] = bullet14PB;
- bulletbuttons[11] = bullet15PB;
- bulletbuttons[12] = bullet20PB;
- bulletbuttons[13] = bullet21PB;
- bulletbuttons[14] = bullet22PB;
- bulletbuttons[15] = bullet23PB;
- bulletbuttons[16] = bullet24PB;
- bulletbuttons[17] = bullet25PB;
- bulletbuttons[18] = bullet30PB;
- bulletbuttons[19] = bullet31PB;
- bulletbuttons[20] = bullet32PB;
- bulletbuttons[21] = bullet33PB;
- bulletbuttons[22] = bullet34PB;
- bulletbuttons[23] = bullet35PB;
- bulletbuttons[24] = bullet40PB;
- bulletbuttons[25] = bullet41PB;
- bulletbuttons[26] = bullet42PB;
- bulletbuttons[27] = bullet43PB;
- bulletbuttons[28] = bullet44PB;
- bulletbuttons[29] = bullet45PB;
- bulletbuttons[30] = bullet50PB;
- bulletbuttons[31] = bullet51PB;
- bulletbuttons[32] = bullet52PB;
- bulletbuttons[33] = bullet53PB;
- bulletbuttons[34] = bullet54PB;
- bulletbuttons[35] = bullet55PB;
-#endif
-}
-
-
-QDocumentDialog::~QDocumentDialog()
-{
-}
-
-
-#if 0
-void QDocumentDialog::slotApply()
-{
- form->apply();
- // PENDING(kalle) Check whether we need this
- // form->bc_->apply();
-}
-
-
-void QDocumentDialog::slotAMSMath(bool)
-{
- form->checkDocumentInput( amsMathCB );
-}
-
-
-void QDocumentDialog::slotBulletDepth1()
-{
- form->bulletDepth( 0 );
-}
-
-
-void QDocumentDialog::slotBulletDepth2()
-{
- form->bulletDepth( 1 );
-}
-
-
-void QDocumentDialog::slotBulletDepth3()
-{
- form->bulletDepth( 2 );
-}
-
-
-void QDocumentDialog::slotBulletDepth4()
-{
- form->bulletDepth( 3 );
-}
-
-
-void QDocumentDialog::slotBulletDing1()
-{
- qDebug( "QDocumentDialog::slotBulletDing1()" );
- form->checkDocumentInput( bulletDing1PB );
- form->setBulletPics();
- bulletStandardPB->setOn( false );
- bulletMathsPB->setOn( false );
- bulletDing2PB->setOn( false );
- bulletDing3PB->setOn( false );
- bulletDing4PB->setOn( false );
-}
-
-
-void QDocumentDialog::slotBulletDing2()
-{
- form->checkDocumentInput( bulletDing2PB );
- form->setBulletPics();
- bulletStandardPB->setOn( false );
- bulletMathsPB->setOn( false );
- bulletDing1PB->setOn( false );
- bulletDing3PB->setOn( false );
- bulletDing4PB->setOn( false );
-}
-
-
-void QDocumentDialog::slotBulletDing3()
-{
- form->checkDocumentInput( bulletDing3PB );
- form->setBulletPics();
- bulletStandardPB->setOn( false );
- bulletMathsPB->setOn( false );
- bulletDing2PB->setOn( false );
- bulletDing1PB->setOn( false );
- bulletDing4PB->setOn( false );
-}
-
-
-void QDocumentDialog::slotBulletDing4()
-{
- form->checkDocumentInput( bulletDing4PB );
- form->setBulletPics();
- bulletStandardPB->setOn( false );
- bulletMathsPB->setOn( false );
- bulletDing2PB->setOn( false );
- bulletDing3PB->setOn( false );
- bulletDing1PB->setOn( false );
-}
-
-
-void QDocumentDialog::slotBulletMaths()
-{
- form->checkDocumentInput( bulletMathsPB );
- form->setBulletPics();
- bulletStandardPB->setOn( false );
- bulletDing1PB->setOn( false );
- bulletDing2PB->setOn( false );
- bulletDing3PB->setOn( false );
- bulletDing4PB->setOn( false );
-}
-
-
-void QDocumentDialog::slotBulletSize(int)
-{
- form->choiceBulletSize();
- form->checkDocumentInput( bulletSizeCO );
-}
-
-
-void QDocumentDialog::slotBulletStandard()
-{
- form->checkDocumentInput( bulletStandardPB );
- form->setBulletPics();
- bulletDing1PB->setOn( false );
- bulletMathsPB->setOn( false );
- bulletDing2PB->setOn( false );
- bulletDing3PB->setOn( false );
- bulletDing4PB->setOn( false );
-}
-
-
-void QDocumentDialog::slotBulletSymbol(int n)
-{
- qDebug( "QDocumentDialog::slotBulletSymbol( %d )", n );
- for( int i = 0; i < 36; i++ )
- bulletbuttons[i]->setOn( false );
- bulletbuttons[n]->setOn( true );
- form->bulletBMTable( n );
- form->checkDocumentInput( bulletTypeBG );
-}
-
-
-void QDocumentDialog::slotClass(int)
-{
- form->checkChoiceClass( 0 );
- form->checkDocumentInput( classesCO );
-}
-
-
-void QDocumentDialog::slotClose()
-{
- form->cancel();
- form->hide();
- // PENDING(kalle) do something with this
- // form->bc_->cancel();
-}
-
-
-void QDocumentDialog::slotColumns(int)
-{
- form->checkDocumentInput( columnsBG );
-}
-
-
-void QDocumentDialog::slotDefaultSkip(const QString&)
-{
- form->checkDocumentInput( defaultSkipED );
-}
-
-
-void QDocumentDialog::slotDefaultSkip(int)
-{
- form->checkChoiceClass( defaultSkipCO );
- form->checkDocumentInput( defaultSkipCO );
-}
-
-
-void QDocumentDialog::slotEncoding(int)
-{
- form->checkChoiceClass( encodingCO );
- form->checkDocumentInput( encodingCO );
-}
-
-
-void QDocumentDialog::slotExtraOptions(const QString&)
-{
- form->checkDocumentInput( extraOptionsED );
-}
-
-
-void QDocumentDialog::slotFloatPlacement(const QString&)
-{
- form->checkDocumentInput( floatPlacementED );
+#include "lengthcombo.h"
+
+
+QDocumentDialog::QDocumentDialog(QDocument * form)
+ : QDocumentDialogBase(0, 0, false, 0), form_(form)
+{
+ connect(okPB, SIGNAL(clicked()),
+ form, SLOT(slotOK()));
+ connect(applyPB, SIGNAL(clicked()),
+ form, SLOT(slotApply()));
+ connect(closePB, SIGNAL(clicked()),
+ form, SLOT(slotClose()));
+ connect(restorePB, SIGNAL(clicked()),
+ form, SLOT(slotRestore()));
+
+ moduleLB->clear();
+ moduleLB->insertItem(qt_("Layout"), LAYOUT);
+ moduleLB->insertItem(qt_("Paper"), PAPER);
+ moduleLB->insertItem(qt_("Margins"), MARGINS);
+ moduleLB->insertItem(qt_("Language"), LANGUAGE);
+ moduleLB->insertItem(qt_("Bullets"), BULLETS);
+ moduleLB->insertItem(qt_("Numbering"), NUMBERING);
+ moduleLB->insertItem(qt_("Bibliography"), BIBLIOGRAPHY);
+ moduleLB->insertItem(qt_("Packages"), PACKAGES);
+ moduleLB->insertItem(qt_("Preamble"), PREAMBLE);
+ moduleLB->setCurrentItem(LAYOUT);
+ moduleLB->setMinimumSize(moduleLB->sizeHint());
+
+ layoutModule = new ClassModuleBase(this);
+ paperModule = new PaperModuleBase(this);
+ marginsModule = new MarginsModuleBase(this);
+ langModule = new LanguageModuleBase(this);
+ bulletsModule = new BulletsModule(this);
+ numberingModule = new NumberingModuleBase(this);
+ biblioModule = new BiblioModuleBase(this);
+ packagesModule = new PackagesModuleBase(this);
+ preambleModule = new PreambleModuleBase(this);
+
+ moduleStack->addWidget(layoutModule, LAYOUT);
+ moduleStack->addWidget(paperModule, PAPER);
+ moduleStack->addWidget(marginsModule, MARGINS);
+ moduleStack->addWidget(langModule, LANGUAGE);
+ moduleStack->addWidget(bulletsModule, BULLETS);
+ moduleStack->addWidget(numberingModule, NUMBERING);
+ moduleStack->addWidget(biblioModule, BIBLIOGRAPHY);
+ moduleStack->addWidget(packagesModule, PACKAGES);
+ moduleStack->addWidget(preambleModule, PREAMBLE);
+
+ moduleStack->raiseWidget(LAYOUT);
+
+
+ // take care of title
+ QFont f = titleL->font();
+ 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->defaultencodingCB, SIGNAL(toggled(bool)),
+ this, SLOT(change_adaptor()));
+ connect(langModule->encodingCO, 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->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->lspacingCO, SIGNAL(activated(int)),
+ this, SLOT(change_adaptor()));
+ connect(layoutModule->lspacingCO, SIGNAL(activated(int)),
+ this, SLOT(setLSpacing(int)));
+ connect(layoutModule->lspacingLE,
+ SIGNAL(textChanged(const QString&)),
+ 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->portraitRB, SIGNAL(toggled(bool)),
+ this, SLOT(portraitChanged()));
+
+ 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->bulletsizeCO, SIGNAL(activated(int)),
+ this, SLOT(change_adaptor()));
+ connect(bulletsModule->bulletsLV, SIGNAL(selectionChanged()),
+ this, SLOT(change_adaptor()));