undo last acedential checkin

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16436 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Peter Kümmel 2006-12-30 10:30:02 +00:00
parent af2ce964ae
commit 74b8008837
18 changed files with 214 additions and 819 deletions

View File

@ -47,8 +47,7 @@ Action::Action(LyXView & lyxView, docstring const & text,
setText(toqstr(text));
setToolTip(toqstr(tooltip));
setStatusTip(toqstr(tooltip));
Q_CONNECT_1(QAction, this, triggered, bool,
Action, this, action, void);
connect(this, SIGNAL(triggered()), this, SLOT(action()));
update();
}
@ -60,8 +59,7 @@ Action::Action(LyXView & lyxView, string const & icon, docstring const & text,
setText(toqstr(text));
setToolTip(toqstr(tooltip));
setStatusTip(toqstr(tooltip));
Q_CONNECT_1(QAction, this, triggered, bool,
Action, this, action, void);
connect(this, SIGNAL(triggered()), this, SLOT(action()));
update();
}

View File

@ -50,11 +50,8 @@ BulletsModule::BulletsModule(QWidget * , char const * , Qt::WFlags)
setupPanel(new QListWidget(bulletpaneSW), qt_("Dings 3"), "psnfss3");
setupPanel(new QListWidget(bulletpaneSW), qt_("Dings 4"), "psnfss4");
Q_CONNECT_1(QListWidget, levelLW, currentRowChanged, int,
BulletsModule, this, showLevel,int);
Q_CONNECT_1(QComboBox, bulletpaneCO, activated, int,
QStackedWidget, bulletpaneSW, setCurrentIndex, int);
connect(levelLW, SIGNAL(currentRowChanged(int)), this, SLOT(showLevel(int)));
connect(bulletpaneCO, SIGNAL(activated(int)), bulletpaneSW, SLOT(setCurrentIndex(int)));
}
@ -65,8 +62,8 @@ BulletsModule::~BulletsModule()
void BulletsModule::setupPanel(QListWidget * lw, QString panelname, std::string fname)
{
Q_CONNECT_2(QListWidget, lw, currentItemChanged, QListWidgetItem*, QListWidgetItem*,
BulletsModule, this, bulletSelected, QListWidgetItem*, QListWidgetItem*);
connect(lw, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)),
this, SLOT(bulletSelected(QListWidgetItem *, QListWidgetItem*)));
// add panelname to combox
bulletpaneCO->addItem(panelname);

View File

@ -31,7 +31,7 @@
*
* Therefore there is a tradeoff in enabling or disabling this (JMarc)
*/
#if defined(Q_WS_MACX) //|| defined(Q_WS_WIN)
#ifdef Q_WS_MACX
#define USE_NATIVE_FILEDIALOG 1
#endif

View File

@ -66,8 +66,7 @@ LyXFileDialog::LyXFileDialog(docstring const & t,
if (!b1.first.empty()) {
b1_dir_ = b1.second;
b1_ = new QToolButton(this);
Q_CONNECT_1(QToolButton, b1_, clicked, bool,
LyXFileDialog, this, buttonClicked, void);
connect(b1_, SIGNAL(clicked()), this, SLOT(buttonClicked()));
b1_->setText(toqstr(getLabel(b1.first)));
layout.at(0)->addWidget(b1_);
}
@ -75,8 +74,7 @@ LyXFileDialog::LyXFileDialog(docstring const & t,
if (!b2.first.empty()) {
b2_dir_ = b2.second;
b2_ = new QToolButton(this);
Q_CONNECT_1(QToolButton, b2_, clicked, bool,
LyXFileDialog, this, buttonClicked, void);
connect(b2_, SIGNAL(clicked()), this, SLOT(buttonClicked()));
b2_->setText(toqstr(getLabel(b2.first)));
layout.at(0)->addWidget(b2_);
}

View File

@ -125,23 +125,20 @@ struct GuiView::GuiViewPrivate
QAction *smallIcons = new QAction(iconSizeGroup);
smallIcons->setText("Small sized icons");
smallIcons->setCheckable(true);
Q_CONNECT_1(QAction, smallIcons, triggered, bool,
GuiView, parent, smallSizedIcons, void);
QObject::connect(smallIcons, SIGNAL(triggered()), parent, SLOT(smallSizedIcons()));
menu->addAction(smallIcons);
QAction *normalIcons = new QAction(iconSizeGroup);
normalIcons->setText("Normal sized icons");
normalIcons->setCheckable(true);
Q_CONNECT_1(QAction, normalIcons, triggered, bool,
GuiView, parent, normalSizedIcons, void);
QObject::connect(normalIcons, SIGNAL(triggered()), parent, SLOT(normalSizedIcons()));
menu->addAction(normalIcons);
QAction *bigIcons = new QAction(iconSizeGroup);
bigIcons->setText("Big sized icons");
bigIcons->setCheckable(true);
Q_CONNECT_1(QAction, bigIcons, triggered, bool,
GuiView, parent, bigSizedIcons, void);
QObject::connect(bigIcons, SIGNAL(triggered()), parent, SLOT(bigSizedIcons()));
menu->addAction(bigIcons);
unsigned int cur = parent->iconSize().width();
@ -213,15 +210,15 @@ QMenu* GuiView::createPopupMenu()
void GuiView::init()
{
menubar_.reset(new QLMenubar(this, menubackend));
Q_CONNECT_1(QMenuBar, menuBar(), triggered, QAction*,
GuiView, this, updateMenu, QAction*);
QObject::connect(menuBar(), SIGNAL(triggered(QAction *)),
this, SLOT(updateMenu(QAction *)));
getToolbars().init();
statusBar()->setSizeGripEnabled(false);
Q_CONNECT_1(QTimer, &statusbar_timer_, timeout, void,
GuiView, this, update_view_state_qt, void);
QObject::connect(&statusbar_timer_, SIGNAL(timeout()),
this, SLOT(update_view_state_qt()));
if (!work_area_->bufferView().buffer() && !theBufferList().empty())
setBuffer(theBufferList().first());
@ -462,8 +459,8 @@ void GuiView::initTab(QWidget* workarea)
{
d.wt = new WidgetWithTabBar(workarea);
setCentralWidget(d.wt);
Q_CONNECT_1(QTabBar, d.wt->tabbar, currentChanged, int,
GuiView, this, currentTabChanged, int);
QObject::connect(d.wt->tabbar, SIGNAL(currentChanged(int)),
this, SLOT(currentTabChanged(int)));
}

View File

@ -186,8 +186,8 @@ GuiWorkArea::GuiWorkArea(int w, int h, int id, LyXView & lyx_view)
this));
// Initialize the vertical Scroll Bar
Q_CONNECT_1(QScrollBar, verticalScrollBar(), actionTriggered, int,
GuiWorkArea, this, adjustViewWithScrollBar, int);
QObject::connect(verticalScrollBar(), SIGNAL(actionTriggered(int)),
this, SLOT(adjustViewWithScrollBar(int)));
// PageStep only depends on the viewport height.
verticalScrollBar()->setPageStep(viewport()->height());

View File

@ -58,7 +58,7 @@ protected:
hide();
} else {
// emit signal
//itemPressed(currentItem());
itemPressed(currentItem());
}
}

View File

