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", qt_("Note Settings"))
32 connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
33 connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
35 connect(noteRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
36 connect(greyedoutRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
37 connect(commentRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
39 bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
41 bc().setCancel(closePB);
45 void GuiNote::change_adaptor()
51 void GuiNote::updateContents()
53 switch (params_.type) {
54 case InsetNoteParams::Note:
55 noteRB->setChecked(true);
57 case InsetNoteParams::Comment:
58 commentRB->setChecked(true);
60 case InsetNoteParams::Greyedout:
61 greyedoutRB->setChecked(true);
67 void GuiNote::applyView()
69 if (greyedoutRB->isChecked())
70 params_.type = InsetNoteParams::Greyedout;
71 else if (commentRB->isChecked())
72 params_.type = InsetNoteParams::Comment;
74 params_.type = InsetNoteParams::Note;
78 bool GuiNote::initialiseParams(string const & data)
80 InsetNoteMailer::string2params(data, params_);
85 void GuiNote::clearParams()
87 params_ = InsetNoteParams();
91 void GuiNote::dispatchParams()
93 dispatch(FuncRequest(getLfun(), InsetNoteMailer::params2string(params_)));
97 Dialog * createGuiNote(GuiView & lv) { return new GuiNote(lv); }
100 } // namespace frontend
103 #include "GuiNote_moc.cpp"