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 "insets/InsetNote.h"
17 #include <QCloseEvent>
22 /////////////////////////////////////////////////////////////////////
26 /////////////////////////////////////////////////////////////////////
28 GuiNoteDialog::GuiNoteDialog(GuiNote * form)
33 connect(okPB, SIGNAL(clicked()), form, SLOT(slotOK()));
34 connect(closePB, SIGNAL(clicked()), form, SLOT(slotClose()));
36 connect(noteRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
37 connect(greyedoutRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
38 connect(commentRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
39 connect(framedRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
40 connect(shadedRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
44 void GuiNoteDialog::closeEvent(QCloseEvent * e)
51 void GuiNoteDialog::change_adaptor()
57 /////////////////////////////////////////////////////////////////////
61 /////////////////////////////////////////////////////////////////////
64 GuiNote::GuiNote(GuiDialog & parent)
65 : GuiView<GuiNoteDialog>(parent, _("Note Settings"))
69 void GuiNote::build_dialog()
71 dialog_.reset(new GuiNoteDialog(this));
73 bc().setOK(dialog_->okPB);
74 bc().setCancel(dialog_->closePB);
78 void GuiNote::update_contents()
80 QRadioButton * rb = 0;
82 switch (controller().params().type) {
83 case InsetNoteParams::Note:
86 case InsetNoteParams::Comment:
87 rb = dialog_->commentRB;
89 case InsetNoteParams::Greyedout:
90 rb = dialog_->greyedoutRB;
92 case InsetNoteParams::Framed:
93 rb = dialog_->framedRB;
95 case InsetNoteParams::Shaded:
96 rb = dialog_->shadedRB;
100 rb->setChecked(true);
104 void GuiNote::applyView()
106 InsetNoteParams::Type type;
108 if (dialog_->greyedoutRB->isChecked())
109 type = InsetNoteParams::Greyedout;
110 else if (dialog_->commentRB->isChecked())
111 type = InsetNoteParams::Comment;
112 else if (dialog_->framedRB->isChecked())
113 type = InsetNoteParams::Framed;
114 else if (dialog_->shadedRB->isChecked())
115 type = InsetNoteParams::Shaded;
117 type = InsetNoteParams::Note;
119 controller().params().type = type;
122 } // namespace frontend
125 #include "GuiNote_moc.cpp"