]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiTabularCreate.cpp
QDialogButtonBox for the remaining dialogs.
[lyx.git] / src / frontends / qt4 / GuiTabularCreate.cpp
index 33e20f33e5e3216ecdfa2e8ba8049e28796f7188..f2c4f98264284d77e3cc23643c68977cfd6c8a2a 100644 (file)
@@ -32,18 +32,30 @@ GuiTabularCreate::GuiTabularCreate(GuiView & lv)
 
        rowsSB->setValue(5);
        columnsSB->setValue(5);
+       table->setMinimumSize(100, 100);
 
-       connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
-       connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
+       connect(table, SIGNAL(rowsChanged(int)),
+               rowsSB, SLOT(setValue(int)));
+       connect(table, SIGNAL(colsChanged(int)),
+               columnsSB, SLOT(setValue(int)));
+       connect(rowsSB, SIGNAL(valueChanged(int)),
+               table, SLOT(setNumberRows(int)));
+       connect(columnsSB, SIGNAL(valueChanged(int)),
+               table, SLOT(setNumberColumns(int)));
+
+       connect(buttonBox, SIGNAL(clicked(QAbstractButton *)),
+               this, SLOT(slotButtonBox(QAbstractButton *)));
 
        connect(rowsSB, SIGNAL(valueChanged(int)),
                this, SLOT(rowsChanged(int)));
        connect(columnsSB, SIGNAL(valueChanged(int)),
                this, SLOT(columnsChanged(int)));
 
-       bc().setPolicy(ButtonPolicy::IgnorantPolicy);
-       bc().setOK(okPB);
-       bc().setCancel(closePB);
+       bc().setPolicy(ButtonPolicy::OkApplyCancelReadOnlyPolicy);
+       bc().setOK(buttonBox->button(QDialogButtonBox::Ok));
+       bc().setApply(buttonBox->button(QDialogButtonBox::Apply));
+       bc().setCancel(buttonBox->button(QDialogButtonBox::Cancel));
+       bc().setValid(isValid());
 }
 
 
@@ -83,8 +95,9 @@ void GuiTabularCreate::clearParams()
 
 void GuiTabularCreate::dispatchParams()
 {
-       string const data = convert<string>(params().first) + ' ' + convert<string>(params().second);
-       dispatch(FuncRequest(getLfun(), data));
+       string const sdata = 
+               convert<string>(params().first) + ' ' + convert<string>(params().second);
+       dispatch(FuncRequest(getLfun(), sdata));
 }
 
 
@@ -97,4 +110,4 @@ Dialog * createGuiTabularCreate(GuiView & lv)
 } // namespace frontend
 } // namespace lyx
 
-#include "GuiTabularCreate_moc.cpp"
+#include "moc_GuiTabularCreate.cpp"