]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/QURLDialog.C
enable Font cache only for MacOSX and inline width() for other platform.
[lyx.git] / src / frontends / qt4 / QURLDialog.C
1 /**
2  * \file QURLDialog.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 #include "QURLDialog.h"
14 #include "UrlView.h"
15
16 #include <QLineEdit>
17 #include <QPushButton>
18 #include <QCloseEvent>
19
20 namespace lyx {
21 namespace frontend {
22
23 QURLDialog::QURLDialog(UrlView * form)
24         : form_(form)
25 {
26         setupUi(this);
27
28         connect(okPB, SIGNAL(clicked()),
29                 form_, SLOT(slotOK()));
30         connect(closePB, SIGNAL(clicked()),
31                 form_, SLOT(slotClose()));
32
33     connect( urlED, SIGNAL( textChanged(const QString&) ), this, SLOT( changed_adaptor() ) );
34     connect( hyperlinkCB, SIGNAL( clicked() ), this, SLOT( changed_adaptor() ) );
35     connect( nameED, SIGNAL( textChanged(const QString&) ), this, SLOT( changed_adaptor() ) );
36 }
37
38
39 QURLDialog::~QURLDialog()
40 {
41 }
42
43
44 void QURLDialog::show()
45 {
46         QDialog::show();
47         urlED->setFocus();
48 }
49
50
51 void QURLDialog::changed_adaptor()
52 {
53         form_->changed();
54 }
55
56
57 void QURLDialog::closeEvent(QCloseEvent * e)
58 {
59         form_->slotWMHide();
60         e->accept();
61 }
62
63 } // namespace frontend
64 } // namespace lyx
65
66 #include "QURLDialog_moc.cpp"