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.
13 // Too hard to make concept checks work with this file
14 #ifdef _GLIBCPP_CONCEPT_CHECKS
15 #undef _GLIBCPP_CONCEPT_CHECKS
19 #include "ControlNote.h"
22 #include "insets/insetnote.h"
24 #include <libglademm.h>
31 GNote::GNote(Dialog & parent)
32 : GViewCB<ControlNote, GViewGladeB>(parent, _("Note Settings"), false)
38 string const gladeName = findGladeFile("note");
39 xml_ = Gnome::Glade::Xml::create(gladeName);
41 Gtk::Button * cancelbutton;
42 xml_->get_widget("Close", cancelbutton);
43 setCancel(cancelbutton);
45 xml_->get_widget("LyXNote", lyxnoteradio_);
46 xml_->get_widget("Comment", commentradio_);
47 xml_->get_widget("GreyedOut", greyedoutradio_);
49 lyxnoteradio_->signal_toggled().connect(
50 sigc::mem_fun(*this, &GNote::apply));
51 commentradio_->signal_toggled().connect(
52 sigc::mem_fun(*this, &GNote::apply));
53 greyedoutradio_->signal_toggled().connect(
54 sigc::mem_fun(*this, &GNote::apply));
56 bcview().addReadOnly(lyxnoteradio_);
57 bcview().addReadOnly(commentradio_);
58 bcview().addReadOnly(greyedoutradio_);
66 bc().refreshReadOnly();
68 switch (controller().params().type) {
69 case InsetNoteParams::Note:
70 lyxnoteradio_->set_active(true);
72 case InsetNoteParams::Comment:
73 commentradio_->set_active(true);
75 case InsetNoteParams::Greyedout:
76 greyedoutradio_->set_active(true);
89 InsetNoteParams::Type type;
91 if (lyxnoteradio_->get_active())
92 type = InsetNoteParams::Note;
93 else if (greyedoutradio_->get_active())
94 type = InsetNoteParams::Greyedout;
96 type = InsetNoteParams::Comment;
98 controller().params().type = type;
99 controller().dispatchParams();
102 } // namespace frontend