3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Jürgen Spitzmüller
8 * Full author contact details are available in file CREDITS.
15 #include "ControlNote.h"
16 #include "insets/InsetNote.h"
18 #include <QCloseEvent>
23 GuiNoteDialog::GuiNoteDialog(LyXView & lv)
24 : GuiDialog(lv, "note")
27 setController(new ControlNote(*this));
28 setViewTitle(_("Note Settings"));
30 connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
31 connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
33 connect(noteRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
34 connect(greyedoutRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
35 connect(commentRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
36 connect(framedRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
37 connect(shadedRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
39 bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
41 bc().setCancel(closePB);
45 ControlNote & GuiNoteDialog::controller() const
47 return static_cast<ControlNote &>(Dialog::controller());
51 void GuiNoteDialog::closeEvent(QCloseEvent * e)
58 void GuiNoteDialog::change_adaptor()
64 void GuiNoteDialog::update_contents()
66 QRadioButton * rb = 0;
68 switch (controller().params().type) {
69 case InsetNoteParams::Note:
72 case InsetNoteParams::Comment:
75 case InsetNoteParams::Greyedout:
78 case InsetNoteParams::Framed:
81 case InsetNoteParams::Shaded:
90 void GuiNoteDialog::applyView()
92 InsetNoteParams::Type type;
94 if (greyedoutRB->isChecked())
95 type = InsetNoteParams::Greyedout;
96 else if (commentRB->isChecked())
97 type = InsetNoteParams::Comment;
98 else if (framedRB->isChecked())
99 type = InsetNoteParams::Framed;
100 else if (shadedRB->isChecked())
101 type = InsetNoteParams::Shaded;
103 type = InsetNoteParams::Note;
105 controller().params().type = type;
108 } // namespace frontend
111 #include "GuiNote_moc.cpp"