]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QExternalDialog.C
The initial merge of the Qt frontend, and the necessary compile fixes.
[lyx.git] / src / frontends / qt2 / QExternalDialog.C
1 /**
2  * \file QExternalDialog.C
3  * Copyright 2001 the LyX Team
4  * Read the file COPYING
5  *
6  * \author John Levon <moz@compsoc.man.ac.uk>
7  */
8
9 #include <config.h>
10
11 #include "gettext.h"
12 #include "ControlExternal.h"
13  
14 #include <qwidget.h>
15 #include <qpushbutton.h>
16 #include <qfiledialog.h>
17 #include <qcombobox.h>
18 #include <qtextview.h>
19 #include <qlineedit.h>
20
21 #include "QExternalDialog.h"
22 #include "QExternal.h"
23
24 QExternalDialog::QExternalDialog(QExternal * form)
25         : QExternalDialogBase(0, 0, false, 0),
26         form_(form)
27 {
28         connect(okPB, SIGNAL(clicked()),
29                 form, SLOT(slotOK()));
30         connect(closePB, SIGNAL(clicked()),
31                 form, SLOT(slotClose()));
32 }
33
34
35 void QExternalDialog::change_adaptor()
36 {
37         form_->changed();
38 }
39
40
41 void QExternalDialog::closeEvent(QCloseEvent * e)
42 {
43         form_->slotWMHide();
44         e->accept();
45 }
46
47
48 void QExternalDialog::editClicked()
49 {
50         form_->changed();
51         form_->controller().editExternal();
52 }
53
54
55 void QExternalDialog::viewClicked()
56 {
57         form_->changed();
58         form_->controller().viewExternal();
59 }
60
61
62 void QExternalDialog::updateClicked()
63 {
64         form_->changed();
65         form_->controller().updateExternal();
66 }
67
68
69 void QExternalDialog::browseClicked()
70 {
71         QString file = QFileDialog::getOpenFileName(QString::null,
72                 _("External material (*)"), this, 0, _("Select external material"));
73         if (!file.isNull()) {
74                 fileED->setText(file.latin1());
75                 form_->changed();
76         }
77 }
78
79
80 void QExternalDialog::templateChanged()
81 {
82         externalTV->setText(form_->helpText().c_str());
83
84         updatePB->setEnabled(!form_->controller().params().templ.automaticProduction);
85         form_->changed();
86 }