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::closeEvent(QCloseEvent * e)
52 void GuiNote::change_adaptor()
58 void GuiNote::updateContents()
60 switch (params_.type) {
61 case InsetNoteParams::Note:
62 noteRB->setChecked(true);
64 case InsetNoteParams::Comment:
65 commentRB->setChecked(true);
67 case InsetNoteParams::Greyedout:
68 greyedoutRB->setChecked(true);
74 void GuiNote::applyView()
76 if (greyedoutRB->isChecked())
77 params_.type = InsetNoteParams::Greyedout;
78 else if (commentRB->isChecked())
79 params_.type = InsetNoteParams::Comment;
81 params_.type = InsetNoteParams::Note;
85 bool GuiNote::initialiseParams(string const & data)
87 InsetNoteMailer::string2params(data, params_);
92 void GuiNote::clearParams()
94 params_ = InsetNoteParams();
98 void GuiNote::dispatchParams()
100 dispatch(FuncRequest(getLfun(), InsetNoteMailer::params2string(params_)));
104 Dialog * createGuiNote(GuiView & lv) { return new GuiNote(lv); }
107 } // namespace frontend
110 #include "GuiNote_moc.cpp"