@ -63,20 +63,20 @@ QDocumentDialog::QDocumentDialog(QDocument * form)
{
setupUi(this);
Q_CONNECT_1(QPushButton, okPB, clicked, bool,
QDocument, form, slotOK, void);
Q_CONNECT_1(QPushButton, applyPB, clicked, bool,
QDocument, form, slotApply, void);
Q_CONNECT_1(QPushButton, closePB, clicked, bool,
QDocument, form, slotClose, void);
Q_CONNECT_1(QPushButton, restorePB, clicked, bool,
QDocument, form, slotRestore, void);
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()));
Q_CONNECT_1(QPushButton, savePB, clicked, bool,
QDocumentDialog, this, saveDefaultClicked, void);
Q_CONNECT_1(QPushButton, defaultPB, clicked, bool,
QDocumentDialog, this, useDefaultsClicked, void);
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);
@ -87,29 +87,17 @@ QDocumentDialog::QDocumentDialog(QDocument * form)
textLayoutModule = new UiWidget<Ui::TextLayoutUi>;
// text layout
Q_CONNECT_1(QComboBox, textLayoutModule->lspacingCO, activated, int,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QComboBox, textLayoutModule->lspacingCO, activated, int,
QDocumentDialog, this, setLSpacing, int);
Q_CONNECT_1(QLineEdit, textLayoutModule->lspacingLE, textChanged, const QString&,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QRadioButton, textLayoutModule->skipRB, toggled, bool,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QRadioButton, textLayoutModule->indentRB, toggled, bool,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QComboBox, textLayoutModule->skipCO, activated, int,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QLineEdit, textLayoutModule->skipLE, textChanged, const QString&,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QComboBox, textLayoutModule->skipLengthCO, activated, int,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QComboBox, textLayoutModule->skipCO, activated, int,
QDocumentDialog, this, setSkip, int);
Q_CONNECT_1(QRadioButton, textLayoutModule->skipRB, toggled, bool,
QDocumentDialog, this, enableSkip, bool);
Q_CONNECT_1(QCheckBox, textLayoutModule->twoColumnCB, toggled, bool,
QDocumentDialog, this, change_adaptor, void);
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(toggled(bool)), this, SLOT(change_adaptor()));
connect(textLayoutModule->indentRB, SIGNAL(toggled(bool)), 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(toggled(bool)), this, SLOT(change_adaptor()));
textLayoutModule->lspacingLE->setValidator(new QDoubleValidator(
textLayoutModule->lspacingLE));
textLayoutModule->skipLE->setValidator(unsignedLengthValidator(
@ -138,42 +126,18 @@ QDocumentDialog::QDocumentDialog(QDocument * form)
fontModule = new UiWidget<Ui::FontUi>;
// fonts
Q_CONNECT_1(QComboBox, fontModule->fontsRomanCO, activated, int,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QComboBox, fontModule->fontsRomanCO, activated, int,
QDocumentDialog, this, romanChanged, int);
Q_CONNECT_1(QComboBox, fontModule->fontsSansCO, activated, int,
QDocumentDialog, this, change_adaptor, void)
Q_CONNECT_1(QComboBox, fontModule->fontsSansCO, activated, int,
QDocumentDialog, this, sansChanged, int);
Q_CONNECT_1(QComboBox, fontModule->fontsTypewriterCO, activated,int,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QComboBox, fontModule->fontsTypewriterCO, activated, int,
QDocumentDialog, this, ttChanged, int);
Q_CONNECT_1(QComboBox, fontModule->fontsDefaultCO, activated, int,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QComboBox, fontModule->fontsizeCO, activated, int,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QSpinBox, fontModule->scaleSansSB, valueChanged, int,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QSpinBox, fontModule->scaleTypewriterSB, valueChanged, int,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QCheckBox, fontModule->fontScCB, toggled, bool,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QCheckBox, fontModule->fontOsfCB, toggled, bool,
QDocumentDialog, this, change_adaptor, void);
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(toggled(bool)), this, SLOT(change_adaptor()));
connect(fontModule->fontOsfCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
for (int n = 0; tex_fonts_roman[n][0]; ++n) {
QString font = toqstr(tex_fonts_roman_gui[n]);
@ -208,42 +172,18 @@ QDocumentDialog::QDocumentDialog(QDocument * form)
pageLayoutModule = new UiWidget<Ui::PageLayoutUi>;
// page layout
Q_CONNECT_1(QComboBox, pageLayoutModule->papersizeCO, activated, int,
QDocumentDialog, this, setCustomPapersize, int);
Q_CONNECT_1(QComboBox, pageLayoutModule->papersizeCO, activated, int,
QDocumentDialog, this, setCustomPapersize, int);
Q_CONNECT_1(QRadioButton, pageLayoutModule->portraitRB, toggled, bool,
QDocumentDialog, this, portraitChanged, void);
Q_CONNECT_1(QComboBox, pageLayoutModule->papersizeCO, activated, int,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QLineEdit, pageLayoutModule->paperheightLE, textChanged, const QString&,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QLineEdit, pageLayoutModule->paperwidthLE, textChanged, const QString&,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QComboBox, pageLayoutModule->paperwidthUnitCO, activated, int,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(LengthCombo, pageLayoutModule->paperheightUnitCO, activated, int,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QRadioButton, pageLayoutModule->portraitRB, toggled, bool,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QRadioButton, pageLayoutModule->landscapeRB, toggled, bool,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QCheckBox, pageLayoutModule->facingPagesCB, toggled, bool,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QComboBox, pageLayoutModule->pagestyleCO, activated, int,
QDocumentDialog, this, change_adaptor, void);
connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)), this, SLOT(setCustomPapersize(int)));
connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)), this, SLOT(setCustomPapersize(int)));
connect(pageLayoutModule->portraitRB, SIGNAL(toggled(bool)), 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(toggled(bool)), this, SLOT(change_adaptor()));
connect(pageLayoutModule->landscapeRB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
connect(pageLayoutModule->facingPagesCB, SIGNAL(toggled(bool)), 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"));
@ -280,55 +220,22 @@ QDocumentDialog::QDocumentDialog(QDocument * form)
marginsModule = new UiWidget<Ui::MarginsUi>;
// margins
Q_CONNECT_1(QCheckBox, marginsModule->marginCB, toggled, bool,
QDocumentDialog, this, setCustomMargins, bool);
Q_CONNECT_1(QCheckBox, marginsModule->marginCB, toggled, bool,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QLineEdit, marginsModule->topLE, textChanged, const QString&,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(LengthCombo, marginsModule->topUnit, activated, int,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QLineEdit, marginsModule->bottomLE, textChanged, const QString&,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(LengthCombo, marginsModule->bottomUnit, activated, int,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QLineEdit, marginsModule->innerLE, textChanged, const QString&,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(LengthCombo, marginsModule->innerUnit, activated, int,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QLineEdit, marginsModule->outerLE, textChanged, const QString&,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(LengthCombo, marginsModule->outerUnit, activated, int,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QLineEdit, marginsModule->headheightLE, textChanged, const QString&,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(LengthCombo, marginsModule->headheightUnit, activated, int,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QLineEdit, marginsModule->headsepLE, textChanged, const QString&,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(LengthCombo, marginsModule->headsepUnit, activated, int,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QLineEdit, marginsModule->footskipLE, textChanged, const QString&,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(LengthCombo, marginsModule->footskipUnit, activated, int,
QDocumentDialog, this, change_adaptor, void);
connect(marginsModule->marginCB, SIGNAL(toggled(bool)), this, SLOT(setCustomMargins(bool)));
connect(marginsModule->marginCB, SIGNAL(toggled(bool)), 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(
@ -364,24 +271,13 @@ QDocumentDialog::QDocumentDialog(QDocument * form)
langModule = new UiWidget<Ui::LanguageUi>;
Q_CONNECT_1(QCheckBox, langModule->defaultencodingCB, toggled, bool,
QLabel, langModule->encodingL, setDisabled, bool);
Q_CONNECT_1(QCheckBox, langModule->defaultencodingCB, toggled, bool,
QComboBox, langModule->encodingCO, 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
Q_CONNECT_1(QComboBox, langModule->languageCO, activated, int,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QCheckBox, langModule->defaultencodingCB, toggled, bool,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QComboBox, langModule->encodingCO, activated, int,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QComboBox, langModule->quoteStyleCO, activated, int,
QDocumentDialog, this, change_adaptor, void);
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()));
// language & quotes
vector<LanguagePair> const langs = getLanguageData(false);
vector<LanguagePair>::const_iterator lit = langs.begin();
@ -410,18 +306,10 @@ QDocumentDialog::QDocumentDialog(QDocument * form)
numberingModule = new UiWidget<Ui::NumberingUi>;
// numbering
Q_CONNECT_1(QSlider, numberingModule->depthSL, valueChanged, int,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QSlider, numberingModule->tocSL, valueChanged, int,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QSlider, numberingModule->depthSL, valueChanged, int,
QDocumentDialog, this, updateNumbering, void);
Q_CONNECT_1(QSlider, numberingModule->tocSL, valueChanged, int,
QDocumentDialog, this, updateNumbering, void);
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"));
@ -429,26 +317,14 @@ QDocumentDialog::QDocumentDialog(QDocument * form)
biblioModule = new UiWidget<Ui::BiblioUi>;
Q_CONNECT_1(QRadioButton, biblioModule->citeNatbibRB, toggled, bool,
QLabel, biblioModule->citationStyleL, setEnabled, bool);
Q_CONNECT_1(QRadioButton, biblioModule->citeNatbibRB, toggled, bool,
QComboBox, biblioModule->citeStyleCO, 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
Q_CONNECT_1(QRadioButton, biblioModule->citeDefaultRB, toggled, bool,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QRadioButton, biblioModule->citeNatbibRB, toggled, bool,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QComboBox, biblioModule->citeStyleCO, activated, int,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QRadioButton, biblioModule->citeJurabibRB, toggled, bool,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QCheckBox, biblioModule->bibtopicCB, toggled, bool,
QDocumentDialog, this, change_adaptor, void);
connect(biblioModule->citeDefaultRB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
connect(biblioModule->citeNatbibRB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
connect(biblioModule->citeStyleCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
connect(biblioModule->citeJurabibRB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
connect(biblioModule->bibtopicCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
// biblio
biblioModule->citeStyleCO->addItem(qt_("Author-year"));
biblioModule->citeStyleCO->addItem(qt_("Numerical"));
@ -457,37 +333,20 @@ QDocumentDialog::QDocumentDialog(QDocument * form)
mathsModule = new UiWidget<Ui::MathsUi>;
Q_CONNECT_1(QCheckBox, mathsModule->amsautoCB, toggled, bool,
QCheckBox, mathsModule->amsCB, setDisabled, bool);
Q_CONNECT_1(QCheckBox, mathsModule->esintautoCB, toggled, bool,
QCheckBox, mathsModule->esintCB, 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
Q_CONNECT_1(QCheckBox, mathsModule->amsCB, toggled, bool,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QCheckBox, mathsModule->amsautoCB, toggled, bool,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QCheckBox, mathsModule->esintCB, toggled, bool,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QCheckBox, mathsModule->esintautoCB, toggled, bool,
QDocumentDialog, this, change_adaptor, void);
connect(mathsModule->amsCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
connect(mathsModule->amsautoCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
connect(mathsModule->esintCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
connect(mathsModule->esintautoCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
latexModule = new UiWidget<Ui::LaTeXUi>;
// latex class
Q_CONNECT_1(QComboBox, latexModule->classCO, activated, int,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QLineEdit, latexModule->optionsLE, textChanged, const QString&,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QComboBox, latexModule->psdriverCO, activated, int,
QDocumentDialog, this, change_adaptor, void);
Q_CONNECT_1(QComboBox, latexModule->classCO, activated, int,
QDocumentDialog, this, classChanged, void);
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];
@ -507,25 +366,21 @@ QDocumentDialog::QDocumentDialog(QDocument * form)
// branches
branchesModule = new QBranches;
Q_CONNECT_0(QBranches, branchesModule, changed,
QDocumentDialog, this, change_adaptor);
connect(branchesModule, SIGNAL(changed()), this, SLOT(change_adaptor()));
// preamble
preambleModule = new UiWidget<Ui::PreambleUi>;
Q_CONNECT_0(QTextEdit, preambleModule->preambleTE, textChanged,
QDocumentDialog, this, change_adaptor);
connect(preambleModule->preambleTE, SIGNAL(textChanged()), this, SLOT(change_adaptor()));
// bullets
bulletsModule = new BulletsModule;
Q_CONNECT_0(BulletsModule, bulletsModule, changed,
QDocumentDialog, this, change_adaptor);
connect(bulletsModule, SIGNAL(changed()), this, SLOT(change_adaptor()));
// float
floatModule = new FloatPlacement;
Q_CONNECT_0(FloatPlacement, floatModule, changed,
QDocumentDialog, this, change_adaptor);
connect(floatModule, SIGNAL(changed()), this, SLOT(change_adaptor()));
docPS->addPanel(latexModule, _("Document Class"));
docPS->addPanel(fontModule, _("Fonts"));

View File

@ -15,7 +15,6 @@
#include "qt_helpers.h"
//Added by qt3to4:
#include <QCloseEvent>
#include <QComboBox>
#include "controllers/ControlSearch.h"
@ -41,32 +40,19 @@ void uniqueInsert(QComboBox * box, QString const & text)
};
QSearchDialog::QSearchDialog(QSearch * form)
: form_(form)
{
setupUi(this);
Q_CONNECT_1(QPushButton, closePB, clicked, bool,
QSearch, form_, slotClose, void);
connect(closePB, SIGNAL(clicked()),
form_, SLOT(slotClose()));
Q_CONNECT_1(QPushButton, findPB, clicked, bool,
QSearchDialog, this, findClicked, void) ;
Q_CONNECT_1(QPushButton, replacePB, clicked, bool,
QSearchDialog, this, replaceClicked, void);
Q_CONNECT_1(QPushButton, replaceallPB, clicked, bool,
QSearchDialog, this, replaceallClicked, void);
Q_CONNECT_1(QComboBox, findCO, editTextChanged, const QString&,
QSearchDialog, this, findChanged, void);
//check<const QString&>(findCO);
// check(findCO, &QComboBox::editTextChanged);
//check<void>(this);
connect( findPB, SIGNAL( clicked() ), this, SLOT( findClicked() ) );
connect( replacePB, SIGNAL( clicked() ), this, SLOT( replaceClicked() ) );
connect( replaceallPB, SIGNAL( clicked() ), this, SLOT( replaceallClicked() ) );
connect( findCO, SIGNAL( editTextChanged(const QString&) ), this, SLOT( findChanged() ) );
}

View File

@ -42,92 +42,55 @@ QTabularDialog::QTabularDialog(QTabular * form)
bottomspaceED->setValidator(new LengthValidator(bottomspaceED));
interlinespaceED->setValidator(new LengthValidator(interlinespaceED));
Q_CONNECT_0(QLineEdit, topspaceED, returnPressed,
QTabularDialog, this, topspace_changed);
Q_CONNECT_1(LengthCombo, topspaceUnit, selectionChanged, lyx::LyXLength::UNIT,
QTabularDialog, this, topspace_changed, void);
Q_CONNECT_1(QComboBox, topspaceCO, activated, int,
QTabularDialog, this, topspace_changed, void);
Q_CONNECT_0(QLineEdit, bottomspaceED, returnPressed,
QTabularDialog, this, bottomspace_changed);
Q_CONNECT_1(LengthCombo, bottomspaceUnit, selectionChanged, lyx::LyXLength::UNIT,
QTabularDialog, this, bottomspace_changed, void);
Q_CONNECT_1(QComboBox, bottomspaceCO, activated, int,
QTabularDialog, this, bottomspace_changed, void);
Q_CONNECT_0(QLineEdit, interlinespaceED, returnPressed,
QTabularDialog, this, interlinespace_changed);
Q_CONNECT_1(LengthCombo, interlinespaceUnit, selectionChanged, lyx::LyXLength::UNIT,
QTabularDialog, this, interlinespace_changed, void);
Q_CONNECT_1(QComboBox, interlinespaceCO, activated, int,
QTabularDialog, this, interlinespace_changed, void);
Q_CONNECT_1(QRadioButton, booktabsRB, clicked, bool,
QTabularDialog, this, on_booktabsRB_toggled, void);
Q_CONNECT_1(QPushButton, borderSetPB, clicked, bool,
QTabularDialog, this, borderSet_clicked, void);
Q_CONNECT_1(QPushButton, borderUnsetPB, clicked, bool,
QTabularDialog, this, borderUnset_clicked, void);
Q_CONNECT_1(QCheckBox, longTabularCB, toggled, bool,
QGroupBox, longtableGB, setEnabled, bool);
Q_CONNECT_1(QCheckBox, longTabularCB, toggled, bool,
QCheckBox, newpageCB, setEnabled, bool);
Q_CONNECT_1(QComboBox, hAlignCB, activated, int,
QTabularDialog, this, hAlign_changed, int);
Q_CONNECT_1(QComboBox, vAlignCB, activated, int,
QTabularDialog, this, vAlign_changed, int);
Q_CONNECT_1(QCheckBox, multicolumnCB, clicked, bool,
QTabularDialog, this, multicolumn_clicked, void);
Q_CONNECT_1(QCheckBox, newpageCB, clicked, bool,
QTabularDialog, this, ltNewpage_clicked, void);
Q_CONNECT_1(QCheckBox, headerStatusCB, clicked, bool,
QTabularDialog, this, ltHeaderStatus_clicked, void);
Q_CONNECT_1(QCheckBox, headerBorderAboveCB, clicked, bool,
QTabularDialog, this, ltHeaderBorderAbove_clicked, void);
Q_CONNECT_1(QCheckBox, headerBorderBelowCB, clicked, bool,
QTabularDialog, this, ltHeaderBorderBelow_clicked, void);
Q_CONNECT_1(QCheckBox, firstheaderStatusCB, clicked, bool,
QTabularDialog, this, ltFirstHeaderStatus_clicked, void);
Q_CONNECT_1(QCheckBox, firstheaderBorderAboveCB, clicked, bool,
QTabularDialog, this, ltFirstHeaderBorderAbove_clicked, void);
Q_CONNECT_1(QCheckBox, firstheaderBorderBelowCB, clicked, bool,
QTabularDialog, this, ltFirstHeaderBorderBelow_clicked, void);
Q_CONNECT_1(QCheckBox, firstheaderNoContentsCB, clicked, bool,
QTabularDialog, this, ltFirstHeaderEmpty_clicked, void);
Q_CONNECT_1(QCheckBox, footerStatusCB, clicked, bool,
QTabularDialog, this, ltFooterStatus_clicked, void);
Q_CONNECT_1(QCheckBox, footerBorderAboveCB, clicked, bool,
QTabularDialog, this, ltFooterBorderAbove_clicked, void);
Q_CONNECT_1(QCheckBox, footerBorderBelowCB, clicked, bool,
QTabularDialog, this, ltFooterBorderBelow_clicked, void);
Q_CONNECT_1(QCheckBox, lastfooterStatusCB, clicked, bool,
QTabularDialog, this, ltLastFooterStatus_clicked, void);
Q_CONNECT_1(QCheckBox, lastfooterBorderAboveCB, clicked, bool,
QTabularDialog, this, ltLastFooterBorderAbove_clicked, void);
Q_CONNECT_1(QCheckBox, lastfooterBorderBelowCB, clicked, bool,
QTabularDialog, this, ltLastFooterBorderBelow_clicked, void);
Q_CONNECT_1(QCheckBox, lastfooterNoContentsCB, clicked, bool,
QTabularDialog, this, ltLastFooterEmpty_clicked, void);
Q_CONNECT_0(QLineEdit, specialAlignmentED, returnPressed,
QTabularDialog, this, specialAlignment_changed);
Q_CONNECT_0(QLineEdit, widthED, returnPressed,
QTabularDialog, this, width_changed);
Q_CONNECT_1(LengthCombo, widthUnit, selectionChanged, lyx::LyXLength::UNIT,
QTabularDialog, this, width_changed, void);
Q_CONNECT_1(QPushButton, closePB, clicked, bool,
QTabularDialog, this, close_clicked, void);
Q_CONNECT_1(QSetBorder, borders, topSet, bool,
QTabularDialog, this, topBorder_changed, void);
Q_CONNECT_1(QSetBorder, borders, bottomSet, bool,
QTabularDialog, this, bottomBorder_changed, void);
Q_CONNECT_1(QSetBorder, borders, rightSet, bool,
QTabularDialog, this, rightBorder_changed, void);
Q_CONNECT_1(QSetBorder, borders, leftSet, bool,
QTabularDialog, this, leftBorder_changed, void);
Q_CONNECT_1(QCheckBox, rotateTabularCB, clicked, bool,
QTabularDialog, this, rotateTabular, void);
Q_CONNECT_1(QCheckBox, rotateCellCB, clicked, bool,
QTabularDialog, this, rotateCell, void);
Q_CONNECT_1(QCheckBox, longTabularCB, clicked, bool,
QTabularDialog, this, longTabular, void);
connect(topspaceED, SIGNAL(returnPressed()),
this, SLOT(topspace_changed()));
connect(topspaceUnit, SIGNAL(selectionChanged(lyx::LyXLength::UNIT)),
this, SLOT(topspace_changed()));
connect(topspaceCO, SIGNAL(activated(int)), this, SLOT(topspace_changed()));
connect(bottomspaceED, SIGNAL(returnPressed()),
this, SLOT(bottomspace_changed()));
connect(bottomspaceUnit, SIGNAL(selectionChanged(lyx::LyXLength::UNIT)),
this, SLOT(bottomspace_changed()));
connect(bottomspaceCO, SIGNAL(activated(int)), this, SLOT(bottomspace_changed()));
connect(interlinespaceED, SIGNAL(returnPressed()),
this, SLOT(interlinespace_changed()));
connect(interlinespaceUnit, SIGNAL(selectionChanged(lyx::LyXLength::UNIT)),
this, SLOT(interlinespace_changed()));
connect(interlinespaceCO, SIGNAL(activated(int)), this, SLOT(interlinespace_changed()));
connect(booktabsRB, SIGNAL(clicked()), this, SLOT(on_booktabsRB_toggled()));
connect(borderSetPB, SIGNAL(clicked()), this, SLOT(borderSet_clicked()));
connect(borderUnsetPB, SIGNAL(clicked()), this, SLOT(borderUnset_clicked()));
connect(longTabularCB, SIGNAL(toggled(bool)), longtableGB, SLOT(setEnabled(bool)));
connect(longTabularCB, SIGNAL(toggled(bool)), newpageCB, SLOT(setEnabled(bool)));
connect(hAlignCB, SIGNAL(activated(int)), this, SLOT(hAlign_changed(int)));
connect(vAlignCB, SIGNAL(activated(int)), this, SLOT(vAlign_changed(int)));
connect(multicolumnCB, SIGNAL(clicked()), this, SLOT(multicolumn_clicked()));
connect(newpageCB, SIGNAL(clicked()), this, SLOT(ltNewpage_clicked()));
connect(headerStatusCB, SIGNAL(clicked()), this, SLOT(ltHeaderStatus_clicked()));
connect(headerBorderAboveCB, SIGNAL(clicked()), this, SLOT(ltHeaderBorderAbove_clicked()));
connect(headerBorderBelowCB, SIGNAL(clicked()), this, SLOT(ltHeaderBorderBelow_clicked()));
connect(firstheaderStatusCB, SIGNAL(clicked()), this, SLOT(ltFirstHeaderStatus_clicked()));
connect(firstheaderBorderAboveCB, SIGNAL(clicked()), this, SLOT(ltFirstHeaderBorderAbove_clicked()));
connect(firstheaderBorderBelowCB, SIGNAL(clicked()), this, SLOT(ltFirstHeaderBorderBelow_clicked()));
connect(firstheaderNoContentsCB, SIGNAL(clicked()), this, SLOT(ltFirstHeaderEmpty_clicked()));
connect(footerStatusCB, SIGNAL(clicked()), this, SLOT(ltFooterStatus_clicked()));
connect(footerBorderAboveCB, SIGNAL(clicked()), this, SLOT(ltFooterBorderAbove_clicked()));
connect(footerBorderBelowCB, SIGNAL(clicked()), this, SLOT(ltFooterBorderBelow_clicked()));
connect(lastfooterStatusCB, SIGNAL(clicked()), this, SLOT(ltLastFooterStatus_clicked()));
connect(lastfooterBorderAboveCB, SIGNAL(clicked()), this, SLOT(ltLastFooterBorderAbove_clicked()));
connect(lastfooterBorderBelowCB, SIGNAL(clicked()), this, SLOT(ltLastFooterBorderBelow_clicked()));
connect(lastfooterNoContentsCB, SIGNAL(clicked()), this, SLOT(ltLastFooterEmpty_clicked()));
connect(specialAlignmentED, SIGNAL(returnPressed()), this, SLOT(specialAlignment_changed()));
connect(widthED, SIGNAL(returnPressed()), this, SLOT(width_changed()));
connect(widthUnit, SIGNAL(selectionChanged(lyx::LyXLength::UNIT)), this, SLOT(width_changed()));
connect(closePB, SIGNAL(clicked()), this, SLOT(close_clicked()));
connect(borders, SIGNAL(topSet(bool)), this, SLOT(topBorder_changed()));
connect(borders, SIGNAL(bottomSet(bool)), this, SLOT(bottomBorder_changed()));
connect(borders, SIGNAL(rightSet(bool)), this, SLOT(rightBorder_changed()));
connect(borders, SIGNAL(leftSet(bool)), this, SLOT(leftBorder_changed()));
connect(rotateTabularCB, SIGNAL(clicked()), this, SLOT(rotateTabular()));
connect(rotateCellCB, SIGNAL(clicked()), this, SLOT(rotateCell()));
connect(longTabularCB, SIGNAL(clicked()), this, SLOT(longTabular()));
}

View File

@ -106,22 +106,16 @@ void QTocDialog::setTreeDepth(int depth)
{
if(depth!=-1)
depth_ = depth;
// expanding and then collapsing is probably better,
// but my qt 4.1.2 doesn't have expandAll()..
//tocTV->expandAll();
// tocTV->expandAll(); //expanding and then collapsing is probably better, but my qt 4.1.2 doesn't have expandAll()..
QModelIndexList indices =
form_->tocModel()->match(form_->tocModel()->index(0,0),
Qt::DisplayRole, "*", -1,
Qt::MatchWildcard|Qt::MatchRecursive);
int size = indices.size();
for (int i = 0; i < size; i++) {
QModelIndex index = indices[i];
if (getIndexDepth(index) < depth_)
tocTV->expand(index);
Q_FOREACH (QModelIndex index, indices) { // I had to use Q_FOREACH instead of foreach
if(getIndexDepth(index) < depth_) // because compile flag -DQT_NO_KEYWORDS doesn't allow me..
tocTV->expand(index);
else
tocTV->collapse(index);
tocTV->collapse(index);
}
}

View File

@ -25,17 +25,14 @@ QURLDialog::QURLDialog(UrlView * form)
{
setupUi(this);
Q_CONNECT_1(QPushButton, okPB, clicked, bool,
UrlView, form_, slotOK, void);
Q_CONNECT_1(QPushButton, closePB, clicked, bool,
UrlView, form_, slotClose, void);
connect(okPB, SIGNAL(clicked()),
form_, SLOT(slotOK()));
connect(closePB, SIGNAL(clicked()),
form_, SLOT(slotClose()));
Q_CONNECT_1(QLineEdit, urlED, textChanged, const QString&,
QURLDialog, this, changed_adaptor, void);
Q_CONNECT_1(QCheckBox, hyperlinkCB, clicked, bool,
QURLDialog, this, changed_adaptor, void);
Q_CONNECT_1(QLineEdit, nameED, textChanged, const QString&,
QURLDialog, this, changed_adaptor, void);
connect( urlED, SIGNAL( textChanged(const QString&) ), this, SLOT( changed_adaptor() ) );
connect( hyperlinkCB, SIGNAL( clicked() ), this, SLOT( changed_adaptor() ) );
connect( nameED, SIGNAL( textChanged(const QString&) ), this, SLOT( changed_adaptor() ) );
}

View File

@ -35,23 +35,18 @@ QVSpaceDialog::QVSpaceDialog(QVSpace * form)
{
setupUi(this);
Q_CONNECT_1(QPushButton, okPB, clicked, bool,
QVSpace, form_, slotOK, void);
Q_CONNECT_1(QPushButton, applyPB, clicked, bool,
QVSpace, form_, slotApply, void);
Q_CONNECT_1(QPushButton, closePB, clicked, bool,
QVSpace, form_, slotClose, void);
connect(okPB, SIGNAL(clicked()),
form_, SLOT(slotOK()));
connect(applyPB, SIGNAL(clicked()),
form_, SLOT(slotApply()));
connect(closePB, SIGNAL(clicked()),
form_, SLOT(slotClose()));
Q_CONNECT_1(QComboBox, spacingCO, highlighted, const QString&,
QVSpaceDialog, this, change_adaptor, void);
Q_CONNECT_1(QLineEdit, valueLE, textChanged, const QString&,
QVSpaceDialog, this, change_adaptor, void);
Q_CONNECT_1(QComboBox, spacingCO, activated, int,
QVSpaceDialog, this, enableCustom, int);
Q_CONNECT_1(QCheckBox, keepCB, clicked, bool,
QVSpaceDialog, this, change_adaptor, void);
Q_CONNECT_1(LengthCombo, unitCO, selectionChanged, lyx::LyXLength::UNIT,
QVSpaceDialog, this, change_adaptor, void);
connect( spacingCO, SIGNAL( highlighted(const QString&) ), this, SLOT( change_adaptor() ) );
connect( valueLE, SIGNAL( textChanged(const QString&) ), this, SLOT( change_adaptor() ) );
connect( spacingCO, SIGNAL( activated(int) ), this, SLOT( enableCustom(int) ) );
connect( keepCB, SIGNAL( clicked() ), this, SLOT( change_adaptor() ) );
connect( unitCO, SIGNAL( selectionChanged(lyx::LyXLength::UNIT) ), this, SLOT( change_adaptor() ) );
valueLE->setValidator(unsignedLengthValidator(valueLE));
}

View File

@ -26,14 +26,13 @@ QViewSourceDialog::QViewSourceDialog(QViewSource * form)
{
setupUi(this);
Q_CONNECT_1(QPushButton, closePB, clicked, bool,
QViewSource, form, slotClose, void);
Q_CONNECT_1(QCheckBox, viewFullSourceCB, toggled, bool,
QViewSourceDialog, this, slotUpdate, void);
Q_CONNECT_1(QCheckBox, autoUpdateCB, toggled, bool,
QPushButton, updatePB, setDisabled, bool);
Q_CONNECT_1(QPushButton, updatePB, clicked, bool,
QViewSourceDialog, this, slotUpdate, void);
connect(closePB, SIGNAL(clicked()), form, SLOT(slotClose()));
connect(viewFullSourceCB, SIGNAL(toggled(bool)),
this, SLOT(slotUpdate()));
connect(autoUpdateCB, SIGNAL(toggled(bool)),
updatePB, SLOT(setDisabled(bool)));
connect(updatePB, SIGNAL(clicked()),
this, SLOT(slotUpdate()));
}

View File

@ -26,21 +26,18 @@ QWrapDialog::QWrapDialog(QWrap * form)
{
setupUi(this);
Q_CONNECT_1(QPushButton, restorePB, clicked, bool,
QWrap, form, slotRestore, void);
Q_CONNECT_1(QPushButton, okPB, clicked, bool,
QWrap, form, slotOK, void);
Q_CONNECT_1(QPushButton, applyPB, clicked, bool,
QWrap, form, slotApply, void);
Q_CONNECT_1(QPushButton, closePB, clicked, bool,
QWrap, form, slotClose, void);
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()));
Q_CONNECT_1(QLineEdit, widthED, textChanged, const QString&,
QWrapDialog, this, change_adaptor, void);
Q_CONNECT_1(LengthCombo, unitsLC, selectionChanged, LyXLength::UNIT,
QWrapDialog, this, change_adaptor, void);
Q_CONNECT_1(QComboBox, valignCO, highlighted, const QString&,
QWrapDialog, this, change_adaptor, void);
connect( widthED, SIGNAL( textChanged(const QString&) ), this, SLOT( change_adaptor() ) );
connect( unitsLC, SIGNAL( selectionChanged(LyXLength::UNIT) ), this, SLOT( change_adaptor() ) );
connect( valignCO, SIGNAL( highlighted(const QString&) ), this, SLOT( change_adaptor() ) );
}

View File

@ -1,378 +0,0 @@
/**
* \file qt_connection_check.h
*
* \author Peter Kümmel
*
* Permission to use, copy, modify, distribute and sell this software for any
* purpose is hereby granted without fee, provided that the above copyright
* notice appear in all copies and that both that copyright notice and this
* permission notice appear in supporting documentation.
* The author makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
*/
#ifndef QT_CONNECTION_CHECK_H
#define QT_CONNECTION_CHECK_H
/*
Usage:
src/corelib/kernel/qobjectdefs.h must be patched.
Add this at the end before the endif to the header:
#ifdef signals
# ifdef QT_CONNECTION_SIGNATURE_CHECK
# undef signals
# define signals public
# endif
#endif
#ifdef Q_SIGNALS
# ifdef QT_CONNECTION_SIGNATURE_CHECK
# undef Q_SIGNALS
# define Q_SIGNALS public
# endif
#endif
*/
template< class SIGNAL_ARG_1 = void,
class SIGNAL_ARG_2 = void,
class SIGNAL_ARG_3 = void,
class SIGNAL_ARG_4 = void>
struct Wrong_Signal_Signature
{
template<class T>
static void signature(T*, void (T::* )(SIGNAL_ARG_1,
SIGNAL_ARG_2,
SIGNAL_ARG_3,
SIGNAL_ARG_4) ){}
template<class T>
static void existance(T*)
{
typedef SIGNAL_ARG_1 T1;
typedef SIGNAL_ARG_2 T2;
typedef SIGNAL_ARG_3 T3;
typedef SIGNAL_ARG_4 T4;
}
};
template< class SIGNAL_ARG_1,
class SIGNAL_ARG_2,
class SIGNAL_ARG_3>
struct Wrong_Signal_Signature< SIGNAL_ARG_1,
SIGNAL_ARG_2,
SIGNAL_ARG_3,
void>
{
template<class T>
static void signature(T*, void (T::* )(SIGNAL_ARG_1,
SIGNAL_ARG_2,
SIGNAL_ARG_3) ){}
template<class T>
static void existance(T*)
{
typedef SIGNAL_ARG_1 T1;
typedef SIGNAL_ARG_2 T2;
typedef SIGNAL_ARG_3 T3;
}
};
template< class SIGNAL_ARG_1,
class SIGNAL_ARG_2>
struct Wrong_Signal_Signature< SIGNAL_ARG_1,
SIGNAL_ARG_2,
void,
void>
{
template<class T>
static void signature(T*, void (T::* )(SIGNAL_ARG_1,
SIGNAL_ARG_2) ){}
template<class T>
static void existance(T*)
{
typedef SIGNAL_ARG_1 T1;
typedef SIGNAL_ARG_2 T2;
}
};
template< class SIGNAL_ARG_1>
struct Wrong_Signal_Signature< SIGNAL_ARG_1,
void,
void,
void>
{
template<class T>
static void signature(T*, void (T::* )(SIGNAL_ARG_1) ){}
template<class T>
static void existance(T*)
{
typedef SIGNAL_ARG_1 T1;
}
};
template<>
struct Wrong_Signal_Signature<void,void,void,void>
{
template<class T>
static void signature(T*, void (T::* )()){}
template<class T>
static void existance(T*) {}
};
template< class SLOT_ARG_1 = void,
class SLOT_ARG_2 = void,
class SLOT_ARG_3 = void,
class SLOT_ARG_4 = void>
struct Wrong__Slot__Signature
{
template<class T>
static void signature(T*, void (T::* )(SLOT_ARG_1,
SLOT_ARG_2,
SLOT_ARG_3,
SLOT_ARG_4) ){}
template<class T>
static void existance(T*)
{
typedef SLOT_ARG_1 T1;
typedef SLOT_ARG_2 T2;
typedef SLOT_ARG_3 T3;
typedef SLOT_ARG_4 T4;
}
};
template< class SLOT_ARG_1,
class SLOT_ARG_2,
class SLOT_ARG_3>
struct Wrong__Slot__Signature< SLOT_ARG_1,
SLOT_ARG_2,
SLOT_ARG_3,
void>
{
template<class T>
static void signature(T*, void (T::* )(SLOT_ARG_1,
SLOT_ARG_2,
SLOT_ARG_3)){}
template<class T>
static void existance(T*)
{
typedef SLOT_ARG_1 T1;
typedef SLOT_ARG_2 T2;
typedef SLOT_ARG_3 T3;
}
};
template< class SLOT_ARG_1,
class SLOT_ARG_2>
struct Wrong__Slot__Signature< SLOT_ARG_1,
SLOT_ARG_2,
void,
void>
{
template<class T>
static void signature(T*, void (T::* )(SLOT_ARG_1,
SLOT_ARG_2)){}
template<class T>
static void existance(T*)
{
typedef SLOT_ARG_1 T1;
typedef SLOT_ARG_2 T2;
}
};
template< class SLOT_ARG_1>
struct Wrong__Slot__Signature< SLOT_ARG_1,
void,
void,
void>
{
template<class T>
static void signature(T*, void (T::* )(SLOT_ARG_1)){}
template<class T>
static void existance(T*)
{
typedef SLOT_ARG_1 T1;
}
};
template<>
struct Wrong__Slot__Signature<void,void,void,void>
{
template<class T>
static void signature(T*, void (T::* )()){}
template<class T>
static void existance(T*){}
};
template<class SIGNAL_ARG_TYPE, class SLOT_ARG_TYPE>
struct Signal_Slot_argument_mismatch
{
// remove '&' from the type
template<class T>struct RefType {typedef T Result;};
template<class T>struct RefType<T&> {typedef T Result;};
template<class T>struct RefType<const T&>{typedef T const Result;};
template<class SIGNAL_SLOT_ARGUMENT_MISMATCH>
static void signal_slot_arguments_mismatch(SIGNAL_SLOT_ARGUMENT_MISMATCH*) {}
static void match()
{
RefType<SLOT_ARG_TYPE>::Result *p(0);
signal_slot_arguments_mismatch<RefType<SIGNAL_ARG_TYPE>::Result>(p);
}
};
template<class SI>
struct Signal_Slot_argument_mismatch<SI, void>
{
static void match() {}
};
template<>
struct Signal_Slot_argument_mismatch<void, void>
{
static void match() {}
};
template<class TOO_MUCH_SLOT_ARGUMENTS>
struct Signal_Slot_argument_mismatch<void, TOO_MUCH_SLOT_ARGUMENTS>
{
template<class T>
void to_much_slot_aruments(TOO_MUCH_SLOT_ARGUMENTS*)
{}
static void match()
{
TOO_MUCH_SLOT_ARGUMENTS *p(0);
to_much_slot_aruments<TOO_MUCH_SLOT_ARGUMENTS>(&p);
}
};
#undef QT_CONNECTION_SIGNATURE_CHECK
#ifdef QT_CONNECTION_SIGNATURE_CHECK
#define Q_CONNECT_0_CHECK( SI_HOST, PTR_SI, SI_NAME, \
SL_HOST, PTR_SL, SL_NAME) \
Wrong_Signal_Signature<void>::signature<SI_HOST>(PTR_SI,&SI_HOST::SI_NAME); \
Wrong__Slot__Signature<void>::signature<SL_HOST>(PTR_SL,&SL_HOST::SL_NAME);
#define Q_CONNECT_1_CHECK( SI_HOST, PTR_SI, SI_NAME, SI_ARG_1, \
SL_HOST, PTR_SL, SL_NAME, SL_ARG_1) \
Wrong_Signal_Signature<SI_ARG_1>::signature<SI_HOST>(PTR_SI,&SI_HOST::SI_NAME); \
Wrong__Slot__Signature<SL_ARG_1>::signature<SL_HOST>(PTR_SL,&SL_HOST::SL_NAME); \
Signal_Slot_argument_mismatch<SI_ARG_1,SL_ARG_1>::match();
#define Q_CONNECT_2_CHECK( SI_HOST, PTR_SI, SI_NAME, SI_ARG_1, SI_ARG_2, \
SL_HOST, PTR_SL, SL_NAME, SL_ARG_1, SL_ARG_2) \
Wrong_Signal_Signature<SI_ARG_1,SI_ARG_2>::signature<SI_HOST>(PTR_SI,&SI_HOST::SI_NAME); \
Wrong__Slot__Signature<SL_ARG_1,SL_ARG_2>::signature<SL_HOST>(PTR_SL,&SL_HOST::SL_NAME); \
Signal_Slot_argument_mismatch<SI_ARG_2,SL_ARG_2>::match(); \
Signal_Slot_argument_mismatch<SI_ARG_1,SL_ARG_1>::match();
#define Q_CONNECT_3_CHECK( SI_HOST, PTR_SI, SI_NAME, SI_ARG_1, SI_ARG_2, SI_ARG_3, \
SL_HOST, PTR_SL, SL_NAME, SL_ARG_1, SL_ARG_2, SL_ARG_3) \
Wrong_Signal_Signature<SI_ARG_1,SI_ARG_2,SI_ARG_3>::signature<SI_HOST>(PTR_SI,&SI_HOST::SI_NAME); \
Wrong__Slot__Signature<SL_ARG_1,SL_ARG_2,SL_ARG_3>::signature<SL_HOST>(PTR_SL,&SL_HOST::SL_NAME); \
Signal_Slot_argument_mismatch<SI_ARG_3,SL_ARG_3>::match(); \
Signal_Slot_argument_mismatch<SI_ARG_2,SL_ARG_2>::match(); \
Signal_Slot_argument_mismatch<SI_ARG_1,SL_ARG_1>::match();
#define Q_CONNECT_4_CHECK( SI_HOST, PTR_SI, SI_NAME, SI_ARG_1, SI_ARG_2, SI_ARG_3, SI_ARG_4, \
SL_HOST, PTR_SL, SL_NAME, SL_ARG_1, SL_ARG_2, SL_ARG_3, SL_ARG_4) \
Wrong_Signal_Signature<SI_ARG_1,SI_ARG_2,SI_ARG_3,SI_ARG_4>::signature<SI_HOST>(PTR_SI,&SI_HOST::SI_NAME); \
Wrong__Slot__Signature<SL_ARG_1,SL_ARG_2,SL_ARG_3,SL_ARG_4>::signature<SL_HOST>(PTR_SL,&SL_HOST::SL_NAME);
Signal_Slot_argument_mismatch<SI_ARG_4,SL_ARG_4>::match(); \
Signal_Slot_argument_mismatch<SI_ARG_3,SL_ARG_3>::match(); \
Signal_Slot_argument_mismatch<SI_ARG_2,SL_ARG_2>::match(); \
Signal_Slot_argument_mismatch<SI_ARG_1,SL_ARG_1>::match();
#else
#define Q_CONNECT_0_CHECK( SI_HOST, PTR_SI, SI_NAME, \
SL_HOST, PTR_SL, SL_NAME) \
Wrong_Signal_Signature<void>::existance<SI_HOST>(PTR_SI); \
Wrong__Slot__Signature<void>::existance<SL_HOST>(PTR_SL);
#define Q_CONNECT_1_CHECK( SI_HOST, PTR_SI, SI_NAME, SI_ARG_1, \
SL_HOST, PTR_SL, SL_NAME, SL_ARG_1) \
Wrong_Signal_Signature<SI_ARG_1>::existance<SI_HOST>(PTR_SI); \
Wrong__Slot__Signature<SL_ARG_1>::existance<SL_HOST>(PTR_SL); \
Signal_Slot_argument_mismatch<SI_ARG_1,SL_ARG_1>::match();
#define Q_CONNECT_2_CHECK( SI_HOST, PTR_SI, SI_NAME, SI_ARG_1, SI_ARG_2, \
SL_HOST, PTR_SL, SL_NAME, SL_ARG_1, SL_ARG_2) \
Wrong_Signal_Signature<SI_ARG_1,SI_ARG_2>::existance<SI_HOST>(PTR_SI); \
Wrong__Slot__Signature<SL_ARG_1,SL_ARG_2>::existance<SL_HOST>(PTR_SL); \
Signal_Slot_argument_mismatch<SI_ARG_2,SL_ARG_2>::match(); \
Signal_Slot_argument_mismatch<SI_ARG_1,SL_ARG_1>::match();
#define Q_CONNECT_3_CHECK( SI_HOST, PTR_SI, SI_NAME, SI_ARG_1, SI_ARG_2, SI_ARG_3, \
SL_HOST, PTR_SL, SL_NAME, SL_ARG_1, SL_ARG_2, SL_ARG_3) \
Wrong_Signal_Signature<SI_ARG_1,SI_ARG_2,SI_ARG_3>::existance<SI_HOST>(PTR_SI); \
Wrong__Slot__Signature<SL_ARG_1,SL_ARG_2,SL_ARG_3>::existance<SL_HOST>(PTR_SL); \
Signal_Slot_argument_mismatch<SI_ARG_2,SL_ARG_3>::match(); \
Signal_Slot_argument_mismatch<SI_ARG_1,SL_ARG_2>::match(); \
Signal_Slot_argument_mismatch<SI_ARG_1,SL_ARG_1>::match();
#define Q_CONNECT_4_CHECK( SI_HOST, PTR_SI, SI_NAME, SI_ARG_1, SI_ARG_2, SI_ARG_3, SI_ARG_4, \
SL_HOST, PTR_SL, SL_NAME, SL_ARG_1, SL_ARG_2, SL_ARG_3, SL_ARG_4) \
Wrong_Signal_Signature<SI_ARG_1,SI_ARG_2,SI_ARG_3,SI_ARG_4>::existance<SI_HOST>(PTR_SI); \
Wrong__Slot__Signature<SL_ARG_1,SL_ARG_2,SL_ARG_3,SL_ARG_4>::existance<SL_HOST>(PTR_SL); \
Signal_Slot_argument_mismatch<SI_ARG_4,SL_ARG_4>::match(); \
Signal_Slot_argument_mismatch<SI_ARG_3,SL_ARG_3>::match(); \
Signal_Slot_argument_mismatch<SI_ARG_2,SL_ARG_2>::match(); \
Signal_Slot_argument_mismatch<SI_ARG_1,SL_ARG_1>::match();
#endif
#define Q_CONNECT_0(SI_HOST, PTR_SI, SI_NAME, \
SL_HOST, PTR_SL, SL_NAME) \
Q_CONNECT_0_CHECK( SI_HOST, PTR_SI, SI_NAME, \
SL_HOST, PTR_SL, SL_NAME); \
QObject::connect( PTR_SI, SIGNAL(SI_NAME()), \
PTR_SL, SLOT (SL_NAME()));
#define Q_CONNECT_1(SI_HOST, PTR_SI, SI_NAME, SI_ARG_1, \
SL_HOST, PTR_SL, SL_NAME, SL_ARG_1) \
Q_CONNECT_1_CHECK( SI_HOST, PTR_SI, SI_NAME, SI_ARG_1, \
SL_HOST, PTR_SL, SL_NAME, SL_ARG_1); \
QObject::connect( PTR_SI, SIGNAL(SI_NAME(SI_ARG_1)), \
PTR_SL, SLOT (SL_NAME(SL_ARG_1)));
#define Q_CONNECT_2(SI_HOST, PTR_SI, SI_NAME, SI_ARG_1, SI_ARG_2, \
SL_HOST, PTR_SL, SL_NAME, SL_ARG_1, SL_ARG_2) \
Q_CONNECT_2_CHECK( SI_HOST, PTR_SI, SI_NAME, SI_ARG_1, SI_ARG_2, \
SL_HOST, PTR_SL, SL_NAME, SL_ARG_1, SL_ARG_2); \
QObject::connect( PTR_SI, SIGNAL(SI_NAME(SI_ARG_1,SI_ARG_2)), \
PTR_SL, SLOT (SL_NAME(SL_ARG_1,SL_ARG_2)));
#define Q_CONNECT_3(SI_HOST, PTR_SI, SI_NAME, SI_ARG_1, SI_ARG_2, SI_ARG_3, \
SL_HOST, PTR_SL, SL_NAME, SL_ARG_1, SL_ARG_2, SL_ARG_3) \
Q_CONNECT_3_CHECK( SI_HOST, PTR_SI, SI_NAME, SI_ARG_1, SI_ARG_2, SI_ARG_3, \
SL_HOST, PTR_SL, SL_NAME, SL_ARG_1, SL_ARG_2, SL_ARG_3); \
QObject::connect( PTR_SI, SIGNAL(SI_NAME(SI_ARG_1,SI_ARG_2,SI_ARG_3)), \
PTR_SL, SLOT (SL_NAME(SL_ARG_1,SL_ARG_2,SL_ARG_3)));
#define Q_CONNECT_4(SI_HOST, PTR_SI, SI_NAME, SI_ARG_1, SI_ARG_2, SI_ARG_3, SI_ARG_4, \
SL_HOST, PTR_SL, SL_NAME, SL_ARG_1, SL_ARG_2, SL_ARG_3, SL_ARG_4) \
Q_CONNECT_4_CHECK( SI_HOST, PTR_SI, SI_NAME, SI_ARG_1, SI_ARG_2, SI_ARG_3, SI_ARG_4, \
SL_HOST, PTR_SL, SL_NAME, SL_ARG_1, SL_ARG_2, SL_ARG_3, SL_ARG_4); \
QObject::connect( PTR_SI, SIGNAL(SI_NAME(SI_ARG_1,SI_ARG_2,SI_ARG_3,SI_ARG_4)), \
PTR_SL, SLOT (SL_NAME(SL_ARG_1,SL_ARG_2,SL_ARG_3,SL_ARG_4)));
#endif

View File

@ -20,8 +20,6 @@
#include <utility>
#include "qt_connection_check.h"
class QComboBox;
class QLineEdit;

View File

@ -13,7 +13,7 @@
#include <config.h>
#include "socket_callback.h"
#include "qt_helpers.h"
namespace lyx {
@ -21,8 +21,7 @@ socket_callback::socket_callback(int fd, boost::function<void()> func)
: func_(func)
{
sn_.reset(new QSocketNotifier(fd, QSocketNotifier::Read, this));
Q_CONNECT_1(QSocketNotifier, sn_.get(), activated, int,
socket_callback, this, data_received, void);
connect(sn_.get(), SIGNAL(activated(int)), this, SLOT(data_received()));
}