#include <config.h>
#include "GuiFloat.h"
-#include "GuiFloatDialog.h"
-#include "Qt2BC.h"
-#include "FloatPlacement.h"
-#include "controllers/ControlFloat.h"
+#include "FloatPlacement.h"
-#include "insets/InsetFloat.h"
+#include "FuncRequest.h"
#include <QPushButton>
+using namespace std;
+
namespace lyx {
namespace frontend {
-typedef QController<ControlFloat, GuiView<GuiFloatDialog> > float_base_class;
-
-
-GuiFloat::GuiFloat(Dialog & parent)
- : float_base_class(parent, _("Float Settings"))
+GuiFloat::GuiFloat(GuiView & lv)
+ : InsetDialog(lv, FLOAT_CODE, LFUN_FLOAT_INSERT, "float", "Float Settings")
{
+ setupUi(this);
+
+ // enable span columns checkbox
+ floatFP->useWide();
+ // enable sideways checkbox
+ floatFP->useSideways();
+
+ connect(floatFP, SIGNAL(changed()), this, SLOT(applyView()));
}
-void GuiFloat::build_dialog()
+void GuiFloat::enableView(bool enable)
{
- dialog_.reset(new GuiFloatDialog(this));
-
- bcview().setCancel(dialog_->closePB);
- bcview().setApply(dialog_->applyPB);
- bcview().setOK(dialog_->okPB);
- bcview().setRestore(dialog_->restorePB);
-
- bcview().addReadOnly(dialog_->floatFP);
+ floatFP->setEnabled(enable);
}
-void GuiFloat::update_contents()
+void GuiFloat::paramsToDialog(Inset const * inset)
{
- dialog_->floatFP->set(controller().params());
+ floatFP->paramsToDialog(inset);
}
-void GuiFloat::apply()
+docstring GuiFloat::dialogToParams() const
{
- InsetFloatParams & params = controller().params();
-
- params.placement = dialog_->floatFP->get(params.wide, params.sideways);
+ return floatFP->dialogToParams();
}
+Dialog * createGuiFloat(GuiView & lv) { return new GuiFloat(lv); }
+
} // namespace frontend
} // namespace lyx
+
+#include "moc_GuiFloat.cpp"