]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QGraphicsDialog.C
Minipage is no more (long live the box inset)
[lyx.git] / src / frontends / qt2 / QGraphicsDialog.C
1 /**
2  * \file QGraphicsDialog.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  * \author Herbert Voß
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #include <config.h>
13
14
15 #include "ControlGraphics.h"
16 #include "debug.h"
17 #include "qt_helpers.h"
18
19 #include <qpushbutton.h>
20 #include <qlineedit.h>
21
22 #include "lengthcombo.h"
23
24 #include "QGraphicsDialog.h"
25 #include "QGraphics.h"
26
27 using std::string;
28
29
30 QGraphicsDialog::QGraphicsDialog(QGraphics * form)
31         : QGraphicsDialogBase(0, 0, false, 0),
32         form_(form)
33 {
34         connect(okPB, SIGNAL(clicked()),
35                 form, SLOT(slotOK()));
36         connect(applyPB, SIGNAL(clicked()),
37                 form, SLOT(slotApply()));
38         connect(closePB, SIGNAL(clicked()),
39                 form, SLOT(slotClose()));
40         connect(restorePB, SIGNAL(clicked()),
41                 form, SLOT(slotRestore()));
42 }
43
44
45 void QGraphicsDialog::show()
46 {
47         QGraphicsDialogBase::show();
48         filename->setFocus();
49 }
50
51
52 void QGraphicsDialog::change_adaptor()
53 {
54         form_->changed();
55 }
56
57
58 void QGraphicsDialog::change_bb()
59 {
60         form_->controller().bbChanged = true;
61         lyxerr[Debug::GRAPHICS]
62                 << "[controller().bb_Changed set to true]\n";
63         form_->changed();
64 }
65
66
67 void QGraphicsDialog::change_WUnit()
68 {
69         bool useHeight = (widthUnit->currentItem() > 0);
70         height->setEnabled(useHeight);
71         heightUnit->setEnabled(useHeight);
72         form_->changed();
73 }
74
75
76 void QGraphicsDialog::closeEvent(QCloseEvent * e)
77 {
78         form_->slotWMHide();
79         e->accept();
80 }
81
82
83 void QGraphicsDialog::browse_clicked()
84 {
85         string const str =
86                 form_->controller().Browse(fromqstr(filename->text()));
87         filename->setText(toqstr(str));
88         form_->changed();
89 }
90
91
92 void QGraphicsDialog::getBB_clicked()
93 {
94         form_->getBB();
95 }