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>
28 GuiNote::GuiNote(GuiView & lv)
29 : GuiDialog(lv, "note")
32 setViewTitle(_("Note Settings"));
34 connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
35 connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
37 connect(noteRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
38 connect(greyedoutRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
39 connect(commentRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
41 bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
43 bc().setCancel(closePB);
47 void GuiNote::closeEvent(QCloseEvent * e)
54 void GuiNote::change_adaptor()
60 void GuiNote::updateContents()
62 switch (params_.type) {
63 case InsetNoteParams::Note:
64 noteRB->setChecked(true);
66 case InsetNoteParams::Comment:
67 commentRB->setChecked(true);
69 case InsetNoteParams::Greyedout:
70 greyedoutRB->setChecked(true);
76 void GuiNote::applyView()
78 if (greyedoutRB->isChecked())
79 params_.type = InsetNoteParams::Greyedout;
80 else if (commentRB->isChecked())
81 params_.type = InsetNoteParams::Comment;
83 params_.type = InsetNoteParams::Note;
87 bool GuiNote::initialiseParams(string const & data)
89 InsetNoteMailer::string2params(data, params_);
94 void GuiNote::clearParams()
96 params_ = InsetNoteParams();
100 void GuiNote::dispatchParams()
102 dispatch(FuncRequest(getLfun(), InsetNoteMailer::params2string(params_)));
106 Dialog * createGuiNote(GuiView & lv) { return new GuiNote(lv); }
109 } // namespace frontend
112 #include "GuiNote_moc.cpp"