3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Alfredo Braunstein
8 * Full author contact details are available in file CREDITS.
13 #include "QErrorList.h"
14 #include "QErrorListDialog.h"
16 #include "qt_helpers.h"
18 #include "controllers/ControlErrorList.h"
20 #include <q3listbox.h>
21 #include <q3textbrowser.h>
22 #include <qpushbutton.h>
27 typedef QController<ControlErrorList, QView<QErrorListDialog> > base_class;
29 QErrorList::QErrorList(Dialog & parent)
30 : base_class(parent, "")
34 void QErrorList::build_dialog()
36 dialog_.reset(new QErrorListDialog(this));
37 bcview().setCancel(dialog_->closePB);
41 void QErrorList::select(int item)
43 controller().goTo(item);
44 dialog_->descriptionTB->setText(toqstr(controller().errorList()[item].description));
48 void QErrorList::update_contents()
50 setTitle(controller().name());
51 dialog_->errorsLB->clear();
52 dialog_->descriptionTB->setText(QString());
54 ErrorList::const_iterator it = controller().errorList().begin();
55 ErrorList::const_iterator end = controller().errorList().end();
56 for(; it != end; ++it) {
57 new Q3ListBoxText(dialog_->errorsLB, toqstr(it->error));
60 dialog_->errorsLB->setSelected(0, true);
63 } // namespace frontend