3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
14 #include "ControlNote.h"
17 #include "insets/insetnote.h"
19 #include <libglademm.h>
26 GNote::GNote(Dialog & parent)
27 : GViewCB<ControlNote, GViewGladeB>(parent, _("Note Settings"), false)
33 string const gladeName = findGladeFile("note");
34 xml_ = Gnome::Glade::Xml::create(gladeName);
36 Gtk::Button * cancelbutton;
37 xml_->get_widget("Close", cancelbutton);
38 setCancel(cancelbutton);
40 xml_->get_widget("LyXNote", lyxnoteradio_);
41 xml_->get_widget("Comment", commentradio_);
42 xml_->get_widget("GreyedOut", greyedoutradio_);
44 lyxnoteradio_->signal_toggled().connect(
45 sigc::mem_fun(*this, &GNote::apply));
46 commentradio_->signal_toggled().connect(
47 sigc::mem_fun(*this, &GNote::apply));
48 greyedoutradio_->signal_toggled().connect(
49 sigc::mem_fun(*this, &GNote::apply));
51 bcview().addReadOnly(lyxnoteradio_);
52 bcview().addReadOnly(commentradio_);
53 bcview().addReadOnly(greyedoutradio_);
61 bc().refreshReadOnly();
63 switch (controller().params().type) {
64 case InsetNoteParams::Note:
65 lyxnoteradio_->set_active(true);
67 case InsetNoteParams::Comment:
68 commentradio_->set_active(true);
70 case InsetNoteParams::Greyedout:
71 greyedoutradio_->set_active(true);
84 InsetNoteParams::Type type;
86 if (lyxnoteradio_->get_active())
87 type = InsetNoteParams::Note;
88 else if (greyedoutradio_->get_active())
89 type = InsetNoteParams::Greyedout;
91 type = InsetNoteParams::Comment;
93 controller().params().type = type;
94 controller().dispatchParams();
97 } // namespace frontend