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
18 #include "GErrorList.h"
19 #include "ControlErrorList.h"
28 GErrorList::GErrorList(Dialog & parent)
29 : GViewCB<ControlErrorList, GViewGladeB>(parent, _("Errors"), false)
33 void GErrorList::doBuild()
35 string const gladeName = findGladeFile("errors");
36 xml_ = Gnome::Glade::Xml::create(gladeName);
38 Gtk::Button * closebutton;
39 xml_->get_widget("Close", closebutton);
40 setCancel(closebutton);
42 xml_->get_widget("ErrorList", errlistview_);
43 listCols_.add(listCol_);
44 listCols_.add(listColIndex_);
45 errliststore_ = Gtk::ListStore::create(listCols_);
46 errlistview_->set_model(errliststore_);
47 errlistview_->append_column("Error", listCol_);
48 errlistsel_ = errlistview_->get_selection();
50 xml_->get_widget("ErrorDescription", errdescview_);
52 errlistsel_->signal_changed().connect(
53 sigc::mem_fun(*this, &GErrorList::onErrListSelection));
57 void GErrorList::update()
59 setTitle(controller().name());
64 void GErrorList::onErrListSelection()
67 (*errlistsel_->get_selected())[listColIndex_];
69 ErrorList const & errors = controller().errorList();
70 errdescview_->get_buffer()->set_text(errors[choice].description);
74 void GErrorList::updateContents()
76 errliststore_->clear();
77 ErrorList const & errors = controller().errorList();
79 (*errliststore_->append())[listCol_] = _("*** No Errors ***");
80 errlistview_->set_sensitive(false);
84 errlistview_->set_sensitive(true);
86 ErrorList::const_iterator cit = errors.begin();
87 ErrorList::const_iterator end = errors.end();
88 for (int rowindex = 0; cit != end; ++cit, ++rowindex) {
89 Gtk::ListStore::Row row = *errliststore_->append();
91 errlistsel_->select(*row);
93 (*row)[listCol_] = cit->error;
94 (*row)[listColIndex_] = rowindex;
98 } // namespace frontend