]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QTexinfoDialog.C
Minipage is no more (long live the box inset)
[lyx.git] / src / frontends / qt2 / 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
14
15 #include "QTexinfoDialog.h"
16 #include "QTexinfo.h"
17
18 #include <qlistbox.h>
19 #include <qpushbutton.h>
20 #include <qcombobox.h>
21
22 using std::vector;
23 using std::string;
24
25
26 QTexinfoDialog::QTexinfoDialog(QTexinfo * form)
27         : QTexinfoDialogBase(0, 0, false, 0),
28         form_(form)
29 {
30         connect(closePB, SIGNAL(clicked()),
31                 form, SLOT(slotClose()));
32 }
33
34
35 void QTexinfoDialog::change_adaptor()
36 {
37         form_->changed();
38 }
39
40
41 void QTexinfoDialog::closeEvent(QCloseEvent * e)
42 {
43         form_->slotWMHide();
44         e->accept();
45 }
46
47
48 void QTexinfoDialog::rescanClicked()
49 {
50         // build new *Files.lst
51         rescanTexStyles();
52         form_->updateStyles();
53         enableViewPB();
54 }
55
56
57 void QTexinfoDialog::viewClicked()
58 {
59         vector<string>::size_type const fitem = fileList->currentItem();
60         vector<string> const & data = form_->texdata_[form_->activeStyle];
61         form_->controller().viewFile(data[fitem]);
62 }
63
64
65 void QTexinfoDialog::update()
66 {
67         switch (whatStyle->currentItem()) {
68         case 0:
69                 form_->updateStyles(ControlTexinfo::cls);
70                 break;
71         case 1:
72                 form_->updateStyles(ControlTexinfo::sty);
73                 break;
74         case 2:
75                 form_->updateStyles(ControlTexinfo::bst);
76                 break;
77         default:
78                 break;
79         }
80
81         enableViewPB();
82 }
83
84
85 void QTexinfoDialog::enableViewPB()
86 {
87         viewPB->setEnabled(fileList->currentItem() > -1);
88 }