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 "controllers/ControlNote.h"
18 #include "insets/InsetNote.h"
20 #include <QCloseEvent>
25 /////////////////////////////////////////////////////////////////////
29 /////////////////////////////////////////////////////////////////////
31 QNoteDialog::QNoteDialog(QNote * form)
36 connect(okPB, SIGNAL(clicked()), form, SLOT(slotOK()));
37 connect(closePB, SIGNAL(clicked()), form, SLOT(slotClose()));
39 connect(noteRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
40 connect(greyedoutRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
41 connect(commentRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
42 connect(framedRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
43 connect(shadedRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
47 void QNoteDialog::closeEvent(QCloseEvent * e)
54 void QNoteDialog::change_adaptor()
60 /////////////////////////////////////////////////////////////////////
64 /////////////////////////////////////////////////////////////////////
66 typedef QController<ControlNote, QView<QNoteDialog> > NoteBase;
69 QNote::QNote(Dialog & parent)
70 : NoteBase(parent, _("Note Settings"))
74 void QNote::build_dialog()
76 dialog_.reset(new QNoteDialog(this));
78 bcview().setOK(dialog_->okPB);
79 bcview().setCancel(dialog_->closePB);
83 void QNote::update_contents()
85 QRadioButton * rb = 0;
87 switch (controller().params().type) {
88 case InsetNoteParams::Note:
91 case InsetNoteParams::Comment:
92 rb = dialog_->commentRB;
94 case InsetNoteParams::Greyedout:
95 rb = dialog_->greyedoutRB;
97 case InsetNoteParams::Framed:
98 rb = dialog_->framedRB;
100 case InsetNoteParams::Shaded:
101 rb = dialog_->shadedRB;
105 rb->setChecked(true);
111 InsetNoteParams::Type type;
113 if (dialog_->greyedoutRB->isChecked())
114 type = InsetNoteParams::Greyedout;
115 else if (dialog_->commentRB->isChecked())
116 type = InsetNoteParams::Comment;
117 else if (dialog_->framedRB->isChecked())
118 type = InsetNoteParams::Framed;
119 else if (dialog_->shadedRB->isChecked())
120 type = InsetNoteParams::Shaded;
122 type = InsetNoteParams::Note;
124 controller().params().type = type;
127 } // namespace frontend
130 #include "QNote_moc.cpp"