]> git.lyx.org Git - features.git/commitdiff
next one
authorAndré Pönitz <poenitz@gmx.net>
Sat, 6 Oct 2007 09:39:29 +0000 (09:39 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Sat, 6 Oct 2007 09:39:29 +0000 (09:39 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20773 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/controllers/ControlTabularCreate.cpp [deleted file]
src/frontends/controllers/ControlTabularCreate.h [deleted file]
src/frontends/controllers/Makefile.am
src/frontends/qt4/Dialogs.cpp
src/frontends/qt4/GuiTabularCreate.cpp
src/frontends/qt4/GuiTabularCreate.h

diff --git a/src/frontends/controllers/ControlTabularCreate.cpp b/src/frontends/controllers/ControlTabularCreate.cpp
deleted file mode 100644 (file)
index 2441a6f..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * \file ControlTabularCreate.cpp
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author unknown
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#include <config.h>
-
-#include "ControlTabularCreate.h"
-#include "FuncRequest.h"
-
-#include "support/convert.h"
-
-
-using std::string;
-
-namespace lyx {
-namespace frontend {
-
-ControlTabularCreate::ControlTabularCreate(Dialog & parent)
-       : Controller(parent)
-{}
-
-
-bool ControlTabularCreate::initialiseParams(string const &)
-{
-       params_.first  = 5;
-       params_.second = 5;
-       return true;
-}
-
-
-void ControlTabularCreate::clearParams()
-{
-       params_.first  = 0;
-       params_.second = 0;
-}
-
-
-void ControlTabularCreate::dispatchParams()
-{
-       string const data = convert<string>(params().first) + ' ' + convert<string>(params().second);
-       dispatch(FuncRequest(getLfun(), data));
-}
-
-} // namespace frontend
-} // namespace lyx
diff --git a/src/frontends/controllers/ControlTabularCreate.h b/src/frontends/controllers/ControlTabularCreate.h
deleted file mode 100644 (file)
index fde42ec..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-// -*- C++ -*-
-/**
- * \file ControlTabularCreate.h
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author unknown
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#ifndef CONTROLTABULARCREATE_H
-#define CONTROLTABULARCREATE_H
-
-#include "Dialog.h"
-#include <utility>
-
-namespace lyx {
-namespace frontend {
-
-/** A controller for the TabularCreate Dialog.
- */
-class ControlTabularCreate : public Controller {
-public:
-       ///
-       ControlTabularCreate(Dialog &);
-       ///
-       virtual bool initialiseParams(std::string const & data);
-       /// clean-up on hide.
-       virtual void clearParams();
-       ///
-       virtual void dispatchParams();
-       ///
-       virtual bool isBufferDependent() const { return true; }
-       ///
-       virtual kb_action getLfun() const { return LFUN_TABULAR_INSERT; }
-
-       ///
-       typedef std::pair<size_t, size_t> rowsCols;
-       ///
-       rowsCols & params() { return params_; }
-
-private:
-       /// rows, cols params
-       rowsCols params_;
-};
-
-} // namespace frontend
-} // namespace lyx
-
-#endif // CONTROLTABULARCREATE_H
index 6aaf8c2b4db58cdc82a107fe1fddbe7db040dab0..a4882ab65c72de3d01d2426b0180653f63a468e1 100644 (file)
@@ -31,7 +31,6 @@ SOURCEFILES = \
        ControlSearch.cpp \
        ControlSendto.cpp \
        ControlSpellchecker.cpp \
-       ControlTabularCreate.cpp \
        ControlThesaurus.cpp \
        ControlToc.cpp \
        frontend_helpers.cpp 
@@ -60,7 +59,6 @@ HEADERFILES = \
        ControlSearch.h \
        ControlSendto.h \
        ControlSpellchecker.h \
-       ControlTabularCreate.h \
        ControlThesaurus.h \
        ControlToc.h \
        frontend_helpers.h
index a4a449962a1a74d013a56c08c44aabbeee44cf96..307adc0280403098d8418ada7dd1dc6b93ffcf31 100644 (file)
@@ -41,8 +41,6 @@
 #include "GuiSendto.h"
 #include "GuiShowFile.h"
 #include "GuiSpellchecker.h"
-#include "GuiTabular.h"
-#include "GuiTabularCreate.h"
 #include "GuiToc.h"
 #include "GuiView.h"
 #include "GuiViewSource.h"
@@ -232,7 +230,7 @@ Dialog * Dialogs::build(string const & name)
        } else if (name == "tabular") {
                dialog = createGuiTabular(lyxview_);
        } else if (name == "tabularcreate") {
-               dialog = new GuiTabularCreateDialog(lyxview_);
+               dialog = createGuiTabularCreate(lyxview_);
        } else if (name == "texinfo") {
                dialog = createGuiTexInfo(lyxview_);
 #ifdef HAVE_LIBAIKSAURUS
index a4394388ab87bfecd03644974410beea09d71045..be59c0bec9b90e89a04ae1465bd313ab1ff47b27 100644 (file)
 
 #include "GuiTabularCreate.h"
 
-#include "ControlTabularCreate.h"
 #include "EmptyTable.h"
+#include "FuncRequest.h"
+
+#include "support/convert.h"
 
 #include <QCloseEvent>
 #include <QSpinBox>
 #include <QPushButton>
 
+using std::string;
+
 
 namespace lyx {
 namespace frontend {
 
-GuiTabularCreateDialog::GuiTabularCreateDialog(LyXView & lv)
-       : GuiDialog(lv, "tabularcreate")
+GuiTabularCreate::GuiTabularCreate(LyXView & lv)
+       : GuiDialog(lv, "tabularcreate"), Controller(this)
 {
        setupUi(this);
        setViewTitle(_("Insert Table"));
-       setController(new ControlTabularCreate(*this));
+       setController(this, false);
 
        rowsSB->setValue(5);
        columnsSB->setValue(5);
@@ -47,30 +51,53 @@ GuiTabularCreateDialog::GuiTabularCreateDialog(LyXView & lv)
 }
 
 
-ControlTabularCreate & GuiTabularCreateDialog::controller()
+void GuiTabularCreate::columnsChanged(int)
 {
-       return static_cast<ControlTabularCreate &>(GuiDialog::controller());
+       changed();
 }
 
 
-void GuiTabularCreateDialog::columnsChanged(int)
+void GuiTabularCreate::rowsChanged(int)
 {
        changed();
 }
 
 
-void GuiTabularCreateDialog::rowsChanged(int)
+void GuiTabularCreate::applyView()
 {
-       changed();
+       params_.first = rowsSB->value();
+       params_.second = columnsSB->value();
 }
 
 
-void GuiTabularCreateDialog::applyView()
+bool GuiTabularCreate::initialiseParams(string const &)
 {
-       controller().params().first = rowsSB->value();
-       controller().params().second = columnsSB->value();
+       params_.first  = 5;
+       params_.second = 5;
+       return true;
 }
 
+
+void GuiTabularCreate::clearParams()
+{
+       params_.first  = 0;
+       params_.second = 0;
+}
+
+
+void GuiTabularCreate::dispatchParams()
+{
+       string const data = convert<string>(params().first) + ' ' + convert<string>(params().second);
+       dispatch(FuncRequest(getLfun(), data));
+}
+
+
+Dialog * createGuiTabularCreate(LyXView & lv)
+{
+       return new GuiTabularCreate(lv);
+}
+
+
 } // namespace frontend
 } // namespace lyx
 
index e620f804a3d1740c3837949cc2b6a59f0ae6e764..45f14a883881af4ec381da9cdb7d3d1e76e325cb 100644 (file)
 #define GUITABULARCREATE_H
 
 #include "GuiDialog.h"
-#include "ControlTabularCreate.h"
 #include "ui_TabularCreateUi.h"
 
+#include <utility>
+
 namespace lyx {
 namespace frontend {
 
-class GuiTabularCreateDialog : public GuiDialog, public Ui::TabularCreateUi
+
+class GuiTabularCreate
+       : public GuiDialog, public Ui::TabularCreateUi, public Controller
 {
        Q_OBJECT
 
 public:
-       GuiTabularCreateDialog(LyXView & lv);
+       GuiTabularCreate(LyXView & lv);
 
 private Q_SLOTS:
        void columnsChanged(int);
        void rowsChanged(int);
 
        /// parent controller
-       ControlTabularCreate & controller();
+       Controller & controller() { return *this; }
 
 private:
        /// Apply changes
        void applyView();
+       ///
+       bool initialiseParams(std::string const & data);
+       /// clean-up on hide.
+       void clearParams();
+       ///
+       void dispatchParams();
+       ///
+       bool isBufferDependent() const { return true; }
+       ///
+       kb_action getLfun() const { return LFUN_TABULAR_INSERT; }
+
+       ///
+       typedef std::pair<size_t, size_t> rowsCols;
+       ///
+       rowsCols & params() { return params_; }
+
+private:
+       /// rows, cols params
+       rowsCols params_;
 };
 
 } // namespace frontend