more dialog merging

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17979 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2007-04-25 10:25:37 +00:00
parent bcec0b3dc9
commit ee2966faba
10 changed files with 329 additions and 237 deletions

View File

@ -43,11 +43,9 @@ libqt4_la_SOURCES = \
QLMenubar.C QLMenubar.h \
QBox.C QBox.h \
QBranches.C QBranches.h \
QChanges.C QChanges.h \
QCharacter.C QCharacter.h \
QCitation.C QCitation.h \
QDialogView.C QDialogView.h \
QErrorList.C QErrorList.h \
QFloat.C QFloat.h \
QGraphics.C QGraphics.h \
QInclude.C QInclude.h \

View File

@ -92,14 +92,14 @@ MOCFILES = \
QBox.C QBox.h \
QBranch.C QBranch.h \
QBranches.C QBranches.h \
QChangesDialog.C QChangesDialog.h \
QChanges.C QChanges.h \
QCharacterDialog.C QCharacterDialog.h \
QCitationDialog.C QCitationDialog.h \
QCommandBuffer.C QCommandBuffer.h \
QCommandEdit.C QCommandEdit.h \
QDelimiterDialog.C QDelimiterDialog.h \
QDocument.C QDocument.h \
QErrorListDialog.C QErrorListDialog.h \
QErrorList.C QErrorList.h \
QERT.C QERT.h \
QExternal.C QExternal.h \
QFloatDialog.C QFloatDialog.h \

View File

@ -12,7 +12,6 @@
#include <config.h>
#include "QChanges.h"
#include "QChangesDialog.h"
#include "Qt2BC.h"
#include "qt_helpers.h"
@ -21,18 +20,69 @@
#include "controllers/ControlChanges.h"
#include <QPushButton>
#include <QCloseEvent>
#include <QTextBrowser>
using lyx::support::bformat;
namespace lyx {
namespace frontend {
typedef QController<ControlChanges, QView<QChangesDialog> > changes_base_class;
/////////////////////////////////////////////////////////////////////
//
// QChangesDialog
//
/////////////////////////////////////////////////////////////////////
QChangesDialog::QChangesDialog(QChanges * form)
: form_(form)
{
setupUi(this);
connect(closePB, SIGNAL(clicked()), form, SLOT(slotClose()));
connect(nextPB, SIGNAL(clicked()), this, SLOT(nextPressed()));
connect(rejectPB, SIGNAL(clicked()), this, SLOT(rejectPressed()));
connect(acceptPB, SIGNAL(clicked()), this, SLOT(acceptPressed()));
}
void QChangesDialog::nextPressed()
{
form_->next();
}
void QChangesDialog::acceptPressed()
{
form_->accept();
}
void QChangesDialog::rejectPressed()
{
form_->reject();
}
void QChangesDialog::closeEvent(QCloseEvent *e)
{
form_->slotWMHide();
e->accept();
}
/////////////////////////////////////////////////////////////////////
//
// QChanges
//
/////////////////////////////////////////////////////////////////////
typedef QController<ControlChanges, QView<QChangesDialog> > ChangesBase;
QChanges::QChanges(Dialog & parent)
: changes_base_class(parent, _("Merge Changes"))
: ChangesBase(parent, _("Merge Changes"))
{
}
@ -81,3 +131,5 @@ void QChanges::reject()
} // namespace frontend
} // namespace lyx
#include "QChanges_moc.cpp"

View File

@ -12,12 +12,35 @@
#ifndef QCHANGES_H
#define QCHANGES_H
#include "QChangesDialog.h"
#include "QDialogView.h"
#include "ui/ChangesUi.h"
#include <QCloseEvent>
#include <QDialog>
namespace lyx {
namespace frontend {
class QChanges;
class QChangesDialog : public QDialog, public Ui::QChangesUi {
Q_OBJECT
public:
QChangesDialog(QChanges * form);
protected Q_SLOTS:
virtual void nextPressed();
virtual void acceptPressed();
virtual void rejectPressed();
protected:
virtual void closeEvent(QCloseEvent * e);
private:
QChanges * form_;
};
class ControlChanges;
class QChanges

View File

@ -1,66 +0,0 @@
/**
* \file QChangesDialog.C
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author John Levon
*
* Full author contact details are available in file CREDITS.
*/
#include <config.h>
#include "QChangesDialog.h"
#include "QChanges.h"
#include <QPushButton>
#include <QCloseEvent>
namespace lyx {
namespace frontend {
QChangesDialog::QChangesDialog(QChanges * form)
: form_(form)
{
setupUi(this);
connect(closePB, SIGNAL(clicked()),
form, SLOT(slotClose()));
connect(nextPB, SIGNAL( clicked() ),
this, SLOT( nextPressed() ) );
connect(rejectPB, SIGNAL( clicked() ),
this, SLOT( rejectPressed() ) );
connect(acceptPB, SIGNAL( clicked() ),
this, SLOT( acceptPressed() ) );
}
void QChangesDialog::nextPressed()
{
form_->next();
}
void QChangesDialog::acceptPressed()
{
form_->accept();
}
void QChangesDialog::rejectPressed()
{
form_->reject();
}
void QChangesDialog::closeEvent(QCloseEvent *e)
{
form_->slotWMHide();
e->accept();
}
} // namespace frontend
} // namespace lyx
#include "QChangesDialog_moc.cpp"

View File

@ -1,47 +0,0 @@
// -*- C++ -*-
/**
* \file QChangesDialog.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author John Levon
*
* Full author contact details are available in file CREDITS.
*/
#ifndef QCHANGESDIALOG_H
#define QCHANGESDIALOG_H
#include "ui/ChangesUi.h"
#include <QCloseEvent>
#include <QDialog>
namespace lyx {
namespace frontend {
class QChanges;
class QChangesDialog : public QDialog, public Ui::QChangesUi {
Q_OBJECT
public:
QChangesDialog(QChanges * form);
protected Q_SLOTS:
virtual void nextPressed();
virtual void acceptPressed();
virtual void rejectPressed();
protected:
virtual void closeEvent(QCloseEvent * e);
private:
QChanges * form_;
};
} // namespace frontend
} // namespace lyx
#endif // QCHANGESDIALOG_H

View File

@ -58,36 +58,28 @@ using std::vector;
using std::string;
namespace lyx {
namespace frontend {
/////////////////////////////////////////////////////////////////////
//
// DocumentDialog
//
/////////////////////////////////////////////////////////////////////
namespace lyx {
namespace frontend {
QDocumentDialog::QDocumentDialog(QDocument * form)
: form_(form),
lang_(getSecond(getLanguageData(false)))
{
setupUi(this);
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()));
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()));
connect(savePB, SIGNAL( clicked() ),
this, SLOT( saveDefaultClicked() ) );
connect(defaultPB, SIGNAL( clicked() ),
this, SLOT( useDefaultsClicked() ) );
connect(savePB, SIGNAL(clicked()), this, SLOT(saveDefaultClicked()));
connect(defaultPB, SIGNAL(clicked()), this, SLOT(useDefaultsClicked()));
// Manage the restore, ok, apply, restore and cancel/close buttons
form_->bcview().setOK(okPB);
@ -98,17 +90,28 @@ QDocumentDialog::QDocumentDialog(QDocument * form)
textLayoutModule = new UiWidget<Ui::TextLayoutUi>;
// text layout
connect(textLayoutModule->lspacingCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
connect(textLayoutModule->lspacingCO, SIGNAL(activated(int)), this, SLOT(setLSpacing(int)));
connect(textLayoutModule->lspacingLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
connect(textLayoutModule->skipRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(textLayoutModule->indentRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(textLayoutModule->skipCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
connect(textLayoutModule->skipLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
connect(textLayoutModule->skipLengthCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
connect(textLayoutModule->skipCO, SIGNAL(activated(int)), this, SLOT(setSkip(int)));
connect(textLayoutModule->skipRB, SIGNAL(toggled(bool)), this, SLOT(enableSkip(bool)));
connect(textLayoutModule->twoColumnCB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(textLayoutModule->lspacingCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
connect(textLayoutModule->lspacingCO, SIGNAL(activated(int)),
this, SLOT(setLSpacing(int)));
connect(textLayoutModule->lspacingLE, SIGNAL(textChanged(const QString&)),
this, SLOT(change_adaptor()));
connect(textLayoutModule->skipRB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
connect(textLayoutModule->indentRB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
connect(textLayoutModule->skipCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
connect(textLayoutModule->skipLE, SIGNAL(textChanged(const QString &)),
this, SLOT(change_adaptor()));
connect(textLayoutModule->skipLengthCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
connect(textLayoutModule->skipCO, SIGNAL(activated(int)),
this, SLOT(setSkip(int)));
connect(textLayoutModule->skipRB, SIGNAL(toggled(bool)),
this, SLOT(enableSkip(bool)));
connect(textLayoutModule->twoColumnCB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
textLayoutModule->lspacingLE->setValidator(new QDoubleValidator(
textLayoutModule->lspacingLE));
textLayoutModule->skipLE->setValidator(unsignedLengthValidator(
@ -132,23 +135,32 @@ QDocumentDialog::QDocumentDialog(QDocument * form)
// initialize the length validator
addCheckedLineEdit(form_->bcview(), textLayoutModule->skipLE);
fontModule = new UiWidget<Ui::FontUi>;
// fonts
connect(fontModule->fontsRomanCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
connect(fontModule->fontsRomanCO, SIGNAL(activated(int)), this, SLOT(romanChanged(int)));
connect(fontModule->fontsSansCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
connect(fontModule->fontsSansCO, SIGNAL(activated(int)), this, SLOT(sansChanged(int)));
connect(fontModule->fontsTypewriterCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
connect(fontModule->fontsTypewriterCO, SIGNAL(activated(int)), this, SLOT(ttChanged(int)));
connect(fontModule->fontsDefaultCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
connect(fontModule->fontsizeCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
connect(fontModule->scaleSansSB, SIGNAL(valueChanged(int)), this, SLOT(change_adaptor()));
connect(fontModule->scaleTypewriterSB, SIGNAL(valueChanged(int)), this, SLOT(change_adaptor()));
connect(fontModule->fontScCB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(fontModule->fontOsfCB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(fontModule->fontsRomanCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
connect(fontModule->fontsRomanCO, SIGNAL(activated(int)),
this, SLOT(romanChanged(int)));
connect(fontModule->fontsSansCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
connect(fontModule->fontsSansCO, SIGNAL(activated(int)),
this, SLOT(sansChanged(int)));
connect(fontModule->fontsTypewriterCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
connect(fontModule->fontsTypewriterCO, SIGNAL(activated(int)),
this, SLOT(ttChanged(int)));
connect(fontModule->fontsDefaultCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
connect(fontModule->fontsizeCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
connect(fontModule->scaleSansSB, SIGNAL(valueChanged(int)),
this, SLOT(change_adaptor()));
connect(fontModule->scaleTypewriterSB, SIGNAL(valueChanged(int)),
this, SLOT(change_adaptor()));
connect(fontModule->fontScCB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
connect(fontModule->fontOsfCB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
for (int n = 0; tex_fonts_roman[n][0]; ++n) {
QString font = toqstr(tex_fonts_roman_gui[n]);
@ -179,22 +191,33 @@ QDocumentDialog::QDocumentDialog(QDocument * form)
qt_(ControlDocument::fontfamilies_gui[n]));
pageLayoutModule = new UiWidget<Ui::PageLayoutUi>;
// page layout
connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)), this, SLOT(setCustomPapersize(int)));
connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)), this, SLOT(setCustomPapersize(int)));
connect(pageLayoutModule->portraitRB, SIGNAL(clicked()), this, SLOT(portraitChanged()));
connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
connect(pageLayoutModule->paperheightLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
connect(pageLayoutModule->paperwidthLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
connect(pageLayoutModule->paperwidthUnitCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
connect(pageLayoutModule->paperheightUnitCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
connect(pageLayoutModule->portraitRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(pageLayoutModule->landscapeRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(pageLayoutModule->facingPagesCB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(pageLayoutModule->pagestyleCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)),
this, SLOT(setCustomPapersize(int)));
connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)),
this, SLOT(setCustomPapersize(int)));
connect(pageLayoutModule->portraitRB, SIGNAL(clicked()),
this, SLOT(portraitChanged()));
connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
connect(pageLayoutModule->paperheightLE, SIGNAL(textChanged(const QString &)),
this, SLOT(change_adaptor()));
connect(pageLayoutModule->paperwidthLE, SIGNAL(textChanged(const QString &)),
this, SLOT(change_adaptor()));
connect(pageLayoutModule->paperwidthUnitCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
connect(pageLayoutModule->paperheightUnitCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
connect(pageLayoutModule->portraitRB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
connect(pageLayoutModule->landscapeRB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
connect(pageLayoutModule->facingPagesCB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
connect(pageLayoutModule->pagestyleCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
pageLayoutModule->pagestyleCO->addItem(qt_("default"));
pageLayoutModule->pagestyleCO->addItem(qt_("empty"));
pageLayoutModule->pagestyleCO->addItem(qt_("plain"));
@ -231,22 +254,38 @@ QDocumentDialog::QDocumentDialog(QDocument * form)
marginsModule = new UiWidget<Ui::MarginsUi>;
// margins
connect(marginsModule->marginCB, SIGNAL(toggled(bool)), this, SLOT(setCustomMargins(bool)));
connect(marginsModule->marginCB, SIGNAL(clicked()), 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(marginsModule->marginCB, SIGNAL(toggled(bool)),
this, SLOT(setCustomMargins(bool)));
connect(marginsModule->marginCB, SIGNAL(clicked()),
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()));
marginsModule->topLE->setValidator(unsignedLengthValidator(
marginsModule->topLE));
marginsModule->bottomLE->setValidator(unsignedLengthValidator(
@ -278,17 +317,20 @@ QDocumentDialog::QDocumentDialog(QDocument * form)
marginsModule->footskipL);
langModule = new UiWidget<Ui::LanguageUi>;
connect(langModule->defaultencodingCB, SIGNAL(toggled(bool)), langModule->encodingL, SLOT(setDisabled(bool)));
connect(langModule->defaultencodingCB, SIGNAL(toggled(bool)), langModule->encodingCO, SLOT(setDisabled(bool)));
connect(langModule->defaultencodingCB, SIGNAL(toggled(bool)),
langModule->encodingL, SLOT(setDisabled(bool)));
connect(langModule->defaultencodingCB, SIGNAL(toggled(bool)),
langModule->encodingCO, SLOT(setDisabled(bool)));
// language & quote
connect(langModule->languageCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
connect(langModule->defaultencodingCB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(langModule->encodingCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
connect(langModule->quoteStyleCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
connect(langModule->languageCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
connect(langModule->defaultencodingCB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
connect(langModule->encodingCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
connect(langModule->quoteStyleCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
// language & quotes
vector<LanguagePair> const langs = getLanguageData(false);
vector<LanguagePair>::const_iterator lit = langs.begin();
@ -317,10 +359,14 @@ QDocumentDialog::QDocumentDialog(QDocument * form)
numberingModule = new UiWidget<Ui::NumberingUi>;
// numbering
connect(numberingModule->depthSL, SIGNAL(valueChanged(int)), this, SLOT(change_adaptor()));
connect(numberingModule->tocSL, SIGNAL(valueChanged(int)), this, SLOT(change_adaptor()));
connect(numberingModule->depthSL, SIGNAL(valueChanged(int)), this, SLOT(updateNumbering()));
connect(numberingModule->tocSL, SIGNAL(valueChanged(int)), this, SLOT(updateNumbering()));
connect(numberingModule->depthSL, SIGNAL(valueChanged(int)),
this, SLOT(change_adaptor()));
connect(numberingModule->tocSL, SIGNAL(valueChanged(int)),
this, SLOT(change_adaptor()));
connect(numberingModule->depthSL, SIGNAL(valueChanged(int)),
this, SLOT(updateNumbering()));
connect(numberingModule->tocSL, SIGNAL(valueChanged(int)),
this, SLOT(updateNumbering()));
numberingModule->tocTW->setColumnCount(3);
numberingModule->tocTW->headerItem()->setText(0, qt_("Example"));
numberingModule->tocTW->headerItem()->setText(1, qt_("Numbered"));
@ -328,14 +374,21 @@ QDocumentDialog::QDocumentDialog(QDocument * form)
biblioModule = new UiWidget<Ui::BiblioUi>;
connect( biblioModule->citeNatbibRB, SIGNAL( toggled(bool) ), biblioModule->citationStyleL, SLOT( setEnabled(bool) ) );
connect( biblioModule->citeNatbibRB, SIGNAL( toggled(bool) ), biblioModule->citeStyleCO, SLOT( setEnabled(bool) ) );
connect(biblioModule->citeNatbibRB, SIGNAL(toggled(bool)),
biblioModule->citationStyleL, SLOT(setEnabled(bool)));
connect(biblioModule->citeNatbibRB, SIGNAL(toggled(bool)),
biblioModule->citeStyleCO, SLOT(setEnabled(bool)));
// biblio
connect(biblioModule->citeDefaultRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(biblioModule->citeNatbibRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(biblioModule->citeStyleCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
connect(biblioModule->citeJurabibRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(biblioModule->bibtopicCB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(biblioModule->citeDefaultRB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
connect(biblioModule->citeNatbibRB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
connect(biblioModule->citeStyleCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
connect(biblioModule->citeJurabibRB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
connect(biblioModule->bibtopicCB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
// biblio
biblioModule->citeStyleCO->addItem(qt_("Author-year"));
biblioModule->citeStyleCO->addItem(qt_("Numerical"));
@ -344,20 +397,30 @@ QDocumentDialog::QDocumentDialog(QDocument * form)
mathsModule = new UiWidget<Ui::MathsUi>;
connect(mathsModule->amsautoCB, SIGNAL(toggled(bool)), mathsModule->amsCB, SLOT(setDisabled(bool)));
connect(mathsModule->esintautoCB, SIGNAL(toggled(bool)), mathsModule->esintCB, SLOT(setDisabled(bool)));
connect(mathsModule->amsautoCB, SIGNAL(toggled(bool)),
mathsModule->amsCB, SLOT(setDisabled(bool)));
connect(mathsModule->esintautoCB, SIGNAL(toggled(bool)),
mathsModule->esintCB, SLOT(setDisabled(bool)));
// maths
connect(mathsModule->amsCB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(mathsModule->amsautoCB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(mathsModule->esintCB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(mathsModule->esintautoCB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(mathsModule->amsCB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
connect(mathsModule->amsautoCB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
connect(mathsModule->esintCB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
connect(mathsModule->esintautoCB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
latexModule = new UiWidget<Ui::LaTeXUi>;
// latex class
connect(latexModule->classCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
connect(latexModule->optionsLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
connect(latexModule->psdriverCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
connect(latexModule->classCO, SIGNAL(activated(int)), this, SLOT(classChanged()));
connect(latexModule->classCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
connect(latexModule->optionsLE, SIGNAL(textChanged(const QString &)),
this, SLOT(change_adaptor()));
connect(latexModule->psdriverCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
connect(latexModule->classCO, SIGNAL(activated(int)),
this, SLOT(classChanged()));
// packages
for (int n = 0; tex_graphics[n][0]; ++n) {
QString enc = tex_graphics[n];
@ -377,7 +440,8 @@ QDocumentDialog::QDocumentDialog(QDocument * form)
// branches
branchesModule = new QBranches;
connect(branchesModule, SIGNAL(changed()), this, SLOT(change_adaptor()));
connect(branchesModule, SIGNAL(changed()),
this, SLOT(change_adaptor()));
// preamble
preambleModule = new UiWidget<Ui::PreambleUi>;
@ -390,12 +454,14 @@ QDocumentDialog::QDocumentDialog(QDocument * form)
// bullets
bulletsModule = new BulletsModule;
connect(bulletsModule, SIGNAL(changed()), this, SLOT(change_adaptor()));
connect(bulletsModule, SIGNAL(changed()),
this, SLOT(change_adaptor()));
// float
floatModule = new FloatPlacement;
connect(floatModule, SIGNAL(changed()), this, SLOT(change_adaptor()));
connect(floatModule, SIGNAL(changed()),
this, SLOT(change_adaptor()));
docPS->addPanel(latexModule, _("Document Class"));
docPS->addPanel(fontModule, _("Fonts"));
@ -419,11 +485,6 @@ QDocumentDialog::QDocumentDialog(QDocument * form)
}
QDocumentDialog::~QDocumentDialog()
{
}
void QDocumentDialog::showPreamble()
{
docPS->setCurrentPanel(_("LaTeX Preamble"));

View File

@ -56,7 +56,6 @@ public:
friend class QDocument;
QDocumentDialog(QDocument *);
~QDocumentDialog();
void updateParams(BufferParams const & params);
void apply(BufferParams & params);

View File

@ -11,7 +11,6 @@
#include <config.h>
#include "QErrorList.h"
#include "QErrorListDialog.h"
#include "Qt2BC.h"
#include "qt_helpers.h"
@ -20,14 +19,63 @@
#include <QListWidget>
#include <QTextBrowser>
#include <QPushButton>
#include <QCloseEvent>
namespace lyx {
namespace frontend {
typedef QController<ControlErrorList, QView<QErrorListDialog> > errorlist_base_class;
/////////////////////////////////////////////////////////////////////
//
// QErrorListDialog
//
/////////////////////////////////////////////////////////////////////
QErrorListDialog::QErrorListDialog(QErrorList * form)
: form_(form)
{
setupUi(this);
connect(closePB, SIGNAL(clicked()),
form, SLOT(slotClose()));
connect(errorsLW, SIGNAL( itemActivated(QListWidgetItem *)),
form, SLOT(slotClose()));
connect( errorsLW, SIGNAL( itemClicked(QListWidgetItem *)),
this, SLOT(select_adaptor(QListWidgetItem *)));
}
void QErrorListDialog::select_adaptor(QListWidgetItem * item)
{
form_->select(item);
}
void QErrorListDialog::closeEvent(QCloseEvent * e)
{
form_->slotWMHide();
e->accept();
}
void QErrorListDialog::showEvent(QShowEvent *e)
{
errorsLW->setCurrentRow(0);
form_->select(errorsLW->item(0));
e->accept();
}
/////////////////////////////////////////////////////////////////////
//
// QErrorList
//
/////////////////////////////////////////////////////////////////////
typedef QController<ControlErrorList, QView<QErrorListDialog> >
ErrorListBase;
QErrorList::QErrorList(Dialog & parent)
: errorlist_base_class(parent, lyx::docstring())
: ErrorListBase(parent, lyx::docstring())
{}
@ -61,3 +109,6 @@ void QErrorList::update_contents()
} // namespace frontend
} // namespace lyx
#include "QErrorList_moc.cpp"

View File

@ -13,13 +13,34 @@
#define QERRORLIST_H
#include "QDialogView.h"
#include "QErrorListDialog.h"
#include "ui/ErrorListUi.h"
#include <QDialog>
class QListWidgetItem;
class QCloseEvent;
class QShowEvent;
namespace lyx {
namespace frontend {
class QErrorList;
class QErrorListDialog : public QDialog, public Ui::QErrorListUi {
Q_OBJECT
public:
QErrorListDialog(QErrorList * form);
public Q_SLOTS:
void select_adaptor(QListWidgetItem *);
protected:
void closeEvent(QCloseEvent *);
void showEvent(QShowEvent *);
private:
QErrorList * form_;
};
class ControlErrorList;
class QErrorList :