]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiFloat.cpp
* fix spelling in comments to please John.
[lyx.git] / src / frontends / qt4 / GuiFloat.cpp
index f0e3d51c2c1d3f1102d6e41cc1a9f1fa229e38f0..773a7f0ba88dacb917789f8c568614f59adf8b4d 100644 (file)
 
 #include "GuiFloat.h"
 
-#include "ControlFloat.h"
 #include "FloatPlacement.h"
+#include "FuncRequest.h"
 
 #include "insets/InsetFloat.h"
 
-#include <QCloseEvent>
 #include <QPushButton>
 
+using namespace std;
 
 namespace lyx {
 namespace frontend {
 
-GuiFloatDialog::GuiFloatDialog(LyXView & lv)
-       : GuiDialog(lv, "float")
+GuiFloat::GuiFloat(GuiView & lv)
+       : GuiDialog(lv, "float", qt_("Float Settings"))
 {
-       setController(new ControlFloat(*this));
-       setViewTitle(_("Float Settings"));
-
        setupUi(this);
+       
        connect(restorePB, SIGNAL(clicked()), this, SLOT(slotRestore()));
        connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
        connect(applyPB, SIGNAL(clicked()), this, SLOT(slotApply()));
@@ -54,38 +52,47 @@ GuiFloatDialog::GuiFloatDialog(LyXView & lv)
 }
 
 
-ControlFloat & GuiFloatDialog::controller() const
+void GuiFloat::change_adaptor()
 {
-       return static_cast<ControlFloat &>(GuiDialog::controller());
+       changed();
 }
 
 
-void GuiFloatDialog::change_adaptor()
+void GuiFloat::updateContents()
 {
-       changed();
+       floatFP->set(params_);
+}
+
+
+void GuiFloat::applyView()
+{
+       params_.placement = floatFP->get(params_.wide, params_.sideways);
 }
 
 
-void GuiFloatDialog::closeEvent(QCloseEvent * e)
+bool GuiFloat::initialiseParams(string const & data)
 {
-       slotWMHide();
-       e->accept();
+       InsetFloat::string2params(data, params_);
+       return true;
 }
 
 
-void GuiFloatDialog::update_contents()
+void GuiFloat::clearParams()
 {
-       floatFP->set(controller().params());
+       params_ = InsetFloatParams();
 }
 
 
-void GuiFloatDialog::applyView()
+void GuiFloat::dispatchParams()
 {
-       InsetFloatParams & params = controller().params();
-       params.placement = floatFP->get(params.wide, params.sideways);
+       dispatch(FuncRequest(getLfun(), InsetFloat::params2string(params_)));
 }
 
+
+Dialog * createGuiFloat(GuiView & lv) { return new GuiFloat(lv); }
+
+
 } // namespace frontend
 } // namespace lyx
 
-#include "GuiFloat_moc.cpp"
+#include "moc_GuiFloat.cpp"