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 _GLIBCXX_CONCEPT_CHECKS
15 #undef _GLIBCXX_CONCEPT_CHECKS
17 #ifdef _GLIBCPP_CONCEPT_CHECKS
18 #undef _GLIBCPP_CONCEPT_CHECKS
21 #include "GErrorList.h"
22 #include "ControlErrorList.h"
31 GErrorList::GErrorList(Dialog & parent)
32 : GViewCB<ControlErrorList, GViewGladeB>(parent, _("Errors"), false)
36 void GErrorList::doBuild()
38 string const gladeName = findGladeFile("errors");
39 xml_ = Gnome::Glade::Xml::create(gladeName);
41 Gtk::Button * closebutton;
42 xml_->get_widget("Close", closebutton);
43 setCancel(closebutton);
45 xml_->get_widget("ErrorList", errlistview_);
46 listCols_.add(listCol_);
47 listCols_.add(listColIndex_);
48 errliststore_ = Gtk::ListStore::create(listCols_);
49 errlistview_->set_model(errliststore_);
50 errlistview_->append_column("Error", listCol_);
51 errlistsel_ = errlistview_->get_selection();
53 xml_->get_widget("ErrorDescription", errdescview_);
55 errlistsel_->signal_changed().connect(
56 sigc::mem_fun(*this, &GErrorList::onErrListSelection));
60 void GErrorList::update()
62 setTitle(controller().name());
67 void GErrorList::onErrListSelection()
70 (*errlistsel_->get_selected())[listColIndex_];
72 ErrorList const & errors = controller().errorList();
73 errdescview_->get_buffer()->set_text(errors[choice].description);
77 void GErrorList::updateContents()
79 errliststore_->clear();
80 ErrorList const & errors = controller().errorList();
82 (*errliststore_->append())[listCol_] = _("*** No Errors ***");
83 errlistview_->set_sensitive(false);
87 errlistview_->set_sensitive(true);
89 ErrorList::const_iterator cit = errors.begin();
90 ErrorList::const_iterator end = errors.end();
91 for (int rowindex = 0; cit != end; ++cit, ++rowindex) {
92 Gtk::ListStore::Row row = *errliststore_->append();
94 errlistsel_->select(*row);
96 (*row)[listCol_] = cit->error;
97 (*row)[listColIndex_] = rowindex;
101 } // namespace frontend