]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiFloat.cpp
header cleanup
[lyx.git] / src / frontends / qt4 / GuiFloat.cpp
1 /**
2  * \file GuiFloat.cpp
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Edwin Leuven
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "GuiFloat.h"
14
15 #include "FloatPlacement.h"
16 #include "FuncRequest.h"
17
18 #include "insets/InsetFloat.h"
19
20 #include <QPushButton>
21
22 using namespace std;
23
24 namespace lyx {
25 namespace frontend {
26
27 GuiFloat::GuiFloat(GuiView & lv)
28         : GuiDialog(lv, "float", qt_("Float Settings"))
29 {
30         setupUi(this);
31         
32         connect(restorePB, SIGNAL(clicked()), this, SLOT(slotRestore()));
33         connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
34         connect(applyPB, SIGNAL(clicked()), this, SLOT(slotApply()));
35         connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
36
37         // enable span columns checkbox
38         floatFP->useWide();
39         // enable sideways checkbox
40         floatFP->useSideways();
41
42         connect(floatFP, SIGNAL(changed()), this, SLOT(change_adaptor()));
43
44         bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
45
46         bc().setCancel(closePB);
47         bc().setApply(applyPB);
48         bc().setOK(okPB);
49         bc().setRestore(restorePB);
50
51         bc().addReadOnly(floatFP);
52 }
53
54
55 void GuiFloat::change_adaptor()
56 {
57         changed();
58 }
59
60
61 void GuiFloat::updateContents()
62 {
63         floatFP->set(params_);
64 }
65
66
67 void GuiFloat::applyView()
68 {
69         params_.placement = floatFP->get(params_.wide, params_.sideways);
70 }
71
72
73 bool GuiFloat::initialiseParams(string const & data)
74 {
75         InsetFloatMailer::string2params(data, params_);
76         return true;
77 }
78
79
80 void GuiFloat::clearParams()
81 {
82         params_ = InsetFloatParams();
83 }
84
85
86 void GuiFloat::dispatchParams()
87 {
88         dispatch(FuncRequest(getLfun(), InsetFloatMailer::params2string(params_)));
89 }
90
91
92 Dialog * createGuiFloat(GuiView & lv) { return new GuiFloat(lv); }
93
94
95 } // namespace frontend
96 } // namespace lyx
97
98 #include "GuiFloat_moc.cpp"