]> git.lyx.org Git - features.git/blob - src/frontends/qt3/QTexinfoDialog.C
Add #include "xxx_moc.cpp" to xxx.C files, and stop compiling _moc.cpp individually.
[features.git] / src / frontends / qt3 / QTexinfoDialog.C
1 /**
2  * \file QTexinfoDialog.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Edwin Leuven
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "QTexinfoDialog.h"
14 #include "QTexinfo.h"
15
16 #include <qcheckbox.h>
17 #include <qcombobox.h>
18 #include <qlistbox.h>
19 #include <qpushbutton.h>
20
21 using std::vector;
22 using std::string;
23
24 namespace lyx {
25 namespace frontend {
26
27
28 QTexinfoDialog::QTexinfoDialog(QTexinfo * form)
29         : QTexinfoDialogBase(0, 0, false, 0),
30         form_(form)
31 {
32         connect(closePB, SIGNAL(clicked()),
33                 form, SLOT(slotClose()));
34 }
35
36
37 void QTexinfoDialog::change_adaptor()
38 {
39         form_->changed();
40 }
41
42
43 void QTexinfoDialog::closeEvent(QCloseEvent * e)
44 {
45         form_->slotWMHide();
46         e->accept();
47 }
48
49
50 void QTexinfoDialog::rescanClicked()
51 {
52         // build new *Files.lst
53         rescanTexStyles();
54         form_->updateStyles();
55         enableViewPB();
56 }
57
58
59 void QTexinfoDialog::viewClicked()
60 {
61         vector<string>::size_type const fitem = fileList->currentItem();
62         vector<string> const & data = form_->texdata_[form_->activeStyle];
63         string file = data[fitem];
64         if (!path->isChecked())
65                 file = getTexFileFromList(data[fitem],
66                         form_->controller().getFileType(form_->activeStyle));
67         form_->controller().viewFile(file);
68 }
69
70
71 void QTexinfoDialog::update()
72 {
73         switch (whatStyle->currentItem()) {
74         case 0:
75                 form_->updateStyles(ControlTexinfo::cls);
76                 break;
77         case 1:
78                 form_->updateStyles(ControlTexinfo::sty);
79                 break;
80         case 2:
81                 form_->updateStyles(ControlTexinfo::bst);
82                 break;
83         default:
84                 break;
85         }
86
87         enableViewPB();
88 }
89
90
91 void QTexinfoDialog::enableViewPB()
92 {
93         viewPB->setEnabled(fileList->currentItem() > -1);
94 }
95
96 } // namespace frontend
97 } // namespace lyx
98
99 #include "QTexinfoDialog_moc.cpp"