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"
23 GuiNote::GuiNote(GuiView & lv)
24 : GuiDialog(lv, "note", qt_("Note Settings"))
28 connect(buttonBox, SIGNAL(clicked(QAbstractButton *)),
29 this, SLOT(slotButtonBox(QAbstractButton *)));
31 connect(noteRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
32 connect(greyedoutRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
33 connect(commentRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
35 bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
36 bc().setOK(buttonBox->button(QDialogButtonBox::Ok));
37 bc().setCancel(buttonBox->button(QDialogButtonBox::Cancel));
41 void GuiNote::change_adaptor()
47 void GuiNote::updateContents()
49 switch (params_.type) {
50 case InsetNoteParams::Note:
51 noteRB->setChecked(true);
53 case InsetNoteParams::Comment:
54 commentRB->setChecked(true);
56 case InsetNoteParams::Greyedout:
57 greyedoutRB->setChecked(true);
63 void GuiNote::applyView()
65 if (greyedoutRB->isChecked())
66 params_.type = InsetNoteParams::Greyedout;
67 else if (commentRB->isChecked())
68 params_.type = InsetNoteParams::Comment;
70 params_.type = InsetNoteParams::Note;
74 bool GuiNote::initialiseParams(string const & sdata)
76 InsetNote::string2params(sdata, params_);
81 void GuiNote::clearParams()
83 params_ = InsetNoteParams();
87 void GuiNote::dispatchParams()
89 dispatch(FuncRequest(getLfun(), InsetNote::params2string(params_)));
93 } // namespace frontend
96 #include "moc_GuiNote.cpp"