]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiMathMatrix.cpp
Complete the removal of the embedding stuff. Maybe. It's hard to be sure we got every...
[lyx.git] / src / frontends / qt4 / GuiMathMatrix.cpp
index 5a83b0d09de9082b7c64a0a3e0b4eeed473f61d0..b7dae78b48be2c7ab5b9e00901509a5e52417548 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "EmptyTable.h"
 #include "qt_helpers.h"
-#include "gettext.h"
+#include "support/gettext.h"
 
 #include <sstream>
 
 #include <QPushButton>
 #include <QSpinBox>
 
-using std::ostringstream;
-using std::string;
+using namespace std;
 
 namespace lyx {
 namespace frontend {
 
-GuiMathMatrix::GuiMathMatrix(Dialog & parent)
-       : GuiView<GuiMathMatrixDialog>(parent, _("Math Matrix"))
-{}
-
-
-void GuiMathMatrix::build_dialog()
-{
-       dialog_.reset(new GuiMathMatrixDialog(this));
-}
-
-
-GuiMathMatrixDialog::GuiMathMatrixDialog(GuiMathMatrix * form)
-       : form_(form)
+GuiMathMatrix::GuiMathMatrix(GuiView & lv)
+       : GuiMath(lv, "mathmatrix", qt_("Math Matrix"))
 {
        setupUi(this);
 
-       setWindowTitle(qt_("LyX: Insert Matrix"));
-
        table->setMinimumSize(100, 100);
        rowsSB->setValue(5);
        columnsSB->setValue(5);
@@ -70,10 +56,12 @@ GuiMathMatrixDialog::GuiMathMatrixDialog(GuiMathMatrix * form)
                this, SLOT(change_adaptor()));
        connect(halignED, SIGNAL(textChanged(const QString&)),
                this, SLOT(change_adaptor()));
+
+       bc().setPolicy(ButtonPolicy::IgnorantPolicy);
 }
 
 
-void GuiMathMatrixDialog::columnsChanged(int)
+void GuiMathMatrix::columnsChanged(int)
 {
        char h_align_str[80] = "c";
        int const nx = int(columnsSB->value());
@@ -85,18 +73,18 @@ void GuiMathMatrixDialog::columnsChanged(int)
 }
 
 
-void GuiMathMatrixDialog::rowsChanged(int)
+void GuiMathMatrix::rowsChanged(int)
 {
 }
 
 
-void GuiMathMatrixDialog::change_adaptor()
+void GuiMathMatrix::change_adaptor()
 {
        // FIXME: We need a filter for the halign input
 }
 
 
-void GuiMathMatrixDialog::slotOK()
+void GuiMathMatrix::slotOK()
 {
        char v_align_c[] = "tcb";
        char const c = v_align_c[valignCO->currentIndex()];
@@ -106,18 +94,22 @@ void GuiMathMatrixDialog::slotOK()
 
        ostringstream os;
        os << nx << ' ' << ny << ' ' << c << ' ' << sh;
-       form_->controller().dispatchMatrix(os.str().c_str());
+       dispatchMatrix(os.str().c_str());
 
        // close the dialog
        close();
 }
 
 
-void GuiMathMatrixDialog::slotClose()
+void GuiMathMatrix::slotClose()
 {
        close();
 }
 
+
+Dialog * createGuiMathMatrix(GuiView & lv) { return new GuiMathMatrix(lv); }
+
+
 } // namespace frontend
 } // namespace lyx