]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QTocDialog.C
reverse last change
[lyx.git] / src / frontends / qt2 / QTocDialog.C
1 /**
2  * \file QTocDialog.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author John Levon
7  *
8  * Full author contact details are available in file CREDITS
9  */
10
11 #include <config.h>
12
13 #ifdef __GNUG__
14 #pragma implementation
15 #endif
16
17 #include "QToc.h"
18 #include "QTocDialog.h"
19 #include "qt_helpers.h"
20
21 #include <qlistview.h>
22 #include <qpushbutton.h>
23
24
25 QTocDialog::QTocDialog(QToc * form)
26         : QTocDialogBase(0, 0, false, 0),
27         form_(form)
28 {
29         // disable sorting
30         tocLV->setSorting(-1);
31
32         connect(closePB, SIGNAL(clicked()),
33                 form, SLOT(slotClose()));
34 }
35
36
37 QTocDialog::~QTocDialog()
38 {
39 }
40
41
42 void QTocDialog::activate_adaptor(int)
43 {
44         form_->updateToc(form_->depth_);
45 }
46
47
48 void QTocDialog::depth_adaptor(int depth)
49 {
50         form_->set_depth(depth);
51 }
52
53
54 void QTocDialog::select_adaptor(QListViewItem * item)
55 {
56         form_->select(fromqstr(item->text(0)));
57 }
58
59
60 void QTocDialog::update_adaptor()
61 {
62         form_->update();
63 }
64
65
66 void QTocDialog::closeEvent(QCloseEvent * e)
67 {
68         form_->slotWMHide();
69         e->accept();
70 }