]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiPhantom.cpp
Disable CheckTeX while buffer is processed
[lyx.git] / src / frontends / qt4 / GuiPhantom.cpp
1 /**
2  * \file GuiPhantom.cpp
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Uwe Stöhr
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "GuiPhantom.h"
14 #include "FuncRequest.h"
15 #include "support/gettext.h"
16
17 #include "insets/InsetPhantom.h"
18
19 using namespace std;
20
21 namespace lyx {
22 namespace frontend {
23
24 GuiPhantom::GuiPhantom(GuiView & lv)
25         : GuiDialog(lv, "phantom", qt_("Phantom Settings"))
26 {
27         setupUi(this);
28
29         connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
30         connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
31
32         connect(phantomRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
33         connect(hphantomRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
34         connect(vphantomRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
35
36         bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
37         bc().setOK(okPB);
38         bc().setCancel(closePB);
39 }
40
41
42 void GuiPhantom::change_adaptor()
43 {
44         changed();
45 }
46
47
48 void GuiPhantom::updateContents()
49 {
50         switch (params_.type) {
51         case InsetPhantomParams::Phantom:
52                 phantomRB->setChecked(true);
53                 break;
54         case InsetPhantomParams::HPhantom:
55                 hphantomRB->setChecked(true);
56                 break;
57         case InsetPhantomParams::VPhantom:
58                 vphantomRB->setChecked(true);
59                 break;
60         }
61 }
62
63
64 void GuiPhantom::applyView()
65 {
66         if (vphantomRB->isChecked())
67                 params_.type = InsetPhantomParams::VPhantom;
68         else if (hphantomRB->isChecked())
69                 params_.type = InsetPhantomParams::HPhantom;
70         else
71                 params_.type = InsetPhantomParams::Phantom;
72 }
73
74
75 bool GuiPhantom::initialiseParams(string const & data)
76 {
77         InsetPhantom::string2params(data, params_);
78         return true;
79 }
80
81
82 void GuiPhantom::clearParams()
83 {
84         params_ = InsetPhantomParams();
85 }
86
87
88 void GuiPhantom::dispatchParams()
89 {
90         dispatch(FuncRequest(getLfun(), InsetPhantom::params2string(params_)));
91 }
92
93
94 Dialog * createGuiPhantom(GuiView & lv) { return new GuiPhantom(lv); }
95
96
97 } // namespace frontend
98 } // namespace lyx
99
100 #include "moc_GuiPhantom.cpp"