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
This commit is contained in:
John Levon 2002-11-13 00:52:15 +00:00
parent 2c3c30c8f2
commit eca7848597
8 changed files with 880 additions and 742 deletions

View File

@ -1,3 +1,12 @@
2002-11-13 John Levon <levon@movementarian.org>
* QDocument.h:
* QDocument.C:
* QDocumentDialog.h:
* QDocumentDialog.C:
* ui/QDocumentDialog.ui:
* ui/BulletsModuleBase.ui: some UI fixes
2002-11-12 Edwin Leuven <leuven@fee.uva.nl>
* QDocumentDialog.C: enable apply on change

View File

@ -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());
m->topUnit->setCurrentItem(LyXLength(params.topmargin).unit());
m->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());
m->bottomUnit->setCurrentItem(LyXLength(params.bottommargin).unit());
m->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());
m->innerUnit->setCurrentItem(LyXLength(params.leftmargin).unit());
m->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());
m->outerUnit->setCurrentItem(LyXLength(params.rightmargin).unit());
m->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());
m->headheightUnit->setCurrentItem(LyXLength(params.headheight).unit());
m->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());
m->headsepUnit->setCurrentItem(LyXLength(params.headsep).unit());
m->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->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();
}

View File

@ -19,7 +19,6 @@
#include "Qt2Base.h"
#include "Qt2BC.h"
//#include "QtLyXView.h"
#include <boost/scoped_ptr.hpp>
@ -30,9 +29,9 @@ class QDocument
: public Qt2CB<ControlDocument, Qt2DB<QDocumentDialog> >
{
public:
///
friend class QDocumentDialog;
///
QDocument();
private:
/// Apply changes
@ -45,9 +44,9 @@ private:
void saveDocDefault();
/// reset to default params
void useClassDefaults();
///
/// FIXME
std::vector<string> lang_;
};
#endif // QDOCUMENT_H

View File

@ -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 <qwidgetstack.h>
#include <qlistbox.h>
@ -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() ) );
// 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.
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) ) );
// 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()));
/* margins */
connect( marginsModule->marginCO, SIGNAL( activated(int) ),
this , SLOT( setCustomMargins(int) ) );
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)));
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() ) );
// margins
connect(marginsModule->marginCO, SIGNAL(activated(int)),
this , SLOT(setCustomMargins(int)));
/* 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(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()));
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() ) );
// 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)));
/* 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() ) );
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");

View File

@ -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,

File diff suppressed because it is too large Load Diff

View File

@ -21,6 +21,10 @@
<name>caption</name>
<string>Form1</string>
</property>
<property stdset="1">
<name>sizeGripEnabled</name>
<bool>true</bool>
</property>
<grid>
<property stdset="1">
<name>margin</name>
@ -186,7 +190,7 @@
<property stdset="1">
<name>sizePolicy</name>
<sizepolicy>
<hsizetype>1</hsizetype>
<hsizetype>5</hsizetype>
<vsizetype>7</vsizetype>
</sizepolicy>
</property>
@ -216,7 +220,7 @@
<name>sizePolicy</name>
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>1</vsizetype>
<vsizetype>0</vsizetype>
</sizepolicy>
</property>
<property stdset="1">
@ -248,6 +252,13 @@
<name>name</name>
<cstring>moduleStack</cstring>
</property>
<property stdset="1">
<name>sizePolicy</name>
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>7</vsizetype>
</sizepolicy>
</property>
</widget>
</vbox>
</widget>
@ -258,7 +269,7 @@
<class>QWidgetStack</class>
<header location="global">qwidgetstack.h</header>
<sizehint>
<width>0</width>
<width>-1</width>
<height>-1</height>
</sizehint>
<container>0</container>

View File

@ -375,8 +375,8 @@
<tabstop>unitsLC</tabstop>
<tabstop>valignCO</tabstop>
<tabstop>restorePB</tabstop>
<tabstop>applyPB</tabstop>
<tabstop>okPB</tabstop>
<tabstop>applyPB</tabstop>
<tabstop>closePB</tabstop>
</tabstops>
</UI>