]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QErrorList.C
some tabular fixes for the problems reported by Helge
[lyx.git] / src / frontends / qt2 / QErrorList.C
1 /**
2  * \file QErrorList.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Alfredo Braunstein
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "QErrorList.h"
14 #include "QErrorListDialog.h"
15 #include "Qt2BC.h"
16 #include "qt_helpers.h"
17
18 #include "controllers/ControlErrorList.h"
19
20 #include <qlistbox.h>
21 #include <qtextbrowser.h>
22 #include <qpushbutton.h>
23
24 namespace lyx {
25 namespace frontend {
26
27 typedef QController<ControlErrorList, QView<QErrorListDialog> > base_class;
28
29 QErrorList::QErrorList(Dialog & parent)
30         : base_class(parent, "")
31 {}
32
33
34 void QErrorList::build_dialog()
35 {
36         dialog_.reset(new QErrorListDialog(this));
37         bcview().setCancel(dialog_->closePB);
38 }
39
40
41 void QErrorList::select(int item)
42 {
43         controller().goTo(item);
44         dialog_->descriptionTB->setText(toqstr(controller().errorList()[item].description));
45 }
46
47
48 void QErrorList::update_contents()
49 {
50         setTitle(controller().name());
51         dialog_->errorsLB->clear();
52         dialog_->descriptionTB->setText(QString());
53
54         ErrorList::const_iterator it = controller().errorList().begin();
55         ErrorList::const_iterator end = controller().errorList().end();
56         for(; it != end; ++it) {
57                 new QListBoxText(dialog_->errorsLB, toqstr(it->error));
58         }
59
60         dialog_->errorsLB->setSelected(0, true);
61 }
62
63 } // namespace frontend
64 } // namespace lyx