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.
16 #include "insets/InsetNote.h"
18 #include <QCloseEvent>
23 /////////////////////////////////////////////////////////////////////
27 /////////////////////////////////////////////////////////////////////
29 GuiNoteDialog::GuiNoteDialog(GuiNote * form)
34 connect(okPB, SIGNAL(clicked()), form, SLOT(slotOK()));
35 connect(closePB, SIGNAL(clicked()), form, 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()));
40 connect(framedRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
41 connect(shadedRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
45 void GuiNoteDialog::closeEvent(QCloseEvent * e)
52 void GuiNoteDialog::change_adaptor()
58 /////////////////////////////////////////////////////////////////////
62 /////////////////////////////////////////////////////////////////////
65 GuiNote::GuiNote(Dialog & parent)
66 : GuiView<GuiNoteDialog>(parent, _("Note Settings"))
70 void GuiNote::build_dialog()
72 dialog_.reset(new GuiNoteDialog(this));
74 bcview().setOK(dialog_->okPB);
75 bcview().setCancel(dialog_->closePB);
79 void GuiNote::update_contents()
81 QRadioButton * rb = 0;
83 switch (controller().params().type) {
84 case InsetNoteParams::Note:
87 case InsetNoteParams::Comment:
88 rb = dialog_->commentRB;
90 case InsetNoteParams::Greyedout:
91 rb = dialog_->greyedoutRB;
93 case InsetNoteParams::Framed:
94 rb = dialog_->framedRB;
96 case InsetNoteParams::Shaded:
97 rb = dialog_->shadedRB;
101 rb->setChecked(true);
105 void GuiNote::apply()
107 InsetNoteParams::Type type;
109 if (dialog_->greyedoutRB->isChecked())
110 type = InsetNoteParams::Greyedout;
111 else if (dialog_->commentRB->isChecked())
112 type = InsetNoteParams::Comment;
113 else if (dialog_->framedRB->isChecked())
114 type = InsetNoteParams::Framed;
115 else if (dialog_->shadedRB->isChecked())
116 type = InsetNoteParams::Shaded;
118 type = InsetNoteParams::Note;
120 controller().params().type = type;
123 } // namespace frontend
126 #include "GuiNote_moc.cpp"