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 #include "GErrorList.h"
14 #include "ControlErrorList.h"
23 GErrorList::GErrorList(Dialog & parent)
24 : GViewCB<ControlErrorList, GViewGladeB>(parent, _("Errors"), false)
28 void GErrorList::doBuild()
30 string const gladeName = findGladeFile("errors");
31 xml_ = Gnome::Glade::Xml::create(gladeName);
33 Gtk::Button * closebutton;
34 xml_->get_widget("Close", closebutton);
35 setCancel(closebutton);
37 xml_->get_widget("ErrorList", errlistview_);
38 listCols_.add(listCol_);
39 listCols_.add(listColIndex_);
40 errliststore_ = Gtk::ListStore::create(listCols_);
41 errlistview_->set_model(errliststore_);
42 errlistview_->append_column("Error", listCol_);
43 errlistsel_ = errlistview_->get_selection();
45 xml_->get_widget("ErrorDescription", errdescview_);
47 errlistsel_->signal_changed().connect(
48 sigc::mem_fun(*this, &GErrorList::onErrListSelection));
52 void GErrorList::update()
54 setTitle(controller().name());
59 void GErrorList::onErrListSelection()
62 (*errlistsel_->get_selected())[listColIndex_];
64 ErrorList const & errors = controller().errorList();
65 errdescview_->get_buffer()->set_text(errors[choice].description);
69 void GErrorList::updateContents()
71 errliststore_->clear();
72 ErrorList const & errors = controller().errorList();
74 (*errliststore_->append())[listCol_] = _("*** No Errors ***");
75 errlistview_->set_sensitive(false);
79 errlistview_->set_sensitive(true);
81 ErrorList::const_iterator cit = errors.begin();
82 ErrorList::const_iterator end = errors.end();
83 for (int rowindex = 0; cit != end; ++cit, ++rowindex) {
84 Gtk::ListStore::Row row = *errliststore_->append();
86 errlistsel_->select(*row);
88 (*row)[listCol_] = cit->error;
89 (*row)[listColIndex_] = rowindex;
93 } // namespace frontend