]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QGraphicsDialog.C
bug 1028 fix
[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 Voss
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 #include "LString.h"
19
20 #include <qwidget.h>
21 #include <qpushbutton.h>
22 #include <qlineedit.h>
23 #include <qcheckbox.h>
24 #include <qfiledialog.h>
25 #include <qcombobox.h>
26
27 #include "lengthcombo.h"
28
29 #include "QGraphicsDialog.h"
30 #include "QGraphics.h"
31
32 #include <vector>
33
34
35 QGraphicsDialog::QGraphicsDialog(QGraphics * form)
36         : QGraphicsDialogBase(0, 0, false, 0),
37         form_(form)
38 {
39         connect(okPB, SIGNAL(clicked()),
40                 form, SLOT(slotOK()));
41         connect(applyPB, SIGNAL(clicked()),
42                 form, SLOT(slotApply()));
43         connect(closePB, SIGNAL(clicked()),
44                 form, SLOT(slotClose()));
45         connect(restorePB, SIGNAL(clicked()),
46                 form, SLOT(slotRestore()));
47 }
48
49
50 void QGraphicsDialog::show()
51 {
52         QGraphicsDialogBase::show();
53         filename->setFocus();
54 }
55
56
57 void QGraphicsDialog::change_adaptor()
58 {
59         form_->changed();
60 }
61
62
63 void QGraphicsDialog::change_bb()
64 {
65         form_->controller().bbChanged = true;
66         lyxerr[Debug::GRAPHICS]
67                 << "[controller().bb_Changed set to true]\n";
68         form_->changed();
69 }
70
71
72 void QGraphicsDialog::change_WUnit()
73 {
74         bool useHeight = (widthUnit->currentItem() > 0);
75         height->setEnabled(useHeight);
76         heightUnit->setEnabled(useHeight);
77         form_->changed();
78 }
79
80
81 void QGraphicsDialog::closeEvent(QCloseEvent * e)
82 {
83         form_->slotWMHide();
84         e->accept();
85 }
86
87
88 void QGraphicsDialog::browse_clicked()
89 {
90         string const str = 
91                 form_->controller().Browse(fromqstr(filename->text()));
92         filename->setText(toqstr(str));
93         form_->changed();
94 }
95
96
97 void QGraphicsDialog::getBB_clicked()
98 {
99         form_->getBB();
100 }