3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Angus Leeming
7 * \author Jürgen Spitzmüller
9 * Full author contact details are available in file CREDITS.
15 #include "FuncRequest.h"
16 #include "support/gettext.h"
18 #include "insets/InsetNote.h"
25 GuiNote::GuiNote(GuiView & lv)
26 : GuiDialog(lv, "note", qt_("Note Settings"))
30 connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
31 connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
33 connect(noteRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
34 connect(greyedoutRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
35 connect(commentRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
37 bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
39 bc().setCancel(closePB);
43 void GuiNote::change_adaptor()
49 void GuiNote::updateContents()
51 switch (params_.type) {
52 case InsetNoteParams::Note:
53 noteRB->setChecked(true);
55 case InsetNoteParams::Comment:
56 commentRB->setChecked(true);
58 case InsetNoteParams::Greyedout:
59 greyedoutRB->setChecked(true);
65 void GuiNote::applyView()
67 if (greyedoutRB->isChecked())
68 params_.type = InsetNoteParams::Greyedout;
69 else if (commentRB->isChecked())
70 params_.type = InsetNoteParams::Comment;
72 params_.type = InsetNoteParams::Note;
76 bool GuiNote::initialiseParams(string const & data)
78 InsetNote::string2params(data, params_);
83 void GuiNote::clearParams()
85 params_ = InsetNoteParams();
89 void GuiNote::dispatchParams()
91 dispatch(FuncRequest(getLfun(), InsetNote::params2string(params_)));
95 Dialog * createGuiNote(GuiView & lv) { return new GuiNote(lv); }
98 } // namespace frontend
101 #include "moc_GuiNote.cpp"