]> git.lyx.org Git - features.git/commitdiff
next one
authorAndré Pönitz <poenitz@gmx.net>
Fri, 5 Oct 2007 22:08:56 +0000 (22:08 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Fri, 5 Oct 2007 22:08:56 +0000 (22:08 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20763 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/controllers/ControlFloat.cpp [deleted file]
src/frontends/controllers/ControlFloat.h [deleted file]
src/frontends/controllers/Makefile.am
src/frontends/qt4/Dialogs.cpp
src/frontends/qt4/GuiFloat.cpp
src/frontends/qt4/GuiFloat.h

diff --git a/src/frontends/controllers/ControlFloat.cpp b/src/frontends/controllers/ControlFloat.cpp
deleted file mode 100644 (file)
index a55527e..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * \file ControlFloat.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 "ControlFloat.h"
-#include "FuncRequest.h"
-
-
-using std::string;
-
-namespace lyx {
-namespace frontend {
-
-ControlFloat::ControlFloat(Dialog & parent)
-       : Controller(parent)
-{}
-
-
-bool ControlFloat::initialiseParams(string const & data)
-{
-       InsetFloatMailer::string2params(data, params_);
-       return true;
-}
-
-
-void ControlFloat::clearParams()
-{
-       params_ = InsetFloatParams();
-}
-
-
-void ControlFloat::dispatchParams()
-{
-       string const lfun = InsetFloatMailer::params2string(params());
-       dispatch(FuncRequest(getLfun(), lfun));
-}
-
-} // namespace frontend
-} // namespace lyx
diff --git a/src/frontends/controllers/ControlFloat.h b/src/frontends/controllers/ControlFloat.h
deleted file mode 100644 (file)
index 06e6fc4..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-// -*- C++ -*-
-/**
- * \file ControlFloat.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 CONTROLFLOAT_H
-#define CONTROLFLOAT_H
-
-#include "Dialog.h"
-#include "insets/InsetFloat.h"
-
-namespace lyx {
-namespace frontend {
-
-class ControlFloat : public Controller
-{
-public:
-       ///
-       ControlFloat(Dialog &);
-       ///
-       virtual bool initialiseParams(std::string const & data);
-       /// clean-up on hide.
-       virtual void clearParams();
-       /// clean-up on hide.
-       virtual void dispatchParams();
-       ///
-       virtual bool isBufferDependent() const { return true; }
-       ///
-       InsetFloatParams & params() { return params_; }
-       ///
-       InsetFloatParams const & params() const { return params_; }
-private:
-       ///
-       InsetFloatParams params_;
-};
-
-} // namespace frontend
-} // namespace lyx
-
-#endif
index 8d8a0fdc49496ad89fc9e2e8346c457e7cf27853..0bc1308c0ad65a3a131cc4f6b6df37be212b547b 100644 (file)
@@ -21,7 +21,6 @@ SOURCEFILES = \
        ControlEmbeddedFiles.cpp \
        ControlErrorList.cpp \
        ControlExternal.cpp \
-       ControlFloat.cpp \
        ControlGraphics.cpp \
        ControlInclude.cpp \
        ControlLog.cpp \
@@ -56,7 +55,6 @@ HEADERFILES = \
        ControlErrorList.h \
        ControlEmbeddedFiles.h \
        ControlExternal.h \
-       ControlFloat.h \
        ControlGraphics.h \
        ControlInclude.h \
        ControlLog.h \
index b2988e86adc7884181300c8a1de86783302d29b4..46d0a3679d6cee424392785c7617dd8526d51979 100644 (file)
@@ -29,7 +29,6 @@
 #include "GuiEmbeddedFiles.h"
 #include "GuiErrorList.h"
 #include "GuiExternal.h"
-#include "GuiFloat.h"
 #include "GuiGraphics.h"
 #include "GuiInclude.h"
 #include "GuiIndex.h"
@@ -191,7 +190,7 @@ Dialog * Dialogs::build(string const & name)
        } else if (name == "findreplace") {
                dialog = new GuiSearchDialog(lyxview_);
        } else if (name == "float") {
-               dialog = new GuiFloatDialog(lyxview_);
+               dialog = createGuiFloat(lyxview_);
        } else if (name == "graphics") {
                dialog = new GuiGraphicsDialog(lyxview_);
        } else if (name == "include") {
index 87d1ca7a67a399c3bada73ce6a8dd064120d7259..6b8abe01078688d1e205b74df284cd455f46aab7 100644 (file)
 
 #include "GuiFloat.h"
 
-#include "ControlFloat.h"
 #include "FloatPlacement.h"
+#include "FuncRequest.h"
 
 #include "insets/InsetFloat.h"
 
 #include <QCloseEvent>
 #include <QPushButton>
 
+using std::string;
+
 
 namespace lyx {
 namespace frontend {
 
-GuiFloatDialog::GuiFloatDialog(LyXView & lv)
-       : GuiDialog(lv, "float")
+GuiFloat::GuiFloat(LyXView & lv)
+       : GuiDialog(lv, "float"), Controller(this)
 {
-       setController(new ControlFloat(*this));
+       setController(this, false);
        setViewTitle(_("Float Settings"));
 
        setupUi(this);
@@ -54,37 +56,53 @@ GuiFloatDialog::GuiFloatDialog(LyXView & lv)
 }
 
 
-ControlFloat & GuiFloatDialog::controller()
+void GuiFloat::change_adaptor()
 {
-       return static_cast<ControlFloat &>(GuiDialog::controller());
+       changed();
 }
 
 
-void GuiFloatDialog::change_adaptor()
+void GuiFloat::closeEvent(QCloseEvent * e)
 {
-       changed();
+       slotClose();
+       e->accept();
 }
 
 
-void GuiFloatDialog::closeEvent(QCloseEvent * e)
+void GuiFloat::updateContents()
 {
-       slotClose();
-       e->accept();
+       floatFP->set(params_);
+}
+
+
+void GuiFloat::applyView()
+{
+       params_.placement = floatFP->get(params_.wide, params_.sideways);
 }
 
 
-void GuiFloatDialog::updateContents()
+bool GuiFloat::initialiseParams(string const & data)
 {
-       floatFP->set(controller().params());
+       InsetFloatMailer::string2params(data, params_);
+       return true;
 }
 
 
-void GuiFloatDialog::applyView()
+void GuiFloat::clearParams()
 {
-       InsetFloatParams & params = controller().params();
-       params.placement = floatFP->get(params.wide, params.sideways);
+       params_ = InsetFloatParams();
 }
 
+
+void GuiFloat::dispatchParams()
+{
+       dispatch(FuncRequest(getLfun(), InsetFloatMailer::params2string(params_)));
+}
+
+
+Dialog * createGuiFloat(LyXView & lv) { return new GuiFloat(lv); }
+
+
 } // namespace frontend
 } // namespace lyx
 
index 881245d0ed6e1b93822735bddb8f9776359816a2..28049e5f40e7340d3e37487fa18d6995331df872 100644 (file)
 #define GUIFLOAT_H
 
 #include "GuiDialog.h"
-#include "ControlFloat.h"
 #include "ui_FloatUi.h"
+#include "insets/InsetFloat.h"
+
 
 namespace lyx {
 namespace frontend {
 
-class GuiFloatDialog : public GuiDialog, public Ui::FloatUi
+class GuiFloat : public GuiDialog, public Ui::FloatUi, public Controller
 {
        Q_OBJECT
 
 public:
-       GuiFloatDialog(LyXView & lv);
+       GuiFloat(LyXView & lv);
 
 private Q_SLOTS:
        void change_adaptor();
@@ -32,11 +33,23 @@ private Q_SLOTS:
 private:
        void closeEvent(QCloseEvent * e);
        /// parent controller
-       ControlFloat & controller();
+       Controller & controller() { return *this; }
        /// Apply changes
        void applyView();
        /// update
        void updateContents();
+       ///
+       bool initialiseParams(std::string const & data);
+       /// clean-up on hide.
+       void clearParams();
+       /// clean-up on hide.
+       void dispatchParams();
+       ///
+       bool isBufferDependent() const { return true; }
+
+private:
+       ///
+       InsetFloatParams params_;
 };
 
 } // namespace frontend