]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QErrorList.C
Martin's changes to the Note inset.
[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 "LyXView.h"
14 #include "errorlist.h"
15 #include "qt_helpers.h"
16 #include "support/lstrings.h"
17 #include "debug.h"
18
19 #include "ControlErrorList.h"
20 #include "QErrorList.h"
21 #include "QErrorListDialog.h"
22 #include "Qt2BC.h"
23
24 #include <qlistbox.h>
25 #include <qtextbrowser.h>
26 #include <qpushbutton.h>
27
28 typedef QController<ControlErrorList, QView<QErrorListDialog> > base_class;
29
30 QErrorList::QErrorList(Dialog & parent)
31         : base_class(parent, "")
32 {}
33
34
35 void QErrorList::build_dialog()
36 {
37         dialog_.reset(new QErrorListDialog(this));
38         bcview().setCancel(dialog_->closePB);
39 }
40
41
42 void QErrorList::select(int item)
43 {
44         controller().goTo(item);
45         dialog_->descriptionTB->setText(toqstr(controller().errorList()[item].description));
46 }
47
48
49 void QErrorList::update_contents()
50 {
51         setTitle(controller().name());
52         dialog_->errorsLB->clear();
53         dialog_->descriptionTB->setText(QString());
54
55         ErrorList::const_iterator it = controller().errorList().begin();
56         ErrorList::const_iterator end = controller().errorList().end();
57         for(; it != end; ++it) {
58                 new QListBoxText(dialog_->errorsLB, toqstr(it->error));
59         }
60
61         dialog_->errorsLB->setSelected(0, true);
62 }
63