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"
20 #include <QCloseEvent>
27 GuiNote::GuiNote(GuiView & lv)
28 : GuiDialog(lv, "note")
31 setViewTitle(_("Note Settings"));
33 connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
34 connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
36 connect(noteRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
37 connect(greyedoutRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
38 connect(commentRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
40 bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
42 bc().setCancel(closePB);
46 void GuiNote::closeEvent(QCloseEvent * e)
53 void GuiNote::change_adaptor()
59 void GuiNote::updateContents()
61 switch (params_.type) {
62 case InsetNoteParams::Note:
63 noteRB->setChecked(true);
65 case InsetNoteParams::Comment:
66 commentRB->setChecked(true);
68 case InsetNoteParams::Greyedout:
69 greyedoutRB->setChecked(true);
75 void GuiNote::applyView()
77 if (greyedoutRB->isChecked())
78 params_.type = InsetNoteParams::Greyedout;
79 else if (commentRB->isChecked())
80 params_.type = InsetNoteParams::Comment;
82 params_.type = InsetNoteParams::Note;
86 bool GuiNote::initialiseParams(string const & data)
88 InsetNoteMailer::string2params(data, params_);
93 void GuiNote::clearParams()
95 params_ = InsetNoteParams();
99 void GuiNote::dispatchParams()
101 dispatch(FuncRequest(getLfun(), InsetNoteMailer::params2string(params_)));
105 Dialog * createGuiNote(GuiView & lv) { return new GuiNote(lv); }
108 } // namespace frontend
111 #include "GuiNote_moc.cpp